4 weeks ago
fix build (WINUI3)
--- 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 @@ <ClCompile Include="..\..\..\ucx\hash_key.c" /> <ClCompile Include="..\..\..\ucx\hash_map.c" /> <ClCompile Include="..\..\..\ucx\iterator.c" /> + <ClCompile Include="..\..\..\ucx\json.c" /> <ClCompile Include="..\..\..\ucx\linked_list.c" /> <ClCompile Include="..\..\..\ucx\list.c" /> <ClCompile Include="..\..\..\ucx\map.c" /> <ClCompile Include="..\..\..\ucx\mempool.c" /> <ClCompile Include="..\..\..\ucx\printf.c" /> + <ClCompile Include="..\..\..\ucx\properties.c" /> + <ClCompile Include="..\..\..\ucx\streams.c" /> <ClCompile Include="..\..\..\ucx\string.c" /> <ClCompile Include="..\..\..\ucx\szmul.c" /> <ClCompile Include="..\..\..\ucx\tree.c" /> - <ClCompile Include="..\..\..\ucx\utils.c" /> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\..\ucx\cx\allocator.h" /> @@ -159,11 +161,14 @@ <ClInclude Include="..\..\..\ucx\cx\hash_key.h" /> <ClInclude Include="..\..\..\ucx\cx\hash_map.h" /> <ClInclude Include="..\..\..\ucx\cx\iterator.h" /> + <ClInclude Include="..\..\..\ucx\cx\json.h" /> <ClInclude Include="..\..\..\ucx\cx\linked_list.h" /> <ClInclude Include="..\..\..\ucx\cx\list.h" /> <ClInclude Include="..\..\..\ucx\cx\map.h" /> <ClInclude Include="..\..\..\ucx\cx\mempool.h" /> <ClInclude Include="..\..\..\ucx\cx\printf.h" /> + <ClInclude Include="..\..\..\ucx\cx\properties.h" /> + <ClInclude Include="..\..\..\ucx\cx\streams.h" /> <ClInclude Include="..\..\..\ucx\cx\string.h" /> <ClInclude Include="..\..\..\ucx\cx\test.h" /> <ClInclude Include="..\..\..\ucx\cx\tree.h" />
--- 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 @@ <ClCompile Include="..\..\..\ucx\string.c"> <Filter>Quelldateien</Filter> </ClCompile> - <ClCompile Include="..\..\..\ucx\utils.c"> - <Filter>Quelldateien</Filter> - </ClCompile> <ClCompile Include="..\..\..\ucx\mempool.c"> <Filter>Quelldateien</Filter> </ClCompile> @@ -63,6 +60,15 @@ <ClCompile Include="..\..\..\ucx\tree.c"> <Filter>Quelldateien</Filter> </ClCompile> + <ClCompile Include="..\..\..\ucx\json.c"> + <Filter>Quelldateien</Filter> + </ClCompile> + <ClCompile Include="..\..\..\ucx\properties.c"> + <Filter>Quelldateien</Filter> + </ClCompile> + <ClCompile Include="..\..\..\ucx\streams.c"> + <Filter>Quelldateien</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\..\ucx\cx\allocator.h"> @@ -110,14 +116,23 @@ <ClInclude Include="..\..\..\ucx\cx\string.h"> <Filter>Headerdateien</Filter> </ClInclude> - <ClInclude Include="..\..\..\ucx\cx\utils.h"> - <Filter>Headerdateien</Filter> - </ClInclude> <ClInclude Include="..\..\..\ucx\cx\test.h"> <Filter>Headerdateien</Filter> </ClInclude> <ClInclude Include="..\..\..\ucx\cx\tree.h"> <Filter>Headerdateien</Filter> </ClInclude> + <ClInclude Include="..\..\..\ucx\cx\json.h"> + <Filter>Headerdateien</Filter> + </ClInclude> + <ClInclude Include="..\..\..\ucx\cx\properties.h"> + <Filter>Headerdateien</Filter> + </ClInclude> + <ClInclude Include="..\..\..\ucx\cx\streams.h"> + <Filter>Headerdateien</Filter> + </ClInclude> + <ClInclude Include="..\..\..\ucx\cx\utils.h"> + <Filter>Headerdateien</Filter> + </ClInclude> </ItemGroup> </Project> \ No newline at end of file
--- 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; }
--- 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);
--- 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;
--- 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;