Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

typedef struct _IWindow IWindow;
QINTERFACE(IWindow)
{
// Enables/Disables the window. Window controls will not process
// events if the window is disabled.
void (*Enable)(IWindow * po, boolean bEnable);

// Redraws the window if enabled
void (*Redraw)(IWindow * po);

// Handles the events routed to the window
boolean (*HandleEvent)(IWindow * po, AEEEvent eCode, uint16 wParam, uint32 dwParam);

// Releases the window resources
void (*Delete)(IWindow * po);
;

#define IWINDOW_Enable(p) GET_PVTBL(p, IWindow)->Enable(p, TRUE) //How to understand GET_PVTBL( ) ????
#define IWINDOW_Disable(p) GET_PVTBL(p, IWindow)->Enable(p, FALSE)
#define IWINDOW_Redraw(p) GET_PVTBL(p, IWindow)->Redraw(p)
#define IWINDOW_HandleEvent(p, e, w, dw) GET_PVTBL(p, IWindow)->HandleEvent(p, e, w, dw)
#define IWINDOW_Delete(p) GET_PVTBL(p, IWindow)->Delete(p)

/*===============================================================================
MACROS
=============================================================================== */
#define MP_IWINDOW_SETVTBL(pVtbl, pfnEn, pfnRd, pfnHE, pfnDel) \
(pVtbl)->Enable = (pfnEn); \
(pVtbl)->Redraw = (pfnRd); \
(pVtbl)->HandleEvent = (pfnHE); \
(pVtbl)->Delete = (pfnDel)

#define MP_IWINDOW_SETVTBL(pVtbl, pfnEn, pfnRd, pfnHE, pfnDel) \
(pVtbl)->Enable = (pfnEn); \
(pVtbl)->Redraw = (pfnRd); \
(pVtbl)->HandleEvent = (pfnHE); \
(pVtbl)->Delete = (pfnDel)

Sorry, I'm a newer to BREW.

:)

it is C based object class. Just expand the MACROs, then you will know the meaning.
-michael

it is C based object class. Just expand the MACROs, then you will know the meaning.
-michael

Where defined GET_PVTBL() , in which header file ?

Where defined GET_PVTBL() , in which header file ?

in AEE.h// returns an 'iname'Vtbl *
#define GET_PVTBL(p,iname) ((iname*)p)->pvt

in AEE.h// returns an 'iname'Vtbl *
#define GET_PVTBL(p,iname) ((iname*)p)->pvt