add UiCellValue wrapper

Mon, 29 Sep 2025 21:34:43 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 29 Sep 2025 21:34:43 +0200
changeset 782
a72d7509d292
parent 781
b15ada8bdd8f
child 783
25b2da0aac15

add UiCellValue wrapper

ui/common/wrapper.c file | annotate | diff | comparison | revisions
ui/common/wrapper.h file | annotate | diff | comparison | revisions
--- a/ui/common/wrapper.c	Mon Sep 29 21:31:49 2025 +0200
+++ b/ui/common/wrapper.c	Mon Sep 29 21:34:43 2025 +0200
@@ -299,3 +299,22 @@
 void ui_textstyle_enable_color(UiTextStyle *style, UiBool enable) {
     style->fg_set = enable;
 }
+
+
+/* ---------------------------- UiTextStyle ---------------------------- */
+
+UiBool ui_cell_value_is_string(UiCellValue *value) {
+   return value->type == UI_STRING_EDITABLE;
+}
+
+UiBool ui_cell_value_is_int(UiCellValue *value) {
+    return FALSE; // TODO
+}
+
+const char* ui_cell_value_get_string(UiCellValue *value) {
+    return value->string;
+}
+
+int64_t ui_cell_value_get_int(UiCellValue *value) {
+    return value->i;
+}
--- a/ui/common/wrapper.h	Mon Sep 29 21:31:49 2025 +0200
+++ b/ui/common/wrapper.h	Mon Sep 29 21:34:43 2025 +0200
@@ -89,6 +89,11 @@
 UIEXPORT void ui_textstyle_set_color(UiTextStyle *style, int r, int g, int b);
 UIEXPORT void ui_textstyle_enable_color(UiTextStyle *style, UiBool enable);
 
+UIEXPORT UiBool ui_cell_value_is_string(UiCellValue *value);
+UIEXPORT UiBool ui_cell_value_is_int(UiCellValue *value);
+UIEXPORT const char* ui_cell_value_get_string(UiCellValue *value);
+UIEXPORT int64_t ui_cell_value_get_int(UiCellValue *value);
+
 
 #ifdef __cplusplus
 }

mercurial