ui/cocoa/list.h

changeset 112
c3f2f16fa4b8
parent 109
c3dfcb8f0be7
--- a/ui/cocoa/list.h	Sat Oct 04 14:54:25 2025 +0200
+++ b/ui/cocoa/list.h	Sun Oct 19 21:20:08 2025 +0200
@@ -55,3 +55,67 @@
 void ui_dropdown_update(UiList *list, int i);
 UiListSelection ui_dropdown_getselection(UiList *list);
 void ui_dropdown_setselection(UiList *list, UiListSelection selection);
+
+@class UiSourceList;
+
+@interface UiSourceListItem : NSObject
+@property (weak) UiSourceList *sourcelist;
+@property (weak) UiSourceListItem *parent;
+@property (strong) NSString *label;
+@property (strong) NSString *badge;
+
+@property (strong) NSMutableArray<UiSourceListItem*> *items;
+@property UiVar *var;
+@property UiSubList *sublist;
+
+@property int sublistIndex;
+@property int sublistStartRow;
+@property int rownum;
+
+@property void *eventdata;
+
+/*
+ * Initialize a section item
+ */
+- (id)init:(UiSubListItem*)item parent:(UiSourceListItem*)parent;
+/*
+ * Initialize a child item
+ */
+- (id)init:(UiSourceList*)sourcelist sublist:(UiSubList*)sublist;
+- (BOOL)isSection;
+- (void)update:(int)row;
+
+@end
+
+
+@interface UiSourceList : NSObject <NSOutlineViewDataSource, NSOutlineViewDelegate>
+
+@property UiObject *obj;
+@property (weak) NSOutlineView *outlineView;
+@property CxList *sublists;
+@property UiVar *dynamic_sublists;
+@property ui_sublist_getvalue_func getvalue;
+@property void *getvaluedata;
+@property ui_callback onactivate;
+@property void *onactivatedata;
+@property ui_callback onbuttonclick;
+@property void *onbuttonclickdata;
+
+@property (strong) NSMutableArray<UiSourceListItem*> *sections;
+
+- (id)init:(UiObject*)obj outline:(NSOutlineView*)view;
+
+- (void)update:(int)row;
+
+@end
+
+@interface UiSourceListRow : NSTableRowView
+
+@property NSTrackingArea *trackingArea;
+@property NSView *disclosureButton;
+@property BOOL hover;
+@property BOOL showDisclosureButton;
+
+@end
+
+void ui_sourcelist_update(UiList *list, int row);

mercurial