Introduction to Windows Client Development (II)

Source: Internet
Author: User
Tags silverlight

Introduction to Windows Client Development (II)

What parts of a typical Windows client program do you want to make? Below I will be a domestic more popular Internet client program basic architecture to follow you gradually analysis, because of the issue of intellectual property rights, please do not ask me what is the product, of course, if you can guess, then I have no ^_^.

A video AV internet PC client product Basic architecture


As above is just a rough hierarchical architecture diagram, there is no more detailed division, but there are several areas that need special attention, such as the top of the few parts, audio and video decoding engine, UI engine, WebKit browser kernel, kernel communication module, log system.

Because the audio and video decoding engine and the kernel communication module are unique to the video client and to the peer-to communication, not universal, so I do not do a special introduction here.

First, we're going to start by introducing the UI engine.

The so-called UI engine is commonly referred to as the interface library, for the client product, UI development takes up a lot of space, the UI will directly impress the user's most intuitive experience, so a good interface library is really the top priority.

So what's a good UI engine? From the functional point of view, the first configuration is convenient, can quickly modify the interface, or complete the reconstruction of the interface, followed by a feature-rich control, to meet a variety of UI requirements. From a technical point of view, the interface library is better to transplant, such as drawing layer and presentation layer separation, so when cross-platform only need to modify the drawing layer of code, and the upper layer of the client UI code does not need to make too much change. Second, scalability, scalability is good for the interface library itself control is not rich enough to quickly develop new controls, where the face of the object-oriented technology has a great relationship. Second, the UI interface library should have good extensibility, for example, if the existing control is not enough, can directly with the platform native control, so that the interface control element is missing can quickly take advantage of the platform native control to compensate.

The current interface library development has been roughly four stages

One of the earliest stages of interface development with Windows API

The interface of this period is relatively simple, the picture also uses less, the software structure is not particularly complex, so this phase of the interface is not even the independent engine, the basic and Data layer and the communication layer is integrated.

At this stage, if you want to create a window, you need to call a lot of Windows APIs, you need to create the message loop manually, you need to call the API such as CreateWindow and the corresponding message processing.

Second-generation interface library represented by MFC and WTL

At this stage, due to the development of object-oriented technology (mainly C + +), the Windows platform has a C + + package interface library such as MFC. Its main feature is the use of C + + polymorphism, encapsulation and other C + + features, such as the window encapsulation, the window as an object, the processing of the window as applied to the window class object behavior. Although the introduction of object-oriented concepts, but in essence, this is a code to piece together the interface, the UI developers still have a high demand.

At this stage, if you want to create a window, the relative amount of work is less, derive two classes, the message loop has been encapsulated inside, covering their virtual function, in the inside do some initialization operation is possible.

Third-generation interface library represented by QT

QT uses a qml this descriptive scripting language to configure the interface, the method of development interface in terms of efficiency and the previous two generations of products have greatly improved, learning costs are much lower.

At this stage, if you want to create a window, you just need to make a visual creation change in the QML editor, QT will compile the corresponding QML file into your application, in a way, you do not even need to understand C + + can also complete the basic development of the interface.

Iv. fourth-generation interface library characterized by XML configuration

On the Windows platform, there are wpf,silverlight technologies, as well as a library of XUL (the UI engine used by Firefox). Now many of the domestic interface libraries are counted as this type, such as the recent popular duilib. Their main characteristics are: interface development and logic control separation, using XML to configure the interface, a node of XML is generally a control, the various properties on the node control the characteristics of the control, such as location, pictures and so on. Using another language as a logical control of the interface element processing, such as the Xul script language javascript,wpf,silverlight with C#,duilib, directly uses C + +.

At this stage, if you want to configure a window you may only need to declare an element in XML (WPF and Silverlight is XAML), such as

<window x= "0" y= "0" width= "All" height= "background=" ></window>

A simple description, similar to the one above, completes a position in the upper-left corner of the screen (0,0), with a width of 400, a height of 300, and a background image of the bg.png's window, noting that this is the configuration, not the creation, because creation needs to be completed after the UI engine resolves the XML.

In fact, the development of Interface library and computing software and hardware technology has a great relationship, with the improvement of software reuse, the reuse of UI elements is also increasing. With the development of hardware technology, faster CPUs and larger memory, we have relatively good performance in some of the ways we used to look at less efficient processing interfaces, but with greater flexibility at the same time.

Today's Internet clients will generally have their own interface library, it is possible to use some open-source interface library to modify their own. As far as I know QQ is using its own development of the interface Library, PPS is Duilib, recently turned out a new PC client, which incredibly also has duilib authorization file, because the interface library development is the client development is relatively technical content of things, so the difficulty is relatively large, The popular fourth generation C + + interface library is not much, if you are interested in self-study.

The second article is here, and then I want to introduce the foundation of Windows interface Development, GDI is the thing, but also a brief introduction of GDI common functions and methods of use, as well as common pits.

Thanks for watching!

Introduction to Windows Client Development (II)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.