SophiaFramework UNIVERSE 5.3 |
This class manages a list of handlers. Some functions of this class are used only in the SFYDistributer class and the SFYResponder class and will not be used directly in the applet development.
Types |
---|
HandlerSPP Prototype of the handler function.
|
RuleRec Structure that represents the handler of a handler function and a reference value.
|
typedef Bool(* SFYHandler::HandlerSPP)(SFYResponderPtr invoker, SFXEventConstRef event, VoidPtr reference) SFMTYPEDEFTYPE(SFYHandler::HandlerSPP)
This is the prototype of the handler function used in the SFYDistributer, SFYResponder, or SFYApplication class.
First argument: the responder that calls this handler function, second argument: the event, third argument: reference value.
SFYDistributer | SFYResponder | SFYApplication | SFYDistributer::RegisterHandler | SFYResponder::RegisterHandler | SFYApplication::RegisterHandler
typedef Bool (*HandlerSPP)(SFYResponderPtr invoker, SFXEventConstRef event, VoidPtr reference); SFMTYPEDEFTYPE(HandlerSPP) SFMTYPEDEFSTRUCT(RuleRec) struct RuleRec { HandlerSPP spp; // handler function VoidPtr reference; // reference value };
This structure is used when calling the SFYDistributer::RegisterHandler, SFYResponder::RegisterHandler, or SFYApplication::RegisterHandler function.
The code to register more than one handler at a time is as follows:
static SFXEventRange::AtomRecConst range[] = { { SFEVT_KEY, SFEVT_KEY, SFP16_BEGIN, SFP16_END}, {SFEVT_KEY_PRESS, SFEVT_KEY_PRESS, SFP16_BEGIN, SFP16_END}, { SFEVT_KEY_RELEASE, SFEVT_KEY_RELEASE, SFP16_BEGIN, SFP16_END} }; SFYHandler::RuleRec rule[lengthof(range)]; SFCError error; rule[0].spp = XANDLER_FUNCTION(OnKey); rule[0].reference = this; rule[1].spp = XANDLER_FUNCTION(OnKeyPress); rule[1].reference = this; rule[2].spp = XANDLER_FUNCTION(OnKeyRelease); rule[2].reference = this; error = RegisterHandler(atomic_cast(range), rule, lengthof(range));
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |