summaryrefslogtreecommitdiffstats
path: root/src/modules/objects/object_macros.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 02:13:59 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 02:13:59 +0000
commita6d58bb6052ac8cb01805a48c4ad2f129126116f (patch)
treedd867a099fcbb263a8009a9fb22695b87855dad6 /src/modules/objects/object_macros.h
downloadkvirc-a6d58bb6052ac8cb01805a48c4ad2f129126116f.tar.gz
kvirc-a6d58bb6052ac8cb01805a48c4ad2f129126116f.zip
Added KDE3 version of kvirc
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1095341 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/objects/object_macros.h')
-rw-r--r--src/modules/objects/object_macros.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/src/modules/objects/object_macros.h b/src/modules/objects/object_macros.h
new file mode 100644
index 00000000..9c0360b2
--- /dev/null
+++ b/src/modules/objects/object_macros.h
@@ -0,0 +1,90 @@
+#ifndef _OBJECT_MACROS_H_
+#define _OBJECT_MACROS_H_
+//=========================================================================================
+//
+// File : object_macros.h
+// Creation date : Sat Jun 18 2005 15:32:01 by Szymon Stefanek
+//
+// This file is part of the KVirc irc client distribution
+// Copyright (C) 2005 Szymon Stefanek (pragma at kvirc dot net)
+//
+// 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 2
+// of the License, or (at your opinion) 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, write to the Free Software Foundation,
+// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================================================
+
+#include "kvi_kvs_object.h"
+#include "kvi_kvs_object_class.h"
+#include "kvi_kvs_kernel.h"
+#include "kvi_kvs_object_controller.h"
+#include "kvi_kvs_object_functioncall.h"
+
+#define KVSO_DECLARE_OBJECT(__className) \
+ __className(KviKvsObjectClass * pClass,KviKvsObject * pParent,const QString &szName); \
+ ~__className(); \
+ static void registerSelf(); \
+ static void unregisterSelf();
+
+
+#define KVSO_REGISTER_HANDLER(__className,__szName,__proc) \
+ g_pKvs##__className##Class->registerFunctionHandler(__szName,(KviKvsObjectFunctionHandlerProc)(KVI_PTR2MEMBER(__className::__proc)));
+
+#define KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(__className,__szName) \
+ g_pKvs##__className##Class->registerStandardNothingReturnFunctionHandler(__szName);
+
+#define KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(__className,__szName) \
+ g_pKvs##__className##Class->registerStandardTrueReturnFunctionHandler(__szName);
+
+#define KVSO_REGISTER_STANDARD_FALSERETURN_HANDLER(__className,__szName) \
+ g_pKvs##__className##Class->registerStandardFalseReturnFunctionHandler(__szName);
+
+#define KVSO_BEGIN_REGISTERCLASS(__className,__stringName,__baseClass) \
+ static KviKvsObjectClass * g_pKvs##__className##Class = 0; \
+ static KviKvsObject * kvs_##__className##_createInstance(KviKvsObjectClass * pClass,KviKvsObject * pParent,const QString &szName) \
+ { \
+ return new __className(pClass,pParent,szName); \
+ } \
+ void __className::unregisterSelf() \
+ { \
+ delete g_pKvs##__className##Class; \
+ g_pKvs##__className##Class = 0; \
+ } \
+ void __className::registerSelf() \
+ { \
+ KviKvsObjectClass * base = KviKvsKernel::instance()->objectController()->lookupClass(__baseClass); \
+ g_pKvs##__className##Class = new KviKvsObjectClass(base,__stringName,kvs_##__className##_createInstance,true);
+
+
+
+#define KVSO_END_REGISTERCLASS(__className) \
+ }
+
+
+#define KVSO_BEGIN_CONSTRUCTOR(__className,__baseClass) \
+ __className::__className(KviKvsObjectClass * pClass,KviKvsObject * pParent,const QString &szName) \
+ : __baseClass(pClass,pParent,szName) \
+ {
+
+#define KVSO_END_CONSTRUCTOR(__className) \
+ }
+
+#define KVSO_BEGIN_DESTRUCTOR(__className) \
+ __className::~__className() \
+ {
+
+#define KVSO_END_DESTRUCTOR(__className) \
+ }
+
+
+#endif