mobject.h File Reference
Go to the source code of this file.
Defines
- #define _c(ths) (ths)->_class
- the marco get the class of a object
- #define _IM(piobj, method,...) (piobj)->_vtable->method(INTEFACE_ADJUST(piobj), ##__VA_ARGS__)
- call the interface object
- #define TYPENAME(obj) ((obj)?(((obj)->_class)?((obj)->_class)->typeName:""):"")
- Get the class name form a Object pointer.
- #define INSTANCEOF(obj, clss) ncsInstanceOf((mObject*)(obj), (mObjectClass*)(void*)(&Class(clss)))
- A wrapper of ncsInstanceOf, just like java's instanceof.
- #define CHECKOBJ(obj) ncsIsValidObj((mObject*)obj)
- the wrapper of ncsIsValidObj
- #define TYPE_CAST(Type, obj) ((Type*)(obj))
- unsafe cast. donot check the type of class
- #define SAFE_CAST(Type, obj) TYPE_CAST(Type, ncsSafeCast((mObject*)obj,(mObjectClass*)(void*)(&(Class(Type)))))
- wrapper of ncsSafeCast, check the class type before cast.
- #define SAFE_CAST_CLASS(Clss, ClssCast) ((ClassType(ClssCast)*)(ncsSafeCastClass((mObjectClass*)Clss, (mObjectClass*)(void*)(&Class(ClssCast)))))
- the wrapper of ncsSafeCastClass
Typedefs
Functions
- static mObject * _initObject (mObject *pobj, mObjectClass *_class, DWORD param)
- static mObject * initObjectArgs (mObject *pobj, mObjectClass *_class,...)
- MGNCS_EXPORT mObject * newObject (mObjectClass *_class)
- new a object instance, like new operator in C++
- MGNCS_EXPORT void deleteObject (mObject *obj)
- delete a object intance, like delete operator in C++
- MGNCS_EXPORT BOOL ncsInstanceOf (mObject *object, mObjectClass *clss)
- check an object is the class instance or not, same as instanceof operator in Java
- static mObject * ncsIsValidObj (mObject *obj)
- Check a pointer is a valid mObject or not.
- MGNCS_EXPORT mObject * ncsSafeCast (mObject *obj, mObjectClass *clss)
- safe type cast function, like the dynamic_cast operator in C++
- MGNCS_EXPORT mObjectClass * ncsSafeCastClass (mObjectClass *clss, mObjectClass *castCls)
- cast from a supper class to derived class type safely
- MGNCS_EXPORT BOOL ncsAddEventListener (mObject *sender, mObject *listener, NCS_CB_ONOBJEVENT eventProc, int eventId)
- connect sender object to listener object
- MGNCS_EXPORT BOOL ncsAddEventListeners (mObject *sender, mObject *listener, NCS_CB_ONOBJEVENT eventProc, int *eventIds)
- connect a group of events from sender to listener
- MGNCS_EXPORT BOOL ncsRemoveEventListener (mObject *listener)
- remove the connections which are listened by the object
- MGNCS_EXPORT BOOL ncsRemoveEventConnect (mObject *listener, mObject *source, int eventId)
- remove a special event connect
- MGNCS_EXPORT BOOL ncsRemoveEventSource (mObject *sender)
- remove the connections when a sender is destroied
- MGNCS_EXPORT void ncsRaiseEvent (mObject *sender, int eventId, DWORD param)
- raise an event to listeners
Variables
Detailed Description
- Author:
- dongjunjie
- Date:
- 2009/04/16
This file include the basic object defines
*
* This file is part of mgncs, new control of MiniGUI
*
*
Definition in file mobject.h.