mGNCS API Reference  v1.5.0
A new control set and a new framework for MiniGUI apps
Data Structures | Macros | Typedefs | Functions | Variables
mObject

Data Structures

struct  mObjectClass
 the basic object class of NCS More...
 
struct  mObject
 the Object struct More...
 

Macros

#define _c(ths)   (ths)->_class
 the marco get the class of a object More...
 
#define INTEFACE_ADJUST(piobj)
 adjust the pointer as the real pointer More...
 
#define _IM(piobj, method, ...)   (piobj)->_vtable->method(INTEFACE_ADJUST(piobj), ##__VA_ARGS__)
 call the interface object More...
 

Typedefs

typedef mObjectClass *(* PClassConstructor) (mObjectClass *)
 the Class initialize callback More...
 
typedef void(* PCONSTRUCT_DWORD) (void *self, DWORD addData)
 

Functions

static mObject_initObject (mObject *pobj, mObjectClass *_class, DWORD param)
 
static mObjectinitObjectArgs (mObject *pobj, mObjectClass *_class,...)
 

Variables

MGNCS_EXPORT mObjectClass g_stmObjectCls
 the singleton of mObjectClass, represent a class object More...
 

Detailed Description

Macro Definition Documentation

◆ _c

#define _c (   ths)    (ths)->_class

the marco get the class of a object

Definition at line 72 of file mobject.h.

◆ _IM

#define _IM (   piobj,
  method,
  ... 
)    (piobj)->_vtable->method(INTEFACE_ADJUST(piobj), ##__VA_ARGS__)

call the interface object

Definition at line 194 of file mobject.h.

◆ INTEFACE_ADJUST

#define INTEFACE_ADJUST (   piobj)
Value:
(_TYPEOF(piobj))((unsigned char*)(piobj) - \
((IInterfaceVTable*)((piobj))->_vtable)->_obj_offset)

adjust the pointer as the real pointer

Definition at line 185 of file mobject.h.

Typedef Documentation

◆ PClassConstructor

mObjectClass *(* PClassConstructor)(mObjectClass *cls)

the Class initialize callback

Parameters
cls- the class pointer to initialize
Returns
mObjectClass* - the initialized class pointer, equal param cls

Definition at line 211 of file mobject.h.

◆ PCONSTRUCT_DWORD

typedef void(* PCONSTRUCT_DWORD) (void *self, DWORD addData)

We support two kind of construct: one is the old construct, uses DWORD to pass the user params; the other is new construct, use the va_list to pass the params

mgncs don't known which construct of an object use, we just pass them by diffrent wrapper

the caller must known which wrapper should be used.

if you use the wrong wrapper, the system may be CRASH

Definition at line 223 of file mobject.h.

Function Documentation

◆ _initObject()

static mObject* _initObject ( mObject pobj,
mObjectClass _class,
DWORD  param 
)
inlinestatic

init an object with DWORD param

Definition at line 318 of file mobject.h.

◆ initObjectArgs()

static mObject* initObjectArgs ( mObject pobj,
mObjectClass _class,
  ... 
)
inlinestatic

init an object with va_list params first param is the construct param count

Definition at line 329 of file mobject.h.

Variable Documentation

◆ g_stmObjectCls

g_stmObjectCls

the singleton of mObjectClass, represent a class object