Developer

API Reference

IController_SetHandler()

Brew Release
Brew MP 1.0.2
Description
This function allows a controller to hook its own event handler into the normal controller event handling mechanism. For example, a controller that derives from one of the standard controllers could insert its own event handler that will be called by the base controller object each time an event is processed.
The event handler is stored in a HandlerDesc data structure as a PFNHANDLER, along with a pointer to a block of memory allocated and owned by the controller. This pointer will be passed into the controller's event handler with each event to be processed. The HandlerDesc data structure also contains a PFNFREEHANDLER that will be called when the controller is released so that the controller may free the private memory allocated and passed to the event handler.
IController_SetHandler() associates a given HandlerDesc data structure with a particular controller.
Interface
Prototype
   void    ICONTROLLER_SetHandler(IController* pi, 
                                  HandlerDesc* pDesc);
Return
none
Side Effect
pDesc is attached or detached (if NULL).
Comment
Passing NULL for the HandlerDesc will reset the controller's event handler to use the base controller's default event handler, without private memory or the need to free privately allocated storage.
The handler installed by a controller to process events should itself remember to call HANDLERDESC_Call() so that controller that themselves derive from this controller may also hook into the controller's event handler.
  • Follow