File indexing completed on 2024-04-21 15:02:57
0001 /*************************************************************************** 0002 * krossconfig.h 0003 * This file is part of the KDE project 0004 * copyright (C)2004-2006 by Sebastian Sauer (mail@dipe.org) 0005 * 0006 * This program is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU Library General Public 0008 * License as published by the Free Software Foundation; either 0009 * version 2 of the License, or (at your option) any later version. 0010 * This program is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0013 * Library General Public License for more details. 0014 * You should have received a copy of the GNU Library General Public License 0015 * along with this program; see the file COPYING. If not, write to 0016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 ***************************************************************************/ 0019 0020 #ifndef KROSS_MAIN_KROSSCONFIG_H 0021 #define KROSS_MAIN_KROSSCONFIG_H 0022 0023 #include <kross/core/krosscore_export.h> 0024 0025 #include <QString> 0026 #include <QMetaType> 0027 0028 namespace Kross 0029 { 0030 0031 // Debugging enabled. Comment the line out to disable all kind of debugging. 0032 #define KROSS_DEBUG_ENABLED 0033 0034 #ifdef KROSS_DEBUG_ENABLED 0035 0036 /** 0037 * Debugging function. 0038 */ 0039 KROSSCORE_EXPORT void krossdebug(const QString &s); 0040 0041 /** 0042 * Warning function. 0043 */ 0044 KROSSCORE_EXPORT void krosswarning(const QString &s); 0045 0046 #else 0047 // Define these to an empty statement if debugging is disabled. 0048 #define krossdebug(x) 0049 #define krosswarning(x) 0050 #endif 0051 0052 // Some more debug switches. 0053 //#define KROSS_OBJECT_METACALL_DEBUG 0054 //#define KROSS_METATYPE_DEBUG 0055 //#define KROSS_INTERPRETER_DEBUG 0056 //#define KROSS_ACTION_DEBUG 0057 //#define KROSS_ACTIONCOLLECTION_DEBUG 0058 0059 // The version number of Kross. For example the interpreters use 0060 // it do be sure there are linked against the correct core version 0061 // and if the numbers don't match, the interpreter is not loaded. 0062 #define KROSS_VERSION 12 0063 0064 // The export macro for interpreter plugins. 0065 #define KROSS_EXPORT_INTERPRETER( InterpreterImpl ) \ 0066 extern "C" { \ 0067 Q_DECL_EXPORT void* krossinterpreter(int version, Kross::InterpreterInfo* info) { \ 0068 if(version != KROSS_VERSION) { \ 0069 Kross::krosswarning(QString("Interpreter skipped cause provided version %1 does not match expected version %2.").arg(version).arg(KROSS_VERSION)); \ 0070 return nullptr; \ 0071 } \ 0072 return new InterpreterImpl(info); \ 0073 } \ 0074 } 0075 0076 // The name of the interpreter's library. Those library got loaded 0077 // dynamically during runtime. Comment out to disable compiling of 0078 // the interpreter-plugin or to hardcode the location of the lib 0079 // like I did at the following line. 0080 //#define KROSS_PYTHON_LIBRARY "/home/kde4/koffice/_build/lib/krosspython.la" 0081 #define KROSS_PYTHON_LIBRARY "krosspython" 0082 #define KROSS_RUBY_LIBRARY "krossruby" 0083 #define KROSS_JAVA_LIBRARY "libkrossjava" 0084 #define KROSS_FALCON_LIBRARY "krossfalcon" 0085 #define KROSS_QTSCRIPT_LIBRARY "krossqts" 0086 #define KROSS_LUA_LIBRARY "kloss" 0087 0088 } 0089 0090 #endif 0091