ui/winui/toolkit.cpp

branch
newapi
changeset 205
b1ac0dd1d38b
parent 189
4daddc326877
child 207
93b9f502cb88
equal deleted inserted replaced
204:4a258d47f964 205:b1ac0dd1d38b
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "pch.h"
30
29 #include "toolkit.h" 31 #include "toolkit.h"
30
31 #include <Windows.h>
32 #undef GetCurrentTime
33 #include <winrt/Windows.Foundation.Collections.h>
34 #include <winrt/Windows.UI.Xaml.Interop.h>
35 #include <winrt/Microsoft.UI.Xaml.Controls.h>
36 #include <winrt/Microsoft.UI.Xaml.Controls.Primitives.h>
37 #include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
38 #include <winrt/Microsoft.UI.Xaml.Markup.h>
39 32
40 #include <cx/allocator.h> 33 #include <cx/allocator.h>
41 #include <cx/mempool.h> 34 #include <cx/mempool.h>
42 35
43 #include "../common/context.h" 36 #include "../common/context.h"
37 #include "../common/toolbar.h"
44 38
39 #include "MainWindow.xaml.h"
40
41 #include "App.xaml.h"
45 42
46 using namespace winrt; 43 using namespace winrt;
47 using namespace Microsoft::UI::Xaml; 44 using namespace Microsoft::UI::Xaml;
48 using namespace Microsoft::UI::Xaml::Controls; 45 using namespace Microsoft::UI::Xaml::Controls;
49 using namespace Microsoft::UI::Xaml::XamlTypeInfo; 46 using namespace Microsoft::UI::Xaml::XamlTypeInfo;
75 void OnLaunched(LaunchActivatedEventArgs const&) { 72 void OnLaunched(LaunchActivatedEventArgs const&) {
76 Resources().MergedDictionaries().Append(XamlControlsResources()); 73 Resources().MergedDictionaries().Append(XamlControlsResources());
77 if (startup_func) { 74 if (startup_func) {
78 startup_func(NULL, startup_data); 75 startup_func(NULL, startup_data);
79 } 76 }
77
78 //auto window = make<winui::implementation::MainWindow>();
79 //window.Activate();
80 } 80 }
81 IXamlType GetXamlType(TypeName const& type) { 81 IXamlType GetXamlType(TypeName const& type) {
82 return provider.GetXamlType(type); 82 return provider.GetXamlType(type);
83 } 83 }
84 IXamlType GetXamlType(hstring const& fullname) { 84 IXamlType GetXamlType(hstring const& fullname) {
124 124
125 125
126 126
127 void ui_init(const char* appname, int argc, char** argv) { 127 void ui_init(const char* appname, int argc, char** argv) {
128 application_name = appname; 128 application_name = appname;
129
130 uic_toolbar_init();
129 } 131 }
130 132
131 const char* ui_appname() { 133 const char* ui_appname() {
132 return application_name; 134 return application_name;
133 } 135 }

mercurial