SophiaFramework UNIVERSE 5.3 |
In general, when using the Standard Tracer of SophiaFramework for the application development, this chapter can be skipped.
Tracer of each Responder holds the rules by which the events will be dispatched to other Responders.
More precisely speaking, Tracer controls how the events will be dispatched to the Child Responder from their Parent Responder.
For instance, the SFEVT_KEY event is set to dispatch to the focused Responders in a given order, while the SFEVT_RESUME event is set to dispatch to all the Responders.
As Tracer is inherited from the Parent Responder, most of the Tracer rules are registered in the SFRApplication class by default. Likewise, most of the Tracer rules for the events related with menu or control are registered in the SFRMenu and SFRControl classes by default, respectively.
Tracer inheriting from the Parent Responder can be overridden at its Child Responder. To override some of the Tracer rules, you have only to register new Tracer rules.
The following are the default rules of dispatching events set as the Standard Tracer of SophiaFramework.
Tracer Rules
Table 10.21. Settings for the Standard Tracer of SophiaFramework
Tracer elements | |||||
---|---|---|---|---|---|
1: |
|
||||
2: |
|
||||
3: |
|
||||
4: |
|
||||
5: |
|
||||
6: |
|
||||
7: |
|
||||
8: |
|
||||
9: |
|
||||
10: |
|
||||
11.1: |
|
||||
11.2: |
|
||||
12: |
|
||||
13: |
|
||||
14 : |
|
Note | |
---|---|
For the SFEVT_KEY event, the forced dispatching flag is not set since there is no need to notify the other Responder instances after one Responder instance handles the SFEVT_KEY event. The events like SFEVT_RESUME should be dispatched to all the Responder instances, so the forced dispatching flag is set. |
Note | |
---|---|
In general, the application can be developed without problem by using this Standard Tracer settings. Standard Tracer settings usually need not to be changed. |
To customize the Standard Tracer of SophiaFramework, you have only to register the event dispatching rule to Tracer.
To register the event dispatching rule to Tracer, use the RegisterTracer function. To cancel the event dispatching rule being registered to Tracer, use the UnregisterTracer function.
Example 10.83. Registering the SREVT_CONTROL event dispatching rule: to the visible Responders, notifying Child Responders from foreground to background, forced dispatching.
SFRResponderPtr responder; SFCError error; error = responder->RegisterTracer(SREVT_CONTROL, STATUS_VISIBLE | TRACER_PROVIDE, TRACER_FORWARD);
Example 10.84. Registering the rule of dispatching the events from SFEVT_KEY to SFEVT_KEY_RELEASE: to the enabled and visible Responders, not notifying Child Responders, not forced dispatching.
SFRResponderPtr responder; SFCError error; error = responder->RegisterTracer(SFEVT_KEY, SFEVT_KEY_RELEASE, STATUS_VISIBLE | STATUS_ENABLE, TRACER_NONE);
More than one dispatching rules for the same event have been registered to Tracer, the last registration of event dispatching rule is effective.
Note | |
---|---|
The result of registering the following two event dispatching rules is different. |
Example 10.85. 1. Registering the event dispatching rule to Tracer
SFRResponderPtr responder; responder->RegisterTracer(SFEVT_KEY, STATUS_VISIBLE | STATUS_ENABLE, TRACER_NONE); responder->RegisterTracer(SFEVT_KEY, SFEVT_KEY_RELEASE, STATUS_VISIBLE | STATUS_ENABLE, TRACER_NONE); responder->RegisterTracer(SFEVT_KEY, SFEVT_KEY_RELEASE, STATUS_VISIBLE | STATUS_ENABLE, TRACER_FOCUS);
Example 10.86. 2. Registering the event dispatching rule to Tracer
SFRResponderPtr responder; responder->RegisterTracer(SFEVT_KEY, SFEVT_KEY_RELEASE, STATUS_VISIBLE | STATUS_ENABLE, TRACER_NONE); responder->RegisterTracer(SFEVT_KEY, SFEVT_KEY_RELEASE, STATUS_VISIBLE | STATUS_ENABLE, TRACER_FOCUS); responder->RegisterTracer(SFEVT_KEY, STATUS_VISIBLE | STATUS_ENABLE, TRACER_NONE);
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |