The two types of anim DLL

Originally, anim DLLs only provided the ability to draw to a single window per anim object. This type of anim DLL is now called a ''window anim'', and to create one you would return an object derived from CWindowAnim from CreateInstanceL().

To provide digital ink on-screen, we developed a new type of anim that allowed drawing to a sprite. This is known as a ''sprite anim'', and to create one you would return an object derived from CSpriteAnim from CreateInstanceL(). The relationships between these, and other, classes are shown in Figure 11.2.

Figure 11.2 Animation class hierarchy

There are two types of functions in the anim interface. Firstly, there are functions in the anim that WSERV calls. These are shown in the diagram as member functions of the four classes: MEventHandler, CAnim, CSpriteAnim and CWindowAnim; they are all pure virtual functions and so the anim writer has to provide implementations for the relevant set of these functions, depending on which class she has derived from.

The WSERV functions that an anim can call are provided by means of the member data shown in Figure 11.2. There are four in all, shown with the class they belong to in parentheses:

• iFunctions (MAnimGeneralFunctions)

• iSpriteFunctions (MAnimSpriteFunctions)

• iWindowFunctions (MAnimWindowFunctions)

CAnimGc provides drawing functions that the window anim uses to draw to its window.

Thus our example CHandWritingAnim is a sub-class of CSpriteAnim.

0 0

Post a comment

  • Receive news updates via email from this site