ui/winui/window.cpp

branch
newapi
changeset 187
24ce2c326d85
parent 184
8c9b4b28aaa9
child 190
70fd1b24e395
equal deleted inserted replaced
186:5db4979bf482 187:24ce2c326d85
43 43
44 #include "../common/context.h" 44 #include "../common/context.h"
45 45
46 #include <stdlib.h> 46 #include <stdlib.h>
47 47
48 #include <cx/basic_mempool.h> 48 #include <cx/mempool.h>
49 49
50 using namespace winrt; 50 using namespace winrt;
51 using namespace Microsoft::UI::Xaml; 51 using namespace Microsoft::UI::Xaml;
52 using namespace Microsoft::UI::Xaml::Controls; 52 using namespace Microsoft::UI::Xaml::Controls;
53 using namespace Microsoft::UI::Xaml::XamlTypeInfo; 53 using namespace Microsoft::UI::Xaml::XamlTypeInfo;
60 60
61 UiObject* ui_window(const char* title, void* window_data) { 61 UiObject* ui_window(const char* title, void* window_data) {
62 CxMempool* mp = cxBasicMempoolCreate(256); 62 CxMempool* mp = cxBasicMempoolCreate(256);
63 UiObject* obj = (UiObject*)cxCalloc(mp->allocator, 1, sizeof(UiObject)); 63 UiObject* obj = (UiObject*)cxCalloc(mp->allocator, 1, sizeof(UiObject));
64 64
65 obj->ctx = uic_context(obj, mp->allocator); 65 obj->ctx = uic_context(obj, mp);
66 obj->window = window_data; 66 obj->window = window_data;
67 67
68 Window window = Window(); 68 Window window = Window();
69 if (title) { 69 if (title) {
70 wchar_t *wtitle = str2wstr(title, nullptr); 70 wchar_t *wtitle = str2wstr(title, nullptr);

mercurial