From c619dbdca59985fefe617a62a2dea4cf04c28111 Mon Sep 17 00:00:00 2001 From: Alex <15167344+frostmorn@users.noreply.github.com> Date: Sun, 29 Mar 2026 16:31:22 +0300 Subject: [PATCH] implement LILKA_MENU_CLBK_CAST and LILKA_MENU_CLBK_DATA_CAST helpers for menu callbacks --- lib/lilka/src/lilka/ui.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/lilka/src/lilka/ui.h b/lib/lilka/src/lilka/ui.h index e54adf7..7c2011a 100644 --- a/lib/lilka/src/lilka/ui.h +++ b/lib/lilka/src/lilka/ui.h @@ -14,8 +14,14 @@ constexpr uint16_t menu_icon_height = 24; typedef uint16_t const menu_icon_t[menu_icon_width * menu_icon_height]; // 24x24px icon (576*2 bytes) namespace lilka { - +// TODO: Split ui.h header on separate headers one per component. Implement abstract widget implementation +// Callback function data type to be triggered on menu item any button(from list of activation buttons) typedef void (*PMenuItemCallback)(void*); +// Helper to cast anything into Lilka Menu callback, note, should match PMenuItemCallback data type +#define LILKA_MENU_CLBK_CAST(CLBK) reinterpret_cast(CLBK) +// Helper to cast any data to be passed inside Lilka Menu Callback +#define LILKA_MENU_CLBK_DATA_CAST(CLBK_DATA) reinterpret_cast(CLBK_DATA) + typedef struct { String title; const menu_icon_t* icon;