Resources | Resources |



Transition manager

The root container has a default transition manager that is responsible for managing widget transitions. It uses an internal timer to schedule the appropriate step calls for each transition. The default transition manager can be replaced by calling IWidget_SetTransitionMrg().

The ITransitionMgr interface is used to step transitions. The transition manager is responsible for managing a collection of ITransition2 objects, resulting in consolidated updates across multiple transitions. This optimizes performance when transition updates occur, similar to invalidates and draws with Widget objects.

A transition manager is also an ITransition2 object, and can receive step calls from another manager. Although any manager may be set in active mode, it is recommended that non-critical managers be inserted within the root container's transition manager to maintain performance. A passive manager will simply step through all its internal transitions based on the offset provided by its overarching manager.

Step calls are made when the timer expires if the manager is in active mode, or when it is stepped by another manager in passive mode. Transitions are kept in the manager until they report their completion. A transition that is set to repeat is reset and kept in the manager. KeepTransitions mode is used when the manager should keep track of transitions that have been completed. Combining this mode with managers and transitions set to repeat allows complex series of transitions to be looped.

Using transition manager

The default transition manager implements all the functionality described by the ITransitionMgr interface. A manager that is not explicitly initialized will have its step time set to the default value and memory mode will be turned off.

Transitions can be added to the manager by calling ITransitionMgr_Add(). Although a transition manager is also a transition, there are transition properties that do not apply to the manager; for example PROP_STEPS and PROP_RUNTIME. The manager returns AEE_ECLASSNOTSUPPORT if one of the unsupported properties is queried.

A manager set to active mode will put itself to sleep if there are no transitions left in its queue. If the manager is in passive mode, it returns ITransition2_STATUS_STEP_DONE, and therefore may be cleaned up by its top manager. It is therefore recommended to fully populate a manager before starting it or inserting it within another manager.

To create a transition manager, an application would do the following:

  1. Call ISHELL_CreateInstance() with a ClassID of AEECLSID_CTransitionMgr to retrieve a reference counted instance of the transition manager.
  2. Insert transitions into the transition manager by calling ITransitionMgr_Add().
  3. Do one of the following:
    • Call ITransitionMgr_Start() to start the manager in master mode.
    • Call ITransitionMgr_Insert() to insert the manager into another manager.

The AEECLSID_CTransitionMgr class frees itself if the reference count reaches zero. Queued transitions are released.