Windows Runtime Deep Dive
510 likes | 852 Vues
DEV317. Windows Runtime Deep Dive. Brendan Forster Senior Developer, ASP.NET/IIS MVP @ shiftkey. # auteched #dev317. About. What is it How can you use it What’s it doing under the hood Don’t worry, there are plenty of demos. Audience. People who work with different languages
Windows Runtime Deep Dive
E N D
Presentation Transcript
DEV317 Windows Runtime Deep Dive Brendan Forster Senior Developer, ASP.NET/IIS MVP @shiftkey
About • What is it • How can you use it • What’s it doing under the hood • Don’t worry, there are plenty of demos
Audience People who • work with different languages • care about native code • are curious about internals
You do not need to remember any of this …but its pretty neat anyway
Windows Store Apps Desktop Apps DX HTML JavaScript HTML / CSS XAML View JavaScript (Chakra) C/C++ C#, VB Model Controller C C++ C# VB Windows Runtime APIs Devices & Printing Communication & Data Graphics & Media System Services .NET SL Internet Explorer Win32 Application Model Windows Kernel Services Kernel
Windows Store Apps Desktop Apps DX HTML JavaScript HTML / CSS XAML View JavaScript (Chakra) C/C++ C#, VB Model Controller C C++ C# VB Windows Runtime APIs Devices & Printing Communication & Data Graphics & Media System Services .NET SL Internet Explorer Win32 Application Model Windows Kernel Services Kernel
Windows Store Apps Desktop Apps HTML JavaScript HTML / CSS View DX XAML JavaScript (Chakra) C/C++ C#, VB Model Controller C C++ C# VB Windows Runtime APIs Devices & Printing Communication & Data Graphics & Media System Services .NET SL Internet Explorer Win32 Application Model Windows Kernel Services Kernel
What it is "Windows Runtime, or WinRT, is a cross-platform application architecture used on the Windows 8 operating system.“ Wikipedia
What it is In laymans’ terms: use what you want. • Use C#, C++, Javascript for your logic • Use XAML or HTML for your UI • Low-level access to hardware and devices
demo An introduction to Windows Runtime What even is it?
Windows Metadata • API specification • Describe the APIs to consumers • Common Intermediate Language • (the one that .NET assemblies use)
demo What is Windows Metadata anyway? “All I see is blonde, brunette, redhead.”
How do we use the metadata ?
Language Projections • Libraries export metadata • Consumers parse said metadata • Tailor the API to the consumer • because each language has its own weirdness beauty
Windows Store App Language Support (CLR, WinJS, CRT) Language Projection Windows Metadata & Namespace UI Pickers Controls Media XAML Storage Network … Windows Runtime Core Windows Core
IInspectable IUnknown Array
IInspectable IUnknown IVector<T> Array IVectorView<T> IObservableVector<T>
STL-style Projection C++ App IInspectable IUnknown IVector<T> C#/VB App IEnumerable (T) style Projection CLR Array IVectorView<T> IObservableVector<T> HTML App Chakra JavaScript Projection
demo Write a Windows Runtime Component How awesome are you? Huh?
Cartoonify • Take in a image, output a cartoon • C++ for the image processing • Javascript for the UI
demo Cartoonify all the things It needs a better name, seriously…
Windows Store App Language Support (CLR, WinJS, CRT) Language Projection Web Host (HTML, CSS, JavaScript)) Windows Metadata & Namespace UI Pickers Controls Media XAML Storage Network … Windows Runtime Core Runtime Broker Windows Core
Process Monitor WWAHost.exe
Process Monitor WWAHost.exe
Process Monitor MyApp.exe
Process Monitor MyApp.exe
Process Monitor MyApp.exe
Package Manifests <Package> ... <Applications> <Application Id="App" Executable="Billboard.exe" EntryPoint="Billboard.App"> <VisualElementsDisplayName="Billboard" … > <DefaultTileShowName="allLogos" /> <SplashScreen Image="Assets\SplashScreen.png" /> </VisualElements> </Application> </Applications> ... </Package>
Package Manifests <Package> ... <Applications> <Application Id="App" StartPage="default.html"> <Extension Category="windows.search" /> <Extension Category="windows.backgroundTasks" StartPage="js\app.js"> <BackgroundTasks> <Task Type="controlChannel" /> </BackgroundTasks> </Extension> </Extensions> </Application> </Applications> ... </Package>
Package Manifests <Package> ... <Capabilities> <Capability Name="internetClient" /> <DeviceCapability Name="location" /> </Capabilities> ... </Package>
Use what you want • Use C#, C++, Javascript for your logic • Use XAML or HTML for your UI • Low-level access to hardware and devices
Related Content • Got Questions? • Community Lounge – Thursday/Friday • Speaker Lounge – Thursday 11am • Twitter - @shiftkey
Track Resources • dev.windows.com • channel9.msdn.com/Events/BUILD/BUILD2011/ • github.com/shiftkey/auteched2012 • github.com/shiftkey/cartoonify