CARPLAY版本整理
This commit is contained in:
110
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/MIME_TYPE.md
Normal file
110
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/MIME_TYPE.md
Normal file
@ -0,0 +1,110 @@
|
||||
## MIME\_TYPE
|
||||
### 概述
|
||||
MIME_TYPE。
|
||||
### 常量
|
||||
<p id="MIME_TYPE_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| MIME\_TYPE\_APPLICATION\_ENVOY | "application/envoy"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_FRACTALS | "application/fractals"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_FUTURESPLASH | "application/futuresplash"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_HTA | "application/hta"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_JSON | "application/json"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_UBJSON | "application/ubjson"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_MAC\_BINHEX40 | "application/mac-binhex40"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_MSWORD | "application/msword"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_OCTET\_STREAM | "application/octet-stream"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_ODA | "application/oda"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_OLESCRIPT | "application/olescript"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_PDF | "application/pdf"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_PICS\_RULES | "application/pics-rules"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_PKCS10 | "application/pkcs10"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_PKIX\_CRL | "application/pkix-crl"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_POSTSCRIPT | "application/postscript"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_RTF | "application/rtf"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_VND\_MS\_EXCEL | "application/vnd.ms-excel"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_VND\_MS\_OUTLOOK | "application/vnd.ms-outlook"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_VND\_MS\_PKICERTSTORE | "application/vnd.ms-pkicertstore"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_VND\_MS\_PKISECCAT | "application/vnd.ms-pkiseccat"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_VND\_MS\_PKISTL | "application/vnd.ms-pkistl"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_VND\_MS\_POWERPOINT | "application/vnd.ms-powerpoint"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_VND\_MS\_PROJECT | "application/vnd.ms-project"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_VND\_MS\_WORKS | "application/vnd.ms-works"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_WINHLP | "application/winhlp"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_BCPIO | "application/x-bcpio"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_CDF | "application/x-cdf"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_COMPRESS | "application/x-compress"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_COMPRESSED | "application/x-compressed"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_CPIO | "application/x-cpio"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_CSH | "application/x-csh"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_DIRECTOR | "application/x-director"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_DVI | "application/x-dvi"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_GTAR | "application/x-gtar"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_GZIP | "application/x-gzip"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_HDF | "application/x-hdf"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_IPHONE | "application/x-iphone"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_JAVASCRIPT | "application/x-javascript"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_LATEX | "application/x-latex"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSACCESS | "application/x-msaccess"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSCARDFILE | "application/x-mscardfile"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSCLIP | "application/x-msclip"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSDOWNLOAD | "application/x-msdownload"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSMEDIAVIEW | "application/x-msmediaview"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSMETAFILE | "application/x-msmetafile"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSMONEY | "application/x-msmoney"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSPUBLISHER | "application/x-mspublisher"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSSCHEDULE | "application/x-msschedule"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSTERMINAL | "application/x-msterminal"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_MSWRITE | "application/x-mswrite"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_NETCDF | "application/x-netcdf"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_PERFMON | "application/x-perfmon"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_PKCS12 | "application/x-pkcs12"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_SH | "application/x-sh"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_SHAR | "application/x-shar"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_SHOCKWAVE\_FLASH | "application/x-shockwave-flash"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_STUFFIT | "application/x-stuffit"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_SV4CPIO | "application/x-sv4cpio"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_SV4CRC | "application/x-sv4crc"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_TAR | "application/x-tar"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_TCL | "application/x-tcl"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_TEX | "application/x-tex"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_TEXINFO | "application/x-texinfo"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_TROFF | "application/x-troff"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_X\_USTAR | "application/x-ustar"。 |
|
||||
| MIME\_TYPE\_APPLICATION\_ZIP | "application/zip"。 |
|
||||
| MIME\_TYPE\_AUDIO\_BASIC | "audio/basic"。 |
|
||||
| MIME\_TYPE\_AUDIO\_MID | "audio/mid"。 |
|
||||
| MIME\_TYPE\_AUDIO\_MPEG | "audio/mpeg"。 |
|
||||
| MIME\_TYPE\_AUDIO\_X\_AIFF | "audio/x-aiff"。 |
|
||||
| MIME\_TYPE\_AUDIO\_X\_MPEGURL | "audio/x-mpegurl"。 |
|
||||
| MIME\_TYPE\_AUDIO\_X\_WAV | "audio/x-wav"。 |
|
||||
| MIME\_TYPE\_IMAGE\_BMP | "image/bmp"。 |
|
||||
| MIME\_TYPE\_IMAGE\_CIS\_COD | "image/cis-cod"。 |
|
||||
| MIME\_TYPE\_IMAGE\_GIF | "image/gif"。 |
|
||||
| MIME\_TYPE\_IMAGE\_IEF | "image/ief"。 |
|
||||
| MIME\_TYPE\_IMAGE\_JPEG | "image/jpeg"。 |
|
||||
| MIME\_TYPE\_IMAGE\_PIPEG | "image/pipeg"。 |
|
||||
| MIME\_TYPE\_IMAGE\_SVG\_XML | "image/svg+xml"。 |
|
||||
| MIME\_TYPE\_IMAGE\_TIFF | "image/tiff"。 |
|
||||
| MIME\_TYPE\_IMAGE\_X\_CMX | "image/x-cmx"。 |
|
||||
| MIME\_TYPE\_IMAGE\_X\_ICON | "image/x-icon"。 |
|
||||
| MIME\_TYPE\_IMAGE\_X\_RGB | "image/x-rgb"。 |
|
||||
| MIME\_TYPE\_IMAGE\_X\_XBITMAP | "image/x-xbitmap"。 |
|
||||
| MIME\_TYPE\_IMAGE\_X\_XPIXMAP | "image/x-xpixmap"。 |
|
||||
| MIME\_TYPE\_IMAGE\_X\_XWINDOWDUMP | "image/x-xwindowdump"。 |
|
||||
| MIME\_TYPE\_MESSAGE\_RFC822 | "message/rfc822"。 |
|
||||
| MIME\_TYPE\_TEXT\_CSS | "text/css"。 |
|
||||
| MIME\_TYPE\_TEXT\_H323 | "text/h323"。 |
|
||||
| MIME\_TYPE\_TEXT\_HTML | "text/html"。 |
|
||||
| MIME\_TYPE\_TEXT\_IULS | "text/iuls"。 |
|
||||
| MIME\_TYPE\_TEXT\_PLAIN | "text/plain"。 |
|
||||
| MIME\_TYPE\_TEXT\_RICHTEXT | "text/richtext"。 |
|
||||
| MIME\_TYPE\_TEXT\_SCRIPTLET | "text/scriptlet"。 |
|
||||
| MIME\_TYPE\_TEXT\_WEBVIEWHTML | "text/webviewhtml"。 |
|
||||
| MIME\_TYPE\_TEXT\_X\_COMPONENT | "text/x-component"。 |
|
||||
| MIME\_TYPE\_TEXT\_X\_SETEXT | "text/x-setext"。 |
|
||||
| MIME\_TYPE\_TEXT\_X\_VCARD | "text/x-vcard"。 |
|
||||
| MIME\_TYPE\_VIDEO\_MPEG | "video/mpeg"。 |
|
||||
| MIME\_TYPE\_VIDEO\_QUICKTIME | "video/quicktime"。 |
|
||||
| MIME\_TYPE\_VIDEO\_X\_MSVIDEO | "video/x-msvideo"。 |
|
135
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/XmlParser.md
Normal file
135
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/XmlParser.md
Normal file
@ -0,0 +1,135 @@
|
||||
## XmlParser
|
||||
### 概述
|
||||
xml解析器
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="XmlParser_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#XmlParser_xml_parser_create">xml\_parser\_create</a> | 创建解析器。 |
|
||||
| <a href="#XmlParser_xml_parser_destroy">xml\_parser\_destroy</a> | 销毁parser对象。 |
|
||||
| <a href="#XmlParser_xml_parser_parse">xml\_parser\_parse</a> | 解析数据。 |
|
||||
| <a href="#XmlParser_xml_parser_parse_file">xml\_parser\_parse\_file</a> | 解析文件。 |
|
||||
| <a href="#XmlParser_xml_parser_set_builder">xml\_parser\_set\_builder</a> | 设置builder。 |
|
||||
| <a href="#XmlParser_xml_parser_set_trim_text">xml\_parser\_set\_trim\_text</a> | 设置是否去掉文本两端的空白字符。 |
|
||||
#### xml\_parser\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="XmlParser_xml_parser_create">创建解析器。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
XmlParser* xml_parser_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | XmlParser* | 返回parser对象。 |
|
||||
#### xml\_parser\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="XmlParser_xml_parser_destroy">销毁parser对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void xml_parser_destroy (XmlParser* parser);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void | 返回无。 |
|
||||
| parser | XmlParser* | parser对象。 |
|
||||
#### xml\_parser\_parse 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="XmlParser_xml_parser_parse">解析数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void xml_parser_parse (XmlParser* parser, const char* xml, int length);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void | 返回无。 |
|
||||
| parser | XmlParser* | parser对象。 |
|
||||
| xml | const char* | 数据。 |
|
||||
| length | int | 数据长度。 |
|
||||
#### xml\_parser\_parse\_file 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="XmlParser_xml_parser_parse_file">解析文件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void xml_parser_parse_file (XmlParser* parser, const char* filename);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void | 返回无。 |
|
||||
| parser | XmlParser* | parser对象。 |
|
||||
| filename | const char* | 文件名。 |
|
||||
#### xml\_parser\_set\_builder 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="XmlParser_xml_parser_set_builder">设置builder。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void xml_parser_set_builder (XmlParser* parser, XmlBuilder* builder);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void | 返回无。 |
|
||||
| parser | XmlParser* | parser对象。 |
|
||||
| builder | XmlBuilder* | builder对象。 |
|
||||
#### xml\_parser\_set\_trim\_text 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="XmlParser_xml_parser_set_trim_text">设置是否去掉文本两端的空白字符。
|
||||
|
||||
> 默认值为去掉文本两端的空白字符,如果不希望去掉,调用本函数设置为FALSE。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void xml_parser_set_trim_text (XmlParser* parser, bool_t trim_text);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void | 返回无。 |
|
||||
| parser | XmlParser* | parser对象。 |
|
||||
| trim\_text | bool\_t | 是否去掉文本两端的空白字符。 |
|
@ -0,0 +1,143 @@
|
||||
## action\_thread\_pool\_t
|
||||
### 概述
|
||||
action线程池。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="action_thread_pool_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#action_thread_pool_t_action_thread_pool_create">action\_thread\_pool\_create</a> | 创建action_thread_pool对象。 |
|
||||
| <a href="#action_thread_pool_t_action_thread_pool_create_ex">action\_thread\_pool\_create\_ex</a> | 创建action_thread_pool对象。 |
|
||||
| <a href="#action_thread_pool_t_action_thread_pool_destroy">action\_thread\_pool\_destroy</a> | 销毁。 |
|
||||
| <a href="#action_thread_pool_t_action_thread_pool_exec">action\_thread\_pool\_exec</a> | 执行action。 |
|
||||
### 属性
|
||||
<p id="action_thread_pool_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#action_thread_pool_t_max_thread_nr">max\_thread\_nr</a> | uint32\_t | 最大线程数。 |
|
||||
| <a href="#action_thread_pool_t_min_idle_nr">min\_idle\_nr</a> | uint32\_t | 最小空闲线程数 |
|
||||
| <a href="#action_thread_pool_t_priority">priority</a> | tk\_thread\_priority\_t | 线程池中的线程优先级 |
|
||||
| <a href="#action_thread_pool_t_stack_size">stack\_size</a> | uint32\_t | 线程池中的线程栈大小 |
|
||||
#### action\_thread\_pool\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_pool_t_action_thread_pool_create">创建action_thread_pool对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
action_thread_pool_t* action_thread_pool_create (uint16_t max_thread_nr, uint16_t min_idle_nr);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | action\_thread\_pool\_t* | action\_thread\_pool对象。 |
|
||||
| max\_thread\_nr | uint16\_t | 最大线程数。 |
|
||||
| min\_idle\_nr | uint16\_t | 最小空闲线程数。 |
|
||||
#### action\_thread\_pool\_create\_ex 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_pool_t_action_thread_pool_create_ex">创建action_thread_pool对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
action_thread_pool_t* action_thread_pool_create_ex (uint16_t max_thread_nr, uint16_t min_idle_nr, uint32_t stack_size, tk_thread_priority_t priority);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | action\_thread\_pool\_t* | action\_thread\_pool对象。 |
|
||||
| max\_thread\_nr | uint16\_t | 最大线程数。 |
|
||||
| min\_idle\_nr | uint16\_t | 最小空闲线程数。 |
|
||||
| stack\_size | uint32\_t | 栈的大小。 |
|
||||
| priority | tk\_thread\_priority\_t | 优先级 |
|
||||
#### action\_thread\_pool\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_pool_t_action_thread_pool_destroy">销毁。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t action_thread_pool_destroy (action_thread_pool_t* thread_pool);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| thread\_pool | action\_thread\_pool\_t* | action\_thread\_pool对象。 |
|
||||
#### action\_thread\_pool\_exec 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_pool_t_action_thread_pool_exec">执行action。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t action_thread_pool_exec (action_thread_pool_t* thread_pool, qaction_t* action);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| thread\_pool | action\_thread\_pool\_t* | action\_thread\_pool对象。 |
|
||||
| action | qaction\_t* | action对象。 |
|
||||
#### max\_thread\_nr 属性
|
||||
-----------------------
|
||||
> <p id="action_thread_pool_t_max_thread_nr">最大线程数。
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### min\_idle\_nr 属性
|
||||
-----------------------
|
||||
> <p id="action_thread_pool_t_min_idle_nr">最小空闲线程数
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### priority 属性
|
||||
-----------------------
|
||||
> <p id="action_thread_pool_t_priority">线程池中的线程优先级
|
||||
|
||||
* 类型:tk\_thread\_priority\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### stack\_size 属性
|
||||
-----------------------
|
||||
> <p id="action_thread_pool_t_stack_size">线程池中的线程栈大小
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
218
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/action_thread_t.md
Normal file
218
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/action_thread_t.md
Normal file
@ -0,0 +1,218 @@
|
||||
## action\_thread\_t
|
||||
### 概述
|
||||
执行action的线程。
|
||||
|
||||
> 每个线程都有一个action queue,可以是共享的queue,也可以是私有的queue。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="action_thread_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#action_thread_t_action_thread_create">action\_thread\_create</a> | 创建action_thread对象。 |
|
||||
| <a href="#action_thread_t_action_thread_create_ex">action\_thread\_create\_ex</a> | 创建action_thread对象。 |
|
||||
| <a href="#action_thread_t_action_thread_create_with_queue">action\_thread\_create\_with\_queue</a> | 创建action_thread对象。 |
|
||||
| <a href="#action_thread_t_action_thread_create_with_queue_ex">action\_thread\_create\_with\_queue\_ex</a> | 创建action_thread对象。 |
|
||||
| <a href="#action_thread_t_action_thread_destroy">action\_thread\_destroy</a> | 销毁。 |
|
||||
| <a href="#action_thread_t_action_thread_exec">action\_thread\_exec</a> | 让线程执行action。 |
|
||||
| <a href="#action_thread_t_action_thread_set_on_idle">action\_thread\_set\_on\_idle</a> | 设置空闲时的回调函数。 |
|
||||
| <a href="#action_thread_t_action_thread_set_on_quit">action\_thread\_set\_on\_quit</a> | 设置退出时的回调函数。 |
|
||||
### 属性
|
||||
<p id="action_thread_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#action_thread_t_executed_actions_nr">executed\_actions\_nr</a> | uint32\_t | 已经执行action的个数。 |
|
||||
| <a href="#action_thread_t_queue">queue</a> | waitable\_action\_queue\_t* | action queue。 |
|
||||
| <a href="#action_thread_t_thread">thread</a> | tk\_thread\_t* | 线程对象。 |
|
||||
#### action\_thread\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_t_action_thread_create">创建action_thread对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
action_thread_t* action_thread_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | action\_thread\_t* | action\_thread对象。 |
|
||||
#### action\_thread\_create\_ex 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_t_action_thread_create_ex">创建action_thread对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
action_thread_t* action_thread_create_ex (const char* name, uint32_t stack_size, tk_thread_priority_t priority);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | action\_thread\_t* | action\_thread对象。 |
|
||||
| name | const char* | 名称。 |
|
||||
| stack\_size | uint32\_t | 栈的大小。 |
|
||||
| priority | tk\_thread\_priority\_t | 优先级。 |
|
||||
#### action\_thread\_create\_with\_queue 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_t_action_thread_create_with_queue">创建action_thread对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
action_thread_t* action_thread_create_with_queue (waitable_action_queue_t* queue);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | action\_thread\_t* | action\_thread对象。 |
|
||||
| queue | waitable\_action\_queue\_t* | queue对象。 |
|
||||
#### action\_thread\_create\_with\_queue\_ex 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_t_action_thread_create_with_queue_ex">创建action_thread对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
action_thread_t* action_thread_create_with_queue_ex (waitable_action_queue_t* queue, const char* name, uint32_t stack_size, tk_thread_priority_t priority);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | action\_thread\_t* | action\_thread对象。 |
|
||||
| queue | waitable\_action\_queue\_t* | queue对象。 |
|
||||
| name | const char* | 名称。 |
|
||||
| stack\_size | uint32\_t | 栈的大小。 |
|
||||
| priority | tk\_thread\_priority\_t | 优先级。 |
|
||||
#### action\_thread\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_t_action_thread_destroy">销毁。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t action_thread_destroy (action_thread_t* thread);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| thread | action\_thread\_t* | action\_thread对象。 |
|
||||
#### action\_thread\_exec 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_t_action_thread_exec">让线程执行action。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t action_thread_exec (action_thread_t* thread, qaction_t* action);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| thread | action\_thread\_t* | action\_thread对象。 |
|
||||
| action | qaction\_t* | action对象。 |
|
||||
#### action\_thread\_set\_on\_idle 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_t_action_thread_set_on_idle">设置空闲时的回调函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t action_thread_set_on_idle (action_thread_t* thread, action_thread_on_idle_t on_idle, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| thread | action\_thread\_t* | action\_thread对象。 |
|
||||
| on\_idle | action\_thread\_on\_idle\_t | 空闲时的回调函数。 |
|
||||
| ctx | void* | 回调函数的上下文。 |
|
||||
#### action\_thread\_set\_on\_quit 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="action_thread_t_action_thread_set_on_quit">设置退出时的回调函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t action_thread_set_on_quit (action_thread_t* thread, action_thread_on_quit_t on_quit, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| thread | action\_thread\_t* | action\_thread对象。 |
|
||||
| on\_quit | action\_thread\_on\_quit\_t | 退出时的回调函数。 |
|
||||
| ctx | void* | 回调函数的上下文。 |
|
||||
#### executed\_actions\_nr 属性
|
||||
-----------------------
|
||||
> <p id="action_thread_t_executed_actions_nr">已经执行action的个数。
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### queue 属性
|
||||
-----------------------
|
||||
> <p id="action_thread_t_queue">action queue。
|
||||
|
||||
* 类型:waitable\_action\_queue\_t*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### thread 属性
|
||||
-----------------------
|
||||
> <p id="action_thread_t_thread">线程对象。
|
||||
|
||||
* 类型:tk\_thread\_t*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
12
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/align_h_t.md
Normal file
12
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/align_h_t.md
Normal file
@ -0,0 +1,12 @@
|
||||
## align\_h\_t
|
||||
### 概述
|
||||
水平对齐的常量定义。
|
||||
### 常量
|
||||
<p id="align_h_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| ALIGN\_H\_NONE | 无效对齐方式。 |
|
||||
| ALIGN\_H\_CENTER | 居中对齐。 |
|
||||
| ALIGN\_H\_LEFT | 左边对齐。 |
|
||||
| ALIGN\_H\_RIGHT | 右边对齐。 |
|
12
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/align_v_t.md
Normal file
12
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/align_v_t.md
Normal file
@ -0,0 +1,12 @@
|
||||
## align\_v\_t
|
||||
### 概述
|
||||
垂直对齐的常量定义。
|
||||
### 常量
|
||||
<p id="align_v_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| ALIGN\_V\_NONE | 无效对齐方式。 |
|
||||
| ALIGN\_V\_MIDDLE | 居中对齐。 |
|
||||
| ALIGN\_V\_TOP | 顶部对齐。 |
|
||||
| ALIGN\_V\_BOTTOM | 底部对齐。 |
|
85
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/app_bar_t.md
Normal file
85
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/app_bar_t.md
Normal file
@ -0,0 +1,85 @@
|
||||
## app\_bar\_t
|
||||
### 概述
|
||||

|
||||
|
||||
app_bar控件。
|
||||
|
||||
一个简单的容器控件,一般在窗口的顶部,用于显示本窗口的状态和信息。
|
||||
|
||||
它本身不提供布局功能,仅提供具有语义的标签,让xml更具有可读性。
|
||||
子控件的布局可用layout\_children属性指定。
|
||||
请参考[布局参数](https://github.com/zlgopen/awtk/blob/master/docs/layout.md)。
|
||||
|
||||
app\_bar\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于app\_bar\_t控件。
|
||||
|
||||
在xml中使用"app\_bar"标签创建app\_bar。如:
|
||||
|
||||
```xml
|
||||
<app_bar x="0" y="0" w="100%" h="30" >
|
||||
<label x="0" y="0" w="100%" h="100%" text="Basic Controls" />
|
||||
</app_bar>
|
||||
```
|
||||
|
||||
在c代码中使用函数app\_bar\_create创建app\_bar。如:
|
||||
|
||||
```c
|
||||
widget_t* app_bar = app_bar_create(win, 0, 0, 320, 30);
|
||||
```
|
||||
|
||||
可用通过style来设置控件的显示风格,如背景颜色等。如:
|
||||
|
||||
```xml
|
||||
<style name="default" border_color="#a0a0a0">
|
||||
<normal bg_color="#f0f0f0" />
|
||||
</style>
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="app_bar_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#app_bar_t_app_bar_cast">app\_bar\_cast</a> | 转换为app_bar对象(供脚本语言使用)。 |
|
||||
| <a href="#app_bar_t_app_bar_create">app\_bar\_create</a> | 创建app_bar对象 |
|
||||
#### app\_bar\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_bar_t_app_bar_cast">转换为app_bar对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* app_bar_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | app\_bar对象。 |
|
||||
| widget | widget\_t* | app\_bar对象。 |
|
||||
#### app\_bar\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_bar_t_app_bar_create">创建app_bar对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* app_bar_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
511
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/app_conf_t.md
Normal file
511
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/app_conf_t.md
Normal file
@ -0,0 +1,511 @@
|
||||
## app\_conf\_t
|
||||
### 概述
|
||||
应用程序的配置信息。
|
||||
|
||||
底层实现可以是任何格式,比如INI,XML,JSON和UBJSON。
|
||||
|
||||
对于树状的文档,key可以是多级的,用.分隔。如network.ip。
|
||||
|
||||
conf-io是可选组件,需要自己包含头文件,否则64位数据类型会被截断成32位的数据。
|
||||
|
||||
```c
|
||||
#include "conf_io/app_conf.h"
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="app_conf_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#app_conf_t_app_conf_deinit">app\_conf\_deinit</a> | 释放conf对象。 |
|
||||
| <a href="#app_conf_t_app_conf_exist">app\_conf\_exist</a> | 检查配置项是否存在。 |
|
||||
| <a href="#app_conf_t_app_conf_get">app\_conf\_get</a> | 获取配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_get_bool">app\_conf\_get\_bool</a> | 获取bool类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_get_double">app\_conf\_get\_double</a> | 获取单精度浮点数类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_get_instance">app\_conf\_get\_instance</a> | 获取app_conf实例。 |
|
||||
| <a href="#app_conf_t_app_conf_get_int">app\_conf\_get\_int</a> | 获取整数类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_get_int64">app\_conf\_get\_int64</a> | 获取64位整数类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_get_str">app\_conf\_get\_str</a> | 获取字符串类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_get_wstr">app\_conf\_get\_wstr</a> | 获取宽字符串类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_off_changed">app\_conf\_off\_changed</a> | 注销配置变化事件。 |
|
||||
| <a href="#app_conf_t_app_conf_off_changed_by_ctx">app\_conf\_off\_changed\_by\_ctx</a> | 注销配置变化事件。 |
|
||||
| <a href="#app_conf_t_app_conf_on_changed">app\_conf\_on\_changed</a> | 注册配置变化事件。 |
|
||||
| <a href="#app_conf_t_app_conf_reload">app\_conf\_reload</a> | 重新加载配置(内存中的配置丢失)。 |
|
||||
| <a href="#app_conf_t_app_conf_remove">app\_conf\_remove</a> | 删除配置项。 |
|
||||
| <a href="#app_conf_t_app_conf_save">app\_conf\_save</a> | 持久保存配置。 |
|
||||
| <a href="#app_conf_t_app_conf_set">app\_conf\_set</a> | 设置配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_set_bool">app\_conf\_set\_bool</a> | 设置bool类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_set_double">app\_conf\_set\_double</a> | 设置双精度类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_set_instance">app\_conf\_set\_instance</a> | 设置app_conf实例。 |
|
||||
| <a href="#app_conf_t_app_conf_set_int">app\_conf\_set\_int</a> | 设置整数类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_set_int64">app\_conf\_set\_int64</a> | 设置64位整数类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_set_str">app\_conf\_set\_str</a> | 设置字符串类型配置项的值。 |
|
||||
| <a href="#app_conf_t_app_conf_set_wstr">app\_conf\_set\_wstr</a> | 设置宽字符串类型配置项的值。 |
|
||||
#### app\_conf\_deinit 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_deinit">释放conf对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_deinit ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
#### app\_conf\_exist 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_exist">检查配置项是否存在。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t app_conf_exist (const char* key);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示存在,FALSE表示不存在。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
#### app\_conf\_get 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_get">获取配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_get (const char* key, value_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| v | value\_t* | 配置项的值(用于返回)。 |
|
||||
#### app\_conf\_get\_bool 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_get_bool">获取bool类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t app_conf_get_bool (const char* key, bool_t defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回配置项的值(如果不存在返回缺省值)。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| defval | bool\_t | 缺省值。 |
|
||||
#### app\_conf\_get\_double 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_get_double">获取单精度浮点数类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
double app_conf_get_double (const char* key, double defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | double | 返回配置项的值(如果不存在返回缺省值)。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| defval | double | 缺省值。 |
|
||||
#### app\_conf\_get\_instance 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_get_instance">获取app_conf实例。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
object_t* app_conf_get_instance ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | object\_t* | 返回app\_conf实例。 |
|
||||
#### app\_conf\_get\_int 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_get_int">获取整数类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t app_conf_get_int (const char* key, int32_t defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 返回配置项的值(如果不存在返回缺省值)。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| defval | int32\_t | 缺省值。 |
|
||||
#### app\_conf\_get\_int64 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_get_int64">获取64位整数类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int64_t app_conf_get_int64 (const char* key, int64_t defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int64\_t | 返回配置项的值(如果不存在返回缺省值)。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| defval | int64\_t | 缺省值。 |
|
||||
#### app\_conf\_get\_str 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_get_str">获取字符串类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* app_conf_get_str (const char* key, const char* defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回配置项的值(如果不存在返回缺省值)。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| defval | const char* | 缺省值。 |
|
||||
#### app\_conf\_get\_wstr 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_get_wstr">获取宽字符串类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_get_wstr (const char* key, const wchar_t* str, uint32_t max_size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| str | const wchar\_t* | 返回值。 |
|
||||
| max\_size | uint32\_t | 最大长度(字符数)。 |
|
||||
#### app\_conf\_off\_changed 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_off_changed">注销配置变化事件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_off_changed (uint32_t id);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| id | uint32\_t | app\_conf\_on\_changed返回的ID。 |
|
||||
#### app\_conf\_off\_changed\_by\_ctx 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_off_changed_by_ctx">注销配置变化事件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_off_changed_by_ctx (void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| ctx | void* | 事件处理函数上下文。 |
|
||||
#### app\_conf\_on\_changed 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_on_changed">注册配置变化事件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t app_conf_on_changed (event_func_t on_event, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 返回id,用于app\_conf\_off\_changed。 |
|
||||
| on\_event | event\_func\_t | 事件处理函数。 |
|
||||
| ctx | void* | 事件处理函数上下文。 |
|
||||
#### app\_conf\_reload 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_reload">重新加载配置(内存中的配置丢失)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_reload ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
#### app\_conf\_remove 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_remove">删除配置项。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_remove (const char* key);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
#### app\_conf\_save 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_save">持久保存配置。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_save ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
#### app\_conf\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_set">设置配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_set (const char* key, const value_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| v | const value\_t* | 配置项的值。 |
|
||||
#### app\_conf\_set\_bool 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_set_bool">设置bool类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_set_bool (const char* key, bool_t v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| v | bool\_t | 配置项的值。 |
|
||||
#### app\_conf\_set\_double 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_set_double">设置双精度类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_set_double (const char* key, double v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| v | double | 配置项的值。 |
|
||||
#### app\_conf\_set\_instance 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_set_instance">设置app_conf实例。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_set_instance (object_t* );
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| | object\_t* | 。 |
|
||||
#### app\_conf\_set\_int 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_set_int">设置整数类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_set_int (const char* key, int32_t v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| v | int32\_t | 配置项的值。 |
|
||||
#### app\_conf\_set\_int64 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_set_int64">设置64位整数类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_set_int64 (const char* key, int64_t v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| v | int64\_t | 配置项的值。 |
|
||||
#### app\_conf\_set\_str 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_set_str">设置字符串类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_set_str (const char* key, const char* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| v | const char* | 配置项的值。 |
|
||||
#### app\_conf\_set\_wstr 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="app_conf_t_app_conf_set_wstr">设置宽字符串类型配置项的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t app_conf_set_wstr (const char* key, const wchar_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| key | const char* | 配置项的名称。 |
|
||||
| v | const wchar\_t* | 配置项的值。 |
|
11
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/app_type_t.md
Normal file
11
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/app_type_t.md
Normal file
@ -0,0 +1,11 @@
|
||||
## app\_type\_t
|
||||
### 概述
|
||||
应用程序类型。
|
||||
### 常量
|
||||
<p id="app_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| APP\_MOBILE | 嵌入式或移动APP |
|
||||
| APP\_SIMULATOR | 模拟器。 |
|
||||
| APP\_DESKTOP | 桌面应用程序。 |
|
@ -0,0 +1,9 @@
|
||||
## arg\_desc\_flags\_t
|
||||
### 概述
|
||||
参数描述范围常量定义。
|
||||
### 常量
|
||||
<p id="arg_desc_flags_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| ARG\_DESC\_FLAGS\_REQUIRED | 必须提供。 |
|
@ -0,0 +1,13 @@
|
||||
## asset\_data\_type\_t
|
||||
### 概述
|
||||
数据资源类型定义。
|
||||
### 常量
|
||||
<p id="asset_data_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| ASSET\_TYPE\_DATA\_NONE | 未知数据类型。 |
|
||||
| ASSET\_TYPE\_DATA\_TEXT | 文本数据类型。 |
|
||||
| ASSET\_TYPE\_DATA\_BIN | 二进制数据类型。 |
|
||||
| ASSET\_TYPE\_DATA\_JSON | JSON数据类型。 |
|
||||
| ASSET\_TYPE\_DATA\_DAT | 通用数据类型。 |
|
@ -0,0 +1,11 @@
|
||||
## asset\_font\_type\_t
|
||||
### 概述
|
||||
字体资源类型定义。
|
||||
### 常量
|
||||
<p id="asset_font_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| ASSET\_TYPE\_FONT\_NONE | 无效字体。 |
|
||||
| ASSET\_TYPE\_FONT\_TTF | TTF字体。 |
|
||||
| ASSET\_TYPE\_FONT\_BMP | 位图字体。 |
|
@ -0,0 +1,18 @@
|
||||
## asset\_image\_type\_t
|
||||
### 概述
|
||||
图片资源类型定义。
|
||||
### 常量
|
||||
<p id="asset_image_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| ASSET\_TYPE\_IMAGE\_NONE | 未知图片类型。 |
|
||||
| ASSET\_TYPE\_IMAGE\_RAW | Raw图片类型。 |
|
||||
| ASSET\_TYPE\_IMAGE\_BMP | 位图图片类型。 |
|
||||
| ASSET\_TYPE\_IMAGE\_PNG | PNG图片类型。 |
|
||||
| ASSET\_TYPE\_IMAGE\_JPG | JPG图片类型。 |
|
||||
| ASSET\_TYPE\_IMAGE\_BSVG | BSVG图片类型。 |
|
||||
| ASSET\_TYPE\_IMAGE\_GIF | GIF图片类型。 |
|
||||
| ASSET\_TYPE\_IMAGE\_WEBP | WEBP图片类型。 |
|
||||
| ASSET\_TYPE\_IMAGE\_LZ4 | LZ4压缩的图片类型。 |
|
||||
| ASSET\_TYPE\_IMAGE\_OTHER | 其它图片类型。 |
|
232
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/asset_info_t.md
Normal file
232
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/asset_info_t.md
Normal file
@ -0,0 +1,232 @@
|
||||
## asset\_info\_t
|
||||
### 概述
|
||||
单个资源的描述信息。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="asset_info_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#asset_info_t_asset_info_create">asset\_info\_create</a> | 创建asset_info对象。 |
|
||||
| <a href="#asset_info_t_asset_info_destroy">asset\_info\_destroy</a> | 销毁asset_info对象。 |
|
||||
| <a href="#asset_info_t_asset_info_get_formatted_name">asset\_info\_get\_formatted\_name</a> | 把资源名字格式化为符合标准长度的字符串。 |
|
||||
| <a href="#asset_info_t_asset_info_get_name">asset\_info\_get\_name</a> | 获取名称。 |
|
||||
| <a href="#asset_info_t_asset_info_get_type">asset\_info\_get\_type</a> | 获取类型。 |
|
||||
| <a href="#asset_info_t_asset_info_ref">asset\_info\_ref</a> | 增加asset_info对象的引用计数。 |
|
||||
| <a href="#asset_info_t_asset_info_unref">asset\_info\_unref</a> | 减少asset_info对象的引用计数。 |
|
||||
### 属性
|
||||
<p id="asset_info_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#asset_info_t_is_in_rom">is\_in\_rom</a> | uint8\_t | 资源是否在ROM中。 |
|
||||
| <a href="#asset_info_t_name">name</a> | char* | 名称。 |
|
||||
| <a href="#asset_info_t_refcount">refcount</a> | uint32\_t | 引用计数。 |
|
||||
| <a href="#asset_info_t_size">size</a> | uint32\_t | 大小。 |
|
||||
| <a href="#asset_info_t_subtype">subtype</a> | uint8\_t | 子类型。 |
|
||||
| <a href="#asset_info_t_type">type</a> | uint16\_t | 类型。 |
|
||||
#### asset\_info\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_info_t_asset_info_create">创建asset_info对象。
|
||||
|
||||
> 主要供脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
asset_info_t* asset_info_create (uint16_t type, uint16_t subtype, const char* name, uint32_t size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | asset\_info\_t* | asset\_info对象。 |
|
||||
| type | uint16\_t | 资源的类型。 |
|
||||
| subtype | uint16\_t | 资源的子类型。 |
|
||||
| name | const char* | 资源的名称。 |
|
||||
| size | uint32\_t | 资源的数据长度(用于分配空间)。 |
|
||||
#### asset\_info\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_info_t_asset_info_destroy">销毁asset_info对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t asset_info_destroy (asset_info_t* info);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| info | asset\_info\_t* | asset\_info对象。 |
|
||||
#### asset\_info\_get\_formatted\_name 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_info_t_asset_info_get_formatted_name">把资源名字格式化为符合标准长度的字符串。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t asset_info_get_formatted_name (const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回格式化后的名字。 |
|
||||
| name | const char* | 未格式化名字。 |
|
||||
#### asset\_info\_get\_name 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_info_t_asset_info_get_name">获取名称。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* asset_info_get_name (asset_info_t* info);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回名称。 |
|
||||
| info | asset\_info\_t* | asset\_info对象。 |
|
||||
#### asset\_info\_get\_type 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_info_t_asset_info_get_type">获取类型。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint16_t asset_info_get_type (asset_info_t* info);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint16\_t | 返回类型。 |
|
||||
| info | asset\_info\_t* | asset\_info对象。 |
|
||||
#### asset\_info\_ref 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_info_t_asset_info_ref">增加asset_info对象的引用计数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t asset_info_ref (asset_info_t* info);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| info | asset\_info\_t* | asset\_info对象。 |
|
||||
#### asset\_info\_unref 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_info_t_asset_info_unref">减少asset_info对象的引用计数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t asset_info_unref (asset_info_t* info);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| info | asset\_info\_t* | asset\_info对象。 |
|
||||
#### is\_in\_rom 属性
|
||||
-----------------------
|
||||
> <p id="asset_info_t_is_in_rom">资源是否在ROM中。
|
||||
|
||||
* 类型:uint8\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### name 属性
|
||||
-----------------------
|
||||
> <p id="asset_info_t_name">名称。
|
||||
|
||||
* 类型:char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### refcount 属性
|
||||
-----------------------
|
||||
> <p id="asset_info_t_refcount">引用计数。
|
||||
is\_in\_rom == FALSE时才有效。
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### size 属性
|
||||
-----------------------
|
||||
> <p id="asset_info_t_size">大小。
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### subtype 属性
|
||||
-----------------------
|
||||
> <p id="asset_info_t_subtype">子类型。
|
||||
|
||||
* 类型:uint8\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### type 属性
|
||||
-----------------------
|
||||
> <p id="asset_info_t_type">类型。
|
||||
|
||||
* 类型:uint16\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
@ -0,0 +1,94 @@
|
||||
## asset\_loader\_t
|
||||
### 概述
|
||||
资源加载器接口。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="asset_loader_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#asset_loader_t_asset_loader_create">asset\_loader\_create</a> | 创建缺省的资源加载器。 |
|
||||
| <a href="#asset_loader_t_asset_loader_destroy">asset\_loader\_destroy</a> | 销毁loader对象。 |
|
||||
| <a href="#asset_loader_t_asset_loader_exist">asset\_loader\_exist</a> | 判断指定资源是否存在。 |
|
||||
| <a href="#asset_loader_t_asset_loader_load">asset\_loader\_load</a> | 加载指定的资源。 |
|
||||
#### asset\_loader\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_loader_t_asset_loader_create">创建缺省的资源加载器。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
asset_loader_t* asset_loader_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | asset\_loader\_t* | 返回loader对象。 |
|
||||
#### asset\_loader\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_loader_t_asset_loader_destroy">销毁loader对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t asset_loader_destroy (asset_loader_t* loader);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| loader | asset\_loader\_t* | loader对象。 |
|
||||
#### asset\_loader\_exist 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_loader_t_asset_loader_exist">判断指定资源是否存在。
|
||||
。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t asset_loader_exist (asset_loader_t* loader, const char* path);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示存在,否则不存在。 |
|
||||
| loader | asset\_loader\_t* | loader对象。 |
|
||||
| path | const char* | 资源是路径。 |
|
||||
#### asset\_loader\_load 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="asset_loader_t_asset_loader_load">加载指定的资源。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
asset_info_t* asset_loader_load (asset_loader_t* loader, uint16_t type, uint16_t subtype, const char* path, const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | asset\_info\_t* | 返回资源对象(由调用者销毁)。 |
|
||||
| loader | asset\_loader\_t* | loader对象。 |
|
||||
| type | uint16\_t | 资源类型。 |
|
||||
| subtype | uint16\_t | 资源子类型。 |
|
||||
| path | const char* | 路径。 |
|
||||
| name | const char* | 名称。 |
|
@ -0,0 +1,12 @@
|
||||
## asset\_script\_type\_t
|
||||
### 概述
|
||||
脚本资源类型定义。
|
||||
### 常量
|
||||
<p id="asset_script_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| ASSET\_TYPE\_SCRIPT\_NONE | 未知脚本类型。 |
|
||||
| ASSET\_TYPE\_SCRIPT\_JS | JS脚本类型。 |
|
||||
| ASSET\_TYPE\_SCRIPT\_LUA | LUA脚本类型。 |
|
||||
| ASSET\_TYPE\_SCRIPT\_PYTHON | Python脚本类型。 |
|
@ -0,0 +1,18 @@
|
||||
## asset\_type\_t
|
||||
### 概述
|
||||
资源类型常量定义。
|
||||
### 常量
|
||||
<p id="asset_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| ASSET\_TYPE\_NONE | 无效资源。 |
|
||||
| ASSET\_TYPE\_FONT | 字体资源。 |
|
||||
| ASSET\_TYPE\_IMAGE | 图片资源。 |
|
||||
| ASSET\_TYPE\_STYLE | 窗体样式资源。 |
|
||||
| ASSET\_TYPE\_UI | UI数据资源。 |
|
||||
| ASSET\_TYPE\_XML | XML数据资源。 |
|
||||
| ASSET\_TYPE\_STRINGS | 字符串数据资源。 |
|
||||
| ASSET\_TYPE\_SCRIPT | JS等脚本资源。 |
|
||||
| ASSET\_TYPE\_FLOW | 流图资源。 |
|
||||
| ASSET\_TYPE\_DATA | 其它数据资源。 |
|
@ -0,0 +1,11 @@
|
||||
## asset\_ui\_type\_t
|
||||
### 概述
|
||||
UI资源类型定义。
|
||||
### 常量
|
||||
<p id="asset_ui_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| ASSET\_TYPE\_UI\_NONE | 无效UI类型。 |
|
||||
| ASSET\_TYPE\_UI\_BIN | 二进制的UI类型。 |
|
||||
| ASSET\_TYPE\_UI\_XML | XML格式的UI类型。 |
|
@ -0,0 +1,62 @@
|
||||
## assets\_event\_t
|
||||
### 概述
|
||||

|
||||
|
||||
资源事件,由资源管理器触发。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="assets_event_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#assets_event_t_assets_event_init">assets\_event\_init</a> | 初始化事件。 |
|
||||
### 属性
|
||||
<p id="assets_event_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#assets_event_t_asset_info">asset\_info</a> | asset\_info\_t* | 触发事件的资源对象 |
|
||||
| <a href="#assets_event_t_type">type</a> | asset\_type\_t | 触发事件的资源类型 |
|
||||
#### assets\_event\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_event_t_assets_event_init">初始化事件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
event_t* assets_event_init (window_event_t* event, assets_manager_t* am, uint32_t type, asset_type_t asset_type, asset_info_t* asset_info);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | event\_t* | event对象。 |
|
||||
| event | window\_event\_t* | event对象。 |
|
||||
| am | assets\_manager\_t* | 事件目标资源管理器。 |
|
||||
| type | uint32\_t | 事件类型。 |
|
||||
| asset\_type | asset\_type\_t | 资源类型。 |
|
||||
| asset\_info | asset\_info\_t* | 资源对象。 |
|
||||
#### asset\_info 属性
|
||||
-----------------------
|
||||
> <p id="assets_event_t_asset_info">触发事件的资源对象
|
||||
|
||||
* 类型:asset\_info\_t*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### type 属性
|
||||
-----------------------
|
||||
> <p id="assets_event_t_type">触发事件的资源类型
|
||||
|
||||
* 类型:asset\_type\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
@ -0,0 +1,619 @@
|
||||
## assets\_manager\_t
|
||||
### 概述
|
||||

|
||||
|
||||
资源管理器。
|
||||
这里的资源管理器并非Windows下的文件浏览器,而是负责对各种资源,比如字体、窗体样式、图片、界面数据、字符串和其它数据的进行集中管理的组件。引入资源管理器的目的有以下几个:
|
||||
|
||||
* 让上层不需要了解存储的方式。
|
||||
在没有文件系统时或者内存紧缺时,把资源转成常量数组直接编译到代码中。在有文件系统而且内存充足时,资源放在文件系统中。在有网络时,资源也可以存放在服务器上(暂未实现)。资源管理器为上层提供统一的接口,让上层而不用关心底层的存储方式。
|
||||
|
||||
* 让上层不需要了解资源的具体格式。
|
||||
比如一个名为earth的图片,没有文件系统或内存紧缺,图片直接用位图数据格式存在ROM中,而有文件系统时,则用PNG格式存放在文件系统中。资源管理器让上层不需要关心图片的格式,访问时指定图片的名称即可(不用指定扩展名)。
|
||||
|
||||
* 让上层不需要了解屏幕的密度。
|
||||
不同的屏幕密度下需要加载不同的图片,比如MacPro的Retina屏就需要用双倍解析度的图片,否则就出现界面模糊。AWTK以后会支持PC软件和手机软件的开发,所以资源管理器需要为此提供支持,让上层不需关心屏幕的密度。
|
||||
|
||||
* 对资源进行内存缓存。
|
||||
不同类型的资源使用方式是不一样的,比如字体和窗体样式加载之后会一直使用,UI文件在生成界面之后就暂时不需要了,PNG文件解码之后就只需要保留解码的位图数据即可。资源管理器配合图片管理器等其它组件实现资源的自动缓存。
|
||||
|
||||
当从文件系统加载资源时,目录结构要求如下:
|
||||
|
||||
```
|
||||
assets/{theme}/raw/
|
||||
fonts 字体
|
||||
images 图片
|
||||
x1 普通密度屏幕的图片。
|
||||
x2 2倍密度屏幕的图片。
|
||||
x3 3倍密度屏幕的图片。
|
||||
xx 密度无关的图片。
|
||||
strings 需要翻译的字符串。
|
||||
styles 窗体样式数据。
|
||||
ui UI描述数据。
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="assets_manager_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#assets_manager_t_assets_manager">assets\_manager</a> | 获取缺省资源管理器。 |
|
||||
| <a href="#assets_manager_t_assets_manager_add">assets\_manager\_add</a> | 向资源管理器中增加一个资源。 |
|
||||
| <a href="#assets_manager_t_assets_manager_add_data">assets\_manager\_add\_data</a> | 向资源管理器中增加一个资源data。 |
|
||||
| <a href="#assets_manager_t_assets_manager_clear_all">assets\_manager\_clear\_all</a> | 清除全部缓存的资源。 |
|
||||
| <a href="#assets_manager_t_assets_manager_clear_cache">assets\_manager\_clear\_cache</a> | 清除指定类型的缓存。 |
|
||||
| <a href="#assets_manager_t_assets_manager_clear_cache_ex">assets\_manager\_clear\_cache\_ex</a> | 清除指定类型和名称的缓存。 |
|
||||
| <a href="#assets_manager_t_assets_manager_create">assets\_manager\_create</a> | 创建资源管理器。 |
|
||||
| <a href="#assets_manager_t_assets_manager_deinit">assets\_manager\_deinit</a> | 释放全部资源。 |
|
||||
| <a href="#assets_manager_t_assets_manager_destroy">assets\_manager\_destroy</a> | 释放全部资源并销毁asset manager对象。 |
|
||||
| <a href="#assets_manager_t_assets_manager_find_in_cache">assets\_manager\_find\_in\_cache</a> | 在资源管理器的缓存中查找指定的资源(不引用)。 |
|
||||
| <a href="#assets_manager_t_assets_manager_get_res_root">assets\_manager\_get\_res\_root</a> | 获取资源所在的目录(其下目录结构请参考demos)。 |
|
||||
| <a href="#assets_manager_t_assets_manager_init">assets\_manager\_init</a> | 初始化资源管理器。 |
|
||||
| <a href="#assets_manager_t_assets_manager_load">assets\_manager\_load</a> | 从文件系统中加载指定的资源,并缓存到内存中。在定义了宏WITH\_FS\_RES时才生效。 |
|
||||
| <a href="#assets_manager_t_assets_manager_load_ex">assets\_manager\_load\_ex</a> | 从文件系统中加载指定的资源,并缓存到内存中。在定义了宏WITH\_FS\_RES时才生效。 |
|
||||
| <a href="#assets_manager_t_assets_manager_load_file">assets\_manager\_load\_file</a> | 获取path里的资源。 |
|
||||
| <a href="#assets_manager_t_assets_manager_preload">assets\_manager\_preload</a> | 从文件系统中加载指定的资源,并缓存到内存中。在定义了宏WITH\_FS\_RES时才生效。 |
|
||||
| <a href="#assets_manager_t_assets_manager_ref">assets\_manager\_ref</a> | 在资源管理器的缓存中查找指定的资源并引用它,如果缓存中不存在,尝试加载该资源。 |
|
||||
| <a href="#assets_manager_t_assets_manager_ref_ex">assets\_manager\_ref\_ex</a> | 在资源管理器的缓存中查找指定的资源并引用它,如果缓存中不存在,尝试加载该资源。 |
|
||||
| <a href="#assets_manager_t_assets_manager_set">assets\_manager\_set</a> | 设置缺省资源管理器。 |
|
||||
| <a href="#assets_manager_t_assets_manager_set_custom_build_asset_dir">assets\_manager\_set\_custom\_build\_asset\_dir</a> | 设置一个函数,该函数用于生成资源路径。 |
|
||||
| <a href="#assets_manager_t_assets_manager_set_custom_load_asset">assets\_manager\_set\_custom\_load\_asset</a> | 设置一个函数,该函数用于实现自定义加载资源。 |
|
||||
| <a href="#assets_manager_t_assets_manager_set_loader">assets\_manager\_set\_loader</a> | 设置loader。 |
|
||||
| <a href="#assets_manager_t_assets_manager_set_locale_info">assets\_manager\_set\_locale\_info</a> | 设置locale_info对象。 |
|
||||
| <a href="#assets_manager_t_assets_manager_set_res_root">assets\_manager\_set\_res\_root</a> | 设置资源所在的目录(其下目录结构请参考demos)。 |
|
||||
| <a href="#assets_manager_t_assets_manager_set_system_info">assets\_manager\_set\_system\_info</a> | 设置system_info对象。 |
|
||||
| <a href="#assets_manager_t_assets_manager_set_theme">assets\_manager\_set\_theme</a> | 设置当前的主题。 |
|
||||
| <a href="#assets_manager_t_assets_manager_unref">assets\_manager\_unref</a> | 释放指定的资源。 |
|
||||
#### assets\_manager 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager">获取缺省资源管理器。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
assets_manager_t* assets_manager ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | assets\_manager\_t* | 返回asset manager对象。 |
|
||||
#### assets\_manager\_add 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_add">向资源管理器中增加一个资源。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_add (assets_manager_t* am, asset_info_t info);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| info | asset\_info\_t | 待增加的资源。 |
|
||||
#### assets\_manager\_add\_data 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_add_data">向资源管理器中增加一个资源data。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_add_data (assets_manager_t* am, const char* name, uint16_t type, uint16_t subtype, uint8_t* buff, uint32_t size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| name | const char* | 待增加的资源的名字。 |
|
||||
| type | uint16\_t | 待增加的资源的主类型枚举。 |
|
||||
| subtype | uint16\_t | 待增加的资源的子类型枚举。 |
|
||||
| buff | uint8\_t* | 待增加的资源的data数据。 |
|
||||
| size | uint32\_t | 待增加的资源的data数据长度。 |
|
||||
#### assets\_manager\_clear\_all 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_clear_all">清除全部缓存的资源。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_clear_all (assets_manager_t* am);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
#### assets\_manager\_clear\_cache 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_clear_cache">清除指定类型的缓存。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_clear_cache (assets_manager_t* am, asset_type_t type);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| type | asset\_type\_t | 资源的类型。 |
|
||||
#### assets\_manager\_clear\_cache\_ex 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_clear_cache_ex">清除指定类型和名称的缓存。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_clear_cache_ex (assets_manager_t* am, asset_type_t type, const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| type | asset\_type\_t | 资源的类型。 |
|
||||
| name | const char* | 资源的名称。 |
|
||||
#### assets\_manager\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_create">创建资源管理器。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
assets_manager_t* assets_manager_create (uint32_t init_nr);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | assets\_manager\_t* | 返回asset manager对象。 |
|
||||
| init\_nr | uint32\_t | 预先分配资源的个数。 |
|
||||
#### assets\_manager\_deinit 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_deinit">释放全部资源。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_deinit (assets_manager_t* am);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
#### assets\_manager\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_destroy">释放全部资源并销毁asset manager对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_destroy (assets_manager_t* am);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
#### assets\_manager\_find\_in\_cache 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_find_in_cache">在资源管理器的缓存中查找指定的资源(不引用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
asset_info_t* assets_manager_find_in_cache (assets_manager_t* am, asset_type_t type, uint16_t subtype, char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | asset\_info\_t* | 返回资源。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| type | asset\_type\_t | 资源的类型。 |
|
||||
| subtype | uint16\_t | 资源的子类型。 |
|
||||
| name | char* | 资源的名称。 |
|
||||
#### assets\_manager\_get\_res\_root 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_get_res_root">获取资源所在的目录(其下目录结构请参考demos)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* assets_manager_get_res_root (assets_manager_t* am);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回资源所在的目录。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
#### assets\_manager\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_init">初始化资源管理器。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
assets_manager_t* assets_manager_init (assets_manager_t* am, uint32_t init_nr);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | assets\_manager\_t* | 返回asset manager对象。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| init\_nr | uint32\_t | 预先分配资源的个数。 |
|
||||
#### assets\_manager\_load 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_load">从文件系统中加载指定的资源,并缓存到内存中。在定义了宏WITH\_FS\_RES时才生效。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
asset_info_t* assets_manager_load (assets_manager_t* am, asset_type_t type, const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | asset\_info\_t* | 返回资源。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| type | asset\_type\_t | 资源的类型。 |
|
||||
| name | const char* | 资源的名称。 |
|
||||
#### assets\_manager\_load\_ex 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_load_ex">从文件系统中加载指定的资源,并缓存到内存中。在定义了宏WITH\_FS\_RES时才生效。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
asset_info_t* assets_manager_load_ex (assets_manager_t* am, asset_type_t type, asset_type_t type, char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | asset\_info\_t* | 返回资源。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| type | asset\_type\_t | 资源的类型。 |
|
||||
| type | asset\_type\_t | 资源的子类型。 |
|
||||
| name | char* | 资源的名称。 |
|
||||
#### assets\_manager\_load\_file 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_load_file">获取path里的资源。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
asset_info_t* assets_manager_load_file (assets_manager_t* am, asset_type_t type, const char* path);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | asset\_info\_t* | 返回asset\_info\_t。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| type | asset\_type\_t | 资源类型。 |
|
||||
| path | const char* | 目录。 |
|
||||
#### assets\_manager\_preload 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_preload">从文件系统中加载指定的资源,并缓存到内存中。在定义了宏WITH\_FS\_RES时才生效。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_preload (assets_manager_t* am, asset_type_t type, char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| type | asset\_type\_t | 资源的类型。 |
|
||||
| name | char* | 资源的名称。 |
|
||||
#### assets\_manager\_ref 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_ref">在资源管理器的缓存中查找指定的资源并引用它,如果缓存中不存在,尝试加载该资源。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
asset_info_t* assets_manager_ref (assets_manager_t* am, asset_type_t type, char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | asset\_info\_t* | 返回资源。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| type | asset\_type\_t | 资源的类型。 |
|
||||
| name | char* | 资源的名称。 |
|
||||
#### assets\_manager\_ref\_ex 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_ref_ex">在资源管理器的缓存中查找指定的资源并引用它,如果缓存中不存在,尝试加载该资源。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
asset_info_t* assets_manager_ref_ex (assets_manager_t* am, asset_type_t type, uint16_t subtype, char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | asset\_info\_t* | 返回资源。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| type | asset\_type\_t | 资源的类型。 |
|
||||
| subtype | uint16\_t | 资源的子类型。 |
|
||||
| name | char* | 资源的名称。 |
|
||||
#### assets\_manager\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_set">设置缺省资源管理器。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_set (assets_manager_t* am);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
#### assets\_manager\_set\_custom\_build\_asset\_dir 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_set_custom_build_asset_dir">设置一个函数,该函数用于生成资源路径。
|
||||
|
||||
> 有时我们需要优先加载用户自定义的资源,加载失败才加载系统缺省的,可用设置一个函数去实现这类功能。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_set_custom_build_asset_dir (assets_manager_t* am, assets_manager_build_asset_dir_t custom_build_asset_dir, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| custom\_build\_asset\_dir | assets\_manager\_build\_asset\_dir\_t | 回调函数。 |
|
||||
| ctx | void* | 回调函数的上下文。 |
|
||||
#### assets\_manager\_set\_custom\_load\_asset 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_set_custom_load_asset">设置一个函数,该函数用于实现自定义加载资源。
|
||||
|
||||
> 如果不支持文件系统,开发者可以设置一个加载资源的回调函数,从flash或其它地方读取资源。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_set_custom_load_asset (assets_manager_t* am, assets_manager_load_asset_t custom_load_asset, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| custom\_load\_asset | assets\_manager\_load\_asset\_t | 回调函数。 |
|
||||
| ctx | void* | 回调函数的上下文。 |
|
||||
#### assets\_manager\_set\_loader 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_set_loader">设置loader。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_set_loader (assets_manager_t* am, asset_loader_t* loader);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| loader | asset\_loader\_t* | 加载器(由assets manager销毁)。 |
|
||||
#### assets\_manager\_set\_locale\_info 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_set_locale_info">设置locale_info对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_set_locale_info (assets_manager_t* am, locale_info_t* locale_info);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| locale\_info | locale\_info\_t* | locale\_info对象。。 |
|
||||
#### assets\_manager\_set\_res\_root 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_set_res_root">设置资源所在的目录(其下目录结构请参考demos)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_set_res_root (assets_manager_t* am, const char* res_root);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| res\_root | const char* | 资源所在的目录。 |
|
||||
#### assets\_manager\_set\_system\_info 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_set_system_info">设置system_info对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_set_system_info (assets_manager_t* am, system_info_t* system_info);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| system\_info | system\_info\_t* | system\_info对象。。 |
|
||||
#### assets\_manager\_set\_theme 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_set_theme">设置当前的主题。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_set_theme (assets_manager_t* am, const char* theme);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| theme | const char* | 主题名称。 |
|
||||
#### assets\_manager\_unref 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="assets_manager_t_assets_manager_unref">释放指定的资源。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t assets_manager_unref (assets_manager_t* am, asset_info_t* info);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| am | assets\_manager\_t* | asset manager对象。 |
|
||||
| info | asset\_info\_t* | 资源。 |
|
69
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/async_t.md
Normal file
69
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/async_t.md
Normal file
@ -0,0 +1,69 @@
|
||||
## async\_t
|
||||
### 概述
|
||||
在后台线程执行指定函数,不会阻塞UI线程。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="async_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#async_t_async_call">async\_call</a> | 异步执行exec函数,执行完成后,在后台线程调用on_result函数。 |
|
||||
| <a href="#async_t_async_call_deinit">async\_call\_deinit</a> | 全局~初始化。 |
|
||||
| <a href="#async_t_async_call_init">async\_call\_init</a> | 全局初始化。 |
|
||||
#### async\_call 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="async_t_async_call">异步执行exec函数,执行完成后,在后台线程调用on_result函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t async_call (async_exec_t exec, async_on_result_t on_result, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| exec | async\_exec\_t | 需要异步支持的函数。 |
|
||||
| on\_result | async\_on\_result\_t | 返回执行结果(可选) |
|
||||
| ctx | void* | 两个回调函数的上下文。 |
|
||||
#### async\_call\_deinit 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="async_t_async_call_deinit">全局~初始化。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t async_call_deinit ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
#### async\_call\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="async_t_async_call_init">全局初始化。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t async_call_init ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
165
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/bidi_t.md
Normal file
165
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/bidi_t.md
Normal file
@ -0,0 +1,165 @@
|
||||
## bidi\_t
|
||||
### 概述
|
||||
Unicode Bidirectional Algorithm.
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="bidi_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#bidi_t_bidi_deinit">bidi\_deinit</a> | 释放bidi对象相关资源。 |
|
||||
| <a href="#bidi_t_bidi_init">bidi\_init</a> | 初始化bidi对象。 |
|
||||
| <a href="#bidi_t_bidi_log2vis">bidi\_log2vis</a> | 将字符串转成用于显示的字符串,输出结果放在bidi->vis_str中。 |
|
||||
| <a href="#bidi_t_bidi_type_from_name">bidi\_type\_from\_name</a> | 将bidi类型的名称转换成类型。 |
|
||||
### 属性
|
||||
<p id="bidi_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#bidi_t_positions_L_to_V">positions\_L\_to\_V</a> | int32\_t* | logical位置与visual位置的映射。 |
|
||||
| <a href="#bidi_t_positions_V_to_L">positions\_V\_to\_L</a> | int32\_t* | visual位置与logical位置的映射。 |
|
||||
| <a href="#bidi_t_request_type">request\_type</a> | bidi\_type\_t | 请求的类型。 |
|
||||
| <a href="#bidi_t_resolved_type">resolved\_type</a> | bidi\_type\_t | 实际的类型。 |
|
||||
| <a href="#bidi_t_vis_str_size">vis\_str\_size</a> | uint32\_t | 用于显示的字符串长度(存放log2vis的结果)。 |
|
||||
| <a href="#bidi_t_vis_strx">vis\_strx</a> | wchar\_t* | 用于显示的字符串(存放log2vis的结果)。 |
|
||||
#### bidi\_deinit 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bidi_t_bidi_deinit">释放bidi对象相关资源。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bidi_deinit (bidi_t* bidi);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| bidi | bidi\_t* | bidi对象。 |
|
||||
#### bidi\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bidi_t_bidi_init">初始化bidi对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bidi_t* bidi_init (bidi_t* bidi, bool_t alloc_l2v, bool_t alloc_v2l, bidi_type_t type);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bidi\_t* | 返回bidi对象。 |
|
||||
| bidi | bidi\_t* | bidi对象。 |
|
||||
| alloc\_l2v | bool\_t | 是否为positions\_L\_to\_V分配空间。 |
|
||||
| alloc\_v2l | bool\_t | 是否为positions\_V\_to\_L分配空间。 |
|
||||
| type | bidi\_type\_t | 类型。 |
|
||||
#### bidi\_log2vis 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bidi_t_bidi_log2vis">将字符串转成用于显示的字符串,输出结果放在bidi->vis_str中。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bidi_log2vis (bidi_t* bidi, const wchar_t* str, uint32_t size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| bidi | bidi\_t* | bidi对象。 |
|
||||
| str | const wchar\_t* | 字符串。 |
|
||||
| size | uint32\_t | 字符串的长度。 |
|
||||
#### bidi\_type\_from\_name 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bidi_t_bidi_type_from_name">将bidi类型的名称转换成类型。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bidi_t* bidi_type_from_name (const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bidi\_t* | 返回bidi对象。 |
|
||||
| name | const char* | 类型名称(取值:rtl,ltr,auto,wrtl,wltr,lro,rlo)。 |
|
||||
#### positions\_L\_to\_V 属性
|
||||
-----------------------
|
||||
> <p id="bidi_t_positions_L_to_V">logical位置与visual位置的映射。
|
||||
|
||||
* 类型:int32\_t*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### positions\_V\_to\_L 属性
|
||||
-----------------------
|
||||
> <p id="bidi_t_positions_V_to_L">visual位置与logical位置的映射。
|
||||
|
||||
* 类型:int32\_t*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### request\_type 属性
|
||||
-----------------------
|
||||
> <p id="bidi_t_request_type">请求的类型。
|
||||
|
||||
* 类型:bidi\_type\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### resolved\_type 属性
|
||||
-----------------------
|
||||
> <p id="bidi_t_resolved_type">实际的类型。
|
||||
|
||||
* 类型:bidi\_type\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### vis\_str\_size 属性
|
||||
-----------------------
|
||||
> <p id="bidi_t_vis_str_size">用于显示的字符串长度(存放log2vis的结果)。
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### vis\_strx 属性
|
||||
-----------------------
|
||||
> <p id="bidi_t_vis_strx">用于显示的字符串(存放log2vis的结果)。
|
||||
|
||||
* 类型:wchar\_t*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
15
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/bidi_type_t.md
Normal file
15
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/bidi_type_t.md
Normal file
@ -0,0 +1,15 @@
|
||||
## bidi\_type\_t
|
||||
### 概述
|
||||
bidi 类型常量定义。
|
||||
### 常量
|
||||
<p id="bidi_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| BIDI\_TYPE\_AUTO | 自动检查。 |
|
||||
| BIDI\_TYPE\_LTR | Left-To-Right letter。 |
|
||||
| BIDI\_TYPE\_RTL | Right-To-Left letter。 |
|
||||
| BIDI\_TYPE\_LRO | Left-To-Right letter Override。 |
|
||||
| BIDI\_TYPE\_RLO | Right-To-Left letter Override。 |
|
||||
| BIDI\_TYPE\_WLTR | Weak Left To Right paragraph。 |
|
||||
| BIDI\_TYPE\_WRTL | Weak Right To Left paragraph。 |
|
@ -0,0 +1,14 @@
|
||||
## bitmap\_flag\_t
|
||||
### 概述
|
||||
位图标志常量定义。
|
||||
### 常量
|
||||
<p id="bitmap_flag_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| BITMAP\_FLAG\_NONE | 无特殊标志。 |
|
||||
| BITMAP\_FLAG\_OPAQUE | 不透明图片。 |
|
||||
| BITMAP\_FLAG\_IMMUTABLE | 图片内容不会变化。 |
|
||||
| BITMAP\_FLAG\_TEXTURE | OpenGL Texture, bitmap的id是有效的texture id。 |
|
||||
| BITMAP\_FLAG\_CHANGED | 如果是MUTABLE的图片,更新时需要设置此标志,底层可能会做特殊处理,比如更新图片到GPU。 |
|
||||
| BITMAP\_FLAG\_PREMULTI\_ALPHA | 预乘alpha。 |
|
@ -0,0 +1,19 @@
|
||||
## bitmap\_format\_t
|
||||
### 概述
|
||||
位图格式常量定义。
|
||||
### 常量
|
||||
<p id="bitmap_format_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| BITMAP\_FMT\_NONE | 无效格式。 |
|
||||
| BITMAP\_FMT\_RGBA8888 | 一个像素占用4个字节,RGBA占一个字节,按内存地址递增。 |
|
||||
| BITMAP\_FMT\_ABGR8888 | 一个像素占用4个字节,ABGR占一个字节,按内存地址递增。 |
|
||||
| BITMAP\_FMT\_BGRA8888 | 一个像素占用4个字节,BGRA占一个字节,按内存地址递增。 |
|
||||
| BITMAP\_FMT\_ARGB8888 | 一个像素占用4个字节,ARGB占一个字节,按内存地址递增。 |
|
||||
| BITMAP\_FMT\_RGB565 | 一个像素占用2个字节,RGB分别占用5,6,5位, 按内存地址递增。 |
|
||||
| BITMAP\_FMT\_BGR565 | 一个像素占用2个字节,BGR分别占用5,6,5位, 按内存地址递增。 |
|
||||
| BITMAP\_FMT\_RGB888 | 一个像素占用3个字节,RGB占一个字节,按内存地址递增。 |
|
||||
| BITMAP\_FMT\_BGR888 | 一个像素占用3个字节,RGB占一个字节,按内存地址递增。 |
|
||||
| BITMAP\_FMT\_GRAY | 一个像素占用1个字节。 |
|
||||
| BITMAP\_FMT\_MONO | 一个像素占用1比特。 |
|
462
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/bitmap_t.md
Normal file
462
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/bitmap_t.md
Normal file
@ -0,0 +1,462 @@
|
||||
## bitmap\_t
|
||||
### 概述
|
||||
位图。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="bitmap_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#bitmap_t_bitmap_create">bitmap\_create</a> | 创建图片对象(一般供脚本语言中使用)。 |
|
||||
| <a href="#bitmap_t_bitmap_create_ex">bitmap\_create\_ex</a> | 创建图片对象。 |
|
||||
| <a href="#bitmap_t_bitmap_destroy">bitmap\_destroy</a> | 销毁图片。 |
|
||||
| <a href="#bitmap_t_bitmap_destroy_with_self">bitmap\_destroy\_with\_self</a> | 销毁图片(for script only)。 |
|
||||
| <a href="#bitmap_t_bitmap_get_bpp">bitmap\_get\_bpp</a> | 获取图片一个像素占用的字节数。 |
|
||||
| <a href="#bitmap_t_bitmap_get_bpp_of_format">bitmap\_get\_bpp\_of\_format</a> | 获取位图格式对应的颜色位数。 |
|
||||
| <a href="#bitmap_t_bitmap_get_line_length">bitmap\_get\_line\_length</a> | 获取每一行占用内存的字节数。 |
|
||||
| <a href="#bitmap_t_bitmap_get_pixel">bitmap\_get\_pixel</a> | 获取图片指定像素的rgba颜色值(主要用于测试程序)。 |
|
||||
| <a href="#bitmap_t_bitmap_init">bitmap\_init</a> | 初始化图片。 |
|
||||
| <a href="#bitmap_t_bitmap_init_from_bgra">bitmap\_init\_from\_bgra</a> | 初始化图片。 |
|
||||
| <a href="#bitmap_t_bitmap_init_from_rgba">bitmap\_init\_from\_rgba</a> | 初始化图片。 |
|
||||
| <a href="#bitmap_t_bitmap_lock_buffer_for_read">bitmap\_lock\_buffer\_for\_read</a> | 为读取数据而锁定bitmap的图片缓冲区。 |
|
||||
| <a href="#bitmap_t_bitmap_lock_buffer_for_write">bitmap\_lock\_buffer\_for\_write</a> | 为修改数据而锁定bitmap的图片缓冲区。 |
|
||||
| <a href="#bitmap_t_bitmap_mono_dump">bitmap\_mono\_dump</a> | dump mono bitmap。 |
|
||||
| <a href="#bitmap_t_bitmap_save_png">bitmap\_save\_png</a> | 把bitmap保存为png。 |
|
||||
| <a href="#bitmap_t_bitmap_set_line_length">bitmap\_set\_line\_length</a> | 设置line_length。 |
|
||||
| <a href="#bitmap_t_bitmap_unlock_buffer">bitmap\_unlock\_buffer</a> | 解锁图像缓冲区。 |
|
||||
### 属性
|
||||
<p id="bitmap_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#bitmap_t_buffer">buffer</a> | graphic\_buffer\_t* | 图片数据。 |
|
||||
| <a href="#bitmap_t_flags">flags</a> | uint16\_t | 标志。请参考{bitmap_flag_t}。 |
|
||||
| <a href="#bitmap_t_format">format</a> | uint16\_t | 格式。请参考{bitmap_format_t}。 |
|
||||
| <a href="#bitmap_t_h">h</a> | wh\_t | 高度。 |
|
||||
| <a href="#bitmap_t_line_length">line\_length</a> | uint32\_t | 每一行实际占用的内存(也称为stride或pitch),一般情况下为w*bpp。 |
|
||||
| <a href="#bitmap_t_name">name</a> | const char* | 名称。 |
|
||||
| <a href="#bitmap_t_w">w</a> | wh\_t | 宽度。 |
|
||||
#### bitmap\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_create">创建图片对象(一般供脚本语言中使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bitmap_t* bitmap_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bitmap\_t* | 返回bitmap对象。 |
|
||||
#### bitmap\_create\_ex 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_create_ex">创建图片对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bitmap_t* bitmap_create_ex (uint32_t w, uint32_t h, uint32_t line_length, bitmap_format_t format);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bitmap\_t* | 返回bitmap对象。 |
|
||||
| w | uint32\_t | 宽度。 |
|
||||
| h | uint32\_t | 高度。 |
|
||||
| line\_length | uint32\_t | line\_length。 |
|
||||
| format | bitmap\_format\_t | 格式。 |
|
||||
#### bitmap\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_destroy">销毁图片。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bitmap_destroy (bitmap_t* bitmap);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
#### bitmap\_destroy\_with\_self 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_destroy_with_self">销毁图片(for script only)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bitmap_destroy_with_self (bitmap_t* bitmap);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
#### bitmap\_get\_bpp 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_get_bpp">获取图片一个像素占用的字节数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t bitmap_get_bpp (bitmap_t* bitmap);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 返回一个像素占用的字节数。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
#### bitmap\_get\_bpp\_of\_format 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_get_bpp_of_format">获取位图格式对应的颜色位数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t bitmap_get_bpp_of_format (bitmap_format_t format);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 成功返回颜色位数,失败返回0。 |
|
||||
| format | bitmap\_format\_t | 位图格式。 |
|
||||
#### bitmap\_get\_line\_length 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_get_line_length">获取每一行占用内存的字节数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bitmap_get_line_length (bitmap_t* bitmap);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回每一行占用内存的字节数。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
#### bitmap\_get\_pixel 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_get_pixel">获取图片指定像素的rgba颜色值(主要用于测试程序)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bitmap_get_pixel (bitmap_t* bitmap, uint32_t x, uint32_t y, rgba_t* rgba);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
| x | uint32\_t | x坐标。 |
|
||||
| y | uint32\_t | y坐标。 |
|
||||
| rgba | rgba\_t* | 返回颜色值。 |
|
||||
#### bitmap\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_init">初始化图片。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bitmap_init (bitmap_t* bitmap, uint32_t w, uint32_t h, bitmap_format_t format, const uint8_t* data);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
| w | uint32\_t | 宽度。 |
|
||||
| h | uint32\_t | 高度。 |
|
||||
| format | bitmap\_format\_t | 格式。 |
|
||||
| data | const uint8\_t* | 数据,直接引用,但不负责释放。如果为空,由内部自动分配和释放。 |
|
||||
#### bitmap\_init\_from\_bgra 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_init_from_bgra">初始化图片。
|
||||
数据。3通道时为BGR888格式,4通道时为BGRA888格式(内部拷贝该数据,不会引用,调用者自行释放)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bitmap_init_from_bgra (bitmap_t* bitmap, uint32_t w, uint32_t h, bitmap_format_t format, const uint8_t* , uint32_t comp);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
| w | uint32\_t | 宽度。 |
|
||||
| h | uint32\_t | 高度。 |
|
||||
| format | bitmap\_format\_t | 格式。 |
|
||||
| | const uint8\_t* | a |
|
||||
| comp | uint32\_t | 颜色通道数(目前支持3(bgr)和4(bgra))。 |
|
||||
#### bitmap\_init\_from\_rgba 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_init_from_rgba">初始化图片。
|
||||
数据。3通道时为RGB888格式,4通道时为RGBA888格式(内部拷贝该数据,不会引用,调用者自行释放)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bitmap_init_from_rgba (bitmap_t* bitmap, uint32_t w, uint32_t h, bitmap_format_t format, const uint8_t* , uint32_t comp);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
| w | uint32\_t | 宽度。 |
|
||||
| h | uint32\_t | 高度。 |
|
||||
| format | bitmap\_format\_t | 格式。 |
|
||||
| | const uint8\_t* | a |
|
||||
| comp | uint32\_t | 颜色通道数(目前支持3(rgb)和4(rgba))。 |
|
||||
#### bitmap\_lock\_buffer\_for\_read 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_lock_buffer_for_read">为读取数据而锁定bitmap的图片缓冲区。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint8_t* bitmap_lock_buffer_for_read (bitmap_t* bitmap);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint8\_t* | 返回缓存区的首地址。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
#### bitmap\_lock\_buffer\_for\_write 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_lock_buffer_for_write">为修改数据而锁定bitmap的图片缓冲区。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint8_t* bitmap_lock_buffer_for_write (bitmap_t* bitmap);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint8\_t* | 返回缓存区的首地址。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
#### bitmap\_mono\_dump 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_mono_dump">dump mono bitmap。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bitmap_mono_dump (const uint8_t* buff, uint32_t w, uint32_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| buff | const uint8\_t* | 数据。 |
|
||||
| w | uint32\_t | 宽度。 |
|
||||
| h | uint32\_t | 高度。 |
|
||||
#### bitmap\_save\_png 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_save_png">把bitmap保存为png。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t bitmap_save_png (bitmap_t* bitmap, const char* filename);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示成功,FALSE表示失败。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
| filename | const char* | 文件名。 |
|
||||
#### bitmap\_set\_line\_length 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_set_line_length">设置line_length。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bitmap_set_line_length (bitmap_t* bitmap, uint32_t line_length);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
| line\_length | uint32\_t | line\_length。 |
|
||||
#### bitmap\_unlock\_buffer 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bitmap_t_bitmap_unlock_buffer">解锁图像缓冲区。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t bitmap_unlock_buffer (bitmap_t* bitmap);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| bitmap | bitmap\_t* | bitmap对象。 |
|
||||
#### buffer 属性
|
||||
-----------------------
|
||||
> <p id="bitmap_t_buffer">图片数据。
|
||||
|
||||
* 类型:graphic\_buffer\_t*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### flags 属性
|
||||
-----------------------
|
||||
> <p id="bitmap_t_flags">标志。请参考{bitmap_flag_t}。
|
||||
|
||||
* 类型:uint16\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### format 属性
|
||||
-----------------------
|
||||
> <p id="bitmap_t_format">格式。请参考{bitmap_format_t}。
|
||||
|
||||
* 类型:uint16\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### h 属性
|
||||
-----------------------
|
||||
> <p id="bitmap_t_h">高度。
|
||||
|
||||
* 类型:wh\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### line\_length 属性
|
||||
-----------------------
|
||||
> <p id="bitmap_t_line_length">每一行实际占用的内存(也称为stride或pitch),一般情况下为w*bpp。
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### name 属性
|
||||
-----------------------
|
||||
> <p id="bitmap_t_name">名称。
|
||||
|
||||
* 类型:const char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### w 属性
|
||||
-----------------------
|
||||
> <p id="bitmap_t_w">宽度。
|
||||
|
||||
* 类型:wh\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
@ -0,0 +1,14 @@
|
||||
## border\_type\_t
|
||||
### 概述
|
||||
控件边框类型。
|
||||
### 常量
|
||||
<p id="border_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| BORDER\_NONE | 无边框。 |
|
||||
| BORDER\_LEFT | 左边框线。 |
|
||||
| BORDER\_RIGHT | 右边框线。 |
|
||||
| BORDER\_TOP | 上边框线。 |
|
||||
| BORDER\_BOTTOM | 下边框线。 |
|
||||
| BORDER\_ALL | 全边框线。 |
|
31
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/bsvg_t.md
Normal file
31
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/bsvg_t.md
Normal file
@ -0,0 +1,31 @@
|
||||
## bsvg\_t
|
||||
### 概述
|
||||
SVG的二进制格式。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="bsvg_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#bsvg_t_bsvg_init">bsvg\_init</a> | 初始化bsvg对象。 |
|
||||
#### bsvg\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="bsvg_t_bsvg_init">初始化bsvg对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bsvg_t* bsvg_init (bsvg_t* , const uint32_t* data, size size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bsvg\_t* | 返回解析后的svg。 |
|
||||
| | bsvg\_t* | 。 |
|
||||
| data | const uint32\_t* | svg数据。 |
|
||||
| size | size | data长度。 |
|
@ -0,0 +1,80 @@
|
||||
## button\_group\_t
|
||||
### 概述
|
||||

|
||||
|
||||
Button Group控件。一个简单的容器控件,用于容纳一组按钮控件。
|
||||
|
||||
它本身不提供布局功能,仅提供具有语义的标签,让xml更具有可读性。
|
||||
子控件的布局可用layout\_children属性指定。
|
||||
请参考[布局参数](https://github.com/zlgopen/awtk/blob/master/docs/layout.md)。
|
||||
|
||||
button\_group\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于button\_group\_t控件。
|
||||
|
||||
在xml中使用"button\_group"标签创建button\_group。如:
|
||||
|
||||
```xml
|
||||
<button_group x="0" y="m" w="100%" h="40" children_layout="default(c=4,r=1,s=5,m=5)">
|
||||
<button name="open:basic" text="Basic"/>
|
||||
<button name="open:button" text="Buttons"/>
|
||||
<button name="open:edit" text="Edits"/>
|
||||
<button name="open:keyboard" text="KeyBoard"/>
|
||||
</button_group>
|
||||
```
|
||||
|
||||
可用通过style来设置控件的显示风格,如背景颜色等。如:
|
||||
|
||||
```xml
|
||||
<style name="default" border_color="#a0a0a0">
|
||||
<normal bg_color="#f0f0f0" />
|
||||
</style>
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="button_group_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#button_group_t_button_group_cast">button\_group\_cast</a> | 转换为button_group对象(供脚本语言使用)。 |
|
||||
| <a href="#button_group_t_button_group_create">button\_group\_create</a> | 创建button_group对象 |
|
||||
#### button\_group\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="button_group_t_button_group_cast">转换为button_group对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* button_group_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | button\_group对象。 |
|
||||
| widget | widget\_t* | button\_group对象。 |
|
||||
#### button\_group\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="button_group_t_button_group_create">创建button_group对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* button_group_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
229
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/button_t.md
Normal file
229
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/button_t.md
Normal file
@ -0,0 +1,229 @@
|
||||
## button\_t
|
||||
### 概述
|
||||

|
||||
|
||||
按钮控件。
|
||||
|
||||
点击按钮之后会触发EVT\_CLICK事件,注册EVT\_CLICK事件以执行特定操作。
|
||||
|
||||
按钮控件也可以作为容器使用,使用图片和文本作为其子控件,可以实现很多有趣的效果。
|
||||
|
||||
button\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于button\_t控件。
|
||||
|
||||
在xml中使用"button"标签创建按钮控件。如:
|
||||
|
||||
```xml
|
||||
<button x="c" y="m" w="80" h="30" text="OK"/>
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[button.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/button.xml)
|
||||
|
||||
在c代码中使用函数button\_create创建按钮控件。如:
|
||||
|
||||
```c
|
||||
widget_t* button = button_create(win, 10, 10, 128, 30);
|
||||
widget_set_text(button, L"OK");
|
||||
widget_on(button, EVT_CLICK, on_click, NULL);
|
||||
```
|
||||
|
||||
> 创建之后,需要用widget\_set\_text或widget\_set\_text\_utf8设置文本内容。
|
||||
|
||||
> 完整示例请参考:
|
||||
[button demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/button.c)
|
||||
|
||||
可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:
|
||||
|
||||
```xml
|
||||
<style name="default" border_color="#a0a0a0" text_color="black">
|
||||
<normal bg_color="#f0f0f0" />
|
||||
<pressed bg_color="#c0c0c0" x_offset="1" y_offset="1"/>
|
||||
<over bg_color="#e0e0e0" />
|
||||
<disable bg_color="gray" text_color="#d0d0d0" />
|
||||
</style>
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[theme
|
||||
default](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L31)
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="button_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#button_t_button_cast">button\_cast</a> | 转换为button对象(供脚本语言使用)。 |
|
||||
| <a href="#button_t_button_create">button\_create</a> | 创建button对象 |
|
||||
| <a href="#button_t_button_set_enable_long_press">button\_set\_enable\_long\_press</a> | 设置是否启用长按事件。 |
|
||||
| <a href="#button_t_button_set_long_press_time">button\_set\_long\_press\_time</a> | 设置触发长按事件的时间。 |
|
||||
| <a href="#button_t_button_set_repeat">button\_set\_repeat</a> | 设置触发EVT\_CLICK事件的时间间隔。为0则不重复触发EVT\_CLICK事件。 |
|
||||
### 属性
|
||||
<p id="button_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#button_t_enable_long_press">enable\_long\_press</a> | bool\_t | 是否启用长按事件,为true时才触发长按事件。 |
|
||||
| <a href="#button_t_long_press_time">long\_press\_time</a> | uint32\_t | 触发长按事件的时间(ms) |
|
||||
| <a href="#button_t_repeat">repeat</a> | int32\_t | 重复触发EVT\_CLICK事件的时间间隔。 |
|
||||
### 事件
|
||||
<p id="button_t_events">
|
||||
|
||||
| 事件名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------- |
|
||||
| EVT\_CLICK | pointer\_event\_t | 点击事件。 |
|
||||
| EVT\_LONG\_PRESS | pointer\_event\_t | 长按事件。 |
|
||||
#### button\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="button_t_button_cast">转换为button对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* button_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | button对象。 |
|
||||
| widget | widget\_t* | button对象。 |
|
||||
#### button\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="button_t_button_create">创建button对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* button_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### button\_set\_enable\_long\_press 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="button_t_button_set_enable_long_press">设置是否启用长按事件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t button_set_enable_long_press (widget_t* widget, bool_t enable_long_press);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| enable\_long\_press | bool\_t | 是否启用长按事件。 |
|
||||
#### button\_set\_long\_press\_time 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="button_t_button_set_long_press_time">设置触发长按事件的时间。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t button_set_long_press_time (widget_t* widget, uint32_t long_press_time);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| long\_press\_time | uint32\_t | 触发长按事件的时间(毫秒)。 |
|
||||
#### button\_set\_repeat 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="button_t_button_set_repeat">设置触发EVT\_CLICK事件的时间间隔。为0则不重复触发EVT\_CLICK事件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t button_set_repeat (widget_t* widget, int32_t repeat);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| repeat | int32\_t | 触发EVT\_CLICK事件的时间间隔(毫秒)。 |
|
||||
#### enable\_long\_press 属性
|
||||
-----------------------
|
||||
> <p id="button_t_enable_long_press">是否启用长按事件,为true时才触发长按事件。
|
||||
|
||||
触发长按事件后不再触发点击事件。
|
||||
缺省不启用。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### long\_press\_time 属性
|
||||
-----------------------
|
||||
> <p id="button_t_long_press_time">触发长按事件的时间(ms)
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### repeat 属性
|
||||
-----------------------
|
||||
> <p id="button_t_repeat">重复触发EVT\_CLICK事件的时间间隔。
|
||||
|
||||
为0则不重复触发EVT\_CLICK事件。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
@ -0,0 +1,120 @@
|
||||
## calibration\_win\_t
|
||||
### 概述
|
||||

|
||||
|
||||
电阻屏校准窗口。
|
||||
|
||||
calibration\_win\_t是[window\_base\_t](window_base_t.md)的子类控件,
|
||||
window\_base\_t的函数均适用于calibration\_win\_t控件。
|
||||
|
||||
在xml中使用"calibration\_win"标签创建电阻屏校准窗口。如:
|
||||
|
||||
```xml
|
||||
<calibration_win name="cali" w="100%" h="100%" text="Please click the center of cross">
|
||||
</calibration_win>
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[window.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/calibration_win.xml)
|
||||
|
||||
在c代码中使用函数calibration\_win\_create创建窗口。如:
|
||||
|
||||
```c
|
||||
widget_t* win = calibration_win_create(NULL, 0, 0, 320, 480);
|
||||
```
|
||||
|
||||
通过calibration\_win\_set\_on\_done注册回调函数,用于保存校准数据。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="calibration_win_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#calibration_win_t_calibration_win_cast">calibration\_win\_cast</a> | 转换为calibration_win对象(供脚本语言使用)。 |
|
||||
| <a href="#calibration_win_t_calibration_win_create">calibration\_win\_create</a> | 创建calibration_win对象 |
|
||||
| <a href="#calibration_win_t_calibration_win_set_on_click">calibration\_win\_set\_on\_click</a> | 设置校准点击事件的处理函数。 |
|
||||
| <a href="#calibration_win_t_calibration_win_set_on_done">calibration\_win\_set\_on\_done</a> | 设置校准完成的处理函数。 |
|
||||
#### calibration\_win\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="calibration_win_t_calibration_win_cast">转换为calibration_win对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* calibration_win_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | calibration\_win对象。 |
|
||||
| widget | widget\_t* | calibration\_win对象。 |
|
||||
#### calibration\_win\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="calibration_win_t_calibration_win_create">创建calibration_win对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* calibration_win_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### calibration\_win\_set\_on\_click 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="calibration_win_t_calibration_win_set_on_click">设置校准点击事件的处理函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t calibration_win_set_on_click (widget_t* widget, calibration_win_on_click_t on_click, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | widget对象。 |
|
||||
| on\_click | calibration\_win\_on\_click\_t | 回调函数。 |
|
||||
| ctx | void* | 回调函数的上下文。 |
|
||||
#### calibration\_win\_set\_on\_done 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="calibration_win_t_calibration_win_set_on_done">设置校准完成的处理函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t calibration_win_set_on_done (widget_t* widget, calibration_win_on_done_t on_done, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | widget对象。 |
|
||||
| on\_done | calibration\_win\_on\_done\_t | 回调函数。 |
|
||||
| ctx | void* | 回调函数的上下文。 |
|
238
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/candidates_t.md
Normal file
238
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/candidates_t.md
Normal file
@ -0,0 +1,238 @@
|
||||
## candidates\_t
|
||||
### 概述
|
||||

|
||||
|
||||
输入法候选字词控件。
|
||||
|
||||
如果希望启用用数字选择对应的候选字,请设置属性grab_keys="true"。如:
|
||||
|
||||
```xml
|
||||
<candidates x="0" y="0" w="100%" h="30" grab_keys="true"/>
|
||||
```
|
||||
|
||||
>相关文件: assets/default/raw/ui/kb_default.xml
|
||||
|
||||
如果希望通过左右键切换不同的候选字,除了设置属性grab_keys="true",还需要设置按钮的focused状态的style。
|
||||
|
||||
```xml
|
||||
<style name="candidates" text_color="black">
|
||||
<normal />
|
||||
<pressed bg_color="#c0c0c0" border_color="#a0a0a0"/>
|
||||
<over bg_color="#e0e0e0" border_color="#a0a0a0"/>
|
||||
<focused border_color="#a0a0a0"/>
|
||||
</style>
|
||||
```
|
||||
|
||||
>相关文件:assets/default/raw/styles/keyboard.xml
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="candidates_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#candidates_t_candidates_cast">candidates\_cast</a> | 转换为candidates对象(供脚本语言使用)。 |
|
||||
| <a href="#candidates_t_candidates_create">candidates\_create</a> | 创建candidates对象 |
|
||||
| <a href="#candidates_t_candidates_set_auto_hide">candidates\_set\_auto\_hide</a> | 设置是否自动隐藏。 |
|
||||
| <a href="#candidates_t_candidates_set_button_style">candidates\_set\_button\_style</a> | 设置按钮的style名称。 |
|
||||
| <a href="#candidates_t_candidates_set_pre">candidates\_set\_pre</a> | 设置是否为预候选字列表。 |
|
||||
| <a href="#candidates_t_candidates_set_select_by_num">candidates\_set\_select\_by\_num</a> | 设置是否启用用数字选择候选字。 |
|
||||
### 属性
|
||||
<p id="candidates_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#candidates_t_auto_hide">auto\_hide</a> | bool\_t | 没有候选字时,是否自动隐藏控件。 |
|
||||
| <a href="#candidates_t_button_style">button\_style</a> | char* | 按钮的style名称。 |
|
||||
| <a href="#candidates_t_pre">pre</a> | bool\_t | 是否为预候选字。 |
|
||||
| <a href="#candidates_t_select_by_num">select\_by\_num</a> | bool\_t | 是否启用用数字选择候选字。比如按下1选择第1个候选字,按下2选择第2个候选字。 |
|
||||
#### candidates\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="candidates_t_candidates_cast">转换为candidates对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* candidates_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | candidates对象。 |
|
||||
| widget | widget\_t* | candidates对象。 |
|
||||
#### candidates\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="candidates_t_candidates_create">创建candidates对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* candidates_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### candidates\_set\_auto\_hide 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="candidates_t_candidates_set_auto_hide">设置是否自动隐藏。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t candidates_set_auto_hide (widget_t* widget, bool_t auto_hide);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| auto\_hide | bool\_t | 是否自动隐藏。 |
|
||||
#### candidates\_set\_button\_style 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="candidates_t_candidates_set_button_style">设置按钮的style名称。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t candidates_set_button_style (widget_t* widget, const char* button_style);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| button\_style | const char* | 按钮的style名称。 |
|
||||
#### candidates\_set\_pre 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="candidates_t_candidates_set_pre">设置是否为预候选字列表。
|
||||
|
||||
> 为预候选字列表则注册EVT\_IM\_SHOW\_PRE\_CANDIDATES,否则注册EVT\_IM\_SHOW\_CANDIDATES事件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t candidates_set_pre (widget_t* widget, bool_t pre);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| pre | bool\_t | 是否为预候选字列表。 |
|
||||
#### candidates\_set\_select\_by\_num 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="candidates_t_candidates_set_select_by_num">设置是否启用用数字选择候选字。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t candidates_set_select_by_num (widget_t* widget, bool_t select_by_num);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| select\_by\_num | bool\_t | 是否启用用数字选择候选字。 |
|
||||
#### auto\_hide 属性
|
||||
-----------------------
|
||||
> <p id="candidates_t_auto_hide">没有候选字时,是否自动隐藏控件。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### button\_style 属性
|
||||
-----------------------
|
||||
> <p id="candidates_t_button_style">按钮的style名称。
|
||||
|
||||
* 类型:char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### pre 属性
|
||||
-----------------------
|
||||
> <p id="candidates_t_pre">是否为预候选字。
|
||||
|
||||
> 预候选字: 在有的输入法中,比如T9硬键盘输入时,按下12两个键时,预候选字会显示可用的拼音列表。
|
||||
> 从预候选字列表中选择拼音,再查询拼音对应的候选字列表。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### select\_by\_num 属性
|
||||
-----------------------
|
||||
> <p id="candidates_t_select_by_num">是否启用用数字选择候选字。比如按下1选择第1个候选字,按下2选择第2个候选字。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
@ -0,0 +1,357 @@
|
||||
## canvas\_offline\_t
|
||||
### 概述
|
||||
离线画布 canvas。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="canvas_offline_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#canvas_offline_t_canvas_offline_begin_draw">canvas\_offline\_begin\_draw</a> | 设置离线 canvas 开始绘图 |
|
||||
| <a href="#canvas_offline_t_canvas_offline_bitmap_move_to_new_bitmap">canvas\_offline\_bitmap\_move\_to\_new\_bitmap</a> | 把离线 canvas 的离线 bitmap 移动赋值给新的 bitmap。 |
|
||||
| <a href="#canvas_offline_t_canvas_offline_clear_canvas">canvas\_offline\_clear\_canvas</a> | 清除离线 canvas 所有数据,并把背景设置为全透明(注意:该离线 canvas 需要有透明通道) |
|
||||
| <a href="#canvas_offline_t_canvas_offline_create">canvas\_offline\_create</a> | 创建一个离线的 canvas |
|
||||
| <a href="#canvas_offline_t_canvas_offline_custom_begin_draw">canvas\_offline\_custom\_begin\_draw</a> | 用户自定义 canvas_offline_custom_begin_draw |
|
||||
| <a href="#canvas_offline_t_canvas_offline_custom_bitmap_move_to_new_bitmap">canvas\_offline\_custom\_bitmap\_move\_to\_new\_bitmap</a> | 用户自定义 canvas_offline_custom_bitmap_move_to_new_bitmap |
|
||||
| <a href="#canvas_offline_t_canvas_offline_custom_clear_canvas">canvas\_offline\_custom\_clear\_canvas</a> | 用户自定义 canvas_offline_custom_clear_canvas |
|
||||
| <a href="#canvas_offline_t_canvas_offline_custom_create">canvas\_offline\_custom\_create</a> | 用户自定义 canvas_offline_create |
|
||||
| <a href="#canvas_offline_t_canvas_offline_custom_destroy">canvas\_offline\_custom\_destroy</a> | 用户自定义 canvas_offline_custom_destroy |
|
||||
| <a href="#canvas_offline_t_canvas_offline_custom_end_draw">canvas\_offline\_custom\_end\_draw</a> | 用户自定义 canvas_offline_custom_end_draw |
|
||||
| <a href="#canvas_offline_t_canvas_offline_custom_flush_bitmap">canvas\_offline\_custom\_flush\_bitmap</a> | 用户自定义 canvas_offline_custom_flush_bitmap |
|
||||
| <a href="#canvas_offline_t_canvas_offline_custom_get_bitmap">canvas\_offline\_custom\_get\_bitmap</a> | 用户自定义 canvas_offline_custom_get_bitmap |
|
||||
| <a href="#canvas_offline_t_canvas_offline_destroy">canvas\_offline\_destroy</a> | 释放离线 canvas 和离线 bitmap |
|
||||
| <a href="#canvas_offline_t_canvas_offline_end_draw">canvas\_offline\_end\_draw</a> | 设置离线 canvas 结束绘图 |
|
||||
| <a href="#canvas_offline_t_canvas_offline_flush_bitmap">canvas\_offline\_flush\_bitmap</a> | 把离线 canvas 的数据放到绑定的 bitmap 中 |
|
||||
| <a href="#canvas_offline_t_canvas_offline_get_bitmap">canvas\_offline\_get\_bitmap</a> | 获取离线 canvas 的离线 bitmap。 |
|
||||
### 属性
|
||||
<p id="canvas_offline_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#canvas_offline_t_bitmap">bitmap</a> | bitmap\_t* | 绑定的离线 bitmap |
|
||||
#### canvas\_offline\_begin\_draw 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_begin_draw">设置离线 canvas 开始绘图
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_begin_draw (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_bitmap\_move\_to\_new\_bitmap 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_bitmap_move_to_new_bitmap">把离线 canvas 的离线 bitmap 移动赋值给新的 bitmap。
|
||||
移动赋值后原来的离线 canvas 的离线 bitmap 就会被置空。
|
||||
备注:在移动赋值之前会先调用 canvas_offline_flush_bitmap 把数据回流到内存中。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_bitmap_move_to_new_bitmap (canvas_t* canvas, bitmap_t* bitmap);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
| bitmap | bitmap\_t* | 新的 bitmap 对象。 |
|
||||
#### canvas\_offline\_clear\_canvas 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_clear_canvas">清除离线 canvas 所有数据,并把背景设置为全透明(注意:该离线 canvas 需要有透明通道)
|
||||
该函数调用前必须要先 canvas_offline_begin_draw 函数。
|
||||
该函数用来解决离线 canvas 多次绘图半透效果后导致半透效果无效的问题。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_clear_canvas (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_create">创建一个离线的 canvas
|
||||
在 opengl 模式下 format 参数只能为 BITMAP_FMT_RGBA8888
|
||||
在其他模式下,离线 canvas 格式可以为 rgba,bgar,bgr565和rgb565
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
canvas_t* canvas_offline_create (uint32_t w, uint32_t h, bitmap_format_t format);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | canvas\_t* | 成功返回 canvas ,失败返回 NULL。 |
|
||||
| w | uint32\_t | 离线 canvas 的宽。 |
|
||||
| h | uint32\_t | 离线 canvas 的高。 |
|
||||
| format | bitmap\_format\_t | 离线 canvas 的格式。 |
|
||||
#### canvas\_offline\_custom\_begin\_draw 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_custom_begin_draw">用户自定义 canvas_offline_custom_begin_draw
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_custom_begin_draw (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_custom\_bitmap\_move\_to\_new\_bitmap 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_custom_bitmap_move_to_new_bitmap">用户自定义 canvas_offline_custom_bitmap_move_to_new_bitmap
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bitmap_t* canvas_offline_custom_bitmap_move_to_new_bitmap (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bitmap\_t* | 返回 bitmap\_t 对象表示成功,返回 NULL 表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_custom\_clear\_canvas 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_custom_clear_canvas">用户自定义 canvas_offline_custom_clear_canvas
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_custom_clear_canvas (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_custom\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_custom_create">用户自定义 canvas_offline_create
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
canvas_t* canvas_offline_custom_create (uint32_t w, uint32_t h, bitmap_format_t format);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | canvas\_t* | 成功返回 canvas ,失败返回 NULL。 |
|
||||
| w | uint32\_t | 离线 canvas 的宽。 |
|
||||
| h | uint32\_t | 离线 canvas 的高。 |
|
||||
| format | bitmap\_format\_t | 离线 canvas 的格式。 |
|
||||
#### canvas\_offline\_custom\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_custom_destroy">用户自定义 canvas_offline_custom_destroy
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_custom_destroy (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_custom\_end\_draw 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_custom_end_draw">用户自定义 canvas_offline_custom_end_draw
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_custom_end_draw (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_custom\_flush\_bitmap 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_custom_flush_bitmap">用户自定义 canvas_offline_custom_flush_bitmap
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_custom_flush_bitmap (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_custom\_get\_bitmap 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_custom_get_bitmap">用户自定义 canvas_offline_custom_get_bitmap
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bitmap_t* canvas_offline_custom_get_bitmap (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bitmap\_t* | 返回 bitmap\_t 对象表示成功,返回 NULL 表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_destroy">释放离线 canvas 和离线 bitmap
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_destroy (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_end\_draw 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_end_draw">设置离线 canvas 结束绘图
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_end_draw (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_flush\_bitmap 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_flush_bitmap">把离线 canvas 的数据放到绑定的 bitmap 中
|
||||
该函数只有在 opengl 模式才需要调用,是否把显存中的数据回传到内存中。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t canvas_offline_flush_bitmap (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### canvas\_offline\_get\_bitmap 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_offline_t_canvas_offline_get_bitmap">获取离线 canvas 的离线 bitmap。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bitmap_t* canvas_offline_get_bitmap (canvas_t* canvas);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bitmap\_t* | 返回 bitmap\_t 对象表示成功,返回 NULL 表示失败。 |
|
||||
| canvas | canvas\_t* | 离线 canvas 对象。 |
|
||||
#### bitmap 属性
|
||||
-----------------------
|
||||
> <p id="canvas_offline_t_bitmap">绑定的离线 bitmap
|
||||
|
||||
* 类型:bitmap\_t*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
1335
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/canvas_t.md
Normal file
1335
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/canvas_t.md
Normal file
File diff suppressed because it is too large
Load Diff
113
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/canvas_widget_t.md
Normal file
113
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/canvas_widget_t.md
Normal file
@ -0,0 +1,113 @@
|
||||
## canvas\_widget\_t
|
||||
### 概述
|
||||

|
||||
|
||||
画布控件。
|
||||
|
||||
画布控件让开发者可以自己在控件上绘制需要的内容。
|
||||
|
||||
canvas\_widget\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于canvas\_widget\_t控件。
|
||||
|
||||
在xml中使用"canvas"标签创建画布控件。如:
|
||||
|
||||
```xml
|
||||
<canvas name="paint_vgcanvas" x="0" y="0" w="100%" h="100%" />
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[canvas_widget.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/vgcanvas.xml)
|
||||
|
||||
在c代码中使用函数canvas\_widget\_create创建画布控件。如:
|
||||
|
||||
```c
|
||||
widget_t* canvas = canvas_widget_create(win, 0, 0, win->w, win->h);
|
||||
```
|
||||
|
||||
> 创建之后,需要用widget\_on注册EVT\_PAINT事件,并在EVT\_PAINT事件处理函数中绘制。
|
||||
|
||||
```c
|
||||
widget_on(canvas, EVT_PAINT, on_paint_event, canvas);
|
||||
```
|
||||
|
||||
绘制时,可以通过canvas接口去绘制,也可以通过vgcanvas接口去绘制。
|
||||
先从evt获取canvas对象,再通过canvas\_get\_vgcanvas从canvas中获取vgcanvas对象。
|
||||
|
||||
```c
|
||||
|
||||
static ret_t on_paint_event(void* ctx, event_t* evt) {
|
||||
widget_t* canvas_widget = WIDGET(ctx);
|
||||
canvas_t* c = paint_event_cast(evt)->c;
|
||||
vgcanvas_t* vg = canvas_get_vgcanvas(c);
|
||||
color_t bg = color_init(0xe0, 0xe0, 0xe0, 0xff);
|
||||
color_t tc = color_init(0, 0, 0, 0xff);
|
||||
rect_t r = rect_init(canvas_widget->x, canvas_widget->y, canvas_widget->w, canvas_widget->h);
|
||||
|
||||
vgcanvas_save(vg);
|
||||
vgcanvas_clip_rect(vg, r.x, r.y, r.w, r.h);
|
||||
vgcanvas_translate(vg, r.x, r.y);
|
||||
|
||||
...
|
||||
|
||||
vgcanvas_restore(vg);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
```
|
||||
|
||||
> 完整示例请参考:
|
||||
[canvas demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/canvas.c)
|
||||
|
||||
参考:
|
||||
|
||||
* [canvas接口描述](canvas_t.md)
|
||||
* [vgcanvas接口描述](vgcanvas_t.md)
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="canvas_widget_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#canvas_widget_t_canvas_widget_cast">canvas\_widget\_cast</a> | 转换为canvas_widget对象(供脚本语言使用)。 |
|
||||
| <a href="#canvas_widget_t_canvas_widget_create">canvas\_widget\_create</a> | 创建canvas_widget对象 |
|
||||
#### canvas\_widget\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_widget_t_canvas_widget_cast">转换为canvas_widget对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* canvas_widget_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | canvas\_widget对象。 |
|
||||
| widget | widget\_t* | canvas\_widget对象。 |
|
||||
#### canvas\_widget\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="canvas_widget_t_canvas_widget_create">创建canvas_widget对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* canvas_widget_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
203
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/check_button_t.md
Normal file
203
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/check_button_t.md
Normal file
@ -0,0 +1,203 @@
|
||||
## check\_button\_t
|
||||
### 概述
|
||||

|
||||
|
||||
勾选按钮控件(单选/多选)。
|
||||
|
||||
check\_button\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于check\_button\_t控件。
|
||||
|
||||
在xml中使用"check_button"标签创建多选按钮控件。如:
|
||||
|
||||
```xml
|
||||
<check_button name="c1" text="Book"/>
|
||||
```
|
||||
|
||||
在xml中使用"radio_button"标签创建单选按钮控件。如:
|
||||
|
||||
```xml
|
||||
<radio_button name="r1" text="Book"/>
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[button.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/basic.xml)
|
||||
|
||||
在c代码中使用函数check\_button\_create创建多选按钮控件。如:
|
||||
|
||||
```c
|
||||
widget_t* button = check_button_create(win, x, y, w, h);
|
||||
widget_set_text(button, L"OK");
|
||||
widget_on(button, EVT_VALUE_CHANGED, on_changed, NULL);
|
||||
```
|
||||
|
||||
在c代码中使用函数check\_button\_create\_radio创建单选按钮控件。如:
|
||||
|
||||
```c
|
||||
widget_t* button = check_button_create_radio(win, x, y, w, h);
|
||||
widget_set_text(button, L"OK");
|
||||
widget_on(button, EVT_VALUE_CHANGED, on_changed, NULL);
|
||||
```
|
||||
|
||||
> 完整示例请参考:
|
||||
[button demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/check_button.c)
|
||||
|
||||
可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:
|
||||
|
||||
```xml
|
||||
<style name="default" icon_at="left">
|
||||
<normal icon="unchecked" />
|
||||
<pressed icon="unchecked" />
|
||||
<over icon="unchecked" text_color="green"/>
|
||||
<normal_of_checked icon="checked" text_color="blue"/>
|
||||
<pressed_of_checked icon="checked" text_color="blue"/>
|
||||
<over_of_checked icon="checked" text_color="green"/>
|
||||
</style>
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[theme
|
||||
default](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L227)
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="check_button_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#check_button_t_check_button_cast">check\_button\_cast</a> | 转换check_button对象(供脚本语言使用)。 |
|
||||
| <a href="#check_button_t_check_button_create">check\_button\_create</a> | 创建多选按钮对象 |
|
||||
| <a href="#check_button_t_check_button_create_radio">check\_button\_create\_radio</a> | 创建单选按钮对象 |
|
||||
| <a href="#check_button_t_check_button_get_checked_button">check\_button\_get\_checked\_button</a> | 用于radio button获取同组中勾选的radio button。 |
|
||||
| <a href="#check_button_t_check_button_set_value">check\_button\_set\_value</a> | 设置控件的值。 |
|
||||
### 属性
|
||||
<p id="check_button_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#check_button_t_value">value</a> | bool\_t | 值(勾选为TRUE,非勾选为FALSE)。 |
|
||||
### 事件
|
||||
<p id="check_button_t_events">
|
||||
|
||||
| 事件名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------- |
|
||||
| EVT\_VALUE\_WILL\_CHANGE | value\_change\_event\_t | 值(勾选状态)即将改变事件。 |
|
||||
| EVT\_VALUE\_CHANGED | value\_change\_event\_t | 值(勾选状态)改变事件。 |
|
||||
| EVT\_CLICK | pointer\_event\_t | 点击事件。 |
|
||||
#### check\_button\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="check_button_t_check_button_cast">转换check_button对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* check_button_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | check\_button对象。 |
|
||||
| widget | widget\_t* | check\_button对象。 |
|
||||
#### check\_button\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="check_button_t_check_button_create">创建多选按钮对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* check_button_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | widget对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### check\_button\_create\_radio 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="check_button_t_check_button_create_radio">创建单选按钮对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* check_button_create_radio (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | widget对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### check\_button\_get\_checked\_button 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="check_button_t_check_button_get_checked_button">用于radio button获取同组中勾选的radio button。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* check_button_get_checked_button (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 同组中勾选的radio button对象。 |
|
||||
| widget | widget\_t* | radio\_button对象。 |
|
||||
#### check\_button\_set\_value 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="check_button_t_check_button_set_value">设置控件的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t check_button_set_value (widget_t* widget, bool_t value);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | check\_button对象。 |
|
||||
| value | bool\_t | 值(勾选为TRUE,非勾选为FALSE)。 |
|
||||
#### value 属性
|
||||
-----------------------
|
||||
> <p id="check_button_t_value">值(勾选为TRUE,非勾选为FALSE)。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
@ -0,0 +1,33 @@
|
||||
## children\_layouter\_default\_t
|
||||
### 概述
|
||||

|
||||
|
||||
缺省的子控件布局算法实现。
|
||||
|
||||
> 用法请参考:[缺省子控件布局算法](
|
||||
https://github.com/zlgopen/awtk/blob/master/docs/children_layouter_default.md)
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="children_layouter_default_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#children_layouter_default_t_children_layouter_default_create">children\_layouter\_default\_create</a> | 创建子控件布局对象。 |
|
||||
#### children\_layouter\_default\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_default_t_children_layouter_default_create">创建子控件布局对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
children_layouter_t* children_layouter_default_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | children\_layouter\_t* | 返回创建子控件布局对象。 |
|
@ -0,0 +1,130 @@
|
||||
## children\_layouter\_factory\_t
|
||||
### 概述
|
||||
子控件布局算法工厂。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="children_layouter_factory_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#children_layouter_factory_t_children_layouter_factory">children\_layouter\_factory</a> | 获取缺省的子控件布局算法工厂对象。 |
|
||||
| <a href="#children_layouter_factory_t_children_layouter_factory_create">children\_layouter\_factory\_create</a> | 创建子控件布局算法工厂对象。 |
|
||||
| <a href="#children_layouter_factory_t_children_layouter_factory_create_layouter">children\_layouter\_factory\_create\_layouter</a> | 创建指定类型的子控件布局算法对象。 |
|
||||
| <a href="#children_layouter_factory_t_children_layouter_factory_destroy">children\_layouter\_factory\_destroy</a> | 析构并释放子控件布局算法工厂对象。 |
|
||||
| <a href="#children_layouter_factory_t_children_layouter_factory_register">children\_layouter\_factory\_register</a> | 注册子控件布局算法创建函数。 |
|
||||
| <a href="#children_layouter_factory_t_children_layouter_factory_set">children\_layouter\_factory\_set</a> | 设置缺省的子控件布局算法工厂对象。 |
|
||||
#### children\_layouter\_factory 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_factory_t_children_layouter_factory">获取缺省的子控件布局算法工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
children_layouter_factory_t* children_layouter_factory ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | children\_layouter\_factory\_t* | 返回子控件布局算法工厂对象。 |
|
||||
#### children\_layouter\_factory\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_factory_t_children_layouter_factory_create">创建子控件布局算法工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
children_layouter_factory_t* children_layouter_factory_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | children\_layouter\_factory\_t* | 返回子控件布局算法工厂对象。 |
|
||||
#### children\_layouter\_factory\_create\_layouter 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_factory_t_children_layouter_factory_create_layouter">创建指定类型的子控件布局算法对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
children_layouter_t* children_layouter_factory_create_layouter (children_layouter_factory_t* factory, const char* type);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | children\_layouter\_t* | 返回子控件布局算法对象。 |
|
||||
| factory | children\_layouter\_factory\_t* | 子控件布局算法工厂对象。 |
|
||||
| type | const char* | 类型。 |
|
||||
#### children\_layouter\_factory\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_factory_t_children_layouter_factory_destroy">析构并释放子控件布局算法工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_factory_destroy (children_layouter_factory_t* factory);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | children\_layouter\_factory\_t* | 子控件布局算法工厂对象。 |
|
||||
#### children\_layouter\_factory\_register 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_factory_t_children_layouter_factory_register">注册子控件布局算法创建函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_factory_register (children_layouter_factory_t* factory, const char* type, children_layouter_create_t create);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | children\_layouter\_factory\_t* | layouter工厂对象。 |
|
||||
| type | const char* | 子控件布局算法类型。 |
|
||||
| create | children\_layouter\_create\_t | 子控件布局算法创建函数。 |
|
||||
#### children\_layouter\_factory\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_factory_t_children_layouter_factory_set">设置缺省的子控件布局算法工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_factory_set (children_layouter_factory_t* factory);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | children\_layouter\_factory\_t* | 子控件布局算法工厂对象。 |
|
@ -0,0 +1,33 @@
|
||||
## children\_layouter\_list\_view\_t
|
||||
### 概述
|
||||

|
||||
|
||||
listview的子控件布局算法实现。
|
||||
|
||||
> 用法请参考:[listview子控件布局算法](
|
||||
https://github.com/zlgopen/awtk/blob/master/docs/children_layouter_list_view.md)
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="children_layouter_list_view_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#children_layouter_list_view_t_children_layouter_list_view_create">children\_layouter\_list\_view\_create</a> | 创建子控件布局对象。 |
|
||||
#### children\_layouter\_list\_view\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_list_view_t_children_layouter_list_view_create">创建子控件布局对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
children_layouter_t* children_layouter_list_view_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | children\_layouter\_t* | 返回创建子控件布局对象。 |
|
@ -0,0 +1,242 @@
|
||||
## children\_layouter\_t
|
||||
### 概述
|
||||
子控件排版布局器的接口。
|
||||
|
||||
按特定算法对子控件进行排版布局,子类需要实现vtable中的函数。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="children_layouter_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#children_layouter_t_children_layouter_clone">children\_layouter\_clone</a> | 克隆layouter对象。 |
|
||||
| <a href="#children_layouter_t_children_layouter_create">children\_layouter\_create</a> | 创建layouter对象。 |
|
||||
| <a href="#children_layouter_t_children_layouter_destroy">children\_layouter\_destroy</a> | 销毁layouter对象。 |
|
||||
| <a href="#children_layouter_t_children_layouter_get_param">children\_layouter\_get\_param</a> | 获取指定的参数。 |
|
||||
| <a href="#children_layouter_t_children_layouter_get_param_float">children\_layouter\_get\_param\_float</a> | 获取指定的浮点格式的参数。 |
|
||||
| <a href="#children_layouter_t_children_layouter_get_param_int">children\_layouter\_get\_param\_int</a> | 获取指定的整数格式的参数。 |
|
||||
| <a href="#children_layouter_t_children_layouter_is_valid">children\_layouter\_is\_valid</a> | 判断layouter对象是否有效。 |
|
||||
| <a href="#children_layouter_t_children_layouter_layout">children\_layouter\_layout</a> | 对控件的子控件进行布局。 |
|
||||
| <a href="#children_layouter_t_children_layouter_set_param">children\_layouter\_set\_param</a> | 获取指定的参数。 |
|
||||
| <a href="#children_layouter_t_children_layouter_set_param_str">children\_layouter\_set\_param\_str</a> | 设置字符串格式的参数。 |
|
||||
| <a href="#children_layouter_t_children_layouter_to_string">children\_layouter\_to\_string</a> | 获取全部参数。 |
|
||||
#### children\_layouter\_clone 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_clone">克隆layouter对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
children_layouter_t* children_layouter_clone (children_layouter_t* layouter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | children\_layouter\_t* | 返回layouter对象。 |
|
||||
| layouter | children\_layouter\_t* | 被克隆的对象。 |
|
||||
#### children\_layouter\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_create">创建layouter对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
children_layouter_t* children_layouter_create (const char* params);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | children\_layouter\_t* | 返回layouter对象。 |
|
||||
| params | const char* | 参数。 |
|
||||
#### children\_layouter\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_destroy">销毁layouter对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_destroy (children_layouter_t* layouter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| layouter | children\_layouter\_t* | layouter对象。 |
|
||||
#### children\_layouter\_get\_param 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_get_param">获取指定的参数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_get_param (children_layouter_t* layouter, const char* name, value_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| layouter | children\_layouter\_t* | layouter对象。 |
|
||||
| name | const char* | 参数名。 |
|
||||
| v | value\_t* | 返回参数的值。 |
|
||||
#### children\_layouter\_get\_param\_float 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_get_param_float">获取指定的浮点格式的参数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_get_param_float (children_layouter_t* layouter, const char* name, float_t defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 成功返回参数的值,失败返回缺省值。 |
|
||||
| layouter | children\_layouter\_t* | layouter对象。 |
|
||||
| name | const char* | 参数名。 |
|
||||
| defval | float\_t | 缺省值。 |
|
||||
#### children\_layouter\_get\_param\_int 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_get_param_int">获取指定的整数格式的参数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_get_param_int (children_layouter_t* layouter, const char* name, int32_t defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 成功返回参数的值,失败返回缺省值。 |
|
||||
| layouter | children\_layouter\_t* | layouter对象。 |
|
||||
| name | const char* | 参数名。 |
|
||||
| defval | int32\_t | 缺省值。 |
|
||||
#### children\_layouter\_is\_valid 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_is_valid">判断layouter对象是否有效。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t children_layouter_is_valid (children_layouter_t* layouter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示有效,否则表示无效。 |
|
||||
| layouter | children\_layouter\_t* | layouter对象。 |
|
||||
#### children\_layouter\_layout 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_layout">对控件的子控件进行布局。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_layout (children_layouter_t* layouter, widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| layouter | children\_layouter\_t* | layouter对象。 |
|
||||
| widget | widget\_t* | 控件。 |
|
||||
#### children\_layouter\_set\_param 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_set_param">获取指定的参数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_set_param (children_layouter_t* layouter, const char* name, const value_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| layouter | children\_layouter\_t* | layouter对象。 |
|
||||
| name | const char* | 参数名。 |
|
||||
| v | const value\_t* | 参数的值。 |
|
||||
#### children\_layouter\_set\_param\_str 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_set_param_str">设置字符串格式的参数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_set_param_str (children_layouter_t* layouter, const char* name, const char* value);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| layouter | children\_layouter\_t* | layouter对象。 |
|
||||
| name | const char* | 参数名。 |
|
||||
| value | const char* | 参数值。 |
|
||||
#### children\_layouter\_to\_string 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="children_layouter_t_children_layouter_to_string">获取全部参数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t children_layouter_to_string (children_layouter_t* layouter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回字符串格式的参数。 |
|
||||
| layouter | children\_layouter\_t* | layouter对象。 |
|
@ -0,0 +1,10 @@
|
||||
## clip\_board\_data\_type\_t
|
||||
### 概述
|
||||
剪切板数据类型定义。
|
||||
### 常量
|
||||
<p id="clip_board_data_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| CLIP\_BOARD\_DATA\_TYPE\_NONE | 无数据。 |
|
||||
| CLIP\_BOARD\_DATA\_TYPE\_TEXT | UTF8文本。 |
|
173
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/clip_board_t.md
Normal file
173
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/clip_board_t.md
Normal file
@ -0,0 +1,173 @@
|
||||
## clip\_board\_t
|
||||
### 概述
|
||||
剪切板接口。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="clip_board_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#clip_board_t_clip_board">clip\_board</a> | 获取缺省的剪切板对象。 |
|
||||
| <a href="#clip_board_t_clip_board_clear">clip\_board\_clear</a> | 清空剪切板中的数据。 |
|
||||
| <a href="#clip_board_t_clip_board_destroy">clip\_board\_destroy</a> | 销毁剪切板对象。 |
|
||||
| <a href="#clip_board_t_clip_board_get_data">clip\_board\_get\_data</a> | 从剪切板中获取数据。 |
|
||||
| <a href="#clip_board_t_clip_board_get_text">clip\_board\_get\_text</a> | 从剪切板中获取文本(UTF8)数据。 |
|
||||
| <a href="#clip_board_t_clip_board_set">clip\_board\_set</a> | 设置缺省的剪切板对象。 |
|
||||
| <a href="#clip_board_t_clip_board_set_data">clip\_board\_set\_data</a> | 设置数据到剪切板中。 |
|
||||
| <a href="#clip_board_t_clip_board_set_text">clip\_board\_set\_text</a> | 设置文本(UTF8)数据到剪切板。 |
|
||||
#### clip\_board 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="clip_board_t_clip_board">获取缺省的剪切板对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t clip_board ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回缺省剪切板对象。 |
|
||||
#### clip\_board\_clear 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="clip_board_t_clip_board_clear">清空剪切板中的数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t clip_board_clear (clip_board_t* cl);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| cl | clip\_board\_t* | 剪切板对象。 |
|
||||
#### clip\_board\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="clip_board_t_clip_board_destroy">销毁剪切板对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t clip_board_destroy (clip_board_t* cl);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| cl | clip\_board\_t* | 剪切板对象。 |
|
||||
#### clip\_board\_get\_data 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="clip_board_t_clip_board_get_data">从剪切板中获取数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t clip_board_get_data (clip_board_t* cl, clip_board_data_type_t* type, void** data data, uint32_t* size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| cl | clip\_board\_t* | 剪切板对象。 |
|
||||
| type | clip\_board\_data\_type\_t* | 返回数据类型(可为NULL)。 |
|
||||
| data | void** data | 返回数据(可为NULL)。 |
|
||||
| size | uint32\_t* | 返回数据长度(可为NULL)。 |
|
||||
#### clip\_board\_get\_text 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="clip_board_t_clip_board_get_text">从剪切板中获取文本(UTF8)数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* clip_board_get_text ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回文本数据。 |
|
||||
#### clip\_board\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="clip_board_t_clip_board_set">设置缺省的剪切板对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t clip_board_set (clip_board_t* cl);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| cl | clip\_board\_t* | 剪切板对象。 |
|
||||
#### clip\_board\_set\_data 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="clip_board_t_clip_board_set_data">设置数据到剪切板中。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t clip_board_set_data (clip_board_t* cl, clip_board_data_type_t type, const void* data data, uint32_t size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| cl | clip\_board\_t* | 剪切板对象。 |
|
||||
| type | clip\_board\_data\_type\_t | 数据类型。 |
|
||||
| data | const void* data | 数据。 |
|
||||
| size | uint32\_t | 数据长度 |
|
||||
#### clip\_board\_set\_text 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="clip_board_t_clip_board_set_text">设置文本(UTF8)数据到剪切板。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t clip_board_set_text (const char* text);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| text | const char* | 文本。 |
|
79
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/clip_view_t.md
Normal file
79
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/clip_view_t.md
Normal file
@ -0,0 +1,79 @@
|
||||
## clip\_view\_t
|
||||
### 概述
|
||||

|
||||
|
||||
一个裁剪子控件的容器控件。
|
||||
|
||||
它本身不提供布局功能,仅提供具有语义的标签,让xml更具有可读性。
|
||||
子控件的布局可用layout\_children属性指定。
|
||||
请参考[布局参数](https://github.com/zlgopen/awtk/blob/master/docs/layout.md)。
|
||||
|
||||
clip\_view\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于clip\_view\_t控件。
|
||||
|
||||
在xml中使用"clip_view"标签创建clip_view,在clip_view控件下的所有子控件都会被裁剪。如下button控件会被裁剪,无法画出clip_view控件 :
|
||||
|
||||
```xml
|
||||
<clip_view x="0" y="0" w="100" h="100">
|
||||
<button x="50" y="10" w="100" h="50" />
|
||||
</clip_view>
|
||||
```
|
||||
|
||||
备注:在clip_view控件下的所有子控件都会被裁剪,如果子控件本身会设置裁剪区的话,在子控件中计算裁剪区的交集,具体请参考scroll_view控件的scroll_view_on_paint_children函数。
|
||||
|
||||
可用通过style来设置控件的显示风格,如背景颜色等。如:
|
||||
|
||||
```xml
|
||||
<style name="default" border_color="#a0a0a0">
|
||||
<normal bg_color="#f0f0f0" />
|
||||
</style>
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="clip_view_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#clip_view_t_clip_view_cast">clip\_view\_cast</a> | 转换为clip_view对象(供脚本语言使用)。 |
|
||||
| <a href="#clip_view_t_clip_view_create">clip\_view\_create</a> | 创建clip_view对象 |
|
||||
#### clip\_view\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="clip_view_t_clip_view_cast">转换为clip_view对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* clip_view_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | clip\_view对象。 |
|
||||
| widget | widget\_t* | clip\_view对象。 |
|
||||
#### clip\_view\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="clip_view_t_clip_view_create">创建clip_view对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* clip_view_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
@ -0,0 +1,107 @@
|
||||
## cmd\_exec\_event\_t
|
||||
### 概述
|
||||

|
||||
|
||||
对象执行命令的事件。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="cmd_exec_event_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#cmd_exec_event_t_cmd_exec_event_cast">cmd\_exec\_event\_cast</a> | 把event对象转cmd_exec_event_t对象,主要给脚本语言使用。 |
|
||||
| <a href="#cmd_exec_event_t_cmd_exec_event_init">cmd\_exec\_event\_init</a> | 初始命令执行事件。 |
|
||||
### 属性
|
||||
<p id="cmd_exec_event_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#cmd_exec_event_t_args">args</a> | const char* | 命令的参数。 |
|
||||
| <a href="#cmd_exec_event_t_can_exec">can\_exec</a> | bool\_t | 标识命令是否可以执行(适用于CAN_EXEC)。 |
|
||||
| <a href="#cmd_exec_event_t_name">name</a> | const char* | 命令的名称。 |
|
||||
| <a href="#cmd_exec_event_t_result">result</a> | ret\_t | 执行结果(适用于EXECED)。 |
|
||||
#### cmd\_exec\_event\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="cmd_exec_event_t_cmd_exec_event_cast">把event对象转cmd_exec_event_t对象,主要给脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
cmd_exec_event_t* cmd_exec_event_cast (event_t* event);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | cmd\_exec\_event\_t* | 返回event对象。 |
|
||||
| event | event\_t* | event对象。 |
|
||||
#### cmd\_exec\_event\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="cmd_exec_event_t_cmd_exec_event_init">初始命令执行事件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
event_t* cmd_exec_event_init (cmd_exec_event_t* event, uint32_t type, const char* name, const char* args);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | event\_t* | 返回event对象。 |
|
||||
| event | cmd\_exec\_event\_t* | event对象。 |
|
||||
| type | uint32\_t | 事件类型。 |
|
||||
| name | const char* | 命令名。 |
|
||||
| args | const char* | 命令参数。 |
|
||||
#### args 属性
|
||||
-----------------------
|
||||
> <p id="cmd_exec_event_t_args">命令的参数。
|
||||
|
||||
* 类型:const char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### can\_exec 属性
|
||||
-----------------------
|
||||
> <p id="cmd_exec_event_t_can_exec">标识命令是否可以执行(适用于CAN_EXEC)。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### name 属性
|
||||
-----------------------
|
||||
> <p id="cmd_exec_event_t_name">命令的名称。
|
||||
|
||||
* 类型:const char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### result 属性
|
||||
-----------------------
|
||||
> <p id="cmd_exec_event_t_result">执行结果(适用于EXECED)。
|
||||
|
||||
* 类型:ret\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
@ -0,0 +1,168 @@
|
||||
## color\_component\_t
|
||||
### 概述
|
||||

|
||||
|
||||
颜色选择器的颜色分量。
|
||||
控件的名称有严格规定:
|
||||
COLOR_PICKER_CHILD_SV: 水平为Value/Brightness(递增),垂直为Saturation(递减)。
|
||||
COLOR_PICKER_CHILD_H: 水平为同色,垂直为Hue(递减)。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="color_component_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#color_component_t_color_component_cast">color\_component\_cast</a> | 转换为color_component对象(供脚本语言使用)。 |
|
||||
| <a href="#color_component_t_color_component_create">color\_component\_create</a> | 创建color_component对象 |
|
||||
| <a href="#color_component_t_color_component_get_h">color\_component\_get\_h</a> | 获取h分量。 |
|
||||
| <a href="#color_component_t_color_component_get_s">color\_component\_get\_s</a> | 获取s分量。 |
|
||||
| <a href="#color_component_t_color_component_get_v">color\_component\_get\_v</a> | 获取v分量。 |
|
||||
| <a href="#color_component_t_color_component_set_color">color\_component\_set\_color</a> | 设置颜色。 |
|
||||
| <a href="#color_component_t_color_component_set_hsv">color\_component\_set\_hsv</a> | 设置颜色。 |
|
||||
### 事件
|
||||
<p id="color_component_t_events">
|
||||
|
||||
| 事件名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------- |
|
||||
| EVT\_VALUE\_CHANGING | value\_change\_event\_t | 颜色正在改变事件。 |
|
||||
#### color\_component\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_component_t_color_component_cast">转换为color_component对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* color_component_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | color\_component对象。 |
|
||||
| widget | widget\_t* | color\_component对象。 |
|
||||
#### color\_component\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_component_t_color_component_create">创建color_component对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* color_component_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### color\_component\_get\_h 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_component_t_color_component_get_h">获取h分量。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
float color_component_get_h (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | float | 返回h分量。 |
|
||||
| widget | widget\_t* | color\_component对象。 |
|
||||
#### color\_component\_get\_s 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_component_t_color_component_get_s">获取s分量。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
float color_component_get_s (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | float | 返回s分量。 |
|
||||
| widget | widget\_t* | color\_component对象。 |
|
||||
#### color\_component\_get\_v 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_component_t_color_component_get_v">获取v分量。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
float color_component_get_v (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | float | 返回v分量。 |
|
||||
| widget | widget\_t* | color\_component对象。 |
|
||||
#### color\_component\_set\_color 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_component_t_color_component_set_color">设置颜色。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t color_component_set_color (widget_t* widget, color_t c);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| c | color\_t | 颜色。 |
|
||||
#### color\_component\_set\_hsv 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_component_t_color_component_set_hsv">设置颜色。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t color_component_set_hsv (widget_t* widget, float h, float s, float v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| h | float | 色调。 |
|
||||
| s | float | 饱和度。 |
|
||||
| v | float | 明度。 |
|
@ -0,0 +1,46 @@
|
||||
## color\_parser\_t
|
||||
### 概述
|
||||
颜色解析相关函数。
|
||||
|
||||
示例:
|
||||
|
||||
```c
|
||||
color_t c;
|
||||
c = color_parse("#112233");
|
||||
c = color_parse("white");
|
||||
c = color_parse("rgb(11,22,33)");
|
||||
c = color_parse("rgba(11,22,33,0.5)");
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="color_parser_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#color_parser_t_color_parse">color\_parse</a> | 把字符串格式的颜色转换成color\_t对象。 |
|
||||
#### color\_parse 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_parser_t_color_parse">把字符串格式的颜色转换成color\_t对象。
|
||||
|
||||
目前支持下列格式:
|
||||
|
||||
* 16进制格式。如:"#112233"
|
||||
* 颜色名称格式。如:"green"
|
||||
* rgb格式。如:"rgb(11,22,33)"
|
||||
* rgba格式。如:"rgba(11,22,33,0.5)"
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void* color_parse (const char* color);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void* | 返回color\_t对象。 |
|
||||
| color | const char* | 字符串格式的颜色。 |
|
133
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/color_picker_t.md
Normal file
133
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/color_picker_t.md
Normal file
@ -0,0 +1,133 @@
|
||||
## color\_picker\_t
|
||||
### 概述
|
||||

|
||||
|
||||
颜色选择器。
|
||||
|
||||
color\_picker\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于color\_picker\_t控件。
|
||||
|
||||
在xml中使用"color\_picker"标签创建颜色选择器控件。如:
|
||||
|
||||
```xml
|
||||
<color_picker x="0" y="0" w="100%" h="100%" value="orange">
|
||||
<color_component x="0" y="0" w="200" h="200" name="sv"/>
|
||||
<color_component x="210" y="0" w="20" h="200" name="h"/>
|
||||
<color_tile x="0" y="210" w="50%" h="20" name="new" bg_color="green"/>
|
||||
<color_tile x="right" y="210" w="50%" h="20" name="old" bg_color="blue"/>
|
||||
</color_picker>
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[color\_picker](https://github.com/zlgopen/awtk/blob/master/design/default/ui/color_picker.xml)
|
||||
|
||||
其中的子控件必须按下列规则命名:
|
||||
|
||||
* r 红色分量。可以是spin_box、edit和slider。
|
||||
* g 绿色分量。可以是spin_box、edit和slider。
|
||||
* b 蓝色分量。可以是spin_box、edit和slider。
|
||||
* h Hue分量。可以是spin_box、edit、slider和color_component。
|
||||
* s Saturation分量。可以是spin_box、edit和slider。
|
||||
* v Value/Brightness分量。可以是spin_box、edit和slider。
|
||||
* sv Saturation和Value/Brightness分量。可以是color_component。
|
||||
* old 旧的值。可以是spin_box、edit和color_tile。
|
||||
* new 新的值。可以是spin_box、edit和color_tile。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="color_picker_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#color_picker_t_color_picker_cast">color\_picker\_cast</a> | 转换为color_picker对象(供脚本语言使用)。 |
|
||||
| <a href="#color_picker_t_color_picker_create">color\_picker\_create</a> | 创建color_picker对象 |
|
||||
| <a href="#color_picker_t_color_picker_set_color">color\_picker\_set\_color</a> | 设置颜色。 |
|
||||
### 属性
|
||||
<p id="color_picker_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#color_picker_t_value">value</a> | const char* | 颜色。 |
|
||||
### 事件
|
||||
<p id="color_picker_t_events">
|
||||
|
||||
| 事件名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------- |
|
||||
| EVT\_VALUE\_WILL\_CHANGE | value\_change\_event\_t | 值(颜色)即将改变事件。 |
|
||||
| EVT\_VALUE\_CHANGED | value\_change\_event\_t | 值(颜色)改变事件。 |
|
||||
#### color\_picker\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_picker_t_color_picker_cast">转换为color_picker对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* color_picker_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | color\_picker对象。 |
|
||||
| widget | widget\_t* | color\_picker对象。 |
|
||||
#### color\_picker\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_picker_t_color_picker_create">创建color_picker对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* color_picker_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### color\_picker\_set\_color 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_picker_t_color_picker_set_color">设置颜色。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t color_picker_set_color (widget_t* widget, const char* color);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| color | const char* | 颜色。 |
|
||||
#### value 属性
|
||||
-----------------------
|
||||
> <p id="color_picker_t_value">颜色。
|
||||
|
||||
* 类型:const char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
303
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/color_t.md
Normal file
303
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/color_t.md
Normal file
@ -0,0 +1,303 @@
|
||||
## color\_t
|
||||
### 概述
|
||||
颜色。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="color_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#color_t_color_a">color\_a</a> | 获取alpha通道的值。 |
|
||||
| <a href="#color_t_color_b">color\_b</a> | 获取蓝色通道的值。 |
|
||||
| <a href="#color_t_color_cast">color\_cast</a> | 转换为color对象。 |
|
||||
| <a href="#color_t_color_create">color\_create</a> | 创建color对象。 |
|
||||
| <a href="#color_t_color_destroy">color\_destroy</a> | 销毁color对象。 |
|
||||
| <a href="#color_t_color_from_str">color\_from\_str</a> | 创建color对象。 |
|
||||
| <a href="#color_t_color_g">color\_g</a> | 获取绿色通道的值。 |
|
||||
| <a href="#color_t_color_get_color">color\_get\_color</a> | 获取颜色值。 |
|
||||
| <a href="#color_t_color_hex_str">color\_hex\_str</a> | 获取16进制格式表示的颜色 |
|
||||
| <a href="#color_t_color_init">color\_init</a> | 初始化颜色对象。 |
|
||||
| <a href="#color_t_color_r">color\_r</a> | 获取红色通道的值。 |
|
||||
| <a href="#color_t_color_rgba_str">color\_rgba\_str</a> | 获取rgba格式表示的颜色 |
|
||||
### 属性
|
||||
<p id="color_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#color_t_color">color</a> | uint32\_t | 颜色的数值。 |
|
||||
| <a href="#color_t_rgba">rgba</a> | rgba\_t | 颜色的RGBA值。 |
|
||||
#### color\_a 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_a">获取alpha通道的值。
|
||||
|
||||
> 主要供脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint8_t color_a (color_t* c);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint8\_t | 返回alpha通道的值。 |
|
||||
| c | color\_t* | color对象。 |
|
||||
#### color\_b 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_b">获取蓝色通道的值。
|
||||
|
||||
> 主要供脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint8_t color_b (color_t* c);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint8\_t | 返回蓝色通道的值。 |
|
||||
| c | color\_t* | color对象。 |
|
||||
#### color\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_cast">转换为color对象。
|
||||
|
||||
> 供脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
color_t* color_cast (color_t* color);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | color\_t* | color对象。 |
|
||||
| color | color\_t* | color对象。 |
|
||||
#### color\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_create">创建color对象。
|
||||
|
||||
> 主要供脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
color_t* color_create (uint8_t r, uint8_t b, uint8_t g, uint8_t a);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | color\_t* | color对象。 |
|
||||
| r | uint8\_t | 红色通道。 |
|
||||
| b | uint8\_t | 蓝色通道。 |
|
||||
| g | uint8\_t | 绿色通道。 |
|
||||
| a | uint8\_t | alpha通道。 |
|
||||
#### color\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_destroy">销毁color对象。
|
||||
> 主要供脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t color_destroy (color_t* c);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| c | color\_t* | color对象。 |
|
||||
#### color\_from\_str 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_from_str">创建color对象。
|
||||
|
||||
> 主要供脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
color_t* color_from_str (color_t* c, const char* str);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | color\_t* | color对象。 |
|
||||
| c | color\_t* | color对象。 |
|
||||
| str | const char* | css类似的颜色值。 |
|
||||
#### color\_g 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_g">获取绿色通道的值。
|
||||
|
||||
> 主要供脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint8_t color_g (color_t* c);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint8\_t | 返回绿色通道的值。 |
|
||||
| c | color\_t* | color对象。 |
|
||||
#### color\_get\_color 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_get_color">获取颜色值。
|
||||
|
||||
> 主要供脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t color_get_color (color_t* c);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 返回颜色值。 |
|
||||
| c | color\_t* | color对象。 |
|
||||
#### color\_hex\_str 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_hex_str">获取16进制格式表示的颜色
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
char* color_hex_str (color_t* c, char* str);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | char* | 获取16进制字符串表示的颜色。 |
|
||||
| c | color\_t* | color对象。 |
|
||||
| str | char* | 内存。 |
|
||||
#### color\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_init">初始化颜色对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
color_t color_init (uint8_t r, uint8_t g, uint8_t b, uint8_t a);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | color\_t | 颜色对象。 |
|
||||
| r | uint8\_t | 红色。 |
|
||||
| g | uint8\_t | 绿色。 |
|
||||
| b | uint8\_t | 蓝色。 |
|
||||
| a | uint8\_t | alpha。 |
|
||||
#### color\_r 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_r">获取红色通道的值。
|
||||
|
||||
> 主要供脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint8_t color_r (color_t* c);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint8\_t | 返回红色通道的值。 |
|
||||
| c | color\_t* | color对象。 |
|
||||
#### color\_rgba\_str 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_t_color_rgba_str">获取rgba格式表示的颜色
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
char* color_rgba_str (color_t* c, char* str);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | char* | 获取rgba格式表示的颜色。 |
|
||||
| c | color\_t* | color对象。 |
|
||||
| str | char* | 内存。 |
|
||||
#### color 属性
|
||||
-----------------------
|
||||
> <p id="color_t_color">颜色的数值。
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
#### rgba 属性
|
||||
-----------------------
|
||||
> <p id="color_t_rgba">颜色的RGBA值。
|
||||
|
||||
* 类型:rgba\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 是 |
|
227
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/color_tile_t.md
Normal file
227
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/color_tile_t.md
Normal file
@ -0,0 +1,227 @@
|
||||
## color\_tile\_t
|
||||
### 概述
|
||||

|
||||
|
||||
色块控件。
|
||||
|
||||
用来显示一个颜色块,它通过属性而不是窗体样式来设置颜色,方便在运行时动态改变颜色。
|
||||
|
||||
可以使用value属性访问背景颜色的颜色值。
|
||||
|
||||
color\_tile\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于color\_tile\_t控件。
|
||||
|
||||
在xml中使用"color_tile"标签创建色块控件。如:
|
||||
|
||||
```xml
|
||||
<color_tile x="c" y="m" w="80" h="30" bg_color="green" />
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[color_tile](https://github.com/zlgopen/awtk/blob/master/design/default/ui/color_picker_rgb.xml)
|
||||
|
||||
在c代码中使用函数color_tile\_create创建色块控件。如:
|
||||
|
||||
```c
|
||||
widget_t* color_tile = color_tile_create(win, 10, 10, 128, 30);
|
||||
color_tile_set_bg_color(color_tile, "red");
|
||||
```
|
||||
> 创建之后,用color\_tile\_set\_bg\_color设置背景颜色。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="color_tile_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#color_tile_t_color_tile_cast">color\_tile\_cast</a> | 转换为color_tile对象(供脚本语言使用)。 |
|
||||
| <a href="#color_tile_t_color_tile_create">color\_tile\_create</a> | 创建color_tile对象 |
|
||||
| <a href="#color_tile_t_color_tile_get_bg_color">color\_tile\_get\_bg\_color</a> | 获取背景颜色。 |
|
||||
| <a href="#color_tile_t_color_tile_get_border_color">color\_tile\_get\_border\_color</a> | 获取边框颜色。 |
|
||||
| <a href="#color_tile_t_color_tile_set_bg_color">color\_tile\_set\_bg\_color</a> | 设置背景颜色。 |
|
||||
| <a href="#color_tile_t_color_tile_set_border_color">color\_tile\_set\_border\_color</a> | 设置边框颜色。 |
|
||||
| <a href="#color_tile_t_color_tile_set_value">color\_tile\_set\_value</a> | 设置背景颜色。 |
|
||||
### 属性
|
||||
<p id="color_tile_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#color_tile_t_bg_color">bg\_color</a> | const char* | 背景颜色。 |
|
||||
| <a href="#color_tile_t_border_color">border\_color</a> | const char* | 边框颜色。 |
|
||||
### 事件
|
||||
<p id="color_tile_t_events">
|
||||
|
||||
| 事件名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------- |
|
||||
| EVT\_VALUE\_WILL\_CHANGE | value\_change\_event\_t | 值(颜色)即将改变事件。 |
|
||||
| EVT\_VALUE\_CHANGED | value\_change\_event\_t | 值(颜色)改变事件。 |
|
||||
#### color\_tile\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_tile_t_color_tile_cast">转换为color_tile对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* color_tile_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | color\_tile对象。 |
|
||||
| widget | widget\_t* | color\_tile对象。 |
|
||||
#### color\_tile\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_tile_t_color_tile_create">创建color_tile对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* color_tile_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### color\_tile\_get\_bg\_color 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_tile_t_color_tile_get_bg_color">获取背景颜色。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* color_tile_get_bg_color (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回背景颜色。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
#### color\_tile\_get\_border\_color 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_tile_t_color_tile_get_border_color">获取边框颜色。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* color_tile_get_border_color (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回边框颜色。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
#### color\_tile\_set\_bg\_color 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_tile_t_color_tile_set_bg_color">设置背景颜色。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t color_tile_set_bg_color (widget_t* widget, const char* color);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| color | const char* | 背景颜色。 |
|
||||
#### color\_tile\_set\_border\_color 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_tile_t_color_tile_set_border_color">设置边框颜色。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t color_tile_set_border_color (widget_t* widget, const char* color);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| color | const char* | 边框颜色。 |
|
||||
#### color\_tile\_set\_value 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="color_tile_t_color_tile_set_value">设置背景颜色。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t color_tile_set_value (widget_t* widget, color_t color);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| color | color\_t | 背景颜色。 |
|
||||
#### bg\_color 属性
|
||||
-----------------------
|
||||
> <p id="color_tile_t_bg_color">背景颜色。
|
||||
|
||||
* 类型:const char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### border\_color 属性
|
||||
-----------------------
|
||||
> <p id="color_tile_t_border_color">边框颜色。
|
||||
|
||||
* 类型:const char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
80
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/column_t.md
Normal file
80
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/column_t.md
Normal file
@ -0,0 +1,80 @@
|
||||
## column\_t
|
||||
### 概述
|
||||

|
||||
|
||||
column。一个简单的容器控件,垂直排列其子控件。
|
||||
|
||||
它本身不提供布局功能,仅提供具有语义的标签,让xml更具有可读性。
|
||||
子控件的布局可用layout\_children属性指定。
|
||||
请参考[布局参数](https://github.com/zlgopen/awtk/blob/master/docs/layout.md)。
|
||||
|
||||
column\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于column\_t控件。
|
||||
|
||||
在xml中使用"column"标签创建column。如:
|
||||
|
||||
```xml
|
||||
<column x="0" y="0" w="100%" h="100%" children_layout="default(c=1,r=0)">
|
||||
<button name="open:basic" text="Basic"/>
|
||||
<button name="open:button" text="Buttons"/>
|
||||
<button name="open:edit" text="Edits"/>
|
||||
<button name="open:keyboard" text="KeyBoard"/>
|
||||
</column>
|
||||
```
|
||||
|
||||
可用通过style来设置控件的显示风格,如背景颜色等。如:
|
||||
|
||||
```xml
|
||||
<style name="default" border_color="#a0a0a0">
|
||||
<normal bg_color="#f0f0f0" />
|
||||
</style>
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="column_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#column_t_column_cast">column\_cast</a> | 转换为column对象(供脚本语言使用)。 |
|
||||
| <a href="#column_t_column_create">column\_create</a> | 创建column对象 |
|
||||
#### column\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="column_t_column_cast">转换为column对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* column_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | column对象。 |
|
||||
| widget | widget\_t* | column对象。 |
|
||||
#### column\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="column_t_column_create">创建column对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* column_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
@ -0,0 +1,35 @@
|
||||
## combo\_box\_ex\_t
|
||||
### 概述
|
||||

|
||||
|
||||
可滚动的combo_box控件。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="combo_box_ex_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#combo_box_ex_t_combo_box_ex_create">combo\_box\_ex\_create</a> | 创建combo_box_ex对象 |
|
||||
#### combo\_box\_ex\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_ex_t_combo_box_ex_create">创建combo_box_ex对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* combo_box_ex_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
@ -0,0 +1,146 @@
|
||||
## combo\_box\_item\_t
|
||||
### 概述
|
||||

|
||||
|
||||
ComboBox Item控件。
|
||||
|
||||
本类仅供combo\_box控件内部使用。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="combo_box_item_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#combo_box_item_t_combo_box_item_cast">combo\_box\_item\_cast</a> | 转换combo_box_item对象(供脚本语言使用)。 |
|
||||
| <a href="#combo_box_item_t_combo_box_item_create">combo\_box\_item\_create</a> | 创建combo_box_item对象 |
|
||||
| <a href="#combo_box_item_t_combo_box_item_set_checked">combo\_box\_item\_set\_checked</a> | 设置控件是否被选中。 |
|
||||
| <a href="#combo_box_item_t_combo_box_item_set_value">combo\_box\_item\_set\_value</a> | 设置控件的值。 |
|
||||
### 属性
|
||||
<p id="combo_box_item_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#combo_box_item_t_checked">checked</a> | bool\_t | 是否被选中。 |
|
||||
| <a href="#combo_box_item_t_value">value</a> | int32\_t | 值。 |
|
||||
### 事件
|
||||
<p id="combo_box_item_t_events">
|
||||
|
||||
| 事件名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------- |
|
||||
| EVT\_CLICK | pointer\_event\_t | 点击事件。 |
|
||||
| EVT\_VALUE\_WILL\_CHANGE | value\_change\_event\_t | 值(勾选状态)即将改变事件。 |
|
||||
| EVT\_VALUE\_CHANGED | value\_change\_event\_t | 值(勾选状态)改变事件。 |
|
||||
#### combo\_box\_item\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_item_t_combo_box_item_cast">转换combo_box_item对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* combo_box_item_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | combo\_box\_item对象。 |
|
||||
| widget | widget\_t* | combo\_box\_item对象。 |
|
||||
#### combo\_box\_item\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_item_t_combo_box_item_create">创建combo_box_item对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* combo_box_item_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### combo\_box\_item\_set\_checked 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_item_t_combo_box_item_set_checked">设置控件是否被选中。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_item_set_checked (widget_t* widget, bool_t checked);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box\_item对象。 |
|
||||
| checked | bool\_t | 是否被选中。 |
|
||||
#### combo\_box\_item\_set\_value 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_item_t_combo_box_item_set_value">设置控件的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_item_set_value (widget_t* widget, int32_t value);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box\_item对象。 |
|
||||
| value | int32\_t | 值 |
|
||||
#### checked 属性
|
||||
-----------------------
|
||||
> <p id="combo_box_item_t_checked">是否被选中。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### value 属性
|
||||
-----------------------
|
||||
> <p id="combo_box_item_t_value">值。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
549
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/combo_box_t.md
Normal file
549
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/combo_box_t.md
Normal file
@ -0,0 +1,549 @@
|
||||
## combo\_box\_t
|
||||
### 概述
|
||||

|
||||
|
||||
下拉列表控件。
|
||||
|
||||
点击右边的按钮,可弹出一个下拉列表,从中选择一项作为当前的值。
|
||||
|
||||
combo\_box\_t是[edit\_t](edit_t.md)的子类控件,edit\_t的函数均适用于combo\_box\_t控件。
|
||||
|
||||
在xml中使用"combo_box"标签创建下拉列表控件。
|
||||
|
||||
列表选项可以直接写在"options"属性中。如:
|
||||
|
||||
```xml
|
||||
<combo_box readonly="true" x="10" y="bottom:5" w="200" h="30" tr_text="ok"
|
||||
options="1:ok;2:cancel;"/>
|
||||
```
|
||||
|
||||
列表选项也可以放在独立的窗口中,用属性"open_window"指定窗口的名称。如:
|
||||
|
||||
```xml
|
||||
<combo_box open_window="language" readonly="true" x="10" y="bottom:50" w="200" h="30"
|
||||
tr_text="english"/>
|
||||
```
|
||||
|
||||
language.xml:
|
||||
|
||||
```xml
|
||||
<popup close_when_click_outside="true" h="80" >
|
||||
<list_view x="0" y="0" w="100%" h="100%" item_height="30">
|
||||
<scroll_view name="view" x="0" y="0" w="-12" h="100%">
|
||||
<combo_box_item tr_text="english"/>
|
||||
<combo_box_item tr_text="chinese" />
|
||||
</scroll_view>
|
||||
<scroll_bar_d name="bar" x="right" y="0" w="12" h="100%" value="0"/>
|
||||
</list_view>
|
||||
</popup>
|
||||
```
|
||||
|
||||
> 更多用法请参考:[combo_box.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/combo_box.xml)
|
||||
|
||||
|
||||
|
||||
如果在文本比较长时,希望在获得焦点时文本自动滚动,可以放入一个hscroll_label为子控件,并命名为"value"。如:
|
||||
|
||||
```xml
|
||||
<combo_box left_margin="6" readonly="true" x="10" y="50" w="80" h="30" options="leftttttttttt;centerrrrrrrrrrrrrrrr;rightttttttttt;"
|
||||
selected_index="1">
|
||||
<hscroll_label x="0" y="0" w="-30" h="100%"
|
||||
name="value"
|
||||
lull="1000"
|
||||
loop="true"
|
||||
yoyo="true"
|
||||
ellipses="true"
|
||||
only_parent_focus="true"/>
|
||||
<button style="combobox_down" x="right:5" y="middle" w="20" h="20"/>
|
||||
</combo_box>
|
||||
```
|
||||
|
||||
在c代码中使用函数combo\_box\_create创建下拉列表控件。如:
|
||||
|
||||
```c
|
||||
widget_t* combo_box = combo_box_create(win, 10, 10, 128, 30);
|
||||
|
||||
combo_box_set_options(combo_box, "left;center;right;");
|
||||
combo_box_set_selected_index(combo_box, 1);
|
||||
|
||||
```
|
||||
|
||||
创建之后:
|
||||
|
||||
* 用combo\_box\_set\_options设置可选项目。
|
||||
* 用combo\_box\_set\_selected\_index设置缺省项。
|
||||
|
||||
> 完整示例请参考:[combo_box
|
||||
demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/combo_box.c)
|
||||
|
||||
可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:
|
||||
|
||||
```xml
|
||||
<combo_box>
|
||||
<style name="default" border_color="#a0a0a0" text_color="black" text_align_h="left">
|
||||
<normal bg_color="#f0f0f0" />
|
||||
<focused bg_color="#f0f0f0" border_color="black"/>
|
||||
<empty bg_color="#f0f0f0" text_color="#a0a0a0" />
|
||||
</style>
|
||||
</combo_box>
|
||||
```
|
||||
|
||||
* 1.combobox的下拉按钮的style名称为combobox_down,可以在窗体样式文件中设置。
|
||||
|
||||
```xml
|
||||
<button>
|
||||
<style name="combobox_down" border_color="#a0a0a0">
|
||||
<normal bg_color="#f0f0f0" icon="arrow_down_n"/>
|
||||
<pressed bg_color="#c0c0c0" icon="arrow_down_p"/>
|
||||
<over bg_color="#e0e0e0" icon="arrow_down_o"/>
|
||||
</style>
|
||||
</button>
|
||||
```
|
||||
|
||||
* 2.combobox的弹出popup窗口的style名称为combobox_popup,可以在窗体样式文件中设置。
|
||||
|
||||
```xml
|
||||
<popup>
|
||||
<style name="combobox_popup" border_color="red">
|
||||
<normal bg_color="#808080"/>
|
||||
</style>
|
||||
</popup>
|
||||
```
|
||||
|
||||
> 更多用法请参考:[theme
|
||||
default](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L422)
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="combo_box_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#combo_box_t_combo_box_append_option">combo\_box\_append\_option</a> | 追加一个选项。 |
|
||||
| <a href="#combo_box_t_combo_box_cast">combo\_box\_cast</a> | 转换combo_box对象(供脚本语言使用)。 |
|
||||
| <a href="#combo_box_t_combo_box_count_options">combo\_box\_count\_options</a> | 获取选项个数。 |
|
||||
| <a href="#combo_box_t_combo_box_create">combo\_box\_create</a> | 创建combo_box对象 |
|
||||
| <a href="#combo_box_t_combo_box_get_option">combo\_box\_get\_option</a> | 获取第index个选项。 |
|
||||
| <a href="#combo_box_t_combo_box_get_text">combo\_box\_get\_text</a> | 获取combo_box的文本。 |
|
||||
| <a href="#combo_box_t_combo_box_get_value">combo\_box\_get\_value</a> | 获取combo_box的值。 |
|
||||
| <a href="#combo_box_t_combo_box_reset_options">combo\_box\_reset\_options</a> | 重置所有选项。 |
|
||||
| <a href="#combo_box_t_combo_box_set_custom_open_popup">combo\_box\_set\_custom\_open\_popup</a> | 设置自定义的打开弹出窗口的函数。 |
|
||||
| <a href="#combo_box_t_combo_box_set_item_height">combo\_box\_set\_item\_height</a> | 设置item高度。 |
|
||||
| <a href="#combo_box_t_combo_box_set_localize_options">combo\_box\_set\_localize\_options</a> | 设置是否本地化(翻译)选项。 |
|
||||
| <a href="#combo_box_t_combo_box_set_open_window">combo\_box\_set\_open\_window</a> | 点击按钮时可以打开popup窗口,本函数可设置窗口的名称。 |
|
||||
| <a href="#combo_box_t_combo_box_set_options">combo\_box\_set\_options</a> | 设置选项。 |
|
||||
| <a href="#combo_box_t_combo_box_set_selected_index">combo\_box\_set\_selected\_index</a> | 设置第index个选项为当前选中的选项。 |
|
||||
| <a href="#combo_box_t_combo_box_set_value">combo\_box\_set\_value</a> | 设置值。 |
|
||||
### 属性
|
||||
<p id="combo_box_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#combo_box_t_item_height">item\_height</a> | int32\_t | 下拉选项的高度。如果open_window为空,则使用缺省高度。 |
|
||||
| <a href="#combo_box_t_localize_options">localize\_options</a> | bool\_t | 是否本地化(翻译)选项(缺省为TRUE)。 |
|
||||
| <a href="#combo_box_t_open_window">open\_window</a> | char* | 为点击按钮时,要打开窗口的名称。 |
|
||||
| <a href="#combo_box_t_options">options</a> | char* | 设置可选项(冒号分隔值和文本,分号分隔选项,如:1:red;2:green;3:blue)。 |
|
||||
| <a href="#combo_box_t_selected_index">selected\_index</a> | int32\_t | 当前选中的选项。 |
|
||||
| <a href="#combo_box_t_value">value</a> | int32\_t | 值。 |
|
||||
### 事件
|
||||
<p id="combo_box_t_events">
|
||||
|
||||
| 事件名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------- |
|
||||
| EVT\_VALUE\_WILL\_CHANGE | value\_change\_event\_t | 值即将改变事件。 |
|
||||
| EVT\_VALUE\_CHANGED | value\_change\_event\_t | 值改变事件。 |
|
||||
#### combo\_box\_append\_option 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_append_option">追加一个选项。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_append_option (widget_t* widget, int32_t value, const char* text);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
| value | int32\_t | 值。 |
|
||||
| text | const char* | 文本。 |
|
||||
#### combo\_box\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_cast">转换combo_box对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* combo_box_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | combo\_box对象。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
#### combo\_box\_count\_options 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_count_options">获取选项个数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t combo_box_count_options (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 返回选项个数。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
#### combo\_box\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_create">创建combo_box对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* combo_box_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### combo\_box\_get\_option 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_get_option">获取第index个选项。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
combo_box_option_t* combo_box_get_option (widget_t* widget, uint32_t index);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | combo\_box\_option\_t* | 返回index个选项。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
| index | uint32\_t | 选项的索引。 |
|
||||
#### combo\_box\_get\_text 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_get_text">获取combo_box的文本。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* combo_box_get_text (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回文本。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
#### combo\_box\_get\_value 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_get_value">获取combo_box的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t combo_box_get_value (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 返回值。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
#### combo\_box\_reset\_options 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_reset_options">重置所有选项。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_reset_options (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
#### combo\_box\_set\_custom\_open\_popup 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_set_custom_open_popup">设置自定义的打开弹出窗口的函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_set_custom_open_popup (widget_t* widget, combo_box_custom_open_popup_t open_popup, combo_box_custom_on_layout_combobox_popup_t on_layout_combobox_popup);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
| open\_popup | combo\_box\_custom\_open\_popup\_t | 回调函数。 |
|
||||
| on\_layout\_combobox\_popup | combo\_box\_custom\_on\_layout\_combobox\_popup\_t | layout 的回调函数。 |
|
||||
#### combo\_box\_set\_item\_height 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_set_item_height">设置item高度。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_set_item_height (widget_t* widget, uint32_t item_height);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
| item\_height | uint32\_t | item的高度。 |
|
||||
#### combo\_box\_set\_localize\_options 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_set_localize_options">设置是否本地化(翻译)选项。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_set_localize_options (widget_t* widget, bool_t localize_options);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
| localize\_options | bool\_t | 是否本地化(翻译)选项。 |
|
||||
#### combo\_box\_set\_open\_window 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_set_open_window">点击按钮时可以打开popup窗口,本函数可设置窗口的名称。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_set_open_window (widget_t* widget, const char* open_window);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
| open\_window | const char* | 弹出窗口的名称。 |
|
||||
#### combo\_box\_set\_options 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_set_options">设置选项。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_set_options (widget_t* widget, const char* options);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
| options | const char* | 选项。 |
|
||||
#### combo\_box\_set\_selected\_index 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_set_selected_index">设置第index个选项为当前选中的选项。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_set_selected_index (widget_t* widget, uint32_t index);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
| index | uint32\_t | 选项的索引。 |
|
||||
#### combo\_box\_set\_value 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="combo_box_t_combo_box_set_value">设置值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t combo_box_set_value (widget_t* widget, int32_t value);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | combo\_box对象。 |
|
||||
| value | int32\_t | 值。 |
|
||||
#### item\_height 属性
|
||||
-----------------------
|
||||
> <p id="combo_box_t_item_height">下拉选项的高度。如果open_window为空,则使用缺省高度。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### localize\_options 属性
|
||||
-----------------------
|
||||
> <p id="combo_box_t_localize_options">是否本地化(翻译)选项(缺省为TRUE)。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### open\_window 属性
|
||||
-----------------------
|
||||
> <p id="combo_box_t_open_window">为点击按钮时,要打开窗口的名称。
|
||||
|
||||
* 类型:char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### options 属性
|
||||
-----------------------
|
||||
> <p id="combo_box_t_options">设置可选项(冒号分隔值和文本,分号分隔选项,如:1:red;2:green;3:blue)。
|
||||
|
||||
* 类型:char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### selected\_index 属性
|
||||
-----------------------
|
||||
> <p id="combo_box_t_selected_index">当前选中的选项。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### value 属性
|
||||
-----------------------
|
||||
> <p id="combo_box_t_value">值。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
@ -0,0 +1,31 @@
|
||||
## compressor\_miniz\_t
|
||||
### 概述
|
||||

|
||||
|
||||
基于miniz实现的compressor接口。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="compressor_miniz_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#compressor_miniz_t_compressor_miniz_create">compressor\_miniz\_create</a> | 创建compressor对象。 |
|
||||
#### compressor\_miniz\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="compressor_miniz_t_compressor_miniz_create">创建compressor对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
compressor_t* compressor_miniz_create (compressor_options_t options);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | compressor\_t* | 返回compressor对象。 |
|
||||
| options | compressor\_options\_t | 选项。 |
|
@ -0,0 +1,75 @@
|
||||
## compressor\_t
|
||||
### 概述
|
||||
压缩解压接口。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="compressor_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#compressor_t_compressor_compress">compressor\_compress</a> | 压缩数据。 |
|
||||
| <a href="#compressor_t_compressor_destroy">compressor\_destroy</a> | 销毁compressor对象。 |
|
||||
| <a href="#compressor_t_compressor_uncompress">compressor\_uncompress</a> | 解压数据。 |
|
||||
#### compressor\_compress 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="compressor_t_compressor_compress">压缩数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t compressor_compress (compressor_t* compressor, const void* data, uint32_t size, wbuffer_t* out);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| compressor | compressor\_t* | compressor对象。 |
|
||||
| data | const void* | 待压缩的数据。 |
|
||||
| size | uint32\_t | 数据长度。 |
|
||||
| out | wbuffer\_t* | 压缩之后的数据。 |
|
||||
#### compressor\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="compressor_t_compressor_destroy">销毁compressor对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t compressor_destroy (compressor_t* compressor);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| compressor | compressor\_t* | compressor对象。 |
|
||||
#### compressor\_uncompress 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="compressor_t_compressor_uncompress">解压数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t compressor_uncompress (compressor_t* compressor, const void* data, uint32_t size, wbuffer_t* out);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| compressor | compressor\_t* | compressor对象。 |
|
||||
| data | const void* | 待解压的数据。 |
|
||||
| size | uint32\_t | 数据长度。 |
|
||||
| out | wbuffer\_t* | 解压之后的数据。 |
|
622
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/conf_doc_t.md
Normal file
622
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/conf_doc_t.md
Normal file
@ -0,0 +1,622 @@
|
||||
## conf\_doc\_t
|
||||
### 概述
|
||||
代表整个配置文件。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="conf_doc_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#conf_doc_t_conf_doc_add_child">conf\_doc\_add\_child</a> | 追加一个子节点。 |
|
||||
| <a href="#conf_doc_t_conf_doc_append_child">conf\_doc\_append\_child</a> | 追加一个子节点。 |
|
||||
| <a href="#conf_doc_t_conf_doc_append_sibling">conf\_doc\_append\_sibling</a> | 追加一个兄弟节点。 |
|
||||
| <a href="#conf_doc_t_conf_doc_clear">conf\_doc\_clear</a> | 删除指定路径的节点的全部子节点。 |
|
||||
| <a href="#conf_doc_t_conf_doc_create">conf\_doc\_create</a> | 构造函数。 |
|
||||
| <a href="#conf_doc_t_conf_doc_create_node">conf\_doc\_create\_node</a> | 创建一个空节点。 |
|
||||
| <a href="#conf_doc_t_conf_doc_destroy">conf\_doc\_destroy</a> | 析构函数。 |
|
||||
| <a href="#conf_doc_t_conf_doc_destroy_node">conf\_doc\_destroy\_node</a> | 销毁节点对象。 |
|
||||
| <a href="#conf_doc_t_conf_doc_exists">conf\_doc\_exists</a> | 判断指定路径的节点是否存在。 |
|
||||
| <a href="#conf_doc_t_conf_doc_get">conf\_doc\_get</a> | 获取指定路径节点的值。 |
|
||||
| <a href="#conf_doc_t_conf_doc_get_bool">conf\_doc\_get\_bool</a> | 获取指定路径节点的值。 |
|
||||
| <a href="#conf_doc_t_conf_doc_get_float">conf\_doc\_get\_float</a> | 获取指定路径节点的值。 |
|
||||
| <a href="#conf_doc_t_conf_doc_get_int">conf\_doc\_get\_int</a> | 获取指定路径节点的值。 |
|
||||
| <a href="#conf_doc_t_conf_doc_get_str">conf\_doc\_get\_str</a> | 获取指定路径节点的值。 |
|
||||
| <a href="#conf_doc_t_conf_doc_is_first">conf\_doc\_is\_first</a> | 检查指定节点是否在兄弟节点中排第一。 |
|
||||
| <a href="#conf_doc_t_conf_doc_is_last">conf\_doc\_is\_last</a> | 检查指定节点是否在兄弟节点中排最后。 |
|
||||
| <a href="#conf_doc_t_conf_doc_move_down">conf\_doc\_move\_down</a> | 和后一个兄弟节点交换位置。 |
|
||||
| <a href="#conf_doc_t_conf_doc_move_up">conf\_doc\_move\_up</a> | 和前一个兄弟节点交换位置。 |
|
||||
| <a href="#conf_doc_t_conf_doc_remove">conf\_doc\_remove</a> | 删除指定路径的节点。 |
|
||||
| <a href="#conf_doc_t_conf_doc_remove_child">conf\_doc\_remove\_child</a> | 删除指定的子节点。 |
|
||||
| <a href="#conf_doc_t_conf_doc_remove_child_by_name">conf\_doc\_remove\_child\_by\_name</a> | 删除指定的子节点。 |
|
||||
| <a href="#conf_doc_t_conf_doc_remove_children">conf\_doc\_remove\_children</a> | 删除全部子节点。 |
|
||||
| <a href="#conf_doc_t_conf_doc_remove_sibling">conf\_doc\_remove\_sibling</a> | 删除指定的兄弟节点。 |
|
||||
| <a href="#conf_doc_t_conf_doc_set">conf\_doc\_set</a> | 设置指定路径节点的值。 |
|
||||
| <a href="#conf_doc_t_conf_doc_set_bool">conf\_doc\_set\_bool</a> | 设置指定路径节点的值。 |
|
||||
| <a href="#conf_doc_t_conf_doc_set_float">conf\_doc\_set\_float</a> | 设置指定路径节点的值。 |
|
||||
| <a href="#conf_doc_t_conf_doc_set_int">conf\_doc\_set\_int</a> | 设置指定路径节点的值。 |
|
||||
| <a href="#conf_doc_t_conf_doc_set_str">conf\_doc\_set\_str</a> | 设置指定路径节点的值。 |
|
||||
### 属性
|
||||
<p id="conf_doc_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#conf_doc_t_root">root</a> | conf\_node\_t* | 根节点。 |
|
||||
#### conf\_doc\_add\_child 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_add_child">追加一个子节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_add_child (conf_doc_t* doc, const char* path);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
#### conf\_doc\_append\_child 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_append_child">追加一个子节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_append_child (conf_doc_t* doc, conf_node_t* node, conf_node_t* child);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
| child | conf\_node\_t* | 待追加节点对象。 |
|
||||
#### conf\_doc\_append\_sibling 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_append_sibling">追加一个兄弟节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_append_sibling (conf_doc_t* doc, conf_node_t* node, conf_node_t* sibling);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
| sibling | conf\_node\_t* | 待追加节点对象。 |
|
||||
#### conf\_doc\_clear 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_clear">删除指定路径的节点的全部子节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_clear (conf_doc_t* doc, const char* path);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
#### conf\_doc\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_create">构造函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
conf_doc_t* conf_doc_create (uint32_t prealloc_nodes_nr);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | conf\_doc\_t* | 返回doc对象。 |
|
||||
| prealloc\_nodes\_nr | uint32\_t | 预先分配的节点数。 |
|
||||
#### conf\_doc\_create\_node 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_create_node">创建一个空节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
conf_node_t* conf_doc_create_node (conf_doc_t* doc, const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | conf\_node\_t* | 返回节点对象。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| name | const char* | 节点名称。 |
|
||||
#### conf\_doc\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_destroy">析构函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_destroy (conf_doc_t* doc);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
#### conf\_doc\_destroy\_node 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_destroy_node">销毁节点对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_destroy_node (conf_doc_t* doc, conf_node_t* node);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
#### conf\_doc\_exists 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_exists">判断指定路径的节点是否存在。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t conf_doc_exists (conf_doc_t* doc, const char* path);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示成功,FALSE表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
#### conf\_doc\_get 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_get">获取指定路径节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_get (conf_doc_t* doc, const char* path, value_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
| v | value\_t* | 用于返回值。 |
|
||||
#### conf\_doc\_get\_bool 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_get_bool">获取指定路径节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t conf_doc_get_bool (conf_doc_t* doc, const char* path, bool_t defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回值。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
| defval | bool\_t | 缺省值。 |
|
||||
#### conf\_doc\_get\_float 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_get_float">获取指定路径节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
float conf_doc_get_float (conf_doc_t* doc, const char* path, float defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | float | 返回值。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
| defval | float | 缺省值。 |
|
||||
#### conf\_doc\_get\_int 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_get_int">获取指定路径节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t conf_doc_get_int (conf_doc_t* doc, const char* path, int32_t defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 返回值。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
| defval | int32\_t | 缺省值。 |
|
||||
#### conf\_doc\_get\_str 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_get_str">获取指定路径节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* conf_doc_get_str (conf_doc_t* doc, const char* path, const char* defval);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回值。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
| defval | const char* | 缺省值。 |
|
||||
#### conf\_doc\_is\_first 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_is_first">检查指定节点是否在兄弟节点中排第一。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t conf_doc_is_first (conf_doc_t* doc, const char* path);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示是,否则表示不是。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
#### conf\_doc\_is\_last 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_is_last">检查指定节点是否在兄弟节点中排最后。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t conf_doc_is_last (conf_doc_t* doc, const char* path);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示是,否则表示不是。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
#### conf\_doc\_move\_down 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_move_down">和后一个兄弟节点交换位置。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_move_down (conf_doc_t* doc, const char* path);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
#### conf\_doc\_move\_up 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_move_up">和前一个兄弟节点交换位置。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_move_up (conf_doc_t* doc, const char* path);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
#### conf\_doc\_remove 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_remove">删除指定路径的节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_remove (conf_doc_t* doc, const char* path);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
#### conf\_doc\_remove\_child 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_remove_child">删除指定的子节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_remove_child (conf_doc_t* doc, conf_node_t* node, conf_node_t* child);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
| child | conf\_node\_t* | 待删除节点对象。 |
|
||||
#### conf\_doc\_remove\_child\_by\_name 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_remove_child_by_name">删除指定的子节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_remove_child_by_name (conf_doc_t* doc, conf_node_t* node, const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
| name | const char* | 待删除节点的名称。 |
|
||||
#### conf\_doc\_remove\_children 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_remove_children">删除全部子节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_remove_children (conf_doc_t* doc, conf_node_t* node);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
#### conf\_doc\_remove\_sibling 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_remove_sibling">删除指定的兄弟节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_remove_sibling (conf_doc_t* doc, conf_node_t* node, conf_node_t* sibling);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
| sibling | conf\_node\_t* | 待删除节点对象。 |
|
||||
#### conf\_doc\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_set">设置指定路径节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_set (conf_doc_t* doc, const char* path, const value_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
| v | const value\_t* | 值。 |
|
||||
#### conf\_doc\_set\_bool 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_set_bool">设置指定路径节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_set_bool (conf_doc_t* doc, const char* path, bool_t v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
| v | bool\_t | 值。 |
|
||||
#### conf\_doc\_set\_float 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_set_float">设置指定路径节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_set_float (conf_doc_t* doc, const char* path, float v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
| v | float | 值。 |
|
||||
#### conf\_doc\_set\_int 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_set_int">设置指定路径节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_set_int (conf_doc_t* doc, const char* path, int32_t v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
| v | int32\_t | 值。 |
|
||||
#### conf\_doc\_set\_str 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_doc_t_conf_doc_set_str">设置指定路径节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_doc_set_str (conf_doc_t* doc, const char* path, const char* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| doc | conf\_doc\_t* | 文档对象。 |
|
||||
| path | const char* | 节点的路径。 |
|
||||
| v | const char* | 值。 |
|
||||
#### root 属性
|
||||
-----------------------
|
||||
> <p id="conf_doc_t_root">根节点。
|
||||
|
||||
* 类型:conf\_node\_t*
|
||||
|
72
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/conf_ini_t.md
Normal file
72
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/conf_ini_t.md
Normal file
@ -0,0 +1,72 @@
|
||||
## conf\_ini\_t
|
||||
### 概述
|
||||

|
||||
|
||||
conf ini对象。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="conf_ini_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#conf_ini_t_conf_ini_create">conf\_ini\_create</a> | 创建一个空的conf对象。 |
|
||||
| <a href="#conf_ini_t_conf_ini_load">conf\_ini\_load</a> | 从指定URL加载INI对象。 |
|
||||
| <a href="#conf_ini_t_conf_ini_save_as">conf\_ini\_save\_as</a> | 将doc对象保存到指定URL。 |
|
||||
#### conf\_ini\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_ini_t_conf_ini_create">创建一个空的conf对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
object_t* conf_ini_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | object\_t* | 返回配置对象。 |
|
||||
#### conf\_ini\_load 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_ini_t_conf_ini_load">从指定URL加载INI对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
object_t* conf_ini_load (const char* url, bool_t create_if_not_exist);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | object\_t* | 返回配置对象。 |
|
||||
| url | const char* | 路径(通常是文件路径)。 |
|
||||
| create\_if\_not\_exist | bool\_t | 如果不存在是否创建。 |
|
||||
#### conf\_ini\_save\_as 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_ini_t_conf_ini_save_as">将doc对象保存到指定URL。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_ini_save_as (object_t* obj, const char* url);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败 |
|
||||
| obj | object\_t* | doc对象。 |
|
||||
| url | const char* | 保存的位置。 |
|
72
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/conf_json_t.md
Normal file
72
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/conf_json_t.md
Normal file
@ -0,0 +1,72 @@
|
||||
## conf\_json\_t
|
||||
### 概述
|
||||

|
||||
|
||||
conf json对象。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="conf_json_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#conf_json_t_conf_json_create">conf\_json\_create</a> | 创建一个空的conf对象。 |
|
||||
| <a href="#conf_json_t_conf_json_load">conf\_json\_load</a> | 从指定URL加载JSON对象。 |
|
||||
| <a href="#conf_json_t_conf_json_save_as">conf\_json\_save\_as</a> | 将doc对象保存到指定URL。 |
|
||||
#### conf\_json\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_json_t_conf_json_create">创建一个空的conf对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
object_t* conf_json_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | object\_t* | 返回配置对象。 |
|
||||
#### conf\_json\_load 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_json_t_conf_json_load">从指定URL加载JSON对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
object_t* conf_json_load (const char* url, bool_t create_if_not_exist);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | object\_t* | 返回配置对象。 |
|
||||
| url | const char* | 路径(通常是文件路径)。 |
|
||||
| create\_if\_not\_exist | bool\_t | 如果不存在是否创建。 |
|
||||
#### conf\_json\_save\_as 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_json_t_conf_json_save_as">将doc对象保存到指定URL。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_json_save_as (object_t* obj, const char* url);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败 |
|
||||
| obj | object\_t* | doc对象。 |
|
||||
| url | const char* | 保存的位置。 |
|
187
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/conf_node_t.md
Normal file
187
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/conf_node_t.md
Normal file
@ -0,0 +1,187 @@
|
||||
## conf\_node\_t
|
||||
### 概述
|
||||
节点。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="conf_node_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#conf_node_t_conf_node_find_child">conf\_node\_find\_child</a> | 查找指定名称的子节点。 |
|
||||
| <a href="#conf_node_t_conf_node_find_sibling">conf\_node\_find\_sibling</a> | 查找指定名称的兄弟节点。 |
|
||||
| <a href="#conf_node_t_conf_node_get_first_child">conf\_node\_get\_first\_child</a> | 获取第一个子节点。 |
|
||||
| <a href="#conf_node_t_conf_node_get_name">conf\_node\_get\_name</a> | 获得节点的名称。 |
|
||||
| <a href="#conf_node_t_conf_node_get_value">conf\_node\_get\_value</a> | 设置节点的值。 |
|
||||
| <a href="#conf_node_t_conf_node_set_first_child">conf\_node\_set\_first\_child</a> | 设置第一个子节点。 |
|
||||
| <a href="#conf_node_t_conf_node_set_value">conf\_node\_set\_value</a> | 设置节点的值。 |
|
||||
### 属性
|
||||
<p id="conf_node_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#conf_node_t_next">next</a> | conf\_node\_t* | 下一个兄弟节点。 |
|
||||
| <a href="#conf_node_t_node_type">node\_type</a> | uint8\_t | 节点类型。 |
|
||||
| <a href="#conf_node_t_parent">parent</a> | conf\_node\_t* | 父节点。 |
|
||||
| <a href="#conf_node_t_value_type">value\_type</a> | uint8\_t | 值的类型。 |
|
||||
#### conf\_node\_find\_child 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_node_t_conf_node_find_child">查找指定名称的子节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
conf_node_t* conf_node_find_child (conf_node_t* node, const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | conf\_node\_t* | 返回节点对象。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
| name | const char* | 节点名称。 |
|
||||
#### conf\_node\_find\_sibling 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_node_t_conf_node_find_sibling">查找指定名称的兄弟节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
conf_node_t* conf_node_find_sibling (conf_node_t* node, const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | conf\_node\_t* | 返回节点对象。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
| name | const char* | 节点名称。 |
|
||||
#### conf\_node\_get\_first\_child 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_node_t_conf_node_get_first_child">获取第一个子节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
conf_node_t* conf_node_get_first_child (conf_node_t* node);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | conf\_node\_t* | 返回第一个子节点。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
#### conf\_node\_get\_name 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_node_t_conf_node_get_name">获得节点的名称。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* conf_node_get_name (conf_node_t* node);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回节点名称。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
#### conf\_node\_get\_value 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_node_t_conf_node_get_value">设置节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_node_get_value (conf_node_t* node, value_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
| v | value\_t* | 值(返回)。 |
|
||||
#### conf\_node\_set\_first\_child 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_node_t_conf_node_set_first_child">设置第一个子节点。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_node_set_first_child (conf_node_t* node, conf_node_t* child);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
| child | conf\_node\_t* | 子节点对象。 |
|
||||
#### conf\_node\_set\_value 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_node_t_conf_node_set_value">设置节点的值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_node_set_value (conf_node_t* node, const value_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| node | conf\_node\_t* | 节点对象。 |
|
||||
| v | const value\_t* | 值。 |
|
||||
#### next 属性
|
||||
-----------------------
|
||||
> <p id="conf_node_t_next">下一个兄弟节点。
|
||||
|
||||
* 类型:conf\_node\_t*
|
||||
|
||||
#### node\_type 属性
|
||||
-----------------------
|
||||
> <p id="conf_node_t_node_type">节点类型。
|
||||
|
||||
* 类型:uint8\_t
|
||||
|
||||
#### parent 属性
|
||||
-----------------------
|
||||
> <p id="conf_node_t_parent">父节点。
|
||||
|
||||
* 类型:conf\_node\_t*
|
||||
|
||||
#### value\_type 属性
|
||||
-----------------------
|
||||
> <p id="conf_node_t_value_type">值的类型。
|
||||
|
||||
* 类型:uint8\_t
|
||||
|
@ -0,0 +1,12 @@
|
||||
## conf\_node\_type\_t
|
||||
### 概述
|
||||
节点类型。
|
||||
### 常量
|
||||
<p id="conf_node_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| CONF\_NODE\_NONE | 无效节点。 |
|
||||
| CONF\_NODE\_OBJECT | 对象节点。 |
|
||||
| CONF\_NODE\_ARRAY | 数组节点。 |
|
||||
| CONF\_NODE\_SIMPLE | 简单节点。 |
|
@ -0,0 +1,23 @@
|
||||
## conf\_node\_value\_t
|
||||
### 概述
|
||||
节点值得类型。
|
||||
### 常量
|
||||
<p id="conf_node_value_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| CONF\_NODE\_VALUE\_NONE | 无效类型。 |
|
||||
| CONF\_NODE\_VALUE\_BOOL | bool\_t类型。 |
|
||||
| CONF\_NODE\_VALUE\_INT8 | int8\_t类型。 |
|
||||
| CONF\_NODE\_VALUE\_UINT8 | uint8\_t类型。 |
|
||||
| CONF\_NODE\_VALUE\_INT16 | int16\_t类型。 |
|
||||
| CONF\_NODE\_VALUE\_UINT16 | uint16\_t类型。 |
|
||||
| CONF\_NODE\_VALUE\_INT32 | int32\_t类型。 |
|
||||
| CONF\_NODE\_VALUE\_UINT32 | uint32\_t类型。 |
|
||||
| CONF\_NODE\_VALUE\_INT64 | int64\_t类型。 |
|
||||
| CONF\_NODE\_VALUE\_UINT64 | uint64\_t类型。 |
|
||||
| CONF\_NODE\_VALUE\_FLOAT32 | float类型。 |
|
||||
| CONF\_NODE\_VALUE\_DOUBLE | double类型。 |
|
||||
| CONF\_NODE\_VALUE\_STRING | 字符串类型。 |
|
||||
| CONF\_NODE\_VALUE\_SMALL\_STR | 短字符(len<=7)串类型。 |
|
||||
| CONF\_NODE\_VALUE\_NODE | 节点类型。 |
|
95
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/conf_obj_t.md
Normal file
95
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/conf_obj_t.md
Normal file
@ -0,0 +1,95 @@
|
||||
## conf\_obj\_t
|
||||
### 概述
|
||||

|
||||
|
||||
conf对象。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="conf_obj_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#conf_obj_t_conf_obj_create">conf\_obj\_create</a> | |
|
||||
| <a href="#conf_obj_t_conf_obj_get_doc">conf\_obj\_get\_doc</a> | 获取doc对象,用于更高级的操作。 |
|
||||
| <a href="#conf_obj_t_conf_obj_save">conf\_obj\_save</a> | 保存文档。 |
|
||||
| <a href="#conf_obj_t_conf_obj_set_readonly">conf\_obj\_set\_readonly</a> | 设置为只读模式。 |
|
||||
#### conf\_obj\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_obj_t_conf_obj_create">
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
object_t* conf_obj_create (conf_doc_save_t save, conf_doc_load_t load, const char* url, bool_t create_if_not_exist);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | object\_t* | 返回配置对象。 |
|
||||
| save | conf\_doc\_save\_t | 保存函数。 |
|
||||
| load | conf\_doc\_load\_t | 加载函数。 |
|
||||
| url | const char* | 路径。 |
|
||||
| create\_if\_not\_exist | bool\_t | 如果不存在是否创建。 |
|
||||
#### conf\_obj\_get\_doc 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_obj_t_conf_obj_get_doc">获取doc对象,用于更高级的操作。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
conf_dot_t conf_obj_get_doc (object_t* conf);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | conf\_dot\_t | 返回doc对象。 |
|
||||
| conf | object\_t* | conf对象。 |
|
||||
#### conf\_obj\_save 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_obj_t_conf_obj_save">保存文档。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_obj_save (object_t* conf);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败 |
|
||||
| conf | object\_t* | conf对象。 |
|
||||
#### conf\_obj\_set\_readonly 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_obj_t_conf_obj_set_readonly">设置为只读模式。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_obj_set_readonly (object_t* conf, bool_t readonly);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败 |
|
||||
| conf | object\_t* | conf对象。 |
|
||||
| readonly | bool\_t | 只读模式。 |
|
@ -0,0 +1,72 @@
|
||||
## conf\_ubjson\_t
|
||||
### 概述
|
||||

|
||||
|
||||
conf json对象。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="conf_ubjson_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#conf_ubjson_t_conf_ubjson_create">conf\_ubjson\_create</a> | 创建一个空的conf对象。 |
|
||||
| <a href="#conf_ubjson_t_conf_ubjson_load">conf\_ubjson\_load</a> | 从指定URL加载UBJSON对象。 |
|
||||
| <a href="#conf_ubjson_t_conf_ubjson_save_as">conf\_ubjson\_save\_as</a> | 将doc对象保存到指定URL。 |
|
||||
#### conf\_ubjson\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_ubjson_t_conf_ubjson_create">创建一个空的conf对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
object_t* conf_ubjson_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | object\_t* | 返回配置对象。 |
|
||||
#### conf\_ubjson\_load 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_ubjson_t_conf_ubjson_load">从指定URL加载UBJSON对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
object_t* conf_ubjson_load (const char* url, bool_t create_if_not_exist);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | object\_t* | 返回配置对象。 |
|
||||
| url | const char* | 路径(通常是文件路径)。 |
|
||||
| create\_if\_not\_exist | bool\_t | 如果不存在是否创建。 |
|
||||
#### conf\_ubjson\_save\_as 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="conf_ubjson_t_conf_ubjson_save_as">将doc对象保存到指定URL。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t conf_ubjson_save_as (object_t* obj, const char* url);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败 |
|
||||
| obj | object\_t* | doc对象。 |
|
||||
| url | const char* | 保存的位置。 |
|
138
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/crc_t.md
Normal file
138
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/crc_t.md
Normal file
@ -0,0 +1,138 @@
|
||||
## crc\_t
|
||||
### 概述
|
||||
crc相关函数。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="crc_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#crc_t_tk_chksum">tk\_chksum</a> | 计算检验和。 |
|
||||
| <a href="#crc_t_tk_chksum_byte">tk\_chksum\_byte</a> | 计算单子节的检验和。 |
|
||||
| <a href="#crc_t_tk_crc16">tk\_crc16</a> | 计算crc16。 |
|
||||
| <a href="#crc_t_tk_crc16_byte">tk\_crc16\_byte</a> | 计算单子节的crc16。 |
|
||||
| <a href="#crc_t_tk_crc32">tk\_crc32</a> | 计算crc32。 |
|
||||
| <a href="#crc_t_tk_crc32_byte">tk\_crc32\_byte</a> | 计算单子节的crc32。 |
|
||||
#### tk\_chksum 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="crc_t_tk_chksum">计算检验和。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint16_t tk_chksum (uint16_t sum, const uint8_t* data, int size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint16\_t | 返回计算结果。 |
|
||||
| sum | uint16\_t | 初始值(一般用INITCHECKSUM) |
|
||||
| data | const uint8\_t* | 数据。 |
|
||||
| size | int | 数据长度。 |
|
||||
#### tk\_chksum\_byte 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="crc_t_tk_chksum_byte">计算单子节的检验和。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint16_t tk_chksum_byte (uint16_t sum, uint8_t data);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint16\_t | 返回计算结果。 |
|
||||
| sum | uint16\_t | 初始值(一般用0,或者之前的值) |
|
||||
| data | uint8\_t | 数据。 |
|
||||
#### tk\_crc16 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="crc_t_tk_crc16">计算crc16。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint16_t tk_crc16 (uint16_t crc, const uint8_t* data, int size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint16\_t | 返回计算结果。 |
|
||||
| crc | uint16\_t | 初始值(一般用PPPINITFCS16) |
|
||||
| data | const uint8\_t* | 数据。 |
|
||||
| size | int | 数据长度。 |
|
||||
#### tk\_crc16\_byte 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="crc_t_tk_crc16_byte">计算单子节的crc16。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint16_t tk_crc16_byte (uint16_t crc, uint8_t data);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint16\_t | 返回计算结果。 |
|
||||
| crc | uint16\_t | 初始值(一般用PPPINITFCS16,或者之前的值) |
|
||||
| data | uint8\_t | 数据。 |
|
||||
#### tk\_crc32 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="crc_t_tk_crc32">计算crc32。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t tk_crc32 (uint32_t crc, const uint8_t* data, int size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 返回计算结果。 |
|
||||
| crc | uint32\_t | 初始值(一般用PPPINITFCS32) |
|
||||
| data | const uint8\_t* | 数据。 |
|
||||
| size | int | 数据长度。 |
|
||||
#### tk\_crc32\_byte 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="crc_t_tk_crc32_byte">计算单子节的crc32。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t tk_crc32_byte (uint32_t crc, uint8_t data);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 返回计算结果。 |
|
||||
| crc | uint32\_t | 初始值(一般用PPPINITFCS32,或者之前的值) |
|
||||
| data | uint8\_t | 数据。 |
|
@ -0,0 +1,51 @@
|
||||
## csv\_file\_object\_t
|
||||
### 概述
|
||||

|
||||
|
||||
将cvs file包装成object对象。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="csv_file_object_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#csv_file_object_t_csv_file_object_create">csv\_file\_object\_create</a> | 将csv_file对象包装成object。 |
|
||||
| <a href="#csv_file_object_t_csv_file_object_get_csv">csv\_file\_object\_get\_csv</a> | 获取csv对象。 |
|
||||
#### csv\_file\_object\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_object_t_csv_file_object_create">将csv_file对象包装成object。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
object_t* csv_file_object_create (csv_file_t* csv);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | object\_t* | 返回对象。 |
|
||||
| csv | csv\_file\_t* | csv对象(由object释放)。 |
|
||||
#### csv\_file\_object\_get\_csv 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_object_t_csv_file_object_get_csv">获取csv对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
csv_file_t* csv_file_object_get_csv (object_t* obj);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | csv\_file\_t* | 返回csv对象。 |
|
||||
| obj | object\_t* | obj对象。 |
|
506
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/csv_file_t.md
Normal file
506
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/csv_file_t.md
Normal file
@ -0,0 +1,506 @@
|
||||
## csv\_file\_t
|
||||
### 概述
|
||||
操作CSV文件。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="csv_file_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#csv_file_t_csv_file_append_row">csv\_file\_append\_row</a> | 追加一行。 |
|
||||
| <a href="#csv_file_t_csv_file_clear">csv\_file\_clear</a> | 保存。 |
|
||||
| <a href="#csv_file_t_csv_file_create">csv\_file\_create</a> | 根据文件创建csv对象。 |
|
||||
| <a href="#csv_file_t_csv_file_create_empty">csv\_file\_create\_empty</a> | 创建空的csv对象。 |
|
||||
| <a href="#csv_file_t_csv_file_create_with_buff">csv\_file\_create\_with\_buff</a> | 根据buff创建csv对象。 |
|
||||
| <a href="#csv_file_t_csv_file_destroy">csv\_file\_destroy</a> | 销毁csv对象。 |
|
||||
| <a href="#csv_file_t_csv_file_get">csv\_file\_get</a> | 获取指定行列的数据。 |
|
||||
| <a href="#csv_file_t_csv_file_get_checked_rows">csv\_file\_get\_checked\_rows</a> | 获取checked行数(包括标题)。 |
|
||||
| <a href="#csv_file_t_csv_file_get_cols">csv\_file\_get\_cols</a> | 获取列数。 |
|
||||
| <a href="#csv_file_t_csv_file_get_rows">csv\_file\_get\_rows</a> | 获取行数(包括标题)。 |
|
||||
| <a href="#csv_file_t_csv_file_get_title">csv\_file\_get\_title</a> | 获取标题(不存在则返回NULL)。 |
|
||||
| <a href="#csv_file_t_csv_file_insert_row">csv\_file\_insert\_row</a> | 插入一行。 |
|
||||
| <a href="#csv_file_t_csv_file_is_row_checked">csv\_file\_is\_row\_checked</a> | 判断指定行是否勾选。 |
|
||||
| <a href="#csv_file_t_csv_file_load_buff">csv\_file\_load\_buff</a> | 从内存加载csv。 |
|
||||
| <a href="#csv_file_t_csv_file_load_file">csv\_file\_load\_file</a> | 从文件加载csv。 |
|
||||
| <a href="#csv_file_t_csv_file_load_file">csv\_file\_load\_file</a> | 保存。 |
|
||||
| <a href="#csv_file_t_csv_file_reload">csv\_file\_reload</a> | 丢弃内存中的修改,重新加载当前文件。 |
|
||||
| <a href="#csv_file_t_csv_file_remove_checked_rows">csv\_file\_remove\_checked\_rows</a> | 删除全部勾选的行。 |
|
||||
| <a href="#csv_file_t_csv_file_remove_row">csv\_file\_remove\_row</a> | 删除指定行。 |
|
||||
| <a href="#csv_file_t_csv_file_save">csv\_file\_save</a> | 保存。 |
|
||||
| <a href="#csv_file_t_csv_file_set">csv\_file\_set</a> | 修改指定行列的数据。 |
|
||||
| <a href="#csv_file_t_csv_file_set_filter">csv\_file\_set\_filter</a> | 设置过滤函数。 |
|
||||
| <a href="#csv_file_t_csv_file_set_row_checked">csv\_file\_set\_row\_checked</a> | 勾选指定行。 |
|
||||
### 属性
|
||||
<p id="csv_file_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#csv_file_t_has_title">has\_title</a> | bool\_t | 是否有标题。 |
|
||||
#### csv\_file\_append\_row 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_append_row">追加一行。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_append_row (csv_file_t* csv, const char* data);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| data | const char* | 数据。 |
|
||||
#### csv\_file\_clear 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_clear">保存。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_clear (csv_file_t* csv, const char* filename);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| filename | const char* | 文件名。 |
|
||||
#### csv\_file\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_create">根据文件创建csv对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
csv_file_t* csv_file_create (const char* filename, char sep);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | csv\_file\_t* | 返回csv对象。 |
|
||||
| filename | const char* | 文件名。 |
|
||||
| sep | char | 分隔符。 |
|
||||
#### csv\_file\_create\_empty 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_create_empty">创建空的csv对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
csv_file_t* csv_file_create_empty (char sep, csv_file_filter_t filter, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | csv\_file\_t* | 返回csv对象。 |
|
||||
| sep | char | 分隔符。 |
|
||||
| filter | csv\_file\_filter\_t | 过滤函数。 |
|
||||
| ctx | void* | 过滤函数的上下文。 |
|
||||
#### csv\_file\_create\_with\_buff 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_create_with_buff">根据buff创建csv对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
csv_file_t csv_file_create_with_buff (const char* buff, uint32_t size, char sep);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | csv\_file\_t | 返回csv对象。 |
|
||||
| buff | const char* | 数据。 |
|
||||
| size | uint32\_t | 数据长度。 |
|
||||
| sep | char | 分隔符。 |
|
||||
#### csv\_file\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_destroy">销毁csv对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_destroy (csv_file_t* csv);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
#### csv\_file\_get 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_get">获取指定行列的数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* csv_file_get (csv_file_t* csv, uint32_t row, uint32_t col);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回数据。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| row | uint32\_t | 行号。 |
|
||||
| col | uint32\_t | 列号。 |
|
||||
#### csv\_file\_get\_checked\_rows 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_get_checked_rows">获取checked行数(包括标题)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t csv_file_get_checked_rows (csv_file_t* csv);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 返回checked行数。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
#### csv\_file\_get\_cols 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_get_cols">获取列数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t csv_file_get_cols (csv_file_t* csv);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 返回列数。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
#### csv\_file\_get\_rows 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_get_rows">获取行数(包括标题)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t csv_file_get_rows (csv_file_t* csv);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 返回行数。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
#### csv\_file\_get\_title 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_get_title">获取标题(不存在则返回NULL)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* csv_file_get_title (csv_file_t* csv);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回标题。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
#### csv\_file\_insert\_row 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_insert_row">插入一行。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_insert_row (csv_file_t* csv, uint32_t row, const char* data);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| row | uint32\_t | 行号。 |
|
||||
| data | const char* | 数据。 |
|
||||
#### csv\_file\_is\_row\_checked 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_is_row_checked">判断指定行是否勾选。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t csv_file_is_row_checked (csv_file_t* csv, uint32_t row);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示勾选,否则表示没勾选。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| row | uint32\_t | 行号。 |
|
||||
#### csv\_file\_load\_buff 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_load_buff">从内存加载csv。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_load_buff (csv_file_t* csv, const char* buff, uint32_t size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| buff | const char* | 数据。 |
|
||||
| size | uint32\_t | 数据长度。 |
|
||||
#### csv\_file\_load\_file 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_load_file">从文件加载csv。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_load_file (csv_file_t* csv, const char* filename);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| filename | const char* | 文件名。 |
|
||||
#### csv\_file\_load\_file 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_load_file">保存。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_load_file (csv_file_t* csv, const char* filename);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| filename | const char* | 文件名。 |
|
||||
#### csv\_file\_reload 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_reload">丢弃内存中的修改,重新加载当前文件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_reload (csv_file_t* csv);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
#### csv\_file\_remove\_checked\_rows 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_remove_checked_rows">删除全部勾选的行。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_remove_checked_rows (csv_file_t* csv);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
#### csv\_file\_remove\_row 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_remove_row">删除指定行。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_remove_row (csv_file_t* csv, uint32_t row);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| row | uint32\_t | 行号。 |
|
||||
#### csv\_file\_save 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_save">保存。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_save (csv_file_t* csv, const char* filename);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| filename | const char* | 文件名。 |
|
||||
#### csv\_file\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_set">修改指定行列的数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_set (csv_file_t* csv, uint32_t row, uint32_t col, const char* value);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| row | uint32\_t | 行号。 |
|
||||
| col | uint32\_t | 列号。 |
|
||||
| value | const char* | 值。 |
|
||||
#### csv\_file\_set\_filter 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_set_filter">设置过滤函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_set_filter (csv_file_t* csv, csv_file_filter_t filter, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| filter | csv\_file\_filter\_t | 过滤函数。 |
|
||||
| ctx | void* | 过滤函数的上下文。 |
|
||||
#### csv\_file\_set\_row\_checked 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="csv_file_t_csv_file_set_row_checked">勾选指定行。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t csv_file_set_row_checked (csv_file_t* csv, uint32_t row, bool_t checked);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| csv | csv\_file\_t* | csv对象。 |
|
||||
| row | uint32\_t | 行号。 |
|
||||
| checked | bool\_t | 是否勾选。 |
|
||||
#### has\_title 属性
|
||||
-----------------------
|
||||
> <p id="csv_file_t_has_title">是否有标题。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
@ -0,0 +1,5 @@
|
||||
## custom\_prop\_t
|
||||
### 概述
|
||||
widget自定义属性。
|
||||
|
||||
----------------------------------
|
102
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/custom_props_t.md
Normal file
102
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/custom_props_t.md
Normal file
@ -0,0 +1,102 @@
|
||||
## custom\_props\_t
|
||||
### 概述
|
||||
widget自定义属性集合。
|
||||
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="custom_props_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#custom_props_t_custom_props_create">custom\_props\_create</a> | 创建custom_props对象 |
|
||||
| <a href="#custom_props_t_custom_props_destroy">custom\_props\_destroy</a> | 销毁属性集合。 |
|
||||
| <a href="#custom_props_t_custom_props_get">custom\_props\_get</a> | 获取属性的值。 |
|
||||
| <a href="#custom_props_t_custom_props_set">custom\_props\_set</a> | 设置属性的值。 |
|
||||
#### custom\_props\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="custom_props_t_custom_props_create"> 创建custom_props对象
|
||||
|
||||
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
custom_props_t* custom_props_create (uint32_t capacity);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | custom\_props\_t* | custom\_props对象。 |
|
||||
| capacity | uint32\_t | 初始容量。 |
|
||||
#### custom\_props\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="custom_props_t_custom_props_destroy"> 销毁属性集合。
|
||||
|
||||
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t custom_props_destroy (custom_props_t props);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| props | custom\_props\_t | 属性集合对象。 |
|
||||
#### custom\_props\_get 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="custom_props_t_custom_props_get"> 获取属性的值。
|
||||
|
||||
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t custom_props_get (custom_props_t props, char* name, value_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| props | custom\_props\_t | 属性集合对象。 |
|
||||
| name | char* | 属性的名称。 |
|
||||
| v | value\_t* | 用于返回属性的值。 |
|
||||
#### custom\_props\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="custom_props_t_custom_props_set"> 设置属性的值。
|
||||
|
||||
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t custom_props_set (custom_props_t props, char* name, value_t* v);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| props | custom\_props\_t | 属性集合对象。 |
|
||||
| name | char* | 属性的名称。 |
|
||||
| v | value\_t* | 属性的值。 |
|
561
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/darray_t.md
Normal file
561
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/darray_t.md
Normal file
@ -0,0 +1,561 @@
|
||||
## darray\_t
|
||||
### 概述
|
||||
动态数组,根据元素个数动态调整数组的容量。
|
||||
|
||||
用darray\_init初始化时,用darray\_deinit释放。如:
|
||||
|
||||
```c
|
||||
darray_t darray;
|
||||
darray_init(&darray, 10, destroy, compare);
|
||||
...
|
||||
darray_deinit(&darray);
|
||||
```
|
||||
|
||||
用darray\_create创建时,用darray\_destroy销毁。如:
|
||||
|
||||
```c
|
||||
darray_t* darray = darray_create(10, destroy, compare);
|
||||
...
|
||||
darray_destroy(darray);
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="darray_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#darray_t_darray_bsearch">darray\_bsearch</a> | 二分查找(确保数组有序)。 |
|
||||
| <a href="#darray_t_darray_bsearch_index">darray\_bsearch\_index</a> | 二分查找(确保数组有序)。 |
|
||||
| <a href="#darray_t_darray_clear">darray\_clear</a> | 清除全部元素。 |
|
||||
| <a href="#darray_t_darray_count">darray\_count</a> | 返回满足条件元素的个数。 |
|
||||
| <a href="#darray_t_darray_create">darray\_create</a> | 创建darray对象。 |
|
||||
| <a href="#darray_t_darray_deinit">darray\_deinit</a> | 清除全部元素,并释放elms。 |
|
||||
| <a href="#darray_t_darray_destroy">darray\_destroy</a> | 销毁darray对象。 |
|
||||
| <a href="#darray_t_darray_find">darray\_find</a> | 查找第一个满足条件的元素。 |
|
||||
| <a href="#darray_t_darray_find_all">darray\_find\_all</a> | 查找全部满足条件的元素。 |
|
||||
| <a href="#darray_t_darray_find_index">darray\_find\_index</a> | 查找第一个满足条件的元素,并返回位置。 |
|
||||
| <a href="#darray_t_darray_foreach">darray\_foreach</a> | 遍历元素。 |
|
||||
| <a href="#darray_t_darray_get">darray\_get</a> | 获取指定序数的元素。 |
|
||||
| <a href="#darray_t_darray_head">darray\_head</a> | 返回第一个元素。 |
|
||||
| <a href="#darray_t_darray_init">darray\_init</a> | 初始化darray对象。 |
|
||||
| <a href="#darray_t_darray_insert">darray\_insert</a> | 插入一个元素。 |
|
||||
| <a href="#darray_t_darray_pop">darray\_pop</a> | 弹出最后一个元素。 |
|
||||
| <a href="#darray_t_darray_push">darray\_push</a> | 在尾巴追加一个元素。 |
|
||||
| <a href="#darray_t_darray_remove">darray\_remove</a> | 删除第一个满足条件的元素。 |
|
||||
| <a href="#darray_t_darray_remove_all">darray\_remove\_all</a> | 删除全部满足条件的元素。 |
|
||||
| <a href="#darray_t_darray_remove_index">darray\_remove\_index</a> | 删除指定位置的元素。 |
|
||||
| <a href="#darray_t_darray_sort">darray\_sort</a> | 排序。 |
|
||||
| <a href="#darray_t_darray_tail">darray\_tail</a> | 返回最后一个元素。 |
|
||||
### 属性
|
||||
<p id="darray_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#darray_t_capacity">capacity</a> | uint32\_t | 数组的容量大小。 |
|
||||
| <a href="#darray_t_compare">compare</a> | tk\_compare\_t | 元素比较函数。 |
|
||||
| <a href="#darray_t_destroy">destroy</a> | tk\_destroy\_t | 元素销毁函数。 |
|
||||
| <a href="#darray_t_elms">elms</a> | void** | 数组中的元素。 |
|
||||
| <a href="#darray_t_size">size</a> | uint32\_t | 数组中元素的个数。 |
|
||||
#### darray\_bsearch 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_bsearch">二分查找(确保数组有序)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void* darray_bsearch (darray_t* darray, tk_compare_t cmp, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void* | 如果找到,返回满足条件的对象,否则返回NULL。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| cmp | tk\_compare\_t | 比较函数,为NULL则使用内置的比较函数。 |
|
||||
| ctx | void* | 比较函数的上下文。 |
|
||||
#### darray\_bsearch\_index 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_bsearch_index">二分查找(确保数组有序)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t darray_bsearch_index (darray_t* darray, tk_compare_t cmp, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 如果找到,返回满足条件的对象的位置,否则返回-1。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| cmp | tk\_compare\_t | 比较函数,为NULL则使用内置的比较函数。 |
|
||||
| ctx | void* | 比较函数的上下文。 |
|
||||
#### darray\_clear 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_clear">清除全部元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_clear (darray_t* darray);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
#### darray\_count 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_count">返回满足条件元素的个数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t darray_count (darray_t* darray, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 返回元素个数。 |
|
||||
| darray | darray\_t* | 单向链表对象。 |
|
||||
| ctx | void* | 比较函数的上下文。 |
|
||||
#### darray\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_create">创建darray对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
darray_t* darray_create (uint32_t capacity, tk_destroy_t destroy, tk_compare_t compare);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | darray\_t* | 数组对象。 |
|
||||
| capacity | uint32\_t | 数组的初始容量。 |
|
||||
| destroy | tk\_destroy\_t | 元素销毁函数。 |
|
||||
| compare | tk\_compare\_t | 元素比较函数。 |
|
||||
#### darray\_deinit 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_deinit">清除全部元素,并释放elms。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_deinit (darray_t* darray);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
#### darray\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_destroy">销毁darray对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_destroy (darray_t* darray);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
#### darray\_find 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_find">查找第一个满足条件的元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void* darray_find (darray_t* darray, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void* | 如果找到,返回满足条件的对象,否则返回NULL。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| ctx | void* | 比较函数的上下文。 |
|
||||
#### darray\_find\_all 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_find_all">查找全部满足条件的元素。
|
||||
|
||||
```
|
||||
darray_t matched;
|
||||
darray_init(&matched, 0, NULL, NULL);
|
||||
darray_find_all(darray, mycmp, myctx, &matched);
|
||||
...
|
||||
darray_deinit(&matched);
|
||||
|
||||
```
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_find_all (darray_t* darray, tk_compare_t cmp, void* ctx, darray_t* matched);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| cmp | tk\_compare\_t | 比较函数,为NULL则使用内置的比较函数。 |
|
||||
| ctx | void* | 比较函数的上下文。 |
|
||||
| matched | darray\_t* | 返回满足条件的元素。 |
|
||||
#### darray\_find\_index 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_find_index">查找第一个满足条件的元素,并返回位置。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t darray_find_index (darray_t* darray, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 如果找到,返回满足条件的对象的位置,否则返回-1。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| ctx | void* | 比较函数的上下文。 |
|
||||
#### darray\_foreach 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_foreach">遍历元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_foreach (darray_t* darray, tk_visit_t visit, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| visit | tk\_visit\_t | 遍历函数。 |
|
||||
| ctx | void* | 遍历函数的上下文。 |
|
||||
#### darray\_get 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_get">获取指定序数的元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void* darray_get (darray_t* darray, uint32_t index);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void* | 返回满足条件的对象,否则返回NULL。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| index | uint32\_t | 序数。 |
|
||||
#### darray\_head 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_head">返回第一个元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void* darray_head (darray_t* darray);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void* | 成功返回最后一个元素,失败返回NULL。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
#### darray\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_init">初始化darray对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
darray_t* darray_init (darray_t* darray, uint32_t capacity, tk_destroy_t destroy, tk_compare_t compare);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | darray\_t* | 数组对象。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| capacity | uint32\_t | 数组的初始容量。 |
|
||||
| destroy | tk\_destroy\_t | 元素销毁函数。 |
|
||||
| compare | tk\_compare\_t | 元素比较函数。 |
|
||||
#### darray\_insert 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_insert">插入一个元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_insert (darray_t* darray, uint32_t index, void* data);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| index | uint32\_t | 位置序数。 |
|
||||
| data | void* | 待插入的元素。 |
|
||||
#### darray\_pop 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_pop">弹出最后一个元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void* darray_pop (darray_t* darray);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void* | 成功返回最后一个元素,失败返回NULL。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
#### darray\_push 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_push">在尾巴追加一个元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_push (darray_t* darray, void* data);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| data | void* | 待追加的元素。 |
|
||||
#### darray\_remove 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_remove">删除第一个满足条件的元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_remove (darray_t* darray, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| ctx | void* | 比较函数的上下文。 |
|
||||
#### darray\_remove\_all 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_remove_all">删除全部满足条件的元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_remove_all (darray_t* darray, tk_compare_t cmp, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| cmp | tk\_compare\_t | 比较函数,为NULL则使用内置的比较函数。 |
|
||||
| ctx | void* | 比较函数的上下文。 |
|
||||
#### darray\_remove\_index 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_remove_index">删除指定位置的元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_remove_index (darray_t* darray, uint32_t index);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| index | uint32\_t | 位置序数。 |
|
||||
#### darray\_sort 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_sort">排序。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t darray_sort (darray_t* darray, tk_compare_t cmp);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
| cmp | tk\_compare\_t | 比较函数,为NULL则使用内置的比较函数。 |
|
||||
#### darray\_tail 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="darray_t_darray_tail">返回最后一个元素。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void* darray_tail (darray_t* darray);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void* | 成功返回最后一个元素,失败返回NULL。 |
|
||||
| darray | darray\_t* | 数组对象。 |
|
||||
#### capacity 属性
|
||||
-----------------------
|
||||
> <p id="darray_t_capacity">数组的容量大小。
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### compare 属性
|
||||
-----------------------
|
||||
> <p id="darray_t_compare">元素比较函数。
|
||||
|
||||
* 类型:tk\_compare\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### destroy 属性
|
||||
-----------------------
|
||||
> <p id="darray_t_destroy">元素销毁函数。
|
||||
|
||||
* 类型:tk\_destroy\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### elms 属性
|
||||
-----------------------
|
||||
> <p id="darray_t_elms">数组中的元素。
|
||||
|
||||
* 类型:void**
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### size 属性
|
||||
-----------------------
|
||||
> <p id="darray_t_size">数组中元素的个数。
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
@ -0,0 +1,10 @@
|
||||
## data\_discard\_policy\_t
|
||||
### 概述
|
||||
缓存不够时丢弃数据的策略。
|
||||
### 常量
|
||||
<p id="data_discard_policy_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| DATA\_DISCARD\_OLD | 丢弃旧的数据。 |
|
||||
| DATA\_DISCARD\_NEW | 丢弃新的数据。 |
|
@ -0,0 +1,59 @@
|
||||
## data\_reader\_asset\_t
|
||||
### 概述
|
||||

|
||||
|
||||
基于资源实现的 data_reader。通过 data_reader_factory 创建 reader 时,URL的格式如下(请用函数data_reader_asset_build_url生成):
|
||||
|
||||
```
|
||||
asset://type/name
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="data_reader_asset_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#data_reader_asset_t_data_reader_asset_build_url">data\_reader\_asset\_build\_url</a> | 构造内存URL。 |
|
||||
| <a href="#data_reader_asset_t_data_reader_asset_create">data\_reader\_asset\_create</a> | 创建基于asset的data reader。 |
|
||||
#### data\_reader\_asset\_build\_url 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_asset_t_data_reader_asset_build_url">构造内存URL。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* data_reader_asset_build_url (const char* name, asset_type_t type, char* url);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回URL。 |
|
||||
| name | const char* | 资源的名称。 |
|
||||
| type | asset\_type\_t | 资源的类型。 |
|
||||
| url | char* | 生成的URL。 |
|
||||
#### data\_reader\_asset\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_asset_t_data_reader_asset_create">创建基于asset的data reader。
|
||||
|
||||
> 不要直接调用,而是注册到 data\_reader\_factory后,通过data\_reader\_factory调用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_reader_t* data_reader_asset_create (const char* assetname);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_reader\_t* | 返回data reader对象。 |
|
||||
| assetname | const char* | 资源的名称。 |
|
@ -0,0 +1,130 @@
|
||||
## data\_reader\_factory\_t
|
||||
### 概述
|
||||
data reader工厂。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="data_reader_factory_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#data_reader_factory_t_data_reader_factory">data\_reader\_factory</a> | 获取缺省的data reader工厂对象。 |
|
||||
| <a href="#data_reader_factory_t_data_reader_factory_create">data\_reader\_factory\_create</a> | 创建data reader工厂对象。 |
|
||||
| <a href="#data_reader_factory_t_data_reader_factory_create_reader">data\_reader\_factory\_create\_reader</a> | 创建指定类型的data reader对象。 |
|
||||
| <a href="#data_reader_factory_t_data_reader_factory_destroy">data\_reader\_factory\_destroy</a> | 析构并释放data reader工厂对象。 |
|
||||
| <a href="#data_reader_factory_t_data_reader_factory_register">data\_reader\_factory\_register</a> | 注册data reader创建函数。 |
|
||||
| <a href="#data_reader_factory_t_data_reader_factory_set">data\_reader\_factory\_set</a> | 设置缺省的data reader工厂对象。 |
|
||||
#### data\_reader\_factory 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_factory_t_data_reader_factory">获取缺省的data reader工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_reader_factory_t* data_reader_factory ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_reader\_factory\_t* | 返回data reader工厂对象。 |
|
||||
#### data\_reader\_factory\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_factory_t_data_reader_factory_create">创建data reader工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_reader_factory_t* data_reader_factory_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_reader\_factory\_t* | 返回data reader工厂对象。 |
|
||||
#### data\_reader\_factory\_create\_reader 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_factory_t_data_reader_factory_create_reader">创建指定类型的data reader对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_reader_t* data_reader_factory_create_reader (data_reader_factory_t* factory, const char* url);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_reader\_t* | 返回data reader对象。 |
|
||||
| factory | data\_reader\_factory\_t* | data reader工厂对象。 |
|
||||
| url | const char* | URL。 |
|
||||
#### data\_reader\_factory\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_factory_t_data_reader_factory_destroy">析构并释放data reader工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_reader_factory_destroy (data_reader_factory_t* factory);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | data\_reader\_factory\_t* | data reader工厂对象。 |
|
||||
#### data\_reader\_factory\_register 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_factory_t_data_reader_factory_register">注册data reader创建函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_reader_factory_register (data_reader_factory_t* factory, const char* protocol, data_reader_create_t create);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | data\_reader\_factory\_t* | reader工厂对象。 |
|
||||
| protocol | const char* | 协议(如file)。 |
|
||||
| create | data\_reader\_create\_t | data reader创建函数。 |
|
||||
#### data\_reader\_factory\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_factory_t_data_reader_factory_set">设置缺省的data reader工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_reader_factory_set (data_reader_factory_t* factory);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | data\_reader\_factory\_t* | data reader工厂对象。 |
|
@ -0,0 +1,36 @@
|
||||
## data\_reader\_file\_t
|
||||
### 概述
|
||||

|
||||
|
||||
基于文件实现的 data_reader。通过 data_reader_factory 创建 reader 时,URL的格式如下(请用函数data_reader_file_build_url生成):
|
||||
|
||||
```
|
||||
file://filename
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="data_reader_file_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#data_reader_file_t_data_reader_file_create">data\_reader\_file\_create</a> | 创建基于文件的data reader。 |
|
||||
#### data\_reader\_file\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_file_t_data_reader_file_create">创建基于文件的data reader。
|
||||
> 不要直接调用,而是注册到 data\_reader\_factory后,通过data\_reader\_factory调用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_reader_t* data_reader_file_create (const char* filename);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_reader\_t* | 返回data reader对象。 |
|
||||
| filename | const char* | 文件名。 |
|
@ -0,0 +1,59 @@
|
||||
## data\_reader\_mem\_t
|
||||
### 概述
|
||||

|
||||
|
||||
基于内存实现的 data_reader。通过 data_reader_factory 创建 reader 时,URL的格式如下(请用函数data_reader_mem_build_url生成):
|
||||
|
||||
```
|
||||
mem://addr:size
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="data_reader_mem_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#data_reader_mem_t_data_reader_mem_build_url">data\_reader\_mem\_build\_url</a> | 构造内存URL。 |
|
||||
| <a href="#data_reader_mem_t_data_reader_mem_create">data\_reader\_mem\_create</a> | 创建基于内存的 data reader。 |
|
||||
#### data\_reader\_mem\_build\_url 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_mem_t_data_reader_mem_build_url">构造内存URL。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* data_reader_mem_build_url (mem_t* mem, uint32_t size, char* url);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回URL。 |
|
||||
| mem | mem\_t* | 内存的地址。 |
|
||||
| size | uint32\_t | 内存的长度。 |
|
||||
| url | char* | 生成的URL。 |
|
||||
#### data\_reader\_mem\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_mem_t_data_reader_mem_create">创建基于内存的 data reader。
|
||||
|
||||
> 不要直接调用,而是注册到 data\_reader\_factory后,通过data\_reader\_factory调用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_reader_t* data_reader_mem_create (const char* memname);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_reader\_t* | 返回data reader对象。 |
|
||||
| memname | const char* | 内存地址和大小的字符串格式表示 。 |
|
@ -0,0 +1,95 @@
|
||||
## data\_reader\_t
|
||||
### 概述
|
||||
数据读取接口。
|
||||
|
||||
>对可读的媒介,如内存、文件、flash、资源和其它媒介提供一个统一的读取接口。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="data_reader_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#data_reader_t_data_reader_destroy">data\_reader\_destroy</a> | 销毁reader对象。 |
|
||||
| <a href="#data_reader_t_data_reader_get_size">data\_reader\_get\_size</a> | 获取数据长度。 |
|
||||
| <a href="#data_reader_t_data_reader_read">data\_reader\_read</a> | 在指定位置读取数据。 |
|
||||
| <a href="#data_reader_t_data_reader_read_all">data\_reader\_read\_all</a> | 从指定的URL读取全部数据。 |
|
||||
#### data\_reader\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_t_data_reader_destroy">销毁reader对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_reader_destroy (data_reader_t* reader);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| reader | data\_reader\_t* | reader对象。 |
|
||||
#### data\_reader\_get\_size 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_t_data_reader_get_size">获取数据长度。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint64_t data_reader_get_size (data_reader_t* reader);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint64\_t | 返回数据长度。 |
|
||||
| reader | data\_reader\_t* | reader对象。 |
|
||||
#### data\_reader\_read 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_t_data_reader_read">在指定位置读取数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t data_reader_read (data_reader_t* reader, uint64_t offset, void* data, uint32_t size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 返回实际读取数据的长度。 |
|
||||
| reader | data\_reader\_t* | reader对象。 |
|
||||
| offset | uint64\_t | 偏移量。 |
|
||||
| data | void* | 用于读取数据的缓冲区。 |
|
||||
| size | uint32\_t | 最大读取数据长度。 |
|
||||
#### data\_reader\_read\_all 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_reader_t_data_reader_read_all">从指定的URL读取全部数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
void* data_reader_read_all (const char* url, uint32_t* size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | void* | 返回全部数据,调用者需要调用TKMEM\_FREE释放返回值。 |
|
||||
| url | const char* | URL。 |
|
||||
| size | uint32\_t* | 返回数据长度。 |
|
@ -0,0 +1,130 @@
|
||||
## data\_writer\_factory\_t
|
||||
### 概述
|
||||
data writer工厂。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="data_writer_factory_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#data_writer_factory_t_data_writer_factory">data\_writer\_factory</a> | 获取缺省的data writer工厂对象。 |
|
||||
| <a href="#data_writer_factory_t_data_writer_factory_create">data\_writer\_factory\_create</a> | 创建data writer工厂对象。 |
|
||||
| <a href="#data_writer_factory_t_data_writer_factory_create_writer">data\_writer\_factory\_create\_writer</a> | 创建指定类型的data writer对象。 |
|
||||
| <a href="#data_writer_factory_t_data_writer_factory_destroy">data\_writer\_factory\_destroy</a> | 析构并释放data writer工厂对象。 |
|
||||
| <a href="#data_writer_factory_t_data_writer_factory_register">data\_writer\_factory\_register</a> | 注册data writer创建函数。 |
|
||||
| <a href="#data_writer_factory_t_data_writer_factory_set">data\_writer\_factory\_set</a> | 设置缺省的data writer工厂对象。 |
|
||||
#### data\_writer\_factory 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_factory_t_data_writer_factory">获取缺省的data writer工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_writer_factory_t* data_writer_factory ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_writer\_factory\_t* | 返回data writer工厂对象。 |
|
||||
#### data\_writer\_factory\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_factory_t_data_writer_factory_create">创建data writer工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_writer_factory_t* data_writer_factory_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_writer\_factory\_t* | 返回data writer工厂对象。 |
|
||||
#### data\_writer\_factory\_create\_writer 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_factory_t_data_writer_factory_create_writer">创建指定类型的data writer对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_writer_t* data_writer_factory_create_writer (data_writer_factory_t* factory, const char* url);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_writer\_t* | 返回data writer对象。 |
|
||||
| factory | data\_writer\_factory\_t* | data writer工厂对象。 |
|
||||
| url | const char* | URL。 |
|
||||
#### data\_writer\_factory\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_factory_t_data_writer_factory_destroy">析构并释放data writer工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_writer_factory_destroy (data_writer_factory_t* factory);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | data\_writer\_factory\_t* | data writer工厂对象。 |
|
||||
#### data\_writer\_factory\_register 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_factory_t_data_writer_factory_register">注册data writer创建函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_writer_factory_register (data_writer_factory_t* factory, const char* protocol, data_writer_create_t create);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | data\_writer\_factory\_t* | writer工厂对象。 |
|
||||
| protocol | const char* | 协议(如file)。 |
|
||||
| create | data\_writer\_create\_t | data writer创建函数。 |
|
||||
#### data\_writer\_factory\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_factory_t_data_writer_factory_set">设置缺省的data writer工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_writer_factory_set (data_writer_factory_t* factory);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | data\_writer\_factory\_t* | data writer工厂对象。 |
|
@ -0,0 +1,37 @@
|
||||
## data\_writer\_file\_t
|
||||
### 概述
|
||||

|
||||
|
||||
基于文件实现的 data_writer。通过 data_writer_factory 创建 writer 时,URL的格式如下:
|
||||
|
||||
```
|
||||
file://filename
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="data_writer_file_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#data_writer_file_t_data_writer_file_create">data\_writer\_file\_create</a> | 创建基于文件的data writer。 |
|
||||
#### data\_writer\_file\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_file_t_data_writer_file_create">创建基于文件的data writer。
|
||||
|
||||
> 不要直接调用,而是注册到 data\_writer\_factory后,通过data\_writer\_factory调用
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_writer_t* data_writer_file_create (const char* filename);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_writer\_t* | 返回data writer对象。 |
|
||||
| filename | const char* | 文件名。 |
|
115
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/data_writer_t.md
Normal file
115
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/data_writer_t.md
Normal file
@ -0,0 +1,115 @@
|
||||
## data\_writer\_t
|
||||
### 概述
|
||||
数据写入接口。
|
||||
|
||||
>对可写的媒介,如内存、文件、flash和其它媒介提供一个统一的写入接口。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="data_writer_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#data_writer_t_data_writer_clear">data\_writer\_clear</a> | 清除指定URL的数据。 |
|
||||
| <a href="#data_writer_t_data_writer_destroy">data\_writer\_destroy</a> | 销毁writer对象。 |
|
||||
| <a href="#data_writer_t_data_writer_flush">data\_writer\_flush</a> | flush数据。 |
|
||||
| <a href="#data_writer_t_data_writer_truncate">data\_writer\_truncate</a> | 截去指定长度之后的数据。 |
|
||||
| <a href="#data_writer_t_data_writer_write">data\_writer\_write</a> | 在指定位置写入数据。 |
|
||||
#### data\_writer\_clear 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_t_data_writer_clear">清除指定URL的数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_writer_clear (const char* url);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| url | const char* | URL。 |
|
||||
#### data\_writer\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_t_data_writer_destroy">销毁writer对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_writer_destroy (data_writer_t* writer);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| writer | data\_writer\_t* | writer对象。 |
|
||||
#### data\_writer\_flush 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_t_data_writer_flush">flush数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_writer_flush (data_writer_t* writer);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| writer | data\_writer\_t* | writer对象。 |
|
||||
#### data\_writer\_truncate 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_t_data_writer_truncate">截去指定长度之后的数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t data_writer_truncate (data_writer_t* writer, uint64_t size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| writer | data\_writer\_t* | writer对象。 |
|
||||
| size | uint64\_t | 保留长度。 |
|
||||
#### data\_writer\_write 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_t_data_writer_write">在指定位置写入数据。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t data_writer_write (data_writer_t* writer, uint64_t offset, const void* data, uint32_t size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 返回实际读取数据的长度。 |
|
||||
| writer | data\_writer\_t* | writer对象。 |
|
||||
| offset | uint64\_t | 偏移量。 |
|
||||
| data | const void* | 数据缓冲区。 |
|
||||
| size | uint32\_t | 数据长度。 |
|
@ -0,0 +1,58 @@
|
||||
## data\_writer\_wbuffer\_t
|
||||
### 概述
|
||||

|
||||
|
||||
基于内存实现的 data_writer。通过 data_writer_factory 创建 writer 时,URL的格式如下(请用函数data_writer_wbuffer_build_url生成):
|
||||
|
||||
```
|
||||
wbuffer://addr
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="data_writer_wbuffer_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#data_writer_wbuffer_t_data_writer_wbuffer_build_url">data\_writer\_wbuffer\_build\_url</a> | 构造wbuffer的URL。 |
|
||||
| <a href="#data_writer_wbuffer_t_data_writer_wbuffer_create">data\_writer\_wbuffer\_create</a> | 创建基于wbuffer的data writer。 |
|
||||
#### data\_writer\_wbuffer\_build\_url 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_wbuffer_t_data_writer_wbuffer_build_url">构造wbuffer的URL。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* data_writer_wbuffer_build_url (wbuffer_t* wbuffer, char* url);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回URL。 |
|
||||
| wbuffer | wbuffer\_t* | wbuffer对象。 |
|
||||
| url | char* | 生成的URL。 |
|
||||
#### data\_writer\_wbuffer\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="data_writer_wbuffer_t_data_writer_wbuffer_create">创建基于wbuffer的data writer。
|
||||
|
||||
> 不要直接调用,而是注册到 data\_writer\_factory后,通过data\_writer\_factory调用
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
data_writer_t* data_writer_wbuffer_create (const char* wbuffer_name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | data\_writer\_t* | 返回data writer对象。 |
|
||||
| wbuffer\_name | const char* | wbuffer地址的字符串格式表示 。 |
|
@ -0,0 +1,76 @@
|
||||
## date\_time\_format\_t
|
||||
### 概述
|
||||
格式化日期时间。
|
||||
|
||||
格式规则:
|
||||
* Y 代表年(完整显示)
|
||||
* M 代表月(1-12)
|
||||
* D 代表日(1-31)
|
||||
* h 代表时(0-23)
|
||||
* m 代表分(0-59)
|
||||
* s 代表秒(0-59)
|
||||
* w 代表星期(0-6)
|
||||
* W 代表星期的英文缩写(支持翻译)
|
||||
* YY 代表年(只显示末两位)
|
||||
* MM 代表月(01-12)
|
||||
* DD 代表日(01-31)
|
||||
* hh 代表时(00-23)
|
||||
* mm 代表分(00-59)
|
||||
* ss 代表秒(00-59)
|
||||
* MMM 代表月的英文缩写(支持翻译)
|
||||
|
||||
如 日期时间为:2018/11/12 9:10:20
|
||||
* "Y/M/D"显示为"2018/11/12"
|
||||
* "Y-M-D"显示为"2018-11-12"
|
||||
* "Y-M-D h:m:s"显示为"2018-11-12 9:10:20"
|
||||
* "Y-M-D hh:mm:ss"显示为"2018-11-12 09:10:20"
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="date_time_format_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#date_time_format_t_wstr_format_date_time">wstr\_format\_date\_time</a> | 格式化date_time。 |
|
||||
| <a href="#date_time_format_t_wstr_format_time">wstr\_format\_time</a> | 格式化time。 |
|
||||
#### wstr\_format\_date\_time 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_format_t_wstr_format_date_time">格式化date_time。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t wstr_format_date_time (wstr_t* str, const char* format, date_time_t* dt);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| str | wstr\_t* | 输出字符串。 |
|
||||
| format | const char* | 格式。 |
|
||||
| dt | date\_time\_t* | 时间。 |
|
||||
#### wstr\_format\_time 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_format_t_wstr_format_time">格式化time。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t wstr_format_time (wstr_t* str, const char* format, uint64_t time);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| str | wstr\_t* | 输出字符串。 |
|
||||
| format | const char* | 格式。 |
|
||||
| time | uint64\_t | 时间。 |
|
492
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/date_time_t.md
Normal file
492
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/date_time_t.md
Normal file
@ -0,0 +1,492 @@
|
||||
## date\_time\_t
|
||||
### 概述
|
||||
日期时间。
|
||||
|
||||
> 在嵌入式平台中,在系统初始时,需要调用date\_time\_global\_init设置实际获取/设置系统时间的函数。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="date_time_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#date_time_t_date_time_add_delta">date\_time\_add\_delta</a> | 加上一个偏移量(s)。 |
|
||||
| <a href="#date_time_t_date_time_create">date\_time\_create</a> | 创建date_time对象,并初始为当前日期和时间(一般供脚本语言中使用)。 |
|
||||
| <a href="#date_time_t_date_time_destroy">date\_time\_destroy</a> | 销毁date_time对象(一般供脚本语言中使用)。 |
|
||||
| <a href="#date_time_t_date_time_from_time">date\_time\_from\_time</a> | 从time转换而来。 |
|
||||
| <a href="#date_time_t_date_time_get_days">date\_time\_get\_days</a> | 获取指定年份月份的天数。 |
|
||||
| <a href="#date_time_t_date_time_get_month_name">date\_time\_get\_month\_name</a> | 获取指定月份的英文名称(简写)。 |
|
||||
| <a href="#date_time_t_date_time_get_wday">date\_time\_get\_wday</a> | 获取指定日期是周几(0-6, Sunday = 0)。。 |
|
||||
| <a href="#date_time_t_date_time_get_wday_name">date\_time\_get\_wday\_name</a> | 获取周几的英文名称(简写)。 |
|
||||
| <a href="#date_time_t_date_time_global_init_ex">date\_time\_global\_init\_ex</a> | 时间日期全局初始化。 |
|
||||
| <a href="#date_time_t_date_time_init">date\_time\_init</a> | 初始为当前日期和时间。 |
|
||||
| <a href="#date_time_t_date_time_is_leap">date\_time\_is\_leap</a> | 是否是闰年。 |
|
||||
| <a href="#date_time_t_date_time_set">date\_time\_set</a> | 设置当前时间。 |
|
||||
| <a href="#date_time_t_date_time_set_day">date\_time\_set\_day</a> | 设置日。 |
|
||||
| <a href="#date_time_t_date_time_set_hour">date\_time\_set\_hour</a> | 设置小时。 |
|
||||
| <a href="#date_time_t_date_time_set_minute">date\_time\_set\_minute</a> | 设置分钟。 |
|
||||
| <a href="#date_time_t_date_time_set_month">date\_time\_set\_month</a> | 设置月。 |
|
||||
| <a href="#date_time_t_date_time_set_second">date\_time\_set\_second</a> | 设置秒。 |
|
||||
| <a href="#date_time_t_date_time_set_year">date\_time\_set\_year</a> | 设置年。 |
|
||||
| <a href="#date_time_t_date_time_to_time">date\_time\_to\_time</a> | 转换成time。 |
|
||||
### 属性
|
||||
<p id="date_time_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#date_time_t_day">day</a> | int32\_t | 日(1-31)。 |
|
||||
| <a href="#date_time_t_hour">hour</a> | int32\_t | 时(0 - 23)。 |
|
||||
| <a href="#date_time_t_minute">minute</a> | int32\_t | 分(0 - 59)。 |
|
||||
| <a href="#date_time_t_month">month</a> | int32\_t | 月(1-12)。 |
|
||||
| <a href="#date_time_t_second">second</a> | int32\_t | 秒(0 - 59)。 |
|
||||
| <a href="#date_time_t_wday">wday</a> | int32\_t | 星期几(0-6, Sunday = 0)。 |
|
||||
| <a href="#date_time_t_year">year</a> | int32\_t | 年。 |
|
||||
#### date\_time\_add\_delta 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_add_delta">加上一个偏移量(s)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_add_delta (date_time_t* dt, int64_t delta);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
| delta | int64\_t | 偏移量(s)。 |
|
||||
#### date\_time\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_create">创建date_time对象,并初始为当前日期和时间(一般供脚本语言中使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
date_time_t* date_time_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | date\_time\_t* | 返回date\_time对象。 |
|
||||
#### date\_time\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_destroy">销毁date_time对象(一般供脚本语言中使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_destroy (date_time_t* dt);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
#### date\_time\_from\_time 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_from_time">从time转换而来。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_from_time (date_time_t* dt, uint64_t time);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
| time | uint64\_t | 时间。 |
|
||||
#### date\_time\_get\_days 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_get_days">获取指定年份月份的天数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t date_time_get_days (uint32_t year, uint32_t montn);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 返回大于0表示天数,否则表示失败。 |
|
||||
| year | uint32\_t | 年份。 |
|
||||
| montn | uint32\_t | 月份(1-12)。 |
|
||||
#### date\_time\_get\_month\_name 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_get_month_name">获取指定月份的英文名称(简写)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* date_time_get_month_name (uint32_t montn);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回指定月份的英文名称(简写)。 |
|
||||
| montn | uint32\_t | 月份(1-12)。 |
|
||||
#### date\_time\_get\_wday 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_get_wday">获取指定日期是周几(0-6, Sunday = 0)。。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
int32_t date_time_get_wday (uint32_t year, uint32_t montn, uint32_t day);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | int32\_t | 返回大于等于0表示周几(0-6),否则表示失败。 |
|
||||
| year | uint32\_t | 年份。 |
|
||||
| montn | uint32\_t | 月份(1-12)。 |
|
||||
| day | uint32\_t | 日(1-31)。 |
|
||||
#### date\_time\_get\_wday\_name 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_get_wday_name">获取周几的英文名称(简写)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const char* date_time_get_wday_name (uint32_t wday);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const char* | 返回指定周几的英文名称(简写)。 |
|
||||
| wday | uint32\_t | 星期几(0-6, Sunday = 0)。 |
|
||||
#### date\_time\_global\_init\_ex 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_global_init_ex">时间日期全局初始化。
|
||||
|
||||
> 嵌入式平台需要提供并设置获取当前日期和时间的函数,否则相关的功能(如时钟控件)将无法正常工作。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_global_init_ex (date_time_vtable_t vt);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| vt | date\_time\_vtable\_t | 日期和时间的相关函数的实现。 |
|
||||
#### date\_time\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_init">初始为当前日期和时间。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
date_time_t* date_time_init (date_time_t* dt);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | date\_time\_t* | 返回date\_time对象。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
#### date\_time\_is\_leap 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_is_leap">是否是闰年。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t date_time_is_leap (uint32_t year);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示是,否则表示否。 |
|
||||
| year | uint32\_t | 年份。 |
|
||||
#### date\_time\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_set">设置当前时间。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_set (date_time_t* dt);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
#### date\_time\_set\_day 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_set_day">设置日。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_set_day (date_time_t* dt, uint32_t day);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
| day | uint32\_t | 日。 |
|
||||
#### date\_time\_set\_hour 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_set_hour">设置小时。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_set_hour (date_time_t* dt, uint32_t hour);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
| hour | uint32\_t | 小时。 |
|
||||
#### date\_time\_set\_minute 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_set_minute">设置分钟。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_set_minute (date_time_t* dt, uint32_t minute);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
| minute | uint32\_t | 分钟。 |
|
||||
#### date\_time\_set\_month 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_set_month">设置月。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_set_month (date_time_t* dt, uint32_t month);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
| month | uint32\_t | 月。 |
|
||||
#### date\_time\_set\_second 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_set_second">设置秒。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_set_second (date_time_t* dt, uint32_t second);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
| second | uint32\_t | 秒。 |
|
||||
#### date\_time\_set\_year 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_set_year">设置年。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t date_time_set_year (date_time_t* dt, uint32_t year);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
| year | uint32\_t | 年。 |
|
||||
#### date\_time\_to\_time 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="date_time_t_date_time_to_time">转换成time。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint64_t date_time_to_time (date_time_t* dt);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint64\_t | 返回time。 |
|
||||
| dt | date\_time\_t* | date\_time对象。 |
|
||||
#### day 属性
|
||||
-----------------------
|
||||
> <p id="date_time_t_day">日(1-31)。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### hour 属性
|
||||
-----------------------
|
||||
> <p id="date_time_t_hour">时(0 - 23)。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### minute 属性
|
||||
-----------------------
|
||||
> <p id="date_time_t_minute">分(0 - 59)。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### month 属性
|
||||
-----------------------
|
||||
> <p id="date_time_t_month">月(1-12)。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### second 属性
|
||||
-----------------------
|
||||
> <p id="date_time_t_second">秒(0 - 59)。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### wday 属性
|
||||
-----------------------
|
||||
> <p id="date_time_t_wday">星期几(0-6, Sunday = 0)。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
||||
#### year 属性
|
||||
-----------------------
|
||||
> <p id="date_time_t_year">年。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
@ -0,0 +1,76 @@
|
||||
## dialog\_client\_t
|
||||
### 概述
|
||||

|
||||
|
||||
对话框客户区控件。
|
||||
|
||||
它本身不提供布局功能,仅提供具有语义的标签,让xml更具有可读性。
|
||||
子控件的布局可用layout\_children属性指定。
|
||||
请参考[布局参数](https://github.com/zlgopen/awtk/blob/master/docs/layout.md)。
|
||||
|
||||
dialog\_client\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于dialog\_client\_t控件。
|
||||
|
||||
在xml中使用"dialog\_client"标签创建dialog\_client。如:
|
||||
|
||||
```xml
|
||||
<dialog anim_hint="center_scale(duration=300)" x="c" y="m" w="80%" h="160" text="Dialog">
|
||||
<dialog_title x="0" y="0" w="100%" h="30" text="Hello AWTK" />
|
||||
<dialog_client x="0" y="bottom" w="100%" h="-30">
|
||||
<label name="" x="center" y="middle:-20" w="200" h="30" text="Are you ready?"/>
|
||||
<button name="quit" x="10" y="bottom:10" w="40%" h="30" text="确定"/>
|
||||
<button name="quit" x="right:10" y="bottom:10" w="40%" h="30" text="取消"/>
|
||||
</dialog_client>
|
||||
</dialog>
|
||||
```
|
||||
|
||||
在c代码中,用dialog\_create\_simple创建对话框时,自动创建dialog客户区对象。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="dialog_client_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#dialog_client_t_dialog_client_cast">dialog\_client\_cast</a> | 转换为dialog_client对象(供脚本语言使用)。 |
|
||||
| <a href="#dialog_client_t_dialog_client_create">dialog\_client\_create</a> | 创建dialog客户区对象。 |
|
||||
#### dialog\_client\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_client_t_dialog_client_cast">转换为dialog_client对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dialog_client_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | dialog\_client对象。 |
|
||||
| widget | widget\_t* | dialog\_client对象。 |
|
||||
#### dialog\_client\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_client_t_dialog_client_create">创建dialog客户区对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dialog_client_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | dialog对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
@ -0,0 +1,58 @@
|
||||
## dialog\_highlighter\_default\_t
|
||||
### 概述
|
||||
缺省对话框高亮策略。
|
||||
|
||||
>本策略在背景上画一层半透明的蒙版来高亮(突出)对话框本身。
|
||||
>对于性能不高的平台,建议将start\_alpha和end\_alpha设为相同。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="dialog_highlighter_default_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#dialog_highlighter_default_t_dialog_highlighter_default_create">dialog\_highlighter\_default\_create</a> | 创建缺省的对话框高亮策略。 |
|
||||
### 属性
|
||||
<p id="dialog_highlighter_default_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#dialog_highlighter_default_t_end_alpha">end\_alpha</a> | uint8\_t | 结束alpha,打开对话框的动画结束(直到对话框被关闭)时的alpha值。 |
|
||||
| <a href="#dialog_highlighter_default_t_start_alpha">start\_alpha</a> | uint8\_t | 起始alpha,打开对话框的动画开始时的alpha值。 |
|
||||
| <a href="#dialog_highlighter_default_t_system_bar_alpha">system\_bar\_alpha</a> | uint8\_t | 由于在没有过度动画的情况下,截图中已经包括黑色色块,为了让 system_bar 也同步高亮部分的色块透明。 |
|
||||
#### dialog\_highlighter\_default\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_default_t_dialog_highlighter_default_create">创建缺省的对话框高亮策略。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
dialog_highlighter_t* dialog_highlighter_default_create (object_t* args);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | dialog\_highlighter\_t* | 返回对话框高亮策略对象。 |
|
||||
| args | object\_t* | 参数。 |
|
||||
#### end\_alpha 属性
|
||||
-----------------------
|
||||
> <p id="dialog_highlighter_default_t_end_alpha">结束alpha,打开对话框的动画结束(直到对话框被关闭)时的alpha值。
|
||||
|
||||
* 类型:uint8\_t
|
||||
|
||||
#### start\_alpha 属性
|
||||
-----------------------
|
||||
> <p id="dialog_highlighter_default_t_start_alpha">起始alpha,打开对话框的动画开始时的alpha值。
|
||||
|
||||
* 类型:uint8\_t
|
||||
|
||||
#### system\_bar\_alpha 属性
|
||||
-----------------------
|
||||
> <p id="dialog_highlighter_default_t_system_bar_alpha">由于在没有过度动画的情况下,截图中已经包括黑色色块,为了让 system_bar 也同步高亮部分的色块透明。
|
||||
|
||||
* 类型:uint8\_t
|
||||
|
@ -0,0 +1,131 @@
|
||||
## dialog\_highlighter\_factory\_t
|
||||
### 概述
|
||||
对话框高亮策略工厂。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="dialog_highlighter_factory_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#dialog_highlighter_factory_t_dialog_highlighter_factory">dialog\_highlighter\_factory</a> | 获取缺省的对话框高亮策略工厂对象。 |
|
||||
| <a href="#dialog_highlighter_factory_t_dialog_highlighter_factory_create">dialog\_highlighter\_factory\_create</a> | 创建对话框高亮策略工厂对象。 |
|
||||
| <a href="#dialog_highlighter_factory_t_dialog_highlighter_factory_create_highlighter">dialog\_highlighter\_factory\_create\_highlighter</a> | 创建指定类型的对话框高亮策略对象。 |
|
||||
| <a href="#dialog_highlighter_factory_t_dialog_highlighter_factory_destroy">dialog\_highlighter\_factory\_destroy</a> | 析构并释放对话框高亮策略工厂对象。 |
|
||||
| <a href="#dialog_highlighter_factory_t_dialog_highlighter_factory_register">dialog\_highlighter\_factory\_register</a> | 注册对话框高亮策略创建函数。 |
|
||||
| <a href="#dialog_highlighter_factory_t_dialog_highlighter_factory_set">dialog\_highlighter\_factory\_set</a> | 设置缺省的对话框高亮策略工厂对象。 |
|
||||
#### dialog\_highlighter\_factory 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_factory_t_dialog_highlighter_factory">获取缺省的对话框高亮策略工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
dialog_highlighter_factory_t* dialog_highlighter_factory ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | dialog\_highlighter\_factory\_t* | 返回对话框高亮策略工厂对象。 |
|
||||
#### dialog\_highlighter\_factory\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_factory_t_dialog_highlighter_factory_create">创建对话框高亮策略工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
dialog_highlighter_factory_t* dialog_highlighter_factory_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | dialog\_highlighter\_factory\_t* | 返回对话框高亮策略工厂对象。 |
|
||||
#### dialog\_highlighter\_factory\_create\_highlighter 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_factory_t_dialog_highlighter_factory_create_highlighter">创建指定类型的对话框高亮策略对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
dialog_highlighter_t* dialog_highlighter_factory_create_highlighter (dialog_highlighter_factory_t* factory, const char* args, widget_t* dialog);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | dialog\_highlighter\_t* | 返回窗口动画对象。 |
|
||||
| factory | dialog\_highlighter\_factory\_t* | 对话框高亮策略工厂对象。 |
|
||||
| args | const char* | 参数。如default(alpha=90) |
|
||||
| dialog | widget\_t* | 对话框对象。 |
|
||||
#### dialog\_highlighter\_factory\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_factory_t_dialog_highlighter_factory_destroy">析构并释放对话框高亮策略工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_factory_destroy (dialog_highlighter_factory_t* factory);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | dialog\_highlighter\_factory\_t* | 对话框高亮策略工厂对象。 |
|
||||
#### dialog\_highlighter\_factory\_register 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_factory_t_dialog_highlighter_factory_register">注册对话框高亮策略创建函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_factory_register (dialog_highlighter_factory_t* factory, const char* type, dialog_highlighter_create_t create);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | dialog\_highlighter\_factory\_t* | highlighter工厂对象。 |
|
||||
| type | const char* | 对话框高亮策略类型。 |
|
||||
| create | dialog\_highlighter\_create\_t | 对话框高亮策略创建函数。 |
|
||||
#### dialog\_highlighter\_factory\_set 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_factory_t_dialog_highlighter_factory_set">设置缺省的对话框高亮策略工厂对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_factory_set (dialog_highlighter_factory_t* factory);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| factory | dialog\_highlighter\_factory\_t* | 对话框高亮策略工厂对象。 |
|
@ -0,0 +1,276 @@
|
||||
## dialog\_highlighter\_t
|
||||
### 概述
|
||||
对话框高亮策略。
|
||||
|
||||
> 高亮策略的基本思路是对背景进行处理,比如将背景变暗或变模糊。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="dialog_highlighter_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_create">dialog\_highlighter\_create</a> | 创建对话框高亮策略对象。 |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_destroy">dialog\_highlighter\_destroy</a> | 销毁对话框高亮策略对象。 |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_draw">dialog\_highlighter\_draw</a> | 绘制背景。 |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_draw_mask">dialog\_highlighter\_draw\_mask</a> | 绘制背景高亮部分。 |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_get_alpha">dialog\_highlighter\_get\_alpha</a> | 获取高亮的透明度。 |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_is_dynamic">dialog\_highlighter\_is\_dynamic</a> | 是否是动态绘制(方便外层优化)。 |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_prepare">dialog\_highlighter\_prepare</a> | 初始化。在绘制完背景,在截图前调用。 |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_prepare_ex">dialog\_highlighter\_prepare\_ex</a> | 初始化。在绘制完背景,在截图前调用。 |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_set_bg">dialog\_highlighter\_set\_bg</a> | 设置背景图片。 |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_set_bg_clip_rect">dialog\_highlighter\_set\_bg\_clip\_rect</a> | 设置背景图片的显示裁剪区。 |
|
||||
| <a href="#dialog_highlighter_t_dialog_highlighter_set_system_bar_alpha">dialog\_highlighter\_set\_system\_bar\_alpha</a> | 设置 sytem_bar 的高亮透明值。 |
|
||||
### 属性
|
||||
<p id="dialog_highlighter_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#dialog_highlighter_t_canvas">canvas</a> | canvas\_t* | 画布。 |
|
||||
| <a href="#dialog_highlighter_t_clip_rect">clip\_rect</a> | rect\_t* | 截图的显示裁减区 |
|
||||
| <a href="#dialog_highlighter_t_dialog">dialog</a> | widget\_t* | 对应的对话框。 |
|
||||
| <a href="#dialog_highlighter_t_img">img</a> | bitmap\_t | 底层窗口的截图。 |
|
||||
#### dialog\_highlighter\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_create">创建对话框高亮策略对象。
|
||||
|
||||
>供子类构造函数用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
dialog_highlighter_t* dialog_highlighter_create (const dialog_highlighter_vtable_t* vt);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | dialog\_highlighter\_t* | 返回对话框高亮策略对象 |
|
||||
| vt | const dialog\_highlighter\_vtable\_t* | 虚表对象。 |
|
||||
#### dialog\_highlighter\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_destroy">销毁对话框高亮策略对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_destroy (dialog_highlighter_t* h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| h | dialog\_highlighter\_t* | 对话框高亮策略对象。 |
|
||||
#### dialog\_highlighter\_draw 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_draw">绘制背景。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_draw (dialog_highlighter_t* h, float_t percent);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| h | dialog\_highlighter\_t* | 对话框高亮策略对象。 |
|
||||
| percent | float\_t | 动画进度(0-1),1表示打开已经完成。 |
|
||||
#### dialog\_highlighter\_draw\_mask 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_draw_mask">绘制背景高亮部分。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_draw_mask (dialog_highlighter_t* h, canvas_t* c, float_t percent);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| h | dialog\_highlighter\_t* | 对话框高亮策略对象。 |
|
||||
| c | canvas\_t* | 画布。 |
|
||||
| percent | float\_t | 高亮的百分比。 |
|
||||
#### dialog\_highlighter\_get\_alpha 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_get_alpha">获取高亮的透明度。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint8_t dialog_highlighter_get_alpha (dialog_highlighter_t* h, float_t percent);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint8\_t | 返回透明度。 |
|
||||
| h | dialog\_highlighter\_t* | 对话框高亮策略对象。 |
|
||||
| percent | float\_t | 高亮的百分比。 |
|
||||
#### dialog\_highlighter\_is\_dynamic 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_is_dynamic">是否是动态绘制(方便外层优化)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t dialog_highlighter_is_dynamic (dialog_highlighter_t* h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示动态绘制,否则表示不是动态绘制。 |
|
||||
| h | dialog\_highlighter\_t* | 对话框高亮策略对象。 |
|
||||
#### dialog\_highlighter\_prepare 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_prepare">初始化。在绘制完背景,在截图前调用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_prepare (dialog_highlighter_t* h, canvas_t* c);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| h | dialog\_highlighter\_t* | 对话框高亮策略对象。 |
|
||||
| c | canvas\_t* | 画布。 |
|
||||
#### dialog\_highlighter\_prepare\_ex 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_prepare_ex">初始化。在绘制完背景,在截图前调用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_prepare_ex (dialog_highlighter_t* h, canvas_t* c, canvas_t* canvas_offline);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| h | dialog\_highlighter\_t* | 对话框高亮策略对象。 |
|
||||
| c | canvas\_t* | 画布。 |
|
||||
| canvas\_offline | canvas\_t* | 离线画布。 |
|
||||
#### dialog\_highlighter\_set\_bg 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_set_bg">设置背景图片。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_set_bg (dialog_highlighter_t* h, bitmap_t* img);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| h | dialog\_highlighter\_t* | 对话框高亮策略对象。 |
|
||||
| img | bitmap\_t* | 背景截图。 |
|
||||
#### dialog\_highlighter\_set\_bg\_clip\_rect 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_set_bg_clip_rect">设置背景图片的显示裁剪区。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_set_bg_clip_rect (dialog_highlighter_t* h, rect_t* clip_rect);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| h | dialog\_highlighter\_t* | 对话框高亮策略对象。 |
|
||||
| clip\_rect | rect\_t* | 背景显示裁剪区。 |
|
||||
#### dialog\_highlighter\_set\_system\_bar\_alpha 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_highlighter_t_dialog_highlighter_set_system_bar_alpha">设置 sytem_bar 的高亮透明值。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_highlighter_set_system_bar_alpha (dialog_highlighter_t* h, uint8_t alpha);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| h | dialog\_highlighter\_t* | 对话框高亮策略对象。 |
|
||||
| alpha | uint8\_t | 设置 sytem\_bar 的高亮透明值。 |
|
||||
#### canvas 属性
|
||||
-----------------------
|
||||
> <p id="dialog_highlighter_t_canvas">画布。
|
||||
|
||||
* 类型:canvas\_t*
|
||||
|
||||
#### clip\_rect 属性
|
||||
-----------------------
|
||||
> <p id="dialog_highlighter_t_clip_rect">截图的显示裁减区
|
||||
|
||||
* 类型:rect\_t*
|
||||
|
||||
#### dialog 属性
|
||||
-----------------------
|
||||
> <p id="dialog_highlighter_t_dialog">对应的对话框。
|
||||
|
||||
* 类型:widget\_t*
|
||||
|
||||
#### img 属性
|
||||
-----------------------
|
||||
> <p id="dialog_highlighter_t_img">底层窗口的截图。
|
||||
|
||||
* 类型:bitmap\_t
|
||||
|
@ -0,0 +1,10 @@
|
||||
## dialog\_highlighter\_type\_t
|
||||
### 概述
|
||||
@type string
|
||||
内置的对话框高亮策略。
|
||||
### 常量
|
||||
<p id="dialog_highlighter_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| DIALOG\_HIGHLIGHTER\_DEFAULT | 缺省的对话框高亮策略。 |
|
@ -0,0 +1,16 @@
|
||||
## dialog\_quit\_code\_t
|
||||
### 概述
|
||||
对话框退出码。
|
||||
|
||||
> 一般用作dialog_quit函数的参数。
|
||||
### 常量
|
||||
<p id="dialog_quit_code_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| DIALOG\_QUIT\_NONE | 对话框被强行关闭或不关心关闭原因。 |
|
||||
| DIALOG\_QUIT\_OK | 点击“OK”按钮关闭。 |
|
||||
| DIALOG\_QUIT\_YES | 点击“YES”按钮关闭。 |
|
||||
| DIALOG\_QUIT\_CANCEL | 点击“CANCEL”按钮关闭。 |
|
||||
| DIALOG\_QUIT\_NO | 点击“NO”按钮关闭。 |
|
||||
| DIALOG\_QUIT\_OTHER | 点击其它按钮关闭。 |
|
456
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/dialog_t.md
Normal file
456
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/dialog_t.md
Normal file
@ -0,0 +1,456 @@
|
||||
## dialog\_t
|
||||
### 概述
|
||||

|
||||
|
||||
对话框。 对话框是一种特殊的窗口,大小和位置可以自由设置。
|
||||
|
||||
AWTK中的对话框可以是模态的,也可以是非模态的。
|
||||
|
||||
如果dialog有透明或半透效果则不支持窗口动画。
|
||||
|
||||
> 由于浏览器中无法实现主循环嵌套,因此无法实现模态对话框。
|
||||
如果希望自己写的AWTK应用程序可以在浏览器(包括各种小程序)中运行或演示,
|
||||
请避免使用模态对话框。
|
||||
|
||||
对话框通常由对话框标题和对话框客户区两部分组成:
|
||||
|
||||

|
||||
|
||||
|
||||
dialog\_t是[window\_base\_t](window_base_t.md)的子类控件,window\_base\_t的函数均适用于dialog\_t控件。
|
||||
|
||||
在xml中使用"dialog"标签创建对话框。如:
|
||||
|
||||
```xml
|
||||
<dialog anim_hint="center_scale(duration=300)" x="c" y="m" w="80%" h="160" text="Dialog">
|
||||
<dialog_title x="0" y="0" w="100%" h="30" text="Hello AWTK" />
|
||||
<dialog_client x="0" y="bottom" w="100%" h="-30">
|
||||
<label name="" x="center" y="middle:-20" w="200" h="30" text="Are you ready?"/>
|
||||
<button name="quit" x="10" y="bottom:10" w="40%" h="30" text="确定"/>
|
||||
<button name="quit" x="right:10" y="bottom:10" w="40%" h="30" text="取消"/>
|
||||
</dialog_client>
|
||||
</dialog>
|
||||
```
|
||||
|
||||
如果你不需要对话框的标题,可以这样写:
|
||||
|
||||
```xml
|
||||
<dialog anim_hint="center_scale(duration=300)" x="c" y="m" w="80%" h="160" text="Dialog">
|
||||
<label name="" x="center" y="middle:-20" w="200" h="30" text="Are you ready?"/>
|
||||
<button name="quit" x="10" y="bottom:10" w="40%" h="30" text="确定"/>
|
||||
<button name="quit" x="right:10" y="bottom:10" w="40%" h="30" text="取消"/>
|
||||
</dialog>
|
||||
```
|
||||
|
||||
打开非模态对话框时,其用法与普通窗口一样。打开非模态对话框时,还需要调用dialog\_modal。
|
||||
|
||||
```c
|
||||
widget_t* dlg = dialog_open(name);
|
||||
|
||||
ret = dialog_modal(dlg);
|
||||
```
|
||||
|
||||
关闭模态对话框用dialog\_quit
|
||||
|
||||
```c
|
||||
static ret_t on_dialog_btn_click(void* ctx, event_t* evt) {
|
||||
widget_t* win = widget_get_window(WIDGET(evt->target));
|
||||
int code = (char*)ctx - (char*)NULL;
|
||||
|
||||
dialog_quit(win, code);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
```
|
||||
|
||||
关闭非模态对话框用window\_close。
|
||||
|
||||
```c
|
||||
static ret_t on_dialog_btn_click(void* ctx, event_t* evt) {
|
||||
widget_t* win = widget_get_window(WIDGET(evt->target));
|
||||
int code = (char*)ctx - (char*)NULL;
|
||||
|
||||
window_close(win);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[dialog.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/)
|
||||
|
||||
> 完整C代码示例请参考:
|
||||
|
||||
* [非模态对话框](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/dialog.c)
|
||||
|
||||
* [模态对话框](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/dialog_modal.c)
|
||||
|
||||
可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:
|
||||
|
||||
```xml
|
||||
<style name="default">
|
||||
<normal border_color="#606060" />
|
||||
</style>
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[theme default]
|
||||
(https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L324)
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="dialog_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#dialog_t_dialog_cast">dialog\_cast</a> | 转换dialog对象(供脚本语言使用)。 |
|
||||
| <a href="#dialog_t_dialog_confirm">dialog\_confirm</a> | 显示『确认』对话框。 |
|
||||
| <a href="#dialog_t_dialog_create">dialog\_create</a> | 创建dialog对象。 |
|
||||
| <a href="#dialog_t_dialog_create_simple">dialog\_create\_simple</a> | 创建dialog对象,同时创建title/client。 |
|
||||
| <a href="#dialog_t_dialog_get_client">dialog\_get\_client</a> | 获取client控件。 |
|
||||
| <a href="#dialog_t_dialog_get_title">dialog\_get\_title</a> | 获取title控件。 |
|
||||
| <a href="#dialog_t_dialog_info">dialog\_info</a> | 显示『提示信息』对话框。 |
|
||||
| <a href="#dialog_t_dialog_is_modal">dialog\_is\_modal</a> | 检查对话框是否为模态对话框。 |
|
||||
| <a href="#dialog_t_dialog_is_quited">dialog\_is\_quited</a> | 检查对话框是否已经退出模态。 |
|
||||
| <a href="#dialog_t_dialog_modal">dialog\_modal</a> | 模态显示对话框。 |
|
||||
| <a href="#dialog_t_dialog_open">dialog\_open</a> | 从资源文件中加载并创建Dialog对象。 |
|
||||
| <a href="#dialog_t_dialog_quit">dialog\_quit</a> | 退出模态显示,关闭对话框。 |
|
||||
| <a href="#dialog_t_dialog_set_title">dialog\_set\_title</a> | 设置对话框的标题文本。 |
|
||||
| <a href="#dialog_t_dialog_toast">dialog\_toast</a> | 显示『短暂提示信息』对话框。 |
|
||||
| <a href="#dialog_t_dialog_warn">dialog\_warn</a> | 显示『警告』对话框。 |
|
||||
### 属性
|
||||
<p id="dialog_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#dialog_t_highlight">highlight</a> | const char* | 对话框高亮策略。 |
|
||||
#### dialog\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_cast">转换dialog对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dialog_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | dialog对象。 |
|
||||
| widget | widget\_t* | dialog对象。 |
|
||||
#### dialog\_confirm 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_confirm">显示『确认』对话框。
|
||||
|
||||
窗体样式由dialog_confirm.xml文件决定。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_confirm (const char* title, const char* text);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示确认,否则表示取消。 |
|
||||
| title | const char* | 标题。 |
|
||||
| text | const char* | 文本内容。 |
|
||||
#### dialog\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_create">创建dialog对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dialog_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | dialog对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### dialog\_create\_simple 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_create_simple">创建dialog对象,同时创建title/client。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dialog_create_simple (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | dialog对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### dialog\_get\_client 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_get_client">获取client控件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dialog_get_client (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | client对象。 |
|
||||
| widget | widget\_t* | dialog对象。 |
|
||||
#### dialog\_get\_title 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_get_title">获取title控件。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dialog_get_title (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | title对象。 |
|
||||
| widget | widget\_t* | dialog对象。 |
|
||||
#### dialog\_info 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_info">显示『提示信息』对话框。
|
||||
|
||||
窗体样式由dialog_info.xml文件决定。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_info (const char* title, const char* text);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| title | const char* | 标题。 |
|
||||
| text | const char* | 文本内容。 |
|
||||
#### dialog\_is\_modal 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_is_modal">检查对话框是否为模态对话框。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t dialog_is_modal (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示是模态对话框,否则表示不是。 |
|
||||
| widget | widget\_t* | dialog对象。 |
|
||||
#### dialog\_is\_quited 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_is_quited">检查对话框是否已经退出模态。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t dialog_is_quited (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示已经退出,否则表示没有。 |
|
||||
| widget | widget\_t* | dialog对象。 |
|
||||
#### dialog\_modal 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_modal">模态显示对话框。
|
||||
dialog_modal返回后,dialog对象将在下一个idle函数中回收。
|
||||
也就是在dialog_modal调用完成后仍然可以访问dialog中控件,直到本次事件结束。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
dialog_quit_code_t dialog_modal (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | dialog\_quit\_code\_t | 返回退出码。 |
|
||||
| widget | widget\_t* | dialog对象。 |
|
||||
#### dialog\_open 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_open">从资源文件中加载并创建Dialog对象。
|
||||
|
||||
本函数在ui\_loader/ui\_builder_default里实现。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dialog_open (const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| name | const char* | dialog的名称。 |
|
||||
#### dialog\_quit 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_quit">退出模态显示,关闭对话框。
|
||||
|
||||
> 比如,在对话框中关闭按钮的事件处理函数中,调用本函数关闭对话框。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_quit (widget_t* widget, uint32_t code);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | dialog对象。 |
|
||||
| code | uint32\_t | 退出码,作为dialog\_modal的返回值(参考:[dialog\_quit\_code\_t](dialog\_quit\_code\_t.md))。 |
|
||||
#### dialog\_set\_title 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_set_title">设置对话框的标题文本。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_set_title (widget_t* widget, char* title);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | dialog对象。 |
|
||||
| title | char* | 标题。 |
|
||||
#### dialog\_toast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_toast">显示『短暂提示信息』对话框。
|
||||
|
||||
窗体样式由dialog_toast.xml文件决定。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_toast (const char* text, uint32_t duration);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| text | const char* | 文本内容。 |
|
||||
| duration | uint32\_t | 显示时间(单位为毫秒)。 |
|
||||
#### dialog\_warn 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_t_dialog_warn">显示『警告』对话框。
|
||||
|
||||
窗体样式由dialog_warn.xml文件决定。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dialog_warn (const char* title, const char* text);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| title | const char* | 标题。 |
|
||||
| text | const char* | 文本内容。 |
|
||||
#### highlight 属性
|
||||
-----------------------
|
||||
> <p id="dialog_t_highlight">对话框高亮策略。
|
||||
|
||||
> 请参考 [对话框高亮策略](https://github.com/zlgopen/awtk/blob/master/docs/dialog_highlight.md)
|
||||
|
||||
* 类型:const char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
@ -0,0 +1,76 @@
|
||||
## dialog\_title\_t
|
||||
### 概述
|
||||

|
||||
|
||||
对话框标题控件。
|
||||
|
||||
它本身不提供布局功能,仅提供具有语义的标签,让xml更具有可读性。
|
||||
子控件的布局可用layout\_children属性指定。
|
||||
请参考[布局参数](https://github.com/zlgopen/awtk/blob/master/docs/layout.md)。
|
||||
|
||||
dialog\_title\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于dialog\_title\_t控件。
|
||||
|
||||
在xml中使用"dialog\_title"标签创建dialog\_title。如:
|
||||
|
||||
```xml
|
||||
<dialog anim_hint="center_scale(duration=300)" x="c" y="m" w="80%" h="160" text="Dialog">
|
||||
<dialog_title x="0" y="0" w="100%" h="30" text="Hello AWTK" />
|
||||
<dialog_client x="0" y="bottom" w="100%" h="-30">
|
||||
<label name="" x="center" y="middle:-20" w="200" h="30" text="Are you ready?"/>
|
||||
<button name="quit" x="10" y="bottom:10" w="40%" h="30" text="确定"/>
|
||||
<button name="quit" x="right:10" y="bottom:10" w="40%" h="30" text="取消"/>
|
||||
</dialog_client>
|
||||
</dialog>
|
||||
```
|
||||
|
||||
在c代码中,用dialog\_create\_simple创建对话框时,自动创建dialog标题对象。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="dialog_title_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#dialog_title_t_dialog_title_cast">dialog\_title\_cast</a> | 转换为dialog_title对象(供脚本语言使用)。 |
|
||||
| <a href="#dialog_title_t_dialog_title_create">dialog\_title\_create</a> | 创建dialog对象。 |
|
||||
#### dialog\_title\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_title_t_dialog_title_cast">转换为dialog_title对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dialog_title_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | dialog\_title对象。 |
|
||||
| widget | widget\_t* | dialog\_title对象。 |
|
||||
#### dialog\_title\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dialog_title_t_dialog_title_create">创建dialog对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dialog_title_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | dialog对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
152
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/digit_clock_t.md
Normal file
152
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/digit_clock_t.md
Normal file
@ -0,0 +1,152 @@
|
||||
## digit\_clock\_t
|
||||
### 概述
|
||||

|
||||
|
||||
数字时钟控件。
|
||||
|
||||
digit\_clock\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于digit\_clock\_t控件。
|
||||
|
||||
在xml中使用"digit\_clock"标签创建数字时钟控件。如:
|
||||
|
||||
```xml
|
||||
<digit_clock format="YY/MM/DD h:mm:ss"/>
|
||||
```
|
||||
|
||||
> 更多用法请参考:[digit\_clock.xml](
|
||||
https://github.com/zlgopen/awtk/blob/master/design/default/ui/digit_clock.xml)
|
||||
|
||||
在c代码中使用函数digit\_clock\_create创建数字时钟控件。如:
|
||||
|
||||
```c
|
||||
widget_t* tc = digit_clock_create(win, 10, 10, 240, 30);
|
||||
digit_clock_set_format(tc, "YY/MM/DD h:mm:ss");
|
||||
```
|
||||
|
||||
> 完整示例请参考:[digit\_clock demo](
|
||||
https://github.com/zlgopen/awtk-c-demos/blob/master/demos/digit_clock.c)
|
||||
|
||||
可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:
|
||||
|
||||
```xml
|
||||
<style name="default">
|
||||
<normal text_color="black" />
|
||||
</style>
|
||||
```
|
||||
|
||||
> 更多用法请参考:[theme default](
|
||||
https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L138)
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="digit_clock_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#digit_clock_t_digit_clock_cast">digit\_clock\_cast</a> | 转换为digit_clock对象(供脚本语言使用)。 |
|
||||
| <a href="#digit_clock_t_digit_clock_create">digit\_clock\_create</a> | 创建digit_clock对象 |
|
||||
| <a href="#digit_clock_t_digit_clock_set_format">digit\_clock\_set\_format</a> | 设置显示格式。 |
|
||||
### 属性
|
||||
<p id="digit_clock_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#digit_clock_t_format">format</a> | char* | 显示格式。 |
|
||||
#### digit\_clock\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="digit_clock_t_digit_clock_cast">转换为digit_clock对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* digit_clock_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | digit\_clock对象。 |
|
||||
| widget | widget\_t* | digit\_clock对象。 |
|
||||
#### digit\_clock\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="digit_clock_t_digit_clock_create">创建digit_clock对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* digit_clock_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### digit\_clock\_set\_format 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="digit_clock_t_digit_clock_set_format">设置显示格式。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t digit_clock_set_format (widget_t* widget, const char* format);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | 控件对象。 |
|
||||
| format | const char* | 格式。 |
|
||||
#### format 属性
|
||||
-----------------------
|
||||
> <p id="digit_clock_t_format">显示格式。
|
||||
|
||||
* Y 代表年(完整显示)
|
||||
* M 代表月(1-12)
|
||||
* D 代表日(1-31)
|
||||
* h 代表时(0-23)
|
||||
* m 代表分(0-59)
|
||||
* s 代表秒(0-59)
|
||||
* w 代表星期(0-6)
|
||||
* W 代表星期的英文缩写(支持翻译)
|
||||
* YY 代表年(只显示末两位)
|
||||
* MM 代表月(01-12)
|
||||
* DD 代表日(01-31)
|
||||
* hh 代表时(00-23)
|
||||
* mm 代表分(00-59)
|
||||
* ss 代表秒(00-59)
|
||||
* MMM 代表月的英文缩写(支持翻译)
|
||||
|
||||
如 日期时间为:2018/11/12 9:10:20
|
||||
* "Y/M/D"显示为"2018/11/12"
|
||||
* "Y-M-D"显示为"2018-11-12"
|
||||
* "Y-M-D h:m:s"显示为"2018-11-12 9:10:20"
|
||||
* "Y-M-D hh:mm:ss"显示为"2018-11-12 09:10:20"
|
||||
|
||||
* 类型:char*
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
238
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/dirty_rects_t.md
Normal file
238
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/dirty_rects_t.md
Normal file
@ -0,0 +1,238 @@
|
||||
## dirty\_rects\_t
|
||||
### 概述
|
||||
支持多个脏矩形。
|
||||
> 在通常情况下,脏矩形的个数并不多,而且一般都是不重叠的,
|
||||
> 所以为了降低计算开销、避免内存分配和简化实现。这里采用下列措施:
|
||||
|
||||
* 如果新的脏矩形是独立的,直接加入进来。
|
||||
* 如果新的脏矩形与某个脏矩形有重叠,则合并到该脏矩形。
|
||||
* 如果脏矩形的个数超出最大个数则进行合并。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="dirty_rects_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#dirty_rects_t_dirty_rects_add">dirty\_rects\_add</a> | 增加脏矩形。 |
|
||||
| <a href="#dirty_rects_t_dirty_rects_deinit">dirty\_rects\_deinit</a> | 释放dirty_rects对象。 |
|
||||
| <a href="#dirty_rects_t_dirty_rects_fix">dirty\_rects\_fix</a> | 脏矩形之间可能重叠,合并重叠的脏矩形。 |
|
||||
| <a href="#dirty_rects_t_dirty_rects_init">dirty\_rects\_init</a> | 初始化dirty_rects对象。 |
|
||||
| <a href="#dirty_rects_t_dirty_rects_remove">dirty\_rects\_remove</a> | 删除指定序数的矩形。 |
|
||||
| <a href="#dirty_rects_t_dirty_rects_reset">dirty\_rects\_reset</a> | 重置dirty_rects对象。 |
|
||||
| <a href="#dirty_rects_t_dirty_rects_set_debug">dirty\_rects\_set\_debug</a> | 设置是否开启调试模式。 |
|
||||
| <a href="#dirty_rects_t_dirty_rects_set_disable_multiple">dirty\_rects\_set\_disable\_multiple</a> | 设置是否关闭多脏矩形模式(方便对比测试和调试)。 |
|
||||
| <a href="#dirty_rects_t_dirty_rects_set_profile">dirty\_rects\_set\_profile</a> | 设置是否开启profile模式。 |
|
||||
### 属性
|
||||
<p id="dirty_rects_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#dirty_rects_t_max">max</a> | rect\_t | 最大脏矩形。 |
|
||||
| <a href="#dirty_rects_t_nr">nr</a> | uint32\_t | 个数。 |
|
||||
| <a href="#dirty_rects_t_rects">rects</a> | rect\_t | 脏矩形。 |
|
||||
#### dirty\_rects\_add 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dirty_rects_t_dirty_rects_add">增加脏矩形。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dirty_rects_add (dirty_rects_t* dirty_rects, rect_t* r);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dirty\_rects | dirty\_rects\_t* | dirty\_rects对象。 |
|
||||
| r | rect\_t* | 脏矩形。 |
|
||||
#### dirty\_rects\_deinit 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dirty_rects_t_dirty_rects_deinit">释放dirty_rects对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dirty_rects_deinit (dirty_rects_t* dirty_rects);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dirty\_rects | dirty\_rects\_t* | dirty\_rects对象。 |
|
||||
#### dirty\_rects\_fix 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dirty_rects_t_dirty_rects_fix">脏矩形之间可能重叠,合并重叠的脏矩形。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dirty_rects_fix (dirty_rects_t* dirty_rects);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dirty\_rects | dirty\_rects\_t* | dirty\_rects对象。 |
|
||||
#### dirty\_rects\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dirty_rects_t_dirty_rects_init">初始化dirty_rects对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dirty_rects_init (dirty_rects_t* dirty_rects);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dirty\_rects | dirty\_rects\_t* | dirty\_rects对象。 |
|
||||
#### dirty\_rects\_remove 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dirty_rects_t_dirty_rects_remove">删除指定序数的矩形。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dirty_rects_remove (dirty_rects_t* dirty_rects, uint32_t index);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dirty\_rects | dirty\_rects\_t* | dirty\_rects对象。 |
|
||||
| index | uint32\_t | 序数。 |
|
||||
#### dirty\_rects\_reset 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dirty_rects_t_dirty_rects_reset">重置dirty_rects对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dirty_rects_reset (dirty_rects_t* dirty_rects);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dirty\_rects | dirty\_rects\_t* | dirty\_rects对象。 |
|
||||
#### dirty\_rects\_set\_debug 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dirty_rects_t_dirty_rects_set_debug">设置是否开启调试模式。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dirty_rects_set_debug (dirty_rects_t* dirty_rects, bool_t debug);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dirty\_rects | dirty\_rects\_t* | dirty\_rects对象。 |
|
||||
| debug | bool\_t | 是否开启调试模式。 |
|
||||
#### dirty\_rects\_set\_disable\_multiple 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dirty_rects_t_dirty_rects_set_disable_multiple">设置是否关闭多脏矩形模式(方便对比测试和调试)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dirty_rects_set_disable_multiple (dirty_rects_t* dirty_rects, bool_t disable_multiple);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dirty\_rects | dirty\_rects\_t* | dirty\_rects对象。 |
|
||||
| disable\_multiple | bool\_t | 是否关闭多脏矩形模式。 |
|
||||
#### dirty\_rects\_set\_profile 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dirty_rects_t_dirty_rects_set_profile">设置是否开启profile模式。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dirty_rects_set_profile (dirty_rects_t* dirty_rects, bool_t profile);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| dirty\_rects | dirty\_rects\_t* | dirty\_rects对象。 |
|
||||
| profile | bool\_t | 是否开启profile模式。 |
|
||||
#### max 属性
|
||||
-----------------------
|
||||
> <p id="dirty_rects_t_max">最大脏矩形。
|
||||
|
||||
* 类型:rect\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### nr 属性
|
||||
-----------------------
|
||||
> <p id="dirty_rects_t_nr">个数。
|
||||
|
||||
* 类型:uint32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
#### rects 属性
|
||||
-----------------------
|
||||
> <p id="dirty_rects_t_rects">脏矩形。
|
||||
|
||||
* 类型:rect\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
@ -0,0 +1,69 @@
|
||||
## done\_event\_t
|
||||
### 概述
|
||||

|
||||
|
||||
执行完成事件。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="done_event_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#done_event_t_done_event_cast">done\_event\_cast</a> | 把event对象转done_event_t对象,主要给脚本语言使用。 |
|
||||
| <a href="#done_event_t_done_event_init">done\_event\_init</a> | 初始done event。 |
|
||||
### 属性
|
||||
<p id="done_event_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#done_event_t_result">result</a> | ret\_t | 执行结果。 |
|
||||
#### done\_event\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="done_event_t_done_event_cast">把event对象转done_event_t对象,主要给脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
done_event_t* done_event_cast (event_t* event);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | done\_event\_t* | 返回event对象。 |
|
||||
| event | event\_t* | event对象。 |
|
||||
#### done\_event\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="done_event_t_done_event_init">初始done event。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
event_t* done_event_init (done_event_t* event, ret_t result);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | event\_t* | 返回event对象。 |
|
||||
| event | done\_event\_t* | event对象。 |
|
||||
| result | ret\_t | 结果。 |
|
||||
#### result 属性
|
||||
-----------------------
|
||||
> <p id="done_event_t_result">执行结果。
|
||||
|
||||
* 类型:ret\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可脚本化 | 是 |
|
356
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/draggable_t.md
Normal file
356
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/draggable_t.md
Normal file
@ -0,0 +1,356 @@
|
||||
## draggable\_t
|
||||
### 概述
|
||||

|
||||
|
||||
将draggable放入目标控件,即可让目标控件或当前窗口可以被拖动。
|
||||
|
||||
draggable\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于draggable\_t控件。
|
||||
|
||||
在xml中使用"draggable"标签创建draggable控件。如:
|
||||
|
||||
```xml
|
||||
<button text="Drag Me" w="80" h="40" x="10" y="10">
|
||||
<draggable />
|
||||
</button>
|
||||
```
|
||||
|
||||
拖动对话框标题时移动对话框:
|
||||
|
||||
```xml
|
||||
<dialog_title x="0" y="0" w="100%" h="30" text="Hello AWTK" >
|
||||
<draggable drag_window="true"/>
|
||||
</dialog_title>
|
||||
```
|
||||
|
||||
> 更多用法请参考:
|
||||
[draggable.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/draggable.xml)
|
||||
|
||||
在c代码中使用函数draggable\_create创建按钮控件。如:
|
||||
|
||||
```c
|
||||
widget_t* draggable = draggable_create(target, 0, 0, 0, 0);
|
||||
```
|
||||
|
||||
> draggable本身不可见,故无需style。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="draggable_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#draggable_t_draggable_cast">draggable\_cast</a> | 转换为draggable对象(供脚本语言使用)。 |
|
||||
| <a href="#draggable_t_draggable_create">draggable\_create</a> | 创建draggable对象 |
|
||||
| <a href="#draggable_t_draggable_set_bottom">draggable\_set\_bottom</a> | 设置bottom。 |
|
||||
| <a href="#draggable_t_draggable_set_drag_window">draggable\_set\_drag\_window</a> | 设置drag_window。 |
|
||||
| <a href="#draggable_t_draggable_set_horizontal_only">draggable\_set\_horizontal\_only</a> | 设置horizontal_only。 |
|
||||
| <a href="#draggable_t_draggable_set_left">draggable\_set\_left</a> | 设置left。 |
|
||||
| <a href="#draggable_t_draggable_set_right">draggable\_set\_right</a> | 设置right。 |
|
||||
| <a href="#draggable_t_draggable_set_top">draggable\_set\_top</a> | 设置top。 |
|
||||
| <a href="#draggable_t_draggable_set_vertical_only">draggable\_set\_vertical\_only</a> | 设置vertical_only。 |
|
||||
### 属性
|
||||
<p id="draggable_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#draggable_t_bottom">bottom</a> | int32\_t | 拖动范围的底部限制。缺省为父控件的底部。 |
|
||||
| <a href="#draggable_t_drag_window">drag\_window</a> | bool\_t | 拖动窗口而不是父控件。比如放在对话框的titlebar上,拖动titlebar其实是希望拖动对话框。 |
|
||||
| <a href="#draggable_t_horizontal_only">horizontal\_only</a> | bool\_t | 只允许水平拖动。 |
|
||||
| <a href="#draggable_t_left">left</a> | int32\_t | 拖动范围的左边限制。缺省为父控件的左边。 |
|
||||
| <a href="#draggable_t_right">right</a> | int32\_t | 拖动范围的右边限制。缺省为父控件的右边边。 |
|
||||
| <a href="#draggable_t_top">top</a> | int32\_t | 拖动范围的顶部限制。缺省为父控件的顶部。 |
|
||||
| <a href="#draggable_t_vertical_only">vertical\_only</a> | bool\_t | 只允许垂直拖动。 |
|
||||
#### draggable\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="draggable_t_draggable_cast">转换为draggable对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* draggable_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | draggable对象。 |
|
||||
| widget | widget\_t* | draggable对象。 |
|
||||
#### draggable\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="draggable_t_draggable_create">创建draggable对象
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* draggable_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### draggable\_set\_bottom 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="draggable_t_draggable_set_bottom">设置bottom。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t draggable_set_bottom (widget_t* widget, int32_t bottom);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | widget对象。 |
|
||||
| bottom | int32\_t | 拖动范围的底部限制。缺省为父控件的底部。 |
|
||||
#### draggable\_set\_drag\_window 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="draggable_t_draggable_set_drag_window">设置drag_window。
|
||||
拖动窗口而不是父控件。比如放在对话框的titlebar上,拖动titlebar其实是希望拖动对话框。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t draggable_set_drag_window (widget_t* widget, bool_t drag_window);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | widget对象。 |
|
||||
| drag\_window | bool\_t | drag\_window |
|
||||
#### draggable\_set\_horizontal\_only 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="draggable_t_draggable_set_horizontal_only">设置horizontal_only。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t draggable_set_horizontal_only (widget_t* widget, bool_t horizontal_only);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | widget对象。 |
|
||||
| horizontal\_only | bool\_t | 只允许水平拖动。 |
|
||||
#### draggable\_set\_left 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="draggable_t_draggable_set_left">设置left。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t draggable_set_left (widget_t* widget, int32_t left);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | widget对象。 |
|
||||
| left | int32\_t | 拖动范围的左边限制。缺省为父控件的左边。 |
|
||||
#### draggable\_set\_right 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="draggable_t_draggable_set_right">设置right。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t draggable_set_right (widget_t* widget, int32_t right);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | widget对象。 |
|
||||
| right | int32\_t | 拖动范围的右边限制。缺省为父控件的右边边。 |
|
||||
#### draggable\_set\_top 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="draggable_t_draggable_set_top">设置top。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t draggable_set_top (widget_t* widget, int32_t top);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | widget对象。 |
|
||||
| top | int32\_t | 拖动范围的顶部限制。缺省为父控件的顶部。 |
|
||||
#### draggable\_set\_vertical\_only 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="draggable_t_draggable_set_vertical_only">设置vertical_only。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t draggable_set_vertical_only (widget_t* widget, bool_t vertical_only);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | widget对象。 |
|
||||
| vertical\_only | bool\_t | 只允许垂直拖动。 |
|
||||
#### bottom 属性
|
||||
-----------------------
|
||||
> <p id="draggable_t_bottom">拖动范围的底部限制。缺省为父控件的底部。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### drag\_window 属性
|
||||
-----------------------
|
||||
> <p id="draggable_t_drag_window">拖动窗口而不是父控件。比如放在对话框的titlebar上,拖动titlebar其实是希望拖动对话框。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### horizontal\_only 属性
|
||||
-----------------------
|
||||
> <p id="draggable_t_horizontal_only">只允许水平拖动。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### left 属性
|
||||
-----------------------
|
||||
> <p id="draggable_t_left">拖动范围的左边限制。缺省为父控件的左边。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### right 属性
|
||||
-----------------------
|
||||
> <p id="draggable_t_right">拖动范围的右边限制。缺省为父控件的右边边。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### top 属性
|
||||
-----------------------
|
||||
> <p id="draggable_t_top">拖动范围的顶部限制。缺省为父控件的顶部。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### vertical\_only 属性
|
||||
-----------------------
|
||||
> <p id="draggable_t_vertical_only">只允许垂直拖动。
|
||||
|
||||
* 类型:bool\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
162
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/dragger_t.md
Normal file
162
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/dragger_t.md
Normal file
@ -0,0 +1,162 @@
|
||||
## dragger\_t
|
||||
### 概述
|
||||

|
||||
|
||||
dragger控件。
|
||||
|
||||
目前主要用于scrollbar里的滑块。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="dragger_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#dragger_t_dragger_cast">dragger\_cast</a> | 转换为dragger对象(供脚本语言使用)。 |
|
||||
| <a href="#dragger_t_dragger_create">dragger\_create</a> | 创建dragger对象。 |
|
||||
| <a href="#dragger_t_dragger_set_range">dragger\_set\_range</a> | 设置拖动的范围。 |
|
||||
### 属性
|
||||
<p id="dragger_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#dragger_t_x_max">x\_max</a> | xy\_t | x坐标的最大值。 |
|
||||
| <a href="#dragger_t_x_min">x\_min</a> | xy\_t | x坐标的最小值。 |
|
||||
| <a href="#dragger_t_y_max">y\_max</a> | xy\_t | y坐标的最大值。 |
|
||||
| <a href="#dragger_t_y_min">y\_min</a> | xy\_t | y坐标的最小值。 |
|
||||
### 事件
|
||||
<p id="dragger_t_events">
|
||||
|
||||
| 事件名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------- |
|
||||
| EVT\_DRAG\_START | event\_t | 开始拖动事件。 |
|
||||
| EVT\_DRAG | event\_t | 拖动事件。 |
|
||||
| EVT\_DRAG\_END | event\_t | 结束拖动事件。 |
|
||||
#### dragger\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dragger_t_dragger_cast">转换为dragger对象(供脚本语言使用)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dragger_cast (widget_t* widget);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | dragger对象。 |
|
||||
| widget | widget\_t* | dragger对象。 |
|
||||
#### dragger\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dragger_t_dragger_create">创建dragger对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
widget_t* dragger_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | widget\_t* | 对象。 |
|
||||
| parent | widget\_t* | 父控件 |
|
||||
| x | xy\_t | x坐标 |
|
||||
| y | xy\_t | y坐标 |
|
||||
| w | wh\_t | 宽度 |
|
||||
| h | wh\_t | 高度 |
|
||||
#### dragger\_set\_range 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="dragger_t_dragger_set_range">设置拖动的范围。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t dragger_set_range (widget_t* widget, xy_t x_min, xy_t y_min, xy_t x_max, xy_t y_max);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| widget | widget\_t* | dragger控件。 |
|
||||
| x\_min | xy\_t | x坐标最小值。 |
|
||||
| y\_min | xy\_t | y坐标最小值。 |
|
||||
| x\_max | xy\_t | x坐标最大值。 |
|
||||
| y\_max | xy\_t | y坐标最大值。 |
|
||||
#### x\_max 属性
|
||||
-----------------------
|
||||
> <p id="dragger_t_x_max">x坐标的最大值。
|
||||
|
||||
* 类型:xy\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### x\_min 属性
|
||||
-----------------------
|
||||
> <p id="dragger_t_x_min">x坐标的最小值。
|
||||
|
||||
* 类型:xy\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### y\_max 属性
|
||||
-----------------------
|
||||
> <p id="dragger_t_y_max">y坐标的最大值。
|
||||
|
||||
* 类型:xy\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
||||
#### y\_min 属性
|
||||
-----------------------
|
||||
> <p id="dragger_t_y_min">y坐标的最小值。
|
||||
|
||||
* 类型:xy\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
||||
| 可持久化 | 是 |
|
||||
| 可脚本化 | 是 |
|
||||
| 可在IDE中设置 | 是 |
|
||||
| 可在XML中设置 | 是 |
|
||||
| 可通过widget\_get\_prop读取 | 是 |
|
||||
| 可通过widget\_set\_prop修改 | 是 |
|
@ -0,0 +1,32 @@
|
||||
## easing\_type\_t
|
||||
### 概述
|
||||
缓动作动画常量定义。
|
||||
### 常量
|
||||
<p id="easing_type_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| EASING\_LINEAR | EASING\_LINEAR。 |
|
||||
| EASING\_QUADRATIC\_IN | EASING\_QUADRATIC\_IN |
|
||||
| EASING\_QUADRATIC\_OUT | EASING\_QUADRATIC\_OUT |
|
||||
| EASING\_QUADRATIC\_INOUT | EASING\_QUADRATIC\_INOUT |
|
||||
| EASING\_CUBIC\_IN | EASING\_CUBIC\_IN |
|
||||
| EASING\_CUBIC\_OUT | EASING\_CUBIC\_OUT |
|
||||
| EASING\_SIN\_IN | EASING\_SIN\_IN |
|
||||
| EASING\_SIN\_OUT | EASING\_SIN\_OUT |
|
||||
| EASING\_SIN\_INOUT | EASING\_SIN\_OUT |
|
||||
| EASING\_POW\_IN | EASING\_POW\_IN |
|
||||
| EASING\_POW\_OUT | EASING\_POW\_OUT |
|
||||
| EASING\_POW\_INOUT | EASING\_POW\_INOUT |
|
||||
| EASING\_CIRCULAR\_IN | EASING\_CIRCULAR\_IN |
|
||||
| EASING\_CIRCULAR\_OUT | EASING\_CIRCULAR\_OUT |
|
||||
| EASING\_CIRCULAR\_INOUT | EASING\_CIRCULAR\_INOUT |
|
||||
| EASING\_ELASTIC\_IN | EASING\_ELASTIC\_IN |
|
||||
| EASING\_ELASTIC\_OUT | EASING\_ELASTIC\_OUT |
|
||||
| EASING\_ELASTIC\_INOUT | EASING\_ELASTIC\_INOUT |
|
||||
| EASING\_BACK\_IN | EASING\_BACK\_IN |
|
||||
| EASING\_BACK\_OUT | EASING\_BACK\_OUT |
|
||||
| EASING\_BACK\_INOUT | EASING\_BACK\_INOUT |
|
||||
| EASING\_BOUNCE\_IN | EASING\_BOUNCE\_IN |
|
||||
| EASING\_BOUNCE\_OUT | EASING\_BOUNCE\_OUT |
|
||||
| EASING\_BOUNCE\_INOUT | EASING\_BOUNCE\_INOUT |
|
1030
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/edit_t.md
Normal file
1030
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/edit_t.md
Normal file
File diff suppressed because it is too large
Load Diff
454
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/emitter_t.md
Normal file
454
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/emitter_t.md
Normal file
@ -0,0 +1,454 @@
|
||||
## emitter\_t
|
||||
### 概述
|
||||
事件分发器, 用于实现观察者模式。
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="emitter_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#emitter_t_emitter_cast">emitter\_cast</a> | 转换为emitter对象(供脚本语言使用)。 |
|
||||
| <a href="#emitter_t_emitter_create">emitter\_create</a> | 创建emitter对象。 |
|
||||
| <a href="#emitter_t_emitter_deinit">emitter\_deinit</a> | 析构。 |
|
||||
| <a href="#emitter_t_emitter_destroy">emitter\_destroy</a> | 销毁。 |
|
||||
| <a href="#emitter_t_emitter_disable">emitter\_disable</a> | 禁用。 |
|
||||
| <a href="#emitter_t_emitter_dispatch">emitter\_dispatch</a> | 分发事件。如果当前分发的回调函数返回RET_REMOVE,该回调函数将被移出。 |
|
||||
| <a href="#emitter_t_emitter_dispatch_simple_event">emitter\_dispatch\_simple\_event</a> | 分发事件。 |
|
||||
| <a href="#emitter_t_emitter_enable">emitter\_enable</a> | 启用。 |
|
||||
| <a href="#emitter_t_emitter_exist">emitter\_exist</a> | 判断指定的事件和回调函数是否已经注册。 |
|
||||
| <a href="#emitter_t_emitter_find">emitter\_find</a> | 通过ID查找emitter_item_t,主要用于辅助测试。 |
|
||||
| <a href="#emitter_t_emitter_forward">emitter\_forward</a> | 分发事件 |
|
||||
| <a href="#emitter_t_emitter_init">emitter\_init</a> | 初始化emitter对象。 |
|
||||
| <a href="#emitter_t_emitter_off">emitter\_off</a> | 注销指定事件的处理函数。 |
|
||||
| <a href="#emitter_t_emitter_off_by_ctx">emitter\_off\_by\_ctx</a> | 注销指定事件的处理函数。 |
|
||||
| <a href="#emitter_t_emitter_off_by_func">emitter\_off\_by\_func</a> | 注销指定事件的处理函数。 |
|
||||
| <a href="#emitter_t_emitter_off_by_tag">emitter\_off\_by\_tag</a> | 注销指定事件的处理函数。 |
|
||||
| <a href="#emitter_t_emitter_on">emitter\_on</a> | 注册指定事件的处理函数。 |
|
||||
| <a href="#emitter_t_emitter_on_with_tag">emitter\_on\_with\_tag</a> | 注册指定事件的处理函数。 |
|
||||
| <a href="#emitter_t_emitter_set_on_destroy">emitter\_set\_on\_destroy</a> | 设置一个回调函数,在emitter被销毁时调用(方便脚本语言去释放回调函数)。 |
|
||||
| <a href="#emitter_t_emitter_size">emitter\_size</a> | 获取注册的回调函数个数,主要用于辅助测试。 |
|
||||
### 属性
|
||||
<p id="emitter_t_properties">
|
||||
|
||||
| 属性名称 | 类型 | 说明 |
|
||||
| -------- | ----- | ------------ |
|
||||
| <a href="#emitter_t_disable">disable</a> | int32\_t | 禁用标志。禁用时dispatch无效。 |
|
||||
#### emitter\_cast 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_cast">转换为emitter对象(供脚本语言使用)。
|
||||
|
||||
主要给脚本语言使用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
emitter_t* emitter_cast (emitter_t* emitter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | emitter\_t* | 对象。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
#### emitter\_create 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_create">创建emitter对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
emitter_t* emitter_create ();
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | emitter\_t* | 对象。 |
|
||||
#### emitter\_deinit 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_deinit">析构。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_deinit (emitter_t* emitter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
#### emitter\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_destroy">销毁。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_destroy (emitter_t* emitter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
#### emitter\_disable 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_disable">禁用。
|
||||
|
||||
禁用后emitter_dispatch无效,但可以注册和注销。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_disable (emitter_t* emitter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
#### emitter\_dispatch 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_dispatch">分发事件。如果当前分发的回调函数返回RET_REMOVE,该回调函数将被移出。
|
||||
禁用状态下,本函数不做任何事情。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_dispatch (emitter_t* emitter, event_t* e);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 如果当前分发的回调函数返回RET\_STOP,dispatch中断分发,并返回RET\_STOP,否则返回RET\_OK。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| e | event\_t* | 事件对象。 |
|
||||
#### emitter\_dispatch\_simple\_event 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_dispatch_simple_event">分发事件。
|
||||
> 对emitter_dispatch的包装,分发一个简单的事件。
|
||||
如果当前分发的回调函数返回RET_STOP,dispatch中断分发,并返回RET_STOP,否则返回RET_OK。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_dispatch_simple_event (emitter_t* emitter, uint32_t type);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| type | uint32\_t | 事件类型。 |
|
||||
#### emitter\_enable 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_enable">启用。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_enable (emitter_t* emitter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
#### emitter\_exist 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_exist">判断指定的事件和回调函数是否已经注册。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
bool_t emitter_exist (emitter_t* emitter, event_type_t type, event_func_t on_event, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | bool\_t | 返回TRUE表示已经注册,否则表示没有注册。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| type | event\_type\_t | 事件类型。 |
|
||||
| on\_event | event\_func\_t | 事件处理函数。 |
|
||||
| ctx | void* | 事件处理函数上下文。 |
|
||||
#### emitter\_find 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_find">通过ID查找emitter_item_t,主要用于辅助测试。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_find (emitter_t* emitter, uint32_t id);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| id | uint32\_t | emitter\_on返回的ID。 |
|
||||
#### emitter\_forward 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_forward">分发事件
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_forward (void* ctx, event_t* e);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| ctx | void* | emitter对象。 |
|
||||
| e | event\_t* | 分发的事件。 |
|
||||
#### emitter\_init 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_init">初始化emitter对象。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
emitter_t* emitter_init (emitter_t* emitter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | emitter\_t* | 对象。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
#### emitter\_off 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_off">注销指定事件的处理函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_off (emitter_t* emitter, uint32_t id);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| id | uint32\_t | emitter\_on返回的ID。 |
|
||||
#### emitter\_off\_by\_ctx 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_off_by_ctx">注销指定事件的处理函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_off_by_ctx (emitter_t* emitter, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| ctx | void* | 事件处理函数上下文。 |
|
||||
#### emitter\_off\_by\_func 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_off_by_func">注销指定事件的处理函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_off_by_func (emitter_t* emitter, event_type_t type, event_func_t on_event, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| type | event\_type\_t | 事件类型。 |
|
||||
| on\_event | event\_func\_t | 事件处理函数。 |
|
||||
| ctx | void* | 事件处理函数上下文。 |
|
||||
#### emitter\_off\_by\_tag 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_off_by_tag">注销指定事件的处理函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_off_by_tag (emitter_t* emitter, uint32_t tag);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| tag | uint32\_t | tag。 |
|
||||
#### emitter\_on 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_on">注册指定事件的处理函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t emitter_on (emitter_t* emitter, event_type_t etype, event_func_t handler, void* ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 返回id,用于emitter\_off。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| etype | event\_type\_t | 事件类型。 |
|
||||
| handler | event\_func\_t | 事件处理函数。 |
|
||||
| ctx | void* | 事件处理函数上下文。 |
|
||||
#### emitter\_on\_with\_tag 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_on_with_tag">注册指定事件的处理函数。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t emitter_on_with_tag (emitter_t* emitter, event_type_t type, event_func_t on_event, void* ctx, uint32_t tag);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 返回id,用于emitter\_off。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| type | event\_type\_t | 事件类型。 |
|
||||
| on\_event | event\_func\_t | 事件处理函数。 |
|
||||
| ctx | void* | 事件处理函数上下文。 |
|
||||
| tag | uint32\_t | tag。 |
|
||||
#### emitter\_set\_on\_destroy 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_set_on_destroy">设置一个回调函数,在emitter被销毁时调用(方便脚本语言去释放回调函数)。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t emitter_set_on_destroy (emitter_t* emitter, uint32_t id, tk_destroy_t on_destroy, void* on_destroy_ctx);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
| id | uint32\_t | emitter\_on返回的ID。 |
|
||||
| on\_destroy | tk\_destroy\_t | 回调函数。 |
|
||||
| on\_destroy\_ctx | void* | 回调函数上下文。 |
|
||||
#### emitter\_size 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="emitter_t_emitter_size">获取注册的回调函数个数,主要用于辅助测试。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
uint32_t emitter_size (emitter_t* emitter);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | uint32\_t | 回调函数个数。 |
|
||||
| emitter | emitter\_t* | emitter对象。 |
|
||||
#### disable 属性
|
||||
-----------------------
|
||||
> <p id="emitter_t_disable">禁用标志。禁用时dispatch无效。
|
||||
|
||||
* 类型:int32\_t
|
||||
|
||||
| 特性 | 是否支持 |
|
||||
| -------- | ----- |
|
||||
| 可直接读取 | 是 |
|
||||
| 可直接修改 | 否 |
|
@ -0,0 +1,15 @@
|
||||
## encoding\_name\_t
|
||||
### 概述
|
||||
编码名称。
|
||||
### 常量
|
||||
<p id="encoding_name_t_consts">
|
||||
|
||||
| 名称 | 说明 |
|
||||
| -------- | ------- |
|
||||
| ENCODING\_UTF8 | UTF-8。 |
|
||||
| ENCODING\_UTF16 | UTF-16。 |
|
||||
| ENCODING\_UTF32 | UTF-32。 |
|
||||
| ENCODING\_GBK | GBK。 |
|
||||
| ENCODING\_BIG | BIG5-2003。 |
|
||||
| ENCODING\_GB2312 | GB\_2312-80。 |
|
||||
| ENCODING\_GB18030 | GB18030。 |
|
85
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/encoding_t.md
Normal file
85
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/encoding_t.md
Normal file
@ -0,0 +1,85 @@
|
||||
## encoding\_t
|
||||
### 概述
|
||||
encoding conversion
|
||||
|
||||
示例:
|
||||
|
||||
```c
|
||||
```
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="encoding_t_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#encoding_t_encoding_convert">encoding\_convert</a> | 字符集转换。 |
|
||||
| <a href="#encoding_t_encoding_gbk_to_utf8">encoding\_gbk\_to\_utf8</a> | 将gbk转换成utf8编码。 |
|
||||
| <a href="#encoding_t_encoding_utf8_to_gbk">encoding\_utf8\_to\_gbk</a> | 将utf8转换成gbk编码。 |
|
||||
#### encoding\_convert 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="encoding_t_encoding_convert">字符集转换。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t encoding_convert (encoding_name_t from, const char* from_str, uint32_t from_size, encoding_name_t to, const char* , uint32_t to_size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| from | encoding\_name\_t | 源字符串的编码名称。 |
|
||||
| from\_str | const char* | 源字符串。 |
|
||||
| from\_size | uint32\_t | 源字符串的长度。 |
|
||||
| to | encoding\_name\_t | 目标字符串的编码名称。 |
|
||||
| | const char* | 。 |
|
||||
| to\_size | uint32\_t | 目标字符串的最大长度。 |
|
||||
#### encoding\_gbk\_to\_utf8 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="encoding_t_encoding_gbk_to_utf8">将gbk转换成utf8编码。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t encoding_gbk_to_utf8 (const char* from_str, uint32_t from_size, const char* , uint32_t to_size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| from\_str | const char* | 源字符串(gbk)。 |
|
||||
| from\_size | uint32\_t | 源字符串的长度。 |
|
||||
| | const char* | 。 |
|
||||
| to\_size | uint32\_t | 目标字符串的最大长度。 |
|
||||
#### encoding\_utf8\_to\_gbk 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="encoding_t_encoding_utf8_to_gbk">将utf8转换成gbk编码。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
ret_t encoding_utf8_to_gbk (const char* from_str, uint32_t from_size, const char* to_str, uint32_t to_size);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
||||
| from\_str | const char* | 源字符串(utf8)。 |
|
||||
| from\_size | uint32\_t | 源字符串的长度。 |
|
||||
| to\_str | const char* | 目标字符串(gbk)。 |
|
||||
| to\_size | uint32\_t | 目标字符串的最大长度。 |
|
113
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/enum_helper.md
Normal file
113
MXC_A27-PCB4.5-270T/lib/awtk/awtk/docs/manual/enum_helper.md
Normal file
@ -0,0 +1,113 @@
|
||||
## enum\_helper
|
||||
### 概述
|
||||
|
||||
----------------------------------
|
||||
### 函数
|
||||
<p id="enum_helper_methods">
|
||||
|
||||
| 函数名称 | 说明 |
|
||||
| -------- | ------------ |
|
||||
| <a href="#enum_helper_asset_type_find_by_value">asset\_type\_find\_by\_value</a> | 获取资源类型枚值和名称的对应关系。 |
|
||||
| <a href="#enum_helper_find_item">find\_item</a> | 获取特定枚值和名称的对应关系。 |
|
||||
| <a href="#enum_helper_find_item_by_value">find\_item\_by\_value</a> | 获取特定枚值和名称的对应关系。 |
|
||||
| <a href="#enum_helper_keys_type_find">keys\_type\_find</a> | 获取按键值和名称的对应关系。 |
|
||||
| <a href="#enum_helper_keys_type_find_by_value">keys\_type\_find\_by\_value</a> | 获取按键值和名称的对应关系。 |
|
||||
#### asset\_type\_find\_by\_value 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="enum_helper_asset_type_find_by_value">获取资源类型枚值和名称的对应关系。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const key_type_value_t* asset_type_find_by_value (uint32_t value);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const key\_type\_value\_t* | 返回资源类型枚值和名称的对应关系。 |
|
||||
| value | uint32\_t | 资源的类型。 |
|
||||
#### find\_item 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="enum_helper_find_item">获取特定枚值和名称的对应关系。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const key_type_value_t* find_item (const key_type_value_t* items, uint32_t nr, const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const key\_type\_value\_t* | 返回资源类型枚值和名称的对应关系。 |
|
||||
| items | const key\_type\_value\_t* | 特定枚举值对应列表。 |
|
||||
| nr | uint32\_t | 列表长度。 |
|
||||
| name | const char* | 名称。 |
|
||||
#### find\_item\_by\_value 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="enum_helper_find_item_by_value">获取特定枚值和名称的对应关系。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const key_type_value_t* find_item_by_value (const key_type_value_t* items, uint32_t nr, uint32_t value);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const key\_type\_value\_t* | 返回资源类型枚值和名称的对应关系。 |
|
||||
| items | const key\_type\_value\_t* | 特定枚举值对应列表。 |
|
||||
| nr | uint32\_t | 列表长度。 |
|
||||
| value | uint32\_t | 资源的类型。 |
|
||||
#### keys\_type\_find 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="enum_helper_keys_type_find">获取按键值和名称的对应关系。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const key_type_value_t* keys_type_find (const char* name);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const key\_type\_value\_t* | 返回按键值和名称的对应关系。 |
|
||||
| name | const char* | 按键名。 |
|
||||
#### keys\_type\_find\_by\_value 函数
|
||||
-----------------------
|
||||
|
||||
* 函数功能:
|
||||
|
||||
> <p id="enum_helper_keys_type_find_by_value">获取按键值和名称的对应关系。
|
||||
|
||||
* 函数原型:
|
||||
|
||||
```
|
||||
const key_type_value_t* keys_type_find_by_value (uint32_t value);
|
||||
```
|
||||
|
||||
* 参数说明:
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------- | ----- | --------- |
|
||||
| 返回值 | const key\_type\_value\_t* | 返回按键值和名称的对应关系。 |
|
||||
| value | uint32\_t | 按键值。 |
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user