[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.4/kdebindings/ruby
From:       Richard Dale <Richard_Dale () tipitina ! demon ! co ! uk>
Date:       2010-01-18 11:33:07
Message-ID: 1263814387.520962.29332.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1076570 by rdale:

* Make QtRuby and Korundum compile with the current smoke.h header

CCMAIL: kde-bindings@kde.org


 M  +3 -3      korundum/src/Korundum.cpp  
 M  +1 -1      korundum/src/kdehandlers.cpp  
 M  +1 -1      qtruby/src/Qt.cpp  
 M  +19 -19    qtruby/src/handlers.cpp  
 M  +8 -12     qtruby/src/qtruby.cpp  


--- branches/KDE/4.4/kdebindings/ruby/korundum/src/Korundum.cpp #1076569:1076570
@@ -194,11 +194,11 @@
 		while (meth.smoke->ambiguousMethodList[i] != 0) {
 			if (	(	qstrcmp(	meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args \
+ 1]].name,  "QAction*" ) == 0 
-						&& a->smoke->isDerivedFromByName(a->smoke->classes[a->classId].className, \
                "QAction")
-						&& !a->smoke->isDerivedFromByName(a->smoke->classes[a->classId].className, \
"KAction") ) +						&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, \
"QAction") +						&& !Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, \
                "KAction") )
 					|| (	qstrcmp(	meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args \
+ 1]].name,  "KAction*" ) == 0 
-							&& a->smoke->isDerivedFromByName(a->smoke->classes[a->classId].className, \
"KAction") ) ) +							&& \
Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "KAction") ) )  {
 				_current_method.smoke = meth.smoke;
 				_current_method.index = meth.smoke->ambiguousMethodList[i];
--- branches/KDE/4.4/kdebindings/ruby/korundum/src/kdehandlers.cpp #1076569:1076570
@@ -56,7 +56,7 @@
 const char*
 resolve_classname_kde(smokeruby_object * o)
 {
-	if (o->smoke->isDerivedFromByName(o->smoke->classes[o->classId].className, \
"KArchiveEntry")) { +	if \
(Smoke::isDerivedFrom(o->smoke->classes[o->classId].className, "KArchiveEntry")) {  \
KArchiveEntry * entry = (KArchiveEntry *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("KArchiveEntry").index);  if (entry->isDirectory()) {
 			return "KDE::ArchiveDirectory";
--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/Qt.cpp #1076569:1076570
@@ -461,7 +461,7 @@
 const char *
 resolve_classname(smokeruby_object * o)
 {
-	if (o->smoke->isDerivedFromByName(o->smoke->classes[o->classId].className, \
"QObject")) { +	if (Smoke::isDerivedFrom(o->smoke->classes[o->classId].className, \
"QObject")) {  QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QObject").index);  const QMetaObject * meta = \
qobject->metaObject();  
--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/handlers.cpp #1076569:1076570
@@ -197,7 +197,7 @@
 	if (do_debug & qtdb_gc) qWarning("Checking for mark (%s*)%p", className, o->ptr);
 
     if (o->ptr && o->allocated) {
-		if (o->smoke->isDerivedFromByName(className, "QObject")) {
+		if (Smoke::isDerivedFrom(className, "QObject")) {
 			QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QObject").index);  // Only mark the QObject tree if the current \
item doesn't have a parent.  // This avoids marking parts of a tree more than once.
@@ -206,7 +206,7 @@
 			}
 		}
 
-		if (o->smoke->isDerivedFromByName(className, "QWidget")) {
+		if (Smoke::isDerivedFrom(className, "QWidget")) {
 			QWidget * widget = (QWidget *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QWidget").index);  QLayout * layout = widget->layout();
 			if (layout != 0) {
@@ -218,7 +218,7 @@
 			}
 		}
 
-		if (o->smoke->isDerivedFromByName(className, "QListWidget")) {
+		if (Smoke::isDerivedFrom(className, "QListWidget")) {
 			QListWidget * listwidget = (QListWidget *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QListWidget").index);  
 			for (int i = 0; i < listwidget->count(); i++) {
@@ -232,7 +232,7 @@
 			return;
 		}
 	
-		if (o->smoke->isDerivedFromByName(className, "QTableWidget")) {
+		if (Smoke::isDerivedFrom(className, "QTableWidget")) {
 			QTableWidget * table = (QTableWidget *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QTableWidget").index);  QTableWidgetItem *item;
 
@@ -249,7 +249,7 @@
 			return;		
 		}
 
-		if (o->smoke->isDerivedFromByName(className, "QTreeWidget")) {
+		if (Smoke::isDerivedFrom(className, "QTreeWidget")) {
 			QTreeWidget * qtreewidget = (QTreeWidget *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QTreeWidget").index);  
 			for (int i = 0; i < qtreewidget->topLevelItemCount(); i++) {
@@ -264,7 +264,7 @@
 			return;
 		}
 
-		if (o->smoke->isDerivedFromByName(className, "QLayout")) {
+		if (Smoke::isDerivedFrom(className, "QLayout")) {
 			QLayout * qlayout = (QLayout *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QLayout").index);  for (int i = 0; i < qlayout->count(); ++i) {
 				QLayoutItem * item = qlayout->itemAt(i);
@@ -279,7 +279,7 @@
 			return;
 		}
 
-		if (o->smoke->isDerivedFromByName(className, "QStandardItemModel")) {
+		if (Smoke::isDerivedFrom(className, "QStandardItemModel")) {
 			QStandardItemModel * model = (QStandardItemModel *) o->smoke->cast(o->ptr, \
o->classId, o->smoke->idClass("QStandardItemModel").index);  for (int row = 0; row < \
model->rowCount(); row++) {  for (int column = 0; column < model->columnCount(); \
column++) { @@ -299,7 +299,7 @@
 			return;
 		}
 
-		if (o->smoke->isDerivedFromByName(className, "QGraphicsWidget")) {
+		if (Smoke::isDerivedFrom(className, "QGraphicsWidget")) {
 			QGraphicsWidget * widget = (QGraphicsWidget *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QGraphicsWidget").index);  QGraphicsLayout * layout = \
widget->layout();  if (layout != 0) {
@@ -311,7 +311,7 @@
 			}
 		}
 
-		if (o->smoke->isDerivedFromByName(className, "QGraphicsLayout")) {
+		if (Smoke::isDerivedFrom(className, "QGraphicsLayout")) {
 			QGraphicsLayout * qlayout = (QGraphicsLayout *) o->smoke->cast(o->ptr, \
o->classId, o->smoke->idClass("QGraphicsLayout").index);  for (int i = 0; i < \
qlayout->count(); ++i) {  QGraphicsLayoutItem * item = qlayout->itemAt(i);
@@ -326,7 +326,7 @@
 			return;
 		}
 
-		if (o->smoke->isDerivedFromByName(className, "QGraphicsItem")) {
+		if (Smoke::isDerivedFrom(className, "QGraphicsItem")) {
 			QGraphicsItem * item = (QGraphicsItem *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QGraphicsItem").index);  // Only mark the QGraphicsItem tree if \
the current item doesn't have a parent.  // This avoids marking parts of a tree more \
than once. @@ -335,7 +335,7 @@
 			}
 		}
 
-		if (o->smoke->isDerivedFromByName(className, "QGraphicsScene")) {
+		if (Smoke::isDerivedFrom(className, "QGraphicsScene")) {
 			QGraphicsScene * scene = (QGraphicsScene *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QGraphicsScene").index);  QList<QGraphicsItem *> list = \
scene->items();  for (int i = 0; i < list.size(); i++) {
@@ -379,13 +379,13 @@
 	unmapPointer(o, o->classId, 0);
 	object_count --;
 	
-	if (o->smoke->isDerivedFromByName(className, "QLayoutItem")) {
+	if (Smoke::isDerivedFrom(className, "QLayoutItem")) {
 		QLayoutItem * item = (QLayoutItem *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QLayoutItem").index);  if (item->layout() != 0 || item->widget() \
!= 0 || item->spacerItem() != 0) {  free_smokeruby_object(o);
 			return;
 		}
-	} else if (o->smoke->isDerivedFromByName(className, "QStandardItem")) {
+	} else if (Smoke::isDerivedFrom(className, "QStandardItem")) {
 		QStandardItem * item = (QStandardItem *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QStandardItem").index);  if (item->model() != 0 || item->parent() \
!= 0) {  free_smokeruby_object(o);
@@ -397,19 +397,19 @@
 			free_smokeruby_object(o);
 			return;
 		}
-	} else if (o->smoke->isDerivedFromByName(className, "QTableWidgetItem")) {
+	} else if (Smoke::isDerivedFrom(className, "QTableWidgetItem")) {
 		QTableWidgetItem * item = (QTableWidgetItem *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QTableWidgetItem").index);  if (item->tableWidget() != 0) {
 			free_smokeruby_object(o);
 			return;
 		}
-	} else if (o->smoke->isDerivedFromByName(className, "QWidget")) {
+	} else if (Smoke::isDerivedFrom(className, "QWidget")) {
 		QWidget * qwidget = (QWidget *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QWidget").index);  if (qwidget->parentWidget() != 0) {
 			free_smokeruby_object(o);
 			return;
 		}
-	} else if (o->smoke->isDerivedFromByName(className, "QObject")) {
+	} else if (Smoke::isDerivedFrom(className, "QObject")) {
 		QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QObject").index);  if (qobject->parent() != 0) {
 			free_smokeruby_object(o);
@@ -444,7 +444,7 @@
 Q_DECL_EXPORT const char *
 resolve_classname_qt(smokeruby_object * o)
 {
-	if (o->smoke->isDerivedFromByName(o->smoke->classes[o->classId].className, \
"QEvent")) { +	if (Smoke::isDerivedFrom(o->smoke->classes[o->classId].className, \
"QEvent")) {  QEvent * qevent = (QEvent *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QEvent").index);  switch (qevent->type()) {
 		case QEvent::Timer:
@@ -667,7 +667,7 @@
 		default:
 			break;
 		}
-	} else if (o->smoke->isDerivedFromByName(o->smoke->classes[o->classId].className, \
"QGraphicsItem")) { +	} else if \
(Smoke::isDerivedFrom(o->smoke->classes[o->classId].className, "QGraphicsItem")) {  \
QGraphicsItem * item = (QGraphicsItem *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QGraphicsItem").index);  switch (item->type()) {
 		case 1:
@@ -700,7 +700,7 @@
 			o->classId = o->smoke->idClass("QGraphicsItemGroup").index;
 			break;
 		}
-	} else if (o->smoke->isDerivedFromByName(o->smoke->classes[o->classId].className, \
"QLayoutItem")) { +	} else if \
(Smoke::isDerivedFrom(o->smoke->classes[o->classId].className, "QLayoutItem")) {  \
QLayoutItem * item = (QLayoutItem *) o->smoke->cast(o->ptr, o->classId, \
o->smoke->idClass("QLayoutItem").index);  if (item->widget() != 0) {
 			o->classId = o->smoke->idClass("QWidgetItem").index;
--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/qtruby.cpp #1076569:1076570
@@ -934,11 +934,11 @@
 		while (meth.smoke->ambiguousMethodList[i] != 0) {
 			if (	(	qstrcmp(	meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args]].name,
  "QObject*" ) == 0 
-						&& a->smoke->isDerivedFromByName(a->smoke->classes[a->classId].className, \
                "QObject")
-						&& !a->smoke->isDerivedFromByName(a->smoke->classes[a->classId].className, \
"QWidget") ) +						&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, \
"QObject") +						&& !Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, \
                "QWidget") )
 					|| (	qstrcmp(	meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args]].name,
  "QWidget*" ) == 0 
-							&& a->smoke->isDerivedFromByName(a->smoke->classes[a->classId].className, \
"QWidget") ) ) +							&& \
Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QWidget") ) )  {
 				_current_method.smoke = meth.smoke;
 				_current_method.index = meth.smoke->ambiguousMethodList[i];
@@ -970,11 +970,11 @@
 		while (meth.smoke->ambiguousMethodList[i] != 0) {
 			if (	(	qstrcmp(	meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args \
+ 1]].name,  "QObject*" ) == 0 
-						&& a->smoke->isDerivedFromByName(a->smoke->classes[a->classId].className, \
                "QObject")
-						&& !a->smoke->isDerivedFromByName(a->smoke->classes[a->classId].className, \
"QWidget") ) +						&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, \
"QObject") +						&& !Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, \
                "QWidget") )
 					|| (	qstrcmp(	meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args \
+ 1]].name,  "QWidget*" ) == 0 
-							&& a->smoke->isDerivedFromByName(a->smoke->classes[a->classId].className, \
"QWidget") ) ) +							&& \
Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QWidget") ) )  {
 				_current_method.smoke = meth.smoke;
 				_current_method.index = meth.smoke->ambiguousMethodList[i];
@@ -1729,7 +1729,7 @@
 {
     char *className = StringValuePtr(className_value);
     char *base = StringValuePtr(base_value);
-    return Smoke::isDerivedFromByName(className, base) ? Qtrue : Qfalse;
+    return Smoke::isDerivedFrom(className, base) ? Qtrue : Qfalse;
 }
 
 static VALUE
@@ -1985,11 +1985,7 @@
 VALUE
 isQObject(VALUE /*self*/, VALUE c)
 {
-    const char* classname = strdup(StringValuePtr(c));
-
-    return Smoke::isDerivedFromByName(classname, "QObject");
-
-    free((void*) classname);
+    return Smoke::isDerivedFrom(StringValuePtr(c), "QObject");
 }
 
 // Returns the Smoke classId of a ruby instance


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic