Skip to content

Commit

Permalink
simplify source code
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft committed Sep 27, 2024
1 parent c24ecc1 commit 5c6c0de
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 350 deletions.
7 changes: 3 additions & 4 deletions examples/fabric/src/main.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include <LCUI.h>
#include <LCUI/main.h>
#include <ui_xml.h>

int main(int argc, char **argv)
{
lcui_init();
return lcui_main();
ui_load_xml_file("test.xml");
return 0;
}
2 changes: 1 addition & 1 deletion examples/fabric/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ add_requires("cairo", { optional = true })
target("fabric")
set_kind("binary")
add_files("src/*.c")
add_packages("cairo", "lcui")
add_packages("cairo", "ui_xml")
if has_package("cairo") then
add_defines("HAS_CAIRO")
end
10 changes: 1 addition & 9 deletions lib/ui-xml/include/ui_xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,15 @@
#define LIB_UI_XML_INCLUDE_XML_H

#include "ui_xml/common.h"
#include <ui.h>

LIBUI_XML_BEGIN_DECLS

/**
* 从字符串中载入界面配置代码,解析并生成相应的图形界面(元素)
* @param[in] str 包含界面配置代码的字符串
* @return 正常解析会返回一个部件,出现错误则返回 NULL
*/
LIBUI_XML_PUBLIC ui_widget_t* ui_load_xml_string(const char *str, int size);

/**
* 从文件中载入界面配置代码,解析并生成相应的图形界面(元素)
* @param[in] filepath 文件路径
* @return 正常解析会返回一个部件,出现错误则返回 NULL
*/
LIBUI_XML_PUBLIC ui_widget_t* ui_load_xml_file(const char *filepath);
LIBUI_XML_PUBLIC void* ui_load_xml_file(const char *filepath);

LIBUI_XML_END_DECLS

Expand Down
Loading

0 comments on commit 5c6c0de

Please sign in to comment.