ui/common/wrapper.c

changeset 109
c3dfcb8f0be7
parent 108
77254bd6dccb
child 110
c00e968d018b
--- a/ui/common/wrapper.c	Sun Jul 20 22:04:39 2025 +0200
+++ b/ui/common/wrapper.c	Sun Aug 24 15:24:16 2025 +0200
@@ -218,3 +218,38 @@
 void ui_sublist_item_set_eventdata(UiSubListItem *item, void *eventdata) {
     item->eventdata = NULL;
 }
+
+/* ---------------------------- UiListSelection ---------------------------- */
+
+UiListSelection* ui_list_get_selection_allocated(UiList *list) {
+    UiListSelection *sel = malloc(sizeof(UiListSelection));
+    *sel = ui_list_get_selection(list);
+    return sel;
+    
+}
+
+int ui_list_selection_get_count(UiListSelection *sel) {
+    return sel->count;
+}
+
+int* ui_list_selection_get_rows(UiListSelection *sel) {
+    return sel->rows;
+}
+
+void ui_list_selection_free(UiListSelection *sel) {
+    ui_listselection_free(*sel);
+    free(sel);
+}
+
+/* ---------------------------- UiFileList ---------------------------- */
+
+int ui_filelist_count(UiFileList *flist) {
+    return flist->nfiles;
+}
+
+char* ui_filelist_get(UiFileList *flist, int index) {
+    if(index >= 0 && index < flist->nfiles) {
+        return flist->files[index];
+    }
+    return NULL;
+}

mercurial