mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
Macros | Typedefs | Functions | Variables
mobject.h File Reference
#include <stdarg.h>

Go to the source code of this file.

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...
 
#define TYPENAME(obj)   ((obj)?(((obj)->_class)?((obj)->_class)->typeName:""):"")
 Get the class name form a Object pointer. More...
 
#define INSTANCEOF(obj, clss)   ncsInstanceOf((mObject*)(obj), (mObjectClass*)(void*)(&Class(clss)))
 A wrapper of ncsInstanceOf, just like java's instanceof. More...
 
#define CHECKOBJ(obj)   ncsIsValidObj((mObject*)obj)
 the wrapper of ncsIsValidObj More...
 
#define TYPE_CAST(Type, obj)   ((Type*)(obj))
 unsafe cast. donot check the type of class More...
 
#define SAFE_CAST(Type, obj)   TYPE_CAST(Type, ncsSafeCast((mObject*)obj,(mObjectClass*)(void*)(&(Class(Type)))))
 wrapper of ncsSafeCast, check the class type before cast. More...
 
#define SAFE_CAST_CLASS(Clss, ClssCast)   ((ClassType(ClssCast)*)(ncsSafeCastClass((mObjectClass*)Clss, (mObjectClass*)(void*)(&Class(ClssCast)))))
 the wrapper of ncsSafeCastClass More...
 

Typedefs

typedef mObjectClass *(* PClassConstructor) (mObjectClass *)
 the Class initialize callback More...
 
typedef void(* PCONSTRUCT_DWORD) (void *self, DWORD addData)
 
typedef BOOL(* NCS_CB_ONOBJEVENT) (mObject *self, mObject *sender, int eventId, DWORD param)
 The Callback of connection. More...
 

Functions

static mObject_initObject (mObject *pobj, mObjectClass *_class, DWORD param)
 
static mObjectinitObjectArgs (mObject *pobj, mObjectClass *_class,...)
 
MGNCS_EXPORT mObjectnewObject (mObjectClass *_class)
 new a object instance, like new operator in C++ More...
 
MGNCS_EXPORT void deleteObject (mObject *obj)
 delete a object intance, like delete operator in C++ More...
 
MGNCS_EXPORT BOOL ncsInstanceOf (mObject *object, mObjectClass *clss)
 check an object is the class instance or not, same as instanceof operator in Java More...
 
static mObjectncsIsValidObj (mObject *obj)
 Check a pointer is a valid mObject or not. More...
 
MGNCS_EXPORT mObjectncsSafeCast (mObject *obj, mObjectClass *clss)
 safe type cast function, like the dynamic_cast operator in C++ More...
 
MGNCS_EXPORT mObjectClassncsSafeCastClass (mObjectClass *clss, mObjectClass *castCls)
 cast from a supper class to derived class type safely More...
 
MGNCS_EXPORT BOOL ncsAddEventListener (mObject *sender, mObject *listener, NCS_CB_ONOBJEVENT eventProc, int eventId)
 connect sender object to listener object More...
 
MGNCS_EXPORT BOOL ncsAddEventListeners (mObject *sender, mObject *listener, NCS_CB_ONOBJEVENT eventProc, int *eventIds)
 connect a group of events from sender to listener More...
 
MGNCS_EXPORT BOOL ncsRemoveEventListener (mObject *listener)
 remove the connections which are listened by the object More...
 
MGNCS_EXPORT BOOL ncsRemoveEventConnect (mObject *listener, mObject *source, int eventId)
 remove a special event connect More...
 
MGNCS_EXPORT BOOL ncsRemoveEventSource (mObject *sender)
 remove the connections when a sender is destroied More...
 
MGNCS_EXPORT void ncsRaiseEvent (mObject *sender, int eventId, DWORD param)
 raise an event to listeners More...
 

Variables

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

Detailed Description

Author
dongjunjie
Date
2009/04/16

This file include the basic object defines

   This file is part of mGNCS, a component for MiniGUI.

   Copyright (C) 2008~2018, Beijing FMSoft Technologies Co., Ltd.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.

   Or,

   As this program is a library, any link to this program must follow
   GNU General Public License version 3 (GPLv3). If you cannot accept
   GPLv3, you need to be licensed from FMSoft.

   If you have got a commercial license of this program, please use it
   under the terms and conditions of the commercial license.

   For more information about the commercial license, please refer to
   <http://www.minigui.com/en/about/licensing-policy/>.

Definition in file mobject.h.