Files
CopilotandLiu 437d93d34e docs: add native doc-viewer and widget documentation (#324)
- Add examples/doc-viewer, an LCUI-based documentation viewer with an
  MDX compiler pipeline that converts source MDX files into C/TSX
  page components rendered by lcui build.
- Add zh-CN and en documentation for 5 widgets (anchor, button,
  scrollarea, text, text-input), each with C/TSX/XML example variants
  and widget-fields data.
- Add handbook and overview documentation.

Co-authored-by: Liu <lc-soft@live.cn>
2026-08-05 22:42:19 +08:00

52 lines
1.3 KiB
C

#include "layout.h"
#include "layout.tsx.h"
typedef struct {
root_layout_react_t base;
// Add additional states to your component here
// ...
} root_layout_t;
static void root_layout_init(ui_widget_t *w)
{
ui_widget_add_data(w, root_layout_proto, sizeof(root_layout_t));
root_layout_react_init(w);
// Write the initialization code for your component here
// such as state initialization, event binding, etc
// ...
root_layout_update(w);
}
static root_layout_t *root_layout_get(ui_widget_t *w)
{
return ui_widget_get_data(w, root_layout_proto);
}
static void root_layout_destroy(ui_widget_t *w)
{
// Write code here to destroy the relevant resources of the component
// ...
root_layout_react_destroy(w);
}
void root_layout_update(ui_widget_t *w)
{
root_layout_react_update(w);
// Write code here to update other content of your component
// ...
}
ui_widget_t *ui_create_root_layout(void)
{
return ui_create_widget_with_prototype(root_layout_proto);
}
void ui_register_root_layout(void)
{
root_layout_init_prototype();
root_layout_proto->init = root_layout_init;
root_layout_proto->destroy = root_layout_destroy;
}