Skip to content

theme_t

概述

窗体样式。

函数

函数名称说明
theme获取缺省的窗体样式对象。
theme_destroy析构并释放窗体样式对象。
theme_find_style查找满足条件的style。
theme_foreach遍历全部数据。
theme_get_style_type获取窗体样式的风格类型。
theme_load_from_asset加载窗体样式对象。
theme_load_from_data加载窗体样式对象。
theme_set设置缺省的窗体样式对象。
theme_set_theme_data设置窗体样式的数据。

theme 函数

  • 函数功能:

获取缺省的窗体样式对象。

  • 函数原型:
theme_t* theme ();
  • 参数说明:
参数类型说明
返回值theme_t*返回窗体样式对象。

theme_destroy 函数

  • 函数功能:

析构并释放窗体样式对象。

  • 函数原型:
ret_t theme_destroy (theme_t* theme);
  • 参数说明:
参数类型说明
返回值ret_t返回RET_OK表示成功,否则表示失败。
themetheme_t*窗体样式对象。

theme_find_style 函数

  • 函数功能:

查找满足条件的style。

  • 函数原型:
const uint8_t* theme_find_style (theme_t* theme, const char* widget_type, const char* name, const char* widget_state);
  • 参数说明:
参数类型说明
返回值const uint8_t*返回风格对象数据。
themetheme_t*窗体样式对象。
widget_typeconst char*控件的类型名。
nameconst char*style的名称。
widget_stateconst char*控件的状态。

theme_foreach 函数

  • 函数功能:

遍历全部数据。

  • 函数原型:
ret_t theme_foreach (theme_t* theme, theme_on_data_t on_data, void* ctx);
  • 参数说明:
参数类型说明
返回值ret_t返回RET_OK表示成功,否则表示失败。
themetheme_t*窗体样式对象。
on_datatheme_on_data_t回调函数。
ctxvoid*回调函数的上下文。

theme_get_style_type 函数

  • 函数功能:

获取窗体样式的风格类型。

  • 函数原型:
const char* theme_get_style_type (theme_t* theme);
  • 参数说明:
参数类型说明
返回值const char*返回风格类型。
themetheme_t*窗体样式对象。

theme_load_from_asset 函数

  • 函数功能:

加载窗体样式对象。

  • 函数原型:
theme_t* theme_load_from_asset (asset_info_t* info);
  • 参数说明:
参数类型说明
返回值theme_t*返回窗体样式对象。
infoasset_info_t*资源对象。

theme_load_from_data 函数

  • 函数功能:

加载窗体样式对象。

  • 函数原型:
theme_t* theme_load_from_data (const char* name, const uint8_t* data, uint32_t size);
  • 参数说明:
参数类型说明
返回值theme_t*返回窗体样式对象。
nameconst char*资源名。
dataconst uint8_t*窗体样式数据。
sizeuint32_t资源长度。

theme_set 函数

  • 函数功能:

设置缺省的窗体样式对象。

  • 函数原型:
ret_t theme_set (theme_t* theme);
  • 参数说明:
参数类型说明
返回值ret_t返回RET_OK表示成功,否则表示失败。
themetheme_t*窗体样式对象。

theme_set_theme_data 函数

  • 函数功能:

设置窗体样式的数据。

  • 函数原型:
ret_t theme_set_theme_data (theme_t* theme, const uint8_t* data);
  • 参数说明:
参数类型说明
返回值ret_t返回RET_OK表示成功,否则表示失败。
themetheme_t*窗体样式对象。
dataconst uint8_t*窗体样式数据。