mcb.h File Reference

<mi32/mcb.h> Include file for Mcb (MicroImages Callback) toolkit More...

#include <mi32/stddefns.h>

Include dependency graph for mcb.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

struct  McbAnyCallbackStruct
struct  McbLIST
 < GENERATING_DOXYGEN_OUTPUT Callback list. More...

Defines

#define LIBEXPORT   MI_DLLIMPORT
#define MCB_ADD(_clsname)   inline void McbCallbackAdd (McbLIST *list, void (*f)(McbAnyCallbackStruct*,_clsname*), UINT32 flags) const { McbAddCallback(list,reinterpret_cast<McbCallbackFunc>(f),const_cast<_clsname*>(this),(flags)); }
#define MCB_ADDEX(_clsname, _strname)   inline void McbCallbackAdd (McbLIST *list, void (*f)(_strname*,_clsname*), UINT32 flags) const { McbAddCallback(list,reinterpret_cast<McbCallbackFunc>(f),const_cast<_clsname*>(this),(flags)); }
#define MCB_PriorityHigh   -1
#define MCB_PriorityLow   1
#define MCB_PriorityNormal   0
#define MCB_REMOVE(_clsname)   inline void McbCallbackRemove (McbLIST *list, void (*f)(McbAnyCallbackStruct*,_clsname*), UINT32 flags) const { McbRemoveCallback(list,reinterpret_cast<McbCallbackFunc>(f),const_cast<_clsname*>(this),(flags)); }
#define MCB_REMOVEEX(_clsname, _strname)   inline void McbCallbackRemove (McbLIST *list, void (*f)(_strname*,_clsname*), UINT32 flags) const { McbRemoveCallback(list,reinterpret_cast<McbCallbackFunc>(f),const_cast<_clsname*>(this),(flags)); }

Typedefs

typedef void(* McbCallbackFunc )(McbAnyCallbackStruct *, void *)

Functions

LIBEXPORT int McbAddCallback (McbLIST *cblist, McbCallbackFunc cbfunc, void *cbdata, UINT32 reasonmask)
LIBEXPORT int McbAddCallbackExt (McbLIST *cblist, McbCallbackFunc cbfunc, void *cbdata, UINT32 reasonmask, INT8 priority)
LIBEXPORT void McbCallCallbacks (McbLIST *cblist, McbAnyCallbackStruct *cbstruct, UINT32 reason)
LIBEXPORT int McbHasCallbacks (McbLIST *cblist, UINT32 reason)
LIBEXPORT void McbRemoveAllCallbacks (McbLIST *cblist)
LIBEXPORT void McbRemoveCallback (McbLIST *cblist, McbCallbackFunc cbfunc, void *cbdata, UINT32 reasonmask)


Detailed Description

<mi32/mcb.h> Include file for Mcb (MicroImages Callback) toolkit

Definition in file mcb.h.


Define Documentation

#define LIBEXPORT   MI_DLLIMPORT
 

Definition at line 53 of file mcb.h.

#define MCB_ADD _clsname   )     inline void McbCallbackAdd (McbLIST *list, void (*f)(McbAnyCallbackStruct*,_clsname*), UINT32 flags) const { McbAddCallback(list,reinterpret_cast<McbCallbackFunc>(f),const_cast<_clsname*>(this),(flags)); }
 

Macros for defining class methods to add Mcb callbacks.

Definition at line 59 of file mcb.h.

#define MCB_ADDEX _clsname,
_strname   )     inline void McbCallbackAdd (McbLIST *list, void (*f)(_strname*,_clsname*), UINT32 flags) const { McbAddCallback(list,reinterpret_cast<McbCallbackFunc>(f),const_cast<_clsname*>(this),(flags)); }
 

Definition at line 60 of file mcb.h.

#define MCB_PriorityHigh   -1
 

Definition at line 84 of file mcb.h.

#define MCB_PriorityLow   1
 

Definition at line 86 of file mcb.h.

#define MCB_PriorityNormal   0
 

Definition at line 85 of file mcb.h.

#define MCB_REMOVE _clsname   )     inline void McbCallbackRemove (McbLIST *list, void (*f)(McbAnyCallbackStruct*,_clsname*), UINT32 flags) const { McbRemoveCallback(list,reinterpret_cast<McbCallbackFunc>(f),const_cast<_clsname*>(this),(flags)); }
 

Definition at line 61 of file mcb.h.

#define MCB_REMOVEEX _clsname,
_strname   )     inline void McbCallbackRemove (McbLIST *list, void (*f)(_strname*,_clsname*), UINT32 flags) const { McbRemoveCallback(list,reinterpret_cast<McbCallbackFunc>(f),const_cast<_clsname*>(this),(flags)); }
 

Definition at line 62 of file mcb.h.


Typedef Documentation

typedef void(* McbCallbackFunc)(McbAnyCallbackStruct *, void *)
 

Definition at line 78 of file mcb.h.


Function Documentation

LIBEXPORT int McbAddCallback McbLIST cblist,
McbCallbackFunc  cbfunc,
void *  cbdata,
UINT32  reasonmask
 

Add callback to callback list.

This is equivalent to McbAddCallbackExt(cblist, cbfunc, cbdata, reasonmask, MCB_PriorityNormal).

Parameters:
cblist  Callback list to add to
cbfunc  Callback function
cbdata  "Hook" data to pass to callback function
reasonmask  Programmer-defined reasons for which callback will be called

LIBEXPORT int McbAddCallbackExt McbLIST cblist,
McbCallbackFunc  cbfunc,
void *  cbdata,
UINT32  reasonmask,
INT8  priority
 

Add callback to callback list with position determined by priority.

If reasonmask is 0 all reasons will be selected.

Parameters:
cblist  Callback list to add to
cbfunc  Callback function
cbdata  "Hook" data to pass to callback function
reasonmask  Programmer-defined reasons for which callback will be called
priority  (MCB_PriorityHigh, MCB_PriorityNormal, MCB_PriorityLow)

LIBEXPORT void McbCallCallbacks McbLIST cblist,
McbAnyCallbackStruct cbstruct,
UINT32  reason
 

Call callbacks in list selected by reason.

The specified reason will be bitwise-anded with the reasonmask which was specified in McbAddCallback() to determine if the callback function will actually be called. You can use McbAnyCallbackStruct for the structure type if you are only interested in specifying a callback reason and no additional information.

Parameters:
cblist  Callback list
cbstruct  Pointer to callback structure, first entry must be ULONG reason
reason  Reason, will be ANDed with callback reasonmask

LIBEXPORT int McbHasCallbacks McbLIST cblist,
UINT32  reason
 

Check to see if callback list has a callback for a given reason.

Returns:
True if there is a callback in the callback list which matches the given reason.
Parameters:
cblist  Callback list
reason  Reason, will be ANDed with callback reasonmask

LIBEXPORT void McbRemoveAllCallbacks McbLIST cblist  ) 
 

Remove all callbacks from list.

Parameters:
cblist  Callback list to remove all callbacks from

LIBEXPORT void McbRemoveCallback McbLIST cblist,
McbCallbackFunc  cbfunc,
void *  cbdata,
UINT32  reasonmask
 

Remove callback from list.

If "cbfunc" or "cbdata" are NULL and/or the "reasonmask" is 0 they will not be used to "match" the callbacks. For example, McbRemoveCallback(&cblist,NULL,data,0) will remove all callbacks that reference the specified "data". This can be useful if that data is about to be freed. Selected callback "reasons" can be removed without removing the entire callback as well. Callbacks can be removed from the list safely while being called.

Parameters:
cblist  Callback list to remove to
cbfunc  Callback function
cbdata  "Hook" data specified in McbAddCallback()
reasonmask  Programmer-defined reasons specified in McbAddCallback()


Generated on Tue Dec 14 13:19:05 2004 for TNTsdk by  doxygen 1.3.8-20040913