Developer

API Reference

HandlerDesc

Brew Release
Brew MP 1.0.2
See Also
- PFNHANDLER
- PFNFREEHANDLER
- IHandler_SetHandler()
Description
This data type defines the callback handlers a object implementing the handler interface will use to handle events and -- when the object is finally released -- free any private storage allocated by the object.
Members
  • pfn:      Pointer to the callback function that BREW will call when handling
                 events sent to this object.  This routine will override the default 
                 event handling routine, allowing an application to perform custom
                 event handling for the object.
  • pCxt:     A pointer to private data allocated and managed by the caller that
                 has registered the handler.  This data pointer is passed into the
                 event handler, as well as the free handler, providing each of these
                 callbacks with access to this private storage.
  • pfnFree:  Pointer to the callback function that BREW will call when freeing the
                 private memory associated with the handler.  This gives the object
                 the opportunity to release any "deep storage" that may have been
                 allocated by the object.
    
Definition
   typedef struct {
      PFNHANDLER        pfn;
      void             *pCxt;
      PFNFREEHANDLER    pfnFree;
   } HandlerDesc;
Comment
A pointer to a HandlerDesc data structure is passed to IHandler_SetHandler() to register the callbacks an object implementing the handler interface will use to perform custom event handling and memory free routines.
  • Follow