[Kde-bindings] branches/KDE/4.4/kdebindings
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Sun Jan 17 15:55:10 UTC 2010
SVN commit 1076138 by rdale:
* Add a 'smokeapi' command line tool for introspecting the smoke libs
* Remove the 'kde' smoke lib as it shouldn't be needed any more
* Make the Smoke NullModuleIndex variable and the findClass() and
isDerivedFrom() methods static
CCMAIL: kde-bindings at kde.org
M +2 -2 csharp/qyoto/CMakeLists.txt
M +1 -0 generator/generators/smoke/writeSmokeDataFile.cpp
M +2 -2 ruby/qtruby/src/Qt.cpp
M +1 -1 ruby/qtruby/src/marshall_types.cpp
M +7 -7 ruby/qtruby/src/qtruby.cpp
M +1 -6 smoke/CMakeLists.txt
D smoke/kde (directory)
D smoke/kde_smoke.h
M +8 -8 smoke/smoke.h
A smoke/smokeapi (directory)
A smoke/smokeapi/CMakeLists.txt
A smoke/smokeapi/main.cpp [License: GPL (v2+)]
--- branches/KDE/4.4/kdebindings/csharp/qyoto/CMakeLists.txt #1076137:1076138
@@ -38,13 +38,13 @@
LINK_DIRECTORIES (${LIBRARY_OUTPUT_PATH})
ADD_LIBRARY (qyotoshared SHARED ${SRC_QYOTO_SHARED})
-TARGET_LINK_LIBRARIES (qyotoshared smokeqtcore smokeqtgui smokeqtxml smokeqtopengl smokeqtsql smokeqtnetwork smokeqtnetwork smokeqtdbus smokeqtsvg
+TARGET_LINK_LIBRARIES (qyotoshared smokeqtcore smokeqtgui smokeqtxml smokeqtopengl smokeqtsql smokeqtnetwork smokeqtdbus smokeqtsvg
${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTDBUS_LIBRARY})
set_target_properties(qyotoshared PROPERTIES VERSION 1.0.0 SOVERSION 1 COMPILE_DEFINITIONS QYOTOSHARED_BUILDING)
ADD_LIBRARY (qyoto MODULE ${SRC_QYOTO})
TARGET_LINK_LIBRARIES (qyoto qyotoshared
- smokeqtcore smokeqtgui smokeqtxml smokeqtopengl smokeqtsql smokeqtnetwork smokeqtnetwork smokeqtdbus smokeqtsvg
+ smokeqtcore smokeqtgui smokeqtxml smokeqtopengl smokeqtsql smokeqtnetwork smokeqtdbus smokeqtsvg
${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTDBUS_LIBRARY})
CSHARP_ADD_LIBRARY(qt-dotnet ${SRC_CS_QYOTO} COMPILE_FLAGS /warn:0 "/keyfile:${KEYFILE}" UNSAFE)
--- branches/KDE/4.4/kdebindings/generator/generators/smoke/writeSmokeDataFile.cpp #1076137:1076138
@@ -652,6 +652,7 @@
if (Options::parentModules.isEmpty()) {
out << "Smoke::ClassMap Smoke::classMap;\n\n";
+ out << "Smoke::ModuleIndex Smoke::NullModuleIndex;\n\n";
}
out << "extern \"C\" {\n\n";
--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/Qt.cpp #1076137:1076138
@@ -494,8 +494,8 @@
char *c = StringValuePtr(c_value);
char *name = StringValuePtr(name_value);
VALUE result = rb_ary_new();
- Smoke::ModuleIndex classId = qtcore_Smoke->findClass(c);
- Smoke::ModuleIndex meth = qtcore_Smoke->NullModuleIndex;
+ Smoke::ModuleIndex classId = Smoke::findClass(c);
+ Smoke::ModuleIndex meth = Smoke::NullModuleIndex;
if (classId.smoke != 0) {
meth = classId.smoke->findMethod(c, name);
}
--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/marshall_types.cpp #1076137:1076138
@@ -675,7 +675,7 @@
o[0] = new QDBusVariant;
#endif
} else {
- Smoke::ModuleIndex ci = qtcore_Smoke->findClass(type);
+ Smoke::ModuleIndex ci = Smoke::findClass(type);
if (ci.index != 0) {
Smoke::ModuleIndex mi = ci.smoke->findMethod(type, type);
if (mi.index) {
--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/qtruby.cpp #1076137:1076138
@@ -925,7 +925,7 @@
smokeruby_object *o = value_obj_info(self);
smokeruby_object *a = value_obj_info(argv[0]);
- Smoke::ModuleIndex nameId = qtcore_Smoke->NullModuleIndex;
+ Smoke::ModuleIndex nameId = Smoke::NullModuleIndex;
nameId = o->smoke->idMethodName("mapping#");
Smoke::ModuleIndex ci(o->smoke, o->classId);
Smoke::ModuleIndex meth = o->smoke->findMethod(ci, nameId);
@@ -961,7 +961,7 @@
smokeruby_object *o = value_obj_info(self);
smokeruby_object *a = value_obj_info(argv[1]);
- Smoke::ModuleIndex nameId = qtcore_Smoke->NullModuleIndex;
+ Smoke::ModuleIndex nameId = Smoke::NullModuleIndex;
nameId = o->smoke->idMethodName("setMapping##");
Smoke::ModuleIndex ci(o->smoke, o->classId);
Smoke::ModuleIndex meth = o->smoke->findMethod(ci, nameId);
@@ -1099,7 +1099,7 @@
qvariant_from_value(int argc, VALUE * argv, VALUE self)
{
if (argc == 2) {
- Smoke::ModuleIndex nameId = qtcore_Smoke->NullModuleIndex;
+ Smoke::ModuleIndex nameId = Smoke::NullModuleIndex;
if (TYPE(argv[0]) == T_DATA) {
nameId = qtcore_Smoke->idMethodName("QVariant#");
} else if (TYPE(argv[0]) == T_ARRAY || TYPE(argv[0]) == T_ARRAY) {
@@ -1729,7 +1729,7 @@
{
char *className = StringValuePtr(className_value);
char *base = StringValuePtr(base_value);
- return qtcore_Smoke->isDerivedFromByName(className, base) ? Qtrue : Qfalse;
+ return Smoke::isDerivedFromByName(className, base) ? Qtrue : Qfalse;
}
static VALUE
@@ -1987,7 +1987,7 @@
{
const char* classname = strdup(StringValuePtr(c));
- return qtcore_Smoke->isDerivedFromByName(classname, "QObject");
+ return Smoke::isDerivedFromByName(classname, "QObject");
free((void*) classname);
}
@@ -2007,7 +2007,7 @@
findClass(VALUE /*self*/, VALUE name_value)
{
char *name = StringValuePtr(name_value);
- Smoke::ModuleIndex mi = qtcore_Smoke->findClass(name);
+ Smoke::ModuleIndex mi = Smoke::findClass(name);
return rb_funcall(moduleindex_class, rb_intern("new"), 2, INT2NUM(smokeList.indexOf(mi.smoke)), INT2NUM(mi.index));
}
@@ -2230,7 +2230,7 @@
rb_define_singleton_method(module_value, "method_missing", (VALUE (*) (...)) module_method_missing, -1);
rb_define_singleton_method(module_value, "const_missing", (VALUE (*) (...)) module_method_missing, -1);
-
+
foreach(QString s, packageName.mid(strlen(moduleName) + 2).split("::")) {
klass = rb_define_class_under(klass, (const char*) s.toLatin1(), qt_base_class);
}
--- branches/KDE/4.4/kdebindings/smoke/CMakeLists.txt #1076137:1076138
@@ -17,7 +17,6 @@
OPTION(ENABLE_QSCI_SMOKE "build QsciSmoke" ON)
OPTION(ENABLE_QWT_SMOKE "build QwtSmoke" OFF)
OPTION(ENABLE_QIMAGEBLITZ_SMOKE "build QImageBlitzSmoke" ON)
-OPTION(ENABLE_KDE_SMOKE "build KDESmoke" ON)
OPTION(ENABLE_KDECORE_SMOKE "build KDECoreSmoke" ON)
OPTION(ENABLE_KDEUI_SMOKE "build KDEUiSmoke" ON)
OPTION(ENABLE_KIO_SMOKE "build KIOSmoke" ON)
@@ -40,6 +39,7 @@
if(ENABLE_QTCORE_SMOKE)
add_subdirectory(qtcore)
+ add_subdirectory(smokeapi)
set(SMOKE_ENABLED "${SMOKE_ENABLED}, QtCore")
endif(ENABLE_QTCORE_SMOKE)
@@ -145,11 +145,6 @@
set(SMOKE_ENABLED "${SMOKE_ENABLED}, Plasma")
endif(ENABLE_PLASMA_SMOKE)
- if(ENABLE_KDE_SMOKE)
- add_subdirectory(kde)
- set(SMOKE_ENABLED "${SMOKE_ENABLED}, KDE")
- endif(ENABLE_KDE_SMOKE)
-
if(ENABLE_KDECORE_SMOKE)
add_subdirectory(kdecore)
set(SMOKE_ENABLED "${SMOKE_ENABLED}, KDECore")
--- branches/KDE/4.4/kdebindings/smoke/smoke.h #1076137:1076138
@@ -108,7 +108,7 @@
/**
* A ModuleIndex with both fields set to 0.
*/
- ModuleIndex NullModuleIndex;
+ static ModuleIndex NullModuleIndex;
typedef std::map<std::string, ModuleIndex> ClassMap;
static ClassMap classMap;
@@ -404,7 +404,7 @@
return NullModuleIndex;
}
- inline ModuleIndex findClass(const char *c) {
+ static inline ModuleIndex findClass(const char *c) {
ClassMap::iterator i = classMap.find(c);
if (i == classMap.end()) {
return NullModuleIndex;
@@ -511,11 +511,11 @@
return idc.smoke->findMethod(idc, idname);
}
- inline bool isDerivedFrom(const ModuleIndex& classId, const ModuleIndex& baseClassId) {
+ static inline bool isDerivedFrom(const ModuleIndex& classId, const ModuleIndex& baseClassId) {
return isDerivedFrom(classId.smoke, classId.index, baseClassId.smoke, baseClassId.index);
}
- inline bool isDerivedFrom(Smoke *smoke, Index classId, Smoke *baseSmoke, Index baseId) {
+ static inline bool isDerivedFrom(Smoke *smoke, Index classId, Smoke *baseSmoke, Index baseId) {
if (!classId || !baseId || !smoke || !baseSmoke)
return false;
if (smoke == baseSmoke && classId == baseId)
@@ -534,10 +534,10 @@
return false;
}
- inline bool isDerivedFromByName(const char *className, const char *baseClassName) {
- ModuleIndex classId = findClass(className);
- ModuleIndex baseId = findClass(baseClassName);
- return isDerivedFrom(classId.smoke, classId.index, baseId.smoke, baseId.index);
+ static inline bool isDerivedFrom(const char *className, const char *baseClassName) {
+ ModuleIndex classId = findClass(className);
+ ModuleIndex baseId = findClass(baseClassName);
+ return isDerivedFrom(classId.smoke, classId.index, baseId.smoke, baseId.index);
}
};
More information about the Kde-bindings
mailing list