# HG changeset patch # User Olaf Wintermann # Date 1740586016 -3600 # Node ID 31213068c2bac755b8e0ea66d0f240d70f182ddc # Parent 8e06a446d5527faa38799f869b8a1cb0ed91b260 fix build (WINUI3) diff -r 8e06a446d552 -r 31213068c2ba make/vs/ucx/ucx.vcxproj --- a/make/vs/ucx/ucx.vcxproj Mon Feb 24 22:08:27 2025 +0100 +++ b/make/vs/ucx/ucx.vcxproj Wed Feb 26 17:06:56 2025 +0100 @@ -139,15 +139,17 @@ + + + - @@ -159,11 +161,14 @@ + + + diff -r 8e06a446d552 -r 31213068c2ba make/vs/ucx/ucx.vcxproj.filters --- a/make/vs/ucx/ucx.vcxproj.filters Mon Feb 24 22:08:27 2025 +0100 +++ b/make/vs/ucx/ucx.vcxproj.filters Wed Feb 26 17:06:56 2025 +0100 @@ -48,9 +48,6 @@ Quelldateien - - Quelldateien - Quelldateien @@ -63,6 +60,15 @@ Quelldateien + + Quelldateien + + + Quelldateien + + + Quelldateien + @@ -110,14 +116,23 @@ Headerdateien - - Headerdateien - Headerdateien Headerdateien + + Headerdateien + + + Headerdateien + + + Headerdateien + + + Headerdateien + \ No newline at end of file diff -r 8e06a446d552 -r 31213068c2ba ui/common/context.c --- a/ui/common/context.c Mon Feb 24 22:08:27 2025 +0100 +++ b/ui/common/context.c Wed Feb 26 17:06:56 2025 +0100 @@ -139,8 +139,8 @@ void uic_context_detach_document2(UiContext *ctx, void *document) { // find the document in the documents list - ssize_t docIndex = cxListFind(ctx->documents, document); - if(docIndex < 0) { + size_t docIndex = cxListFind(ctx->documents, document); + if(!cxListIndexValid(ctx->documents, docIndex)) { return; } diff -r 8e06a446d552 -r 31213068c2ba ui/ui/container.h --- a/ui/ui/container.h Mon Feb 24 22:08:27 2025 +0100 +++ b/ui/ui/container.h Wed Feb 26 17:06:56 2025 +0100 @@ -336,6 +336,8 @@ typedef UIWIDGET (*ui_createwidget_func)(UiObject *obj, UiWidgetArgs args, void *userdata, Widget parent, Arg *a, int n); #elif defined(UI_COCOA) typedef UIWIDGET (*ui_createwidget_func)(UiObject *obj, UiWidgetArgs args, void *userdata); +#elif defined(UI_WINUI) +typedef UIWIDGET(*ui_createwidget_func)(UiObject *obj, UiWidgetArgs args, void *userdata); #endif UIEXPORT UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget, void *userdata, UiWidgetArgs args); diff -r 8e06a446d552 -r 31213068c2ba ui/ui/toolkit.h --- a/ui/ui/toolkit.h Mon Feb 24 22:08:27 2025 +0100 +++ b/ui/ui/toolkit.h Wed Feb 26 17:06:56 2025 +0100 @@ -152,7 +152,11 @@ #define UI_GROUPS(...) (const int[]){ __VA_ARGS__, -1 } /* public types */ +#ifndef __cplusplus typedef _Bool UiBool; +#else +typedef bool UiBool; +#endif typedef struct UiObject UiObject; typedef struct UiContainerX UiContainerX; diff -r 8e06a446d552 -r 31213068c2ba ui/winui/container.cpp --- a/ui/winui/container.cpp Mon Feb 24 22:08:27 2025 +0100 +++ b/ui/winui/container.cpp Wed Feb 26 17:06:56 2025 +0100 @@ -905,6 +905,11 @@ ct->layout.vfill = fill; } +void ui_layout_override_defaults(UiObject* obj, UiBool def) { + UiContainer* ct = uic_get_current_container(obj); + ct->layout.override_defaults = def; +} + void ui_layout_width(UiObject* obj, int width) { UiContainer* ct = uic_get_current_container(obj); ct->layout.width = width; diff -r 8e06a446d552 -r 31213068c2ba ui/winui/container.h --- a/ui/winui/container.h Mon Feb 24 22:08:27 2025 +0100 +++ b/ui/winui/container.h Wed Feb 26 17:06:56 2025 +0100 @@ -69,6 +69,7 @@ UiBool vexpand; UiBool hfill; UiBool vfill; + UiBool override_defaults; int width; int height; int colspan;