SDK สำหรับ TESAIoT Dev Kit
คู่มืออ้างอิง API และ Tutorial (MTB & µPython)
Loading...
Searching...
No Matches

Functions

void ui_widget_mgr_init (lv_obj_t *parent)
 ipc_ui_init() เรียกฟังก์ชันนี้เอง — ห้ามเรียกโดยตรง
void ui_widget_mgr_set_parent (lv_obj_t *parent)
 เคลียร์ widget ทั้งหมดแล้วตั้ง parent ใหม่; ถูกเรียกผ่าน ipc_ui_set_container() เท่านั้น
bool ui_widget_mgr_needs_container (void)
 คืน true ขณะที่ parent เป็น NULL; ไม่มีผู้เรียกที่ใดเลย
int ui_widget_mgr_create (const ipc_ui_create_t *cfg)
 สร้าง widget จาก config; คืน handle 0-31, -1 เมื่อตารางเต็ม, -2 เมื่อชนิดไม่ถูกต้อง
int ui_widget_mgr_create_sprite (const lv_image_dsc_t *dsc, int16_t x, int16_t y)
 สร้าง sprite ชนิดภาพลงใน handle table เดียวกัน
void ui_widget_mgr_set_sprite_image (int handle, const lv_image_dsc_t *dsc)
 สลับภาพของ sprite; descriptor มาจาก game_sprite_lookup()
void ui_widget_mgr_delete (int handle)
 ลบ widget หนึ่งตัวและปล่อย handle ของมันคืน
void ui_widget_mgr_clear_all (void)
 ลบ widget ทุกตัวและรีเซ็ต handle table
void ui_widget_mgr_set_text (int handle, const char *text)
 ตั้งข้อความของ widget; switch จะตั้ง fast drain ให้พร้อมทำงานหลังจากนั้น
void ui_widget_mgr_set_value (int handle, int32_t value)
 ตั้งค่าตัวเลข; ตั้ง fast drain ให้พร้อมทำงานเพื่อไม่ให้แดชบอร์ดถูกตรึงไว้ที่ 5 FPS
void ui_widget_mgr_set_position (int handle, int16_t x, int16_t y)
 ย้ายตำแหน่ง widget; ตั้ง fast drain ให้พร้อมทำงานเพื่ออัตราเฟรมระหว่างเล่นเกม
void ui_widget_mgr_set_size (int handle, int16_t w, int16_t h)
 เปลี่ยนขนาดของ widget
void ui_widget_mgr_set_color (int handle, uint32_t color)
 ตั้งสีหลัก 0xRRGGBB
void ui_widget_mgr_set_visible (int handle, bool visible)
 แสดงหรือซ่อน widget หนึ่งตัว
void ui_widget_mgr_set_all_visible (bool visible)
 แสดงหรือซ่อน widget ที่จัดการอยู่ทุกตัว; เป็นตัวสลับมุมมองของการสลับคอนโซลบนหน้า Playground
int32_t ui_widget_mgr_get_value (int handle)
 อ่านค่าปัจจุบันของ widget; ค่า 0 หมายถึง handle ไม่ถูกต้องได้ด้วย
void ui_widget_mgr_set_dotmatrix (int handle, const uint8_t *bitmap, uint8_t len)
 โหลดบิตแมปเข้าไปใน widget ชนิด DotMatrix
void ui_widget_mgr_set_image (int handle, uint16_t offset, const uint8_t *data, uint8_t len)
 การส่ง RGB565 เป็นก้อน ๆ เข้าไปใน canvas ของ widget ชนิด Image
void ui_widget_mgr_event_push (uint8_t handle, uint8_t event_type, int32_t value)
 ฝั่งผู้ผลิตข้อมูลของ event ring; เฉพาะ LVGL event callback ภายในเท่านั้น
int ui_widget_mgr_event_drain (ipc_ui_event_t *out, int max_events)
 ระบาย event ออกให้ POLL_EVENTS — เป็น backend ของ ui.poll()
int ui_widget_mgr_count (void)
 จำนวน handle ที่ยังใช้งานอยู่; ไม่มีผู้เรียกเลยที่ใด
int ui_widget_mgr_list (ipc_ui_widget_info_t *out, int max_items)
 handle และชนิดของ widget ที่ทำงานอยู่ทุกตัว — เป็น backend ของ ui.list()
lv_obj_t * ui_widget_mgr_get_parent (void)
 parent ปัจจุบันที่เป็น null ได้; ทุก call site ตรวจ null ของค่านี้
void ui_widget_mgr_set_screen (int16_t width, int16_t height)
 ตั้งขนาดหน้าจอและรีเซ็ตกริดของ auto-layout
int ui_widget_mgr_chart_add_series (int handle, uint32_t color)
 เพิ่มชุดข้อมูลให้ Chart; คืนดัชนี 0-3 หรือ -1
void ui_widget_mgr_chart_set_next (int handle, uint8_t series_idx, int32_t value)
 ต่อค่าถัดไปเข้าไปในชุดข้อมูลของ chart ชุดหนึ่ง
int ui_widget_mgr_item_add (const ipc_ui_item_add_t *it)
 ต่อรายการหนึ่งรายการ; ค่าที่คืนมีหลายความหมาย และมีกฎเรื่องตัวโค้ดที่ทำงานจริง 2 ชุด
void ui_widget_mgr_item_clear (int handle)
 ล้าง widget ชนิดคอลเล็กชันให้ว่าง
void ui_widget_mgr_set_prop (int handle, uint8_t prop_id, int32_t value)
 ตั้งคุณสมบัติ UI_PROP_* หนึ่งรายการ; เป็นกลไกที่ .listen() ใช้สมัครรับ event
lv_obj_t * ui_widget_mgr_get_object (int handle)
 อ็อบเจ็กต์ LVGL ที่อยู่หลัง handle; เป็นเส้นทาง GET_TEXT สำหรับข้อความที่ผู้ใช้พิมพ์

Detailed Description

Header: ui_widget_mgr.h ตัวโค้ดที่ทำงานจริง: ui_widget_mgr.c ที่อยู่ใน archive (libbento_ipc.a) "Widget handle table and LVGL widget lifecycle manager. Maps handle IDs (0-31) to lv_obj_t* pointers. Creates, modifies, deletes LVGL widgets in GFX task context" (ui_widget_mgr.h)

อ่านย่อหน้านี้ก่อน — ว่าใครเป็นผู้เรียกฟังก์ชันเหล่านี้จริง ๆ ฟังก์ชันพื้นฐานชุดนี้ ไม่ใช่ ส่วนที่แอปพลิเคชันภาษา C เรียกใช้ ภายใน archive ผู้เรียกเพียงรายเดียวของพวกมันคือ IPC command switch process_ui_command() ใน ipc_ui.c (นิยามอยู่ที่ :393 และถูกระบายคิวจาก LVGL timer 50 ms ที่ :875) ผู้เรียกจริงคือสคริปต์ MicroPython บน CM33_NS: การเรียก ui.* แต่ละครั้งใน modui.c จะแพ็ก payload ส่งผ่าน pipe แล้ว switch ด้านล่างจึงแกะออกมาและเรียกฟังก์ชันพื้นฐานหนึ่งตัว การเขียนเอกสารว่า "call this from your page code" จะบิดเบือนสถาปัตยกรรม — หน้า (page) ที่เรียก ui_widget_mgr_create() โดยตรงคือการข้ามเจ้าของ handle table ไป และจะเกิด race condition กับ CLEAR_ALL ของสคริปต์ตัวถัดไป

แต่ละรายการจึงให้ข้อมูล 3 อย่าง: จุด dispatch ใน switch ที่ปักหมุดไว้ (ป้าย case และบรรทัดที่เรียก อ่านจากซอร์สในรอบสกัดจุดปักหมุด) ส่วนที่เรียกใช้ได้ฝั่ง MicroPython ui.* ที่เข้าถึงมัน และข้อกำหนดการเรียกใช้ มีสี่ case — CREATE, DELETE, SET_TEXT, SET_VALUE — ที่ทำซ้ำไว้แบบคัดมาตามตัวอักษรในข้อความตัดตอน (excerpt) Tier-2 ส่วน case ที่เหลือจงใจไม่ทำซ้ำ (เพื่อจำกัดการเปิดเผย) และอ้างถึงเป็นข้อความแทน ฟังก์ชันพื้นฐาน 2 ตัวถูกเรียกจากนอก switch (init โดย ipc_ui_init() และ set_parent โดย ipc_ui_set_container()) อีก 2 ตัวไม่มีผู้เรียกที่ใดเลย (count, needs_container) และอีก 2 ตัวถูกเรียกจากหน้า (page) Playground ของเทมเพลตเอง (clear_all, set_all_visible)

variant ที่ใช้ได้
mtb-mpy และ mtb-only (ทั้ง 30 ตัว)
ข้อความตัดตอนที่เป็นตัวแทนของ dispatch
ที่มา
ยกมาจาก BENTO-TESAIoT-libraries/claw/common/modules/ipc_ui/ipc_ui.c:393-394 and 418-477 (คอมไพล์รวมอยู่ใน archive สำเร็จรูป ไม่ได้ส่งมอบมาเป็นซอร์ส)

Function Documentation

◆ ui_widget_mgr_init()

void ui_widget_mgr_init ( lv_obj_t * parent)

ipc_ui_init() เรียกฟังก์ชันนี้เอง — ห้ามเรียกโดยตรง

Initialize the widget manager.

Parameters
parentThe LVGL parent object (UX/UI tab scrollable container).
ข้อกำหนดการเรียกใช้
ipc_ui_init() เรียกฟังก์ชันนี้เองเป็นคำสั่งแรกของตน (ipc_ui.c:890 ภายใน ipc_ui_init() ที่ :885) — ห้ามเรียกโดยตรง ไม่ใช่ case หนึ่งใน switch รับ NULL ของ deferred binding (การผูกแบบเลื่อนเวลา) ตอนบูต ส่วน parent ตัวจริงนั้นหน้า (page) จะจัดหาให้ภายหลังผ่าน ipc_ui_set_container()
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ไม่มี — ใช้เริ่มการทำงานเท่านั้น
จุดปักหมุดของ dispatch
ipc_ui.c:890ui_widget_mgr_init(parent); ใต้คอมเมนต์ "Initialize widget manager with parent container"
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_parent()

void ui_widget_mgr_set_parent ( lv_obj_t * parent)

เคลียร์ widget ทั้งหมดแล้วตั้ง parent ใหม่; ถูกเรียกผ่าน ipc_ui_set_container() เท่านั้น

Update the parent container (for page-based navigation). Clears all existing widgets and sets new parent.

Parameters
parentNew LVGL parent object, or NULL to invalidate.
ข้อกำหนดการเรียกใช้
"Clears all existing widgets and sets new parent" (ui_widget_mgr.h) ให้ส่ง NULL เข้ามาเพื่อทำให้เป็นโมฆะ ผู้เรียกเพียงรายเดียวคือ ipc_ui_set_container() (ipc_ui.c:918-921) — เป็นการนำทางตามหน้า (page) ไม่ใช่ dispatch switch การทบทวนการออกแบบครั้งหนึ่งบันทึกการแก้ไขนี้ไว้: ข้อความเหมารวมว่า "sole caller is the IPC command switch" นั้นผิดสำหรับแถวนี้แถวเดียว ผู้ใช้ไลบรารี (consumer) เรียก ipc_ui_set_container() ห้ามเรียกฟังก์ชันนี้ ทำงานใน GFX-task context คืนค่า void
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ไม่มี — หน้า (page) เป็นผู้ผูก container ส่วนสคริปต์ทำไม่ได้
จุดปักหมุดของ dispatch
ipc_ui.c:920 — เนื้อทั้งหมดของ ipc_ui_set_container() คือ ui_widget_mgr_set_parent(parent);. ส่วน call site ของ wrapper ตัวนั้นในเทมเพลตอยู่ที่ container ของ UI
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_needs_container()

bool ui_widget_mgr_needs_container ( void )

คืน true ขณะที่ parent เป็น NULL; ไม่มีผู้เรียกที่ใดเลย

Check if the widget manager has no parent container.

Returns
true if parent is NULL (needs container before creating widgets).
ข้อกำหนดการเรียกใช้
คืนค่า true ขณะที่ parent เป็น NULL — คือช่วงระหว่าง ipc_ui_set_container(NULL) ตอนทำลายหน้า (page) กับการผูกของหน้าถัดไป กล่าวคือช่วงที่ CREATE จะล้มเหลว ไม่มีผู้เรียกที่ใดเลย ตัวอย่างที่เขียนขึ้นเองโยงฟังก์ชันนี้เข้ากับข้อกำหนดของ deferred binding: หน้า (page) ที่ต้องการทราบว่า widget ของสคริปต์วางลงได้แล้วหรือยัง ให้ถามฟังก์ชันนี้ ใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ไม่มี
variant ที่ใช้ได้
mtb-mpy และ mtb-only
ตัวอย่าง (เขียนขึ้นเอง — ไม่มี call site ในของที่ส่งมอบจริง)
static void bento_ex_ui_widget_mgr_needs_container(void)
{
/* No page has bound a container (or the page just died and
* correctly NULLed it). Do not create widgets; retry on the
* next tick after a page binds. */
return;
}
/* Safe window: a container is bound — widget creation commands
* (ui_widget_mgr_create / the IPC CREATE path) have a live parent. */
}

◆ ui_widget_mgr_create()

int ui_widget_mgr_create ( const ipc_ui_create_t * cfg)

สร้าง widget จาก config; คืน handle 0-31, -1 เมื่อตารางเต็ม, -2 เมื่อชนิดไม่ถูกต้อง

Create a widget from IPC CREATE payload.

Parameters
cfgParsed CREATE payload.
Returns
Handle ID (0-31) on success, -1 if table full, -2 if invalid type.
ข้อกำหนดการเรียกใช้
คืนค่า handle 0-31, -1 เมื่อตารางเต็ม และ -2 เมื่อชนิดไม่ถูกต้อง switch จับค่าเหล่านั้นให้เป็น UI_STATUS_OK / UI_STATUS_TABLE_FULL / UI_STATUS_INVALID_TYPE ในคำตอบแบบสองทาง ตั้ง fast drain ให้พร้อมทำงาน (ui_arm_fast_mode()) และเมื่อ CREATE ครั้งแรก จะซ่อน container ไว้จนกว่า POLL_EVENTS หรือการหมดเวลาจะเปิดให้เห็นอีกครั้ง (เพื่อให้การสร้างเป็นชุดรวดปรากฏขึ้นพร้อมกันทีเดียว) ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ตัวสร้าง widget ทุกตัว — ui.Button(...), ui.Label(...), ui.Slider(...), ui.Chart(...) และตัวอื่นที่เหลือในตารางคลาส ui (modui.c:1226, แบบสองทาง)
จุดปักหมุดของ dispatch
ipc_ui.c:420 case IPC_CMD_UI_CREATE: / :422 int handle = ui_widget_mgr_create(cfg); — ทำซ้ำไว้ในข้อความตัดตอนที่เป็นตัวแทนที่ Widget manager (IPC dispatch)
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_create_sprite()

int ui_widget_mgr_create_sprite ( const lv_image_dsc_t * dsc,
int16_t x,
int16_t y )

สร้าง sprite ชนิดภาพลงใน handle table เดียวกัน

Create an image sprite from a compiled C descriptor. Reuses the widget handle table so position/visibility/delete work through the normal ops.

Parameters
dscCompiled sprite descriptor (resolved per-project from a SPR id).
Returns
Handle ID (0-31), -1 if table full, -2 if invalid/no sprite engine.
ข้อกำหนดการเรียกใช้
สร้าง sprite ชนิดภาพจาก descriptor ที่คอมไพล์ไว้ แล้วจัดเก็บไว้ใน handle table เดียวกัน การกำหนดตำแหน่ง / การแสดงหรือซ่อน / การลบ จึงทำได้ผ่านการดำเนินการปกติ คืนค่า 0-31, -1 เมื่อตารางเต็ม, -2 เมื่อไม่ถูกต้องหรือไม่มี sprite engine — กรณีหลังคือสิ่งที่ค่าปริยายชนิด weak ของ game_sprite_create ให้ออกมา (ดู Weak hook (ให้นิยามเอง ห้ามเรียก)) ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ui.sprite(id, x, y) (modui.c:1731, แบบสองทาง)
จุดปักหมุดของ dispatch
ipc_ui.c:758 case IPC_CMD_UI_SPRITE_NEW: / :763 int handle = ui_widget_mgr_create_sprite(dsc, s->x, s->y);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_sprite_image()

void ui_widget_mgr_set_sprite_image ( int handle,
const lv_image_dsc_t * dsc )

สลับภาพของ sprite; descriptor มาจาก game_sprite_lookup()

Swap a sprite's image (directional head, enemy kind, explosion frame). No-op on invalid handle or NULL descriptor.

ข้อกำหนดการเรียกใช้
สลับภาพของ sprite (ทิศทางของหัว ชนิดของศัตรู เฟรมของการระเบิด) เป็น no-op เมื่อ handle ไม่ถูกต้องหรือ descriptor เป็น NULL ตัว descriptor มาจาก game_sprite_lookup() ที่โปรเจกต์เขียนทับไว้ ซึ่งถูกเรียกก่อนหน้าหนึ่งบรรทัดใน switch ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.frame(sprite_id) บน handle ของ sprite (modui.c:651)
จุดปักหมุดของ dispatch
ipc_ui.c:819 case IPC_CMD_UI_SPRITE_FRAME: / :822 game_sprite_lookup(item->data[1]) / :823 ui_widget_mgr_set_sprite_image(handle, dsc);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_delete()

void ui_widget_mgr_delete ( int handle)

ลบ widget หนึ่งตัวและปล่อย handle ของมันคืน

Delete a widget by handle.

Parameters
handleHandle ID (0-31).
ข้อกำหนดการเรียกใช้
ลบ widget หนึ่งตัวและปล่อย handle ของมันคืน เป็นแบบ fire-and-forget จากฝั่งสคริปต์ ไม่มีคำตอบกลับ ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.delete() (modui.c:506)
จุดปักหมุดของ dispatch
ipc_ui.c:453 case IPC_CMD_UI_DELETE: / :455 ui_widget_mgr_delete(handle); — ทำซ้ำไว้ในข้อความตัดตอนที่เป็นตัวแทนที่ Widget manager (IPC dispatch)
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_clear_all()

void ui_widget_mgr_clear_all ( void )

ลบ widget ทุกตัวและรีเซ็ต handle table

Delete all widgets and reset the handle table.

ข้อกำหนดการเรียกใช้
ลบ widget ทุกตัวและรีเซ็ต handle table มีผู้เรียก 2 ราย: case CLEAR_ALL ของ switch (เมื่อมีสคริปต์ใหม่) และหน้า (page) Playground ของเทมเพลต ซึ่งเรียกจาก LVGL callback ชนิด LV_EVENT_CLICKED — ทำงานใน GFX-task context ในหน้านั้น widget ถูกรื้อทิ้ง ก่อนที่คำสั่ง restart ทาง IPC จะถูกส่งออกไป CM33_NS จึงดัน widget ใหม่เข้าไปในตารางที่เคลียร์ไปได้ครึ่งเดียวไม่ได้ คืนค่า void ไม่มีเส้นทางแจ้งข้อผิดพลาด รูปแบบที่ทำลายข้อมูลที่ page_playground.c:105 จะเคลียร์ ส่ง IPC_CMD_DELETE_MAIN_PY แล้วรีเซ็ต MCU
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ui.clear() (modui.c:1553) และยังถูกสั่งโดย ui.program() กับเส้นทาง deploy ของ IDE ด้วย (:1641, :1975)
จุดปักหมุดของ dispatch
ipc_ui.c:553 case IPC_CMD_UI_CLEAR_ALL: / :554 ui_widget_mgr_clear_all(); ตามด้วยการรีเซ็ต auto-navigate
variant ที่ใช้ได้
mtb-mpy และ mtb-only
ตัวอย่าง — soft restart (เทมเพลต)
/* ...context: inside uxui_ctrl_event_cb() - GFX task context ... */
if (cmd == UXUI_CTRL_RESTART) {
/* Soft restart: clear widgets, then tell CM33_NS to re-run main.py.
* No NVIC_SystemReset — CM55/WiFi/sensors stay alive. */
send_ipc_cmd(IPC_CMD_RESTART_SCRIPT);
}

◆ ui_widget_mgr_set_text()

void ui_widget_mgr_set_text ( int handle,
const char * text )

ตั้งข้อความของ widget; switch จะตั้ง fast drain ให้พร้อมทำงานหลังจากนั้น

Set text on a widget.

ข้อกำหนดการเรียกใช้
ตั้งข้อความของ widget switch จะตั้ง fast drain ให้พร้อมทำงานหลังจากนั้น เพื่อให้ label ที่ถูกอัปเดตในลูปวาดใหม่ที่จังหวะ 5 ms ตัวข้อความมาถึงในรูปที่ปิดท้ายด้วย NUL อยู่ใน payload ถัดจากไบต์ของ handle ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.text("...") (modui.c:396 และ :527 กับ :1261 สำหรับข้อความตอนสร้าง) ให้สังเกตขีดจำกัดของ payload ที่ 95 ไบต์สำหรับตัวสร้าง และ 126 ไบต์สำหรับ .text() ซึ่งบังคับใช้ที่ฝั่ง CM33_NS
จุดปักหมุดของ dispatch
ipc_ui.c:459 case IPC_CMD_UI_SET_TEXT: / :462 ui_widget_mgr_set_text(handle, text); + :463 ui_arm_fast_mode(); — ทำซ้ำไว้ในข้อความตัดตอนที่เป็นตัวแทนที่ Widget manager (IPC dispatch)
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_value()

void ui_widget_mgr_set_value ( int handle,
int32_t value )

ตั้งค่าตัวเลข; ตั้ง fast drain ให้พร้อมทำงานเพื่อไม่ให้แดชบอร์ดถูกตรึงไว้ที่ 5 FPS

Set numeric value on a widget.

ข้อกำหนดการเรียกใช้
ตั้งค่าตัวเลข (slider, bar, arc, seg7 ...) switch ตั้ง fast drain ให้พร้อมทำงานที่จุดนี้ด้วย — คอมเมนต์ในซอร์สบันทึกเหตุผลไว้: หากไม่มีมัน แดชบอร์ดของเซนเซอร์ทุกตัวจะถูกตรึงไว้ที่การระบายคิวแบบ idle 200 ms (ประมาณ 5 FPS) ขณะที่เกมทำงานที่ 5 ms ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.value(n) (modui.c:424)
จุดปักหมุดของ dispatch
ipc_ui.c:467 case IPC_CMD_UI_SET_VALUE: / :471 ui_widget_mgr_set_value(handle, value); — ทำซ้ำไว้ในข้อความตัดตอนที่เป็นตัวแทนที่ Widget manager (IPC dispatch)
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_position()

void ui_widget_mgr_set_position ( int handle,
int16_t x,
int16_t y )

ย้ายตำแหน่ง widget; ตั้ง fast drain ให้พร้อมทำงานเพื่ออัตราเฟรมระหว่างเล่นเกม

Set position of a widget.

ข้อกำหนดการเรียกใช้
ย้ายตำแหน่ง widget switch ตั้ง fast drain ให้พร้อมทำงาน "to keep full frame rate during gameplay" ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.pos(x, y) (modui.c:442)
จุดปักหมุดของ dispatch
ipc_ui.c:479 case IPC_CMD_UI_SET_POSITION: / :484 ui_widget_mgr_set_position(handle, x, y); + :485 ui_arm_fast_mode();.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_size()

void ui_widget_mgr_set_size ( int handle,
int16_t w,
int16_t h )

เปลี่ยนขนาดของ widget

Set size of a widget.

ข้อกำหนดการเรียกใช้
เปลี่ยนขนาดของ widget ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.size(w, h) (modui.c:460)
จุดปักหมุดของ dispatch
ipc_ui.c:489 case IPC_CMD_UI_SET_SIZE: / :494 ui_widget_mgr_set_size(handle, w, h);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_color()

void ui_widget_mgr_set_color ( int handle,
uint32_t color )

ตั้งสีหลัก 0xRRGGBB

Set primary color of a widget.

ข้อกำหนดการเรียกใช้
ตั้งสีหลัก 0xRRGGBB ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.color(0xRRGGBB) (modui.c:476)
จุดปักหมุดของ dispatch
ipc_ui.c:499 case IPC_CMD_UI_SET_COLOR: / :503 ui_widget_mgr_set_color(handle, color);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_visible()

void ui_widget_mgr_set_visible ( int handle,
bool visible )

แสดงหรือซ่อน widget หนึ่งตัว

Show or hide a widget.

ข้อกำหนดการเรียกใช้
แสดงหรือซ่อน widget หนึ่งตัว ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.show() / w.hide() (modui.c:486, :496)
จุดปักหมุดของ dispatch
ipc_ui.c:508 case IPC_CMD_UI_SET_VISIBLE: / :511 ui_widget_mgr_set_visible(handle, visible);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_all_visible()

void ui_widget_mgr_set_all_visible ( bool visible)

แสดงหรือซ่อน widget ที่จัดการอยู่ทุกตัว; เป็นตัวสลับมุมมองของการสลับคอนโซลบนหน้า Playground

Show or hide ALL managed widgets at once. Used by Console/UI toggle to switch between widget view and console view.

ข้อกำหนดการเรียกใช้
แสดงหรือซ่อน widget ที่จัดการอยู่ทุกตัวพร้อมกันในครั้งเดียว ไม่ใช่ case หนึ่งใน switch — ผู้เรียกของมันคือการสลับคอนโซลบนหน้า Playground ของเทมเพลต (ทั้งสองสาขา) widget จะถูกซ่อนก็ต่อเมื่อคอนโซลถูกแสดงเท่านั้น ดูลำดับที่ไม่สมมาตรได้ที่ คอนโซล LCD และพาเนล ทำงานใน GFX-task context คืนค่า void
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ไม่มี — เป็นตัวสลับมุมมองของหน้า (page) บน CM55 เอง
variant ที่ใช้ได้
mtb-mpy และ mtb-only
static void console_toggle_cb(lv_event_t *e)
{
(void)e;
s_console_mode = !s_console_mode;
if (s_console_mode) {
/* Switch to Console view — clear unread badge */
if (s_console_badge) {
lv_obj_add_flag(s_console_badge, LV_OBJ_FLAG_HIDDEN);
}
}
} else {
/* Switch to UI view */
}
}
/* Update button icon */
if (s_console_btn_lbl) {
lv_label_set_text(s_console_btn_lbl,
s_console_mode ? LV_SYMBOL_EYE_OPEN : LV_SYMBOL_LIST);
}
}

◆ ui_widget_mgr_get_value()

int32_t ui_widget_mgr_get_value ( int handle)

อ่านค่าปัจจุบันของ widget; ค่า 0 หมายถึง handle ไม่ถูกต้องได้ด้วย

Get current value of a widget.

Returns
Widget value or 0 if invalid handle.
ข้อกำหนดการเรียกใช้
คืนค่าปัจจุบันของ widget หรือคืน 0 เมื่อ handle ไม่ถูกต้อง — สคริปต์แยกไม่ออกระหว่าง "0" กับ "bad handle" แต่สถานะของคำตอบแบบสองทางแยกออก ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.value() ที่ไม่ใส่อาร์กิวเมนต์ (modui.c:409, แบบสองทาง)
จุดปักหมุดของ dispatch
ipc_ui.c:586 case IPC_CMD_UI_GET_VALUE: / :588 int32_t value = ui_widget_mgr_get_value(handle);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_dotmatrix()

void ui_widget_mgr_set_dotmatrix ( int handle,
const uint8_t * bitmap,
uint8_t len )

โหลดบิตแมปเข้าไปใน widget ชนิด DotMatrix

Set dot matrix bitmap data.

ข้อกำหนดการเรียกใช้
โหลดบิตแมปเข้าไปใน widget ชนิด DotMatrix โดยข้อมูล len ไบต์ตามหลัง handle อยู่ใน payload ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.set_pixels(bytes) บน ui.DotMatrix (modui.c:589)
จุดปักหมุดของ dispatch
ipc_ui.c:578 case IPC_CMD_UI_SET_DOTMATRIX: / :582 ui_widget_mgr_set_dotmatrix(handle, bitmap, len);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_image()

void ui_widget_mgr_set_image ( int handle,
uint16_t offset,
const uint8_t * data,
uint8_t len )

การส่ง RGB565 เป็นก้อน ๆ เข้าไปใน canvas ของ widget ชนิด Image

Set image pixel data (chunked RGB565 transfer).

Parameters
handleWidget handle (must be UI_WIDGET_IMAGE).
offsetByte offset into the canvas pixel buffer.
dataChunk of RGB565 pixel data.
lenChunk length in bytes.
ข้อกำหนดการเรียกใช้
การส่ง RGB565 เป็นก้อน ๆ เข้าไปใน canvas ของ widget ชนิด Image : offset คือระยะเยื้องเป็นไบต์ในบัฟเฟอร์พิกเซล ส่วน len คือความยาวของก้อนข้อมูล handle ต้องเป็น UI_WIDGET_IMAGE ฝั่งสคริปต์วนส่งก้อนข้อมูลที่ใหญ่ไม่เกินงบของ payload ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.set_image(data) บน ui.Image (modui.c:558 หนึ่งข้อความ IPC ต่อหนึ่งก้อนข้อมูล)
จุดปักหมุดของ dispatch
ipc_ui.c:647 case IPC_CMD_UI_SET_IMAGE: / :656 ui_widget_mgr_set_image(handle, offset, pixel_data, chunk_len);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_event_push()

void ui_widget_mgr_event_push ( uint8_t handle,
uint8_t event_type,
int32_t value )

ฝั่งผู้ผลิตข้อมูลของ event ring; เฉพาะ LVGL event callback ภายในเท่านั้น

Push an event into the ring buffer (called from LVGL event callbacks).

ข้อกำหนดการเรียกใช้
เป็นฝั่งผู้ผลิตข้อมูลของ event ring ซึ่งถูกระบายคิวโดย ui_widget_mgr_event_drain() ถูกเรียกจาก LVGL event callback ภายใน widget manager ที่อยู่ใน archive — มี 2 จุด และทั้งสองเป็นจุดภายใน: widget event callback ตัวทั่วไป (ui_widget_mgr.c:333 มีตัวกัน if (event_type != 0)) และ input event callback สำหรับ input event ทั้ง 12 แบบ (:406) ซึ่งจะตรวจ mask การสมัครรับประจำ widget ก่อน (s_widget_event_mask[handle] & UI_EVENT_MASK(event_type)) แล้วคืนกลับโดยไม่ผลักข้อมูลเข้าคิว เมื่อสคริปต์ไม่ได้ .listen() event นั้นไว้ ที่นี่ยังเป็นจุดที่มีการเรียก ipc_ui_input_activity() ด้วย ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
เข้าถึงทางอ้อม: w.listen("pressed", cb) และ w.bind(...) เป็นตัวตั้ง mask ที่ยอมให้การผลักข้อมูลผ่านเข้ามา ส่วน ui.poll() เป็นตัวระบายคิว
ที่มา
BENTO-TESAIoT-libraries/claw/common/modules/ipc_ui/ui_widget_mgr.c:333 และ :406 (คอมไพล์รวมอยู่ใน archive ที่สร้างไว้ล่วงหน้า ไม่ได้ส่งมอบมาเป็นซอร์ส) — ปักหมุดไว้ ไม่ได้ทำซ้ำ
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_event_drain()

int ui_widget_mgr_event_drain ( ipc_ui_event_t * out,
int max_events )

ระบาย event ออกให้ POLL_EVENTS — เป็น backend ของ ui.poll()

Drain events from the ring buffer.

Parameters
outOutput array.
max_eventsMaximum events to drain.
Returns
Number of events drained.
ข้อกำหนดการเรียกใช้
ระบาย event ออกได้ไม่เกิน max_events รายการลงในอาร์เรย์ที่ผู้เรียกเป็นเจ้าของ แล้วคืนค่าเป็นจำนวนที่ระบายได้ switch ตอบ POLL_EVENTS ด้วยไบต์ชุดนั้นพอดี case เดียวกันนี้ยังเปิดให้เห็น container ที่ถูกซ่อนไว้จาก CREATE ครั้งแรกด้วย — ผ่าน ui_widget_mgr_get_parent() ที่ตรวจ null แล้ว — เพื่อให้ widget ของสคริปต์ปรากฏขึ้นพร้อมกันทีเดียว ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ui.poll() (modui.c:1324, แบบสองทาง) — เป็นการเรียกที่ทุก event loop ต้องทำ callback ของ .listen() ถูกเรียกจากผลลัพธ์ของมัน
จุดปักหมุดของ dispatch
ipc_ui.c:516 case IPC_CMD_UI_POLL_EVENTS: / :527 int count = ui_widget_mgr_event_drain(events, UI_MAX_EVENTS_PER_POLL);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only
ที่มา
ยกมาจาก BENTO-TESAIoT-libraries/claw/common/modules/ipc_ui/ipc_ui.c:516-532 (คอมไพล์รวมอยู่ใน archive สำเร็จรูป ไม่ได้ส่งมอบมาเป็นซอร์ส)

◆ ui_widget_mgr_count()

int ui_widget_mgr_count ( void )

จำนวน handle ที่ยังใช้งานอยู่; ไม่มีผู้เรียกเลยที่ใด

Get current widget count.

ข้อกำหนดการเรียกใช้
คืนค่าจำนวน handle ที่ยังใช้งานอยู่ ถูกจัดประเภทใหม่เป็น AUTHORED ในรอบสกัดจุดปักหมุด: ทั่วทั้งไลบรารีทั้งสาม variant และเทมเพลต สิ่งที่ค้นพบมีเพียงการประกาศ (ui_widget_mgr.h:142) กับการนิยามอีก 3 แห่ง — ไม่มีผู้เรียกเลย ตัวอย่างที่เขียนขึ้นเองอ่านค่านี้ใน GFX-task context หลัง clear_all() ในฐานะข้อยืนยันตอนรื้อถอน ส่วนการอ่านจำนวนจาก task อื่นจะเกิด race condition กับเส้นทาง dispatch
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ไม่มี (ui.list() ใช้ ui_widget_mgr_list() ไม่ใช่ฟังก์ชันนี้)
variant ที่ใช้ได้
mtb-mpy และ mtb-only
ตัวอย่าง (เขียนขึ้นเอง — ไม่มี call site ในของที่ส่งมอบจริง)
static void bento_ex_ui_widget_mgr_count(void)
{
/* Teardown path (GFX task): widgets down BEFORE the IPC restart
* command, then verify the table is really empty. */
int live = ui_widget_mgr_count();
if (live != 0) {
/* Something re-created a widget between clear and check — the
* clear-before-restart ordering was violated. Surface it; do
* not silently continue into the restart. */
return;
}
/* Table empty (0 of 32 handles) — safe to let CM33_NS repopulate. */
}

◆ ui_widget_mgr_list()

int ui_widget_mgr_list ( ipc_ui_widget_info_t * out,
int max_items )

handle และชนิดของ widget ที่ทำงานอยู่ทุกตัว — เป็น backend ของ ui.list()

List all active widgets (handle + type).

Parameters
outOutput array of ipc_ui_widget_info_t.
max_itemsMaximum items to fill.
Returns
Number of active widgets written to out.
ข้อกำหนดการเรียกใช้
เติม handle และชนิดของ widget ที่ทำงานอยู่ทุกตัว ได้ไม่เกิน max_items รายการ (UI_MAX_WIDGETS ใน switch) แล้วคืนค่าเป็นจำนวนที่เขียนได้ ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ui.list() (modui.c:1432, แบบสองทาง) และ ui.get(id) (:1519) รวมถึงการ re-sync ภายในที่ modui.c:138-153 และ :291
จุดปักหมุดของ dispatch
ipc_ui.c:660 case IPC_CMD_UI_LIST: / :664 int count = ui_widget_mgr_list(info, UI_MAX_WIDGETS);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_get_parent()

lv_obj_t * ui_widget_mgr_get_parent ( void )

parent ปัจจุบันที่เป็น null ได้; ทุก call site ตรวจ null ของค่านี้

Get the current parent container object.

Returns
The LVGL parent object, or NULL if not set.
ข้อกำหนดการเรียกใช้
เป็นค่าที่เป็น null ได้ — call site ทั้ง 5 จุด ทุกจุด ตรวจ null ของผลลัพธ์ ค่านี้เป็น NULL เมื่อใดก็ตามที่ยังไม่มีหน้า (page) ใดผูก container ไว้ คือช่วงระหว่าง ipc_ui_set_container(NULL) ตอนทำลาย กับการผูกของหน้าถัดไป ตัวกัน 3 บรรทัดชุดเดียวกันนี้ปรากฏซ้ำที่ ipc_ui.c:443 (ซ่อนตอน CREATE ครั้งแรก) :519 (เปิดให้เห็นตอน POLL_EVENTS) :560 และ :859 (การเปิดให้เห็นเมื่อหมดเวลานิรภัย ในกรณีที่ POLL_EVENTS ไม่มาเลย) ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ไม่มี — เป็นเรื่องภายในของโพรโทคอลการซ่อน container
variant ที่ใช้ได้
mtb-mpy และ mtb-only
ที่มา
ยกมาจาก BENTO-TESAIoT-libraries/claw/common/modules/ipc_ui/ipc_ui.c:516-524 (คอมไพล์รวมอยู่ใน archive สำเร็จรูป ไม่ได้ส่งมอบมาเป็นซอร์ส)

◆ ui_widget_mgr_set_screen()

void ui_widget_mgr_set_screen ( int16_t width,
int16_t height )

ตั้งขนาดหน้าจอและรีเซ็ตกริดของ auto-layout

Set screen dimensions and reset auto-layout grid.

Parameters
widthScreen width in pixels (auto-layout wraps at width - 100).
heightScreen height in pixels (reserved for future use).
ข้อกำหนดการเรียกใช้
ตั้งขนาดหน้าจอและรีเซ็ตกริดของ auto-layout (auto-layout ตัดขึ้นบรรทัดใหม่ที่ width - 100 ส่วน height สงวนไว้) ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
ui.screen(w, h) (modui.c:1647)
จุดปักหมุดของ dispatch
ipc_ui.c:672 case IPC_CMD_UI_SET_SCREEN: / :676 ui_widget_mgr_set_screen(w, h);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_chart_add_series()

int ui_widget_mgr_chart_add_series ( int handle,
uint32_t color )

เพิ่มชุดข้อมูลให้ Chart; คืนดัชนี 0-3 หรือ -1

Add a series to a chart widget.

Parameters
handleWidget handle (must be UI_WIDGET_CHART).
colorSeries color (0xRRGGBB).
Returns
Series index (0-3) on success, -1 on error.
ข้อกำหนดการเรียกใช้
เพิ่มชุดข้อมูลให้ widget ชนิด Chart แล้วคืนค่าดัชนีของชุดข้อมูลเป็น 0-3 หรือ -1 ตัว handle ต้องเป็น UI_WIDGET_CHART เป็นแบบสองทางเพื่อให้สคริปต์ทราบดัชนี ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.add_series(color) บน ui.Chart (modui.c:605, แบบสองทาง)
จุดปักหมุดของ dispatch
ipc_ui.c:686 case IPC_CMD_UI_CHART_ADD_SERIES: / :691 int idx = ui_widget_mgr_chart_add_series(handle, color);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_chart_set_next()

void ui_widget_mgr_chart_set_next ( int handle,
uint8_t series_idx,
int32_t value )

ต่อค่าถัดไปเข้าไปในชุดข้อมูลของ chart ชุดหนึ่ง

Set next value for a specific chart series.

Parameters
handleWidget handle (must be UI_WIDGET_CHART).
series_idxSeries index (0-3).
valueData value.
ข้อกำหนดการเรียกใช้
ต่อค่าถัดไปเข้าไปในชุดข้อมูลของ chart ชุดหนึ่ง (ดัชนี 0-3) ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.set_next(series, value) (modui.c:631)
จุดปักหมุดของ dispatch
ipc_ui.c:700 case IPC_CMD_UI_CHART_SET_NEXT: / :706 ui_widget_mgr_chart_set_next(handle, series_idx, value);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_item_add()

int ui_widget_mgr_item_add ( const ipc_ui_item_add_t * it)

ต่อรายการหนึ่งรายการ; ค่าที่คืนมีหลายความหมาย และมีกฎเรื่องตัวโค้ดที่ทำงานจริง 2 ชุด

Append one item to a collection or container widget.

Parameters
itParsed ITEM_ADD payload; the meaning of a/b/flags/text is per widget type and is tabulated beside ui_widget_type_t.
Returns
>= 0 handle of the child page a container created (Tabview / Tileview / Win), UI_ITEM_ADD_OK_NO_CHILD item appended, no child object, -1 handle table full, -2 bad handle, wrong widget type, or the item could not be added.
ข้อกำหนดการเรียกใช้
ต่อรายการหนึ่งรายการเข้าไปใน widget ชนิดคอลเล็กชันหรือชนิด container ค่าที่คืนมีหลายความหมายและต้องอ่านตามลำดับนี้: >= 0 คือ handle ของหน้า (page) ลูกที่ container สร้างขึ้น (Tabview / Tileview / Win); UI_ITEM_ADD_OK_NO_CHILD (-3) หมายความว่ารายการถูกต่อเข้าไปแล้วโดยไม่มีอ็อบเจ็กต์ลูก; -1 คือตารางเต็ม; -2 คือ handle ไม่ถูกต้อง ชนิดผิด หรือเพิ่มรายการนั้นไม่ได้ คอมเมนต์แบบบล็อกใน header มีผลผูกพัน: ฟังก์ชันนี้ "MUST exist, and behave the same way for the same widget type, in BOTH ui_widget_mgr.c implementations — claw's and game's" เพราะชุดคิต Game คอมไพล์ ipc_ui.c ของ claw เข้ากับ widget manager ของ game และชนิดที่ฝ่ายหนึ่งรองรับแต่อีกฝ่ายไม่รองรับจะคืนค่า UI_STATUS_INVALID_TYPE บนบอร์ดบางรุ่น โดยไม่มีข้อผิดพลาดตอน build ที่ใดเลย ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.add_item, w.add_row, w.add_option, w.add_button, w.add_point, w.add_tab, w.add_tile, w.add_page, w.add_span, w.row, w.section, w.separator (modui.c:686 แบบ fire-and-forget และ :694 แบบสองทางสำหรับรูปที่เป็น container)
จุดปักหมุดของ dispatch
ipc_ui.c:772 case IPC_CMD_UI_ITEM_ADD: / :782 int child = ui_widget_mgr_item_add(it);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_item_clear()

void ui_widget_mgr_item_clear ( int handle)

ล้าง widget ชนิดคอลเล็กชันให้ว่าง

Empty a collection widget (all rows / options / buttons / list entries). No-op on a bad handle or a widget type with no collection.

ข้อกำหนดการเรียกใช้
ล้าง widget ชนิดคอลเล็กชันให้ว่าง (ทุกแถว / ตัวเลือก / ปุ่ม / รายการใน list) เป็น no-op เมื่อ handle ไม่ถูกต้องหรือเป็นชนิดที่ไม่มีคอลเล็กชัน ใช้กฎเรื่องตัวโค้ดที่ทำงานจริงสองชุดเดียวกันกับ item_add ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.clear_items() (modui.c:836)
จุดปักหมุดของ dispatch
ipc_ui.c:804 case IPC_CMD_UI_ITEM_CLEAR: / :805 ui_widget_mgr_item_clear(item->data[0]);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_set_prop()

void ui_widget_mgr_set_prop ( int handle,
uint8_t prop_id,
int32_t value )

ตั้งคุณสมบัติ UI_PROP_* หนึ่งรายการ; เป็นกลไกที่ .listen() ใช้สมัครรับ event

Set one per-widget property.

Parameters
handleWidget handle.
prop_idUI_PROP_*.
valueProperty value; two props carry a hi16/lo16 pair (see header).
ข้อกำหนดการเรียกใช้
ตั้งคุณสมบัติประจำ widget หนึ่งรายการ (UI_PROP_*) มีสองคุณสมบัติที่บรรจุคู่ hi16/lo16 ไว้ใน value ใช้กฎเรื่องตัวโค้ดที่ทำงานจริง 2 ชุดเดียวกันกับ item_add คุณสมบัติ UI_PROP_EVENT_MASK คือกลไกที่ .listen() ใช้สมัครให้ widget รับ input event ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.prop(ui.PROP_*, value) และตัวช่วยที่มีชื่อเฉพาะ w.ticks(), w.digits(), w.col_width(), w.listen(), w.opens(), w.pen(), w.month() (modui.c:856)
จุดปักหมุดของ dispatch
ipc_ui.c:810 case IPC_CMD_UI_SET_PROP: / :814 ui_widget_mgr_set_prop(p->handle, p->prop_id, value);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only

◆ ui_widget_mgr_get_object()

lv_obj_t * ui_widget_mgr_get_object ( int handle)

อ็อบเจ็กต์ LVGL ที่อยู่หลัง handle; เป็นเส้นทาง GET_TEXT สำหรับข้อความที่ผู้ใช้พิมพ์

The LVGL object behind a handle, or NULL if the slot is empty.

The manager IS the handle table, so answering this is its job. Nothing on the device calls it — it exists so a host harness can drive an object the way a finger would (lv_obj_send_event), which is the only way to photograph behaviour that only a tap can start, such as a menu row loading its page.

ข้อกำหนดการเรียกใช้
คืนอ็อบเจ็กต์ LVGL ที่อยู่หลัง handle หรือคืน NULL เมื่อช่องนั้นว่าง มีข้อเท็จจริง 2 ข้อ ทั้งคู่เป็นจริงและต้องอ่านคู่กัน: header ระบุว่า "Nothing on the device calls it — it exists so a host harness can drive an object the way a finger would" และรอบสกัดจุดปักหมุดพบว่ามันถูก dispatch จาก handler ของ GET_TEXT ที่ ipc_ui.c:606 — ไม่ใช่จาก opcode GET_OBJECT — ซึ่งเป็นจุดที่อ็อบเจ็กต์นั้นถูกใช้อ่านข้อความที่ผู้ใช้พิมพ์ลงใน textarea คอมเมนต์ของ handler เองบรรยายเส้นทางนั้นว่าเป็น "the only route by which anything a user TYPED reaches MicroPython" (ipc_ui.c:595-596) ทำงานใน GFX-task context
ส่วนที่เรียกใช้ได้ฝั่ง MicroPython
w.text() ที่ไม่ใส่อาร์กิวเมนต์ (modui.c:366, แบบสองทาง) บน ui.Textarea หรือ widget ที่มีคีย์บอร์ดรองรับ
จุดปักหมุดของ dispatch
ipc_ui.c:594 case IPC_CMD_UI_GET_TEXT: / :606 lv_obj_t *obj = ui_widget_mgr_get_object((int)handle);.
variant ที่ใช้ได้
mtb-mpy และ mtb-only