HTML and CSS Reference
In-Depth Information
library. Any Windows 8 application written with JavaScript will include the WinJS library and use its
API to access functions such as storage, networking, graphics, and more.
Any code you write is compiled by the Windows 8 JavaScript engine and then run. Access to the
WinRT subsystem occurs dynamically as the user interacts with the application. As you can see from
Figure 5-2, WinRT supports all stacks: that's why there's nearly no functional difference between what
applications written with JavaScript and C# can do.
Capabilities of the WinrT ApI
Figure 5-3 expands the black box labeled with the WinRT API name that you saw in Figure 5-2. Also,
Figure 5-3 lists the classes of functions available to Windows 8 programmers.
To use a particular class of functions—for example to set up a network connection and download
some RSS data from a remote URL—you just reference the appropriate JavaScript file in your
application and start using the related functions.
The DirectX block refers to the underlying API that backs up advanced graphic capabilities of
upper layers in the Windows 8 stack. Media and presentation blocks provide the infrastructure for
image processing and manipulation, and multimedia and visual elements. Networking refers to the
communication layer—most notably HTTP connections. Finally, storage is about the reading and
writing of files and data, and the Devices block indicates the set of functions to control sensors and
locally connected devices, such as printers.
FIGURE 5-3 Class of functionality available in WinRT.
In the upcoming chapters, you'll take a tour of the various classes of functions and see how to take
advantage of them in sample applications.
Aspects of the WinrT ApI
Any code that you write on top of the WinRT API using any of the supported development stacks
(that is, HTML+JavaScript) will have some common aspects. These common aspects descend from the
design and implementation of the underlying WinRT API and strongly characterize function calls you
make through WinJS—your gateway to the low-level WinRT API.
For example, any functions expected to perform for longer than just a bunch of milliseconds have
been designed to be asynchronous. This is a huge change for developers with some experience in
Search WWH ::

Custom Search