[Kde-bindings] KDE/kdebindings/qtruby

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Apr 20 09:46:14 UTC 2006


SVN commit 531809 by rdale:

* Added marshalling for WId and Q_PID types which will work
  on Windows.
* Fixed the rbuic qmake project file so it will build on Windows

CCMAIL: kde-bindings at kde.org



 M  +6 -0      ChangeLog  
 M  +38 -99    rubylib/designer/rbuic/rbuic.pro  
 M  +1 -1      rubylib/designer/rbuic/uic.cpp  
 M  +1 -1      rubylib/examples/mainwindows/mdi/mainwindow.rb  
 M  +3 -0      rubylib/qtruby/handlers.cpp  
 M  +1 -1      rubylib/qtruby/lib/Qt/qtruby.rb  
 M  +17 -0     rubylib/qtruby/marshall_primitives.h  


--- trunk/KDE/kdebindings/qtruby/ChangeLog #531808:531809
@@ -1,3 +1,9 @@
+2006-04-20  Richard Dale  <rdale at foton.es>
+
+	* Added marshalling for WId and Q_PID types which will work
+	  on Windows.
+	* Fixed the rbuic qmake project file so it will build on Windows
+
 2006-04-19  Richard Dale  <rdale at foton.es>
 
 	* Removed a call to vasprintf() as it didn't compile with mingw
--- trunk/KDE/kdebindings/qtruby/rubylib/designer/rbuic/rbuic.pro #531808:531809
@@ -1,101 +1,40 @@
+######################################################################
+# Automatically generated by qmake (2.00a) Thu Apr 20 09:05:23 2006
+######################################################################
+
 TEMPLATE = app
-QT = xml core
-CONFIG += warn_on console no_batch
-CONFIG -= app_bundle
-build_all:!build_pass {
-    CONFIG -= build_all
-    CONFIG += release
-}
+TARGET += 
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += xml
 
-unix:!contains(QT_CONFIG, zlib):LIBS        += -lz
-
-TARGET = uic
-DESTDIR = ../../../bin
-
-DEFINES	       += QT_BOOTSTRAPPED QT_UIC QT_LITE_UNICODE QT_NO_DATASTREAM \
-	          QT_NO_THREAD QT_NO_QOBJECT QT_NO_UNICODETABLES QT_NO_LIBRARY
-win32:DEFINES += QT_NODLL
-
-CONFIG -= qt
-INCLUDEPATH	 = ../../corelib/arch/generic $$QT_BUILD_TREE/include . \
-                   $$QT_BUILD_TREE/include/QtCore $$QT_BUILD_TREE/include/QtXml
-DEPENDPATH	+= $$INCLUDEPATH ../../corelib/base ../../corelib/tools ../../corelib/io ../../corelib/codecs ../../xml
-
-include(uic.pri)
-
-SOURCES += main.cpp
-
-
-# Qt tools needed to link rcc
-SOURCES	+= ../../corelib/global/qglobal.cpp \
-	   ../../corelib/io/qbuffer.cpp \
-	   ../../corelib/io/qdir.cpp		\
-	   ../../corelib/io/qfile.cpp		\
-	   ../../corelib/io/qfileinfo.cpp	\
-	   ../../corelib/io/qfsfileengine.cpp	\
-	   ../../corelib/io/qiodevice.cpp	\
-	   ../../corelib/io/qtemporaryfile.cpp \
-	   ../../corelib/io/qtextstream.cpp \
-	   ../../corelib/kernel/qinternal.cpp \
-	   ../../corelib/tools/qbytearraymatcher.cpp \
-	   ../../corelib/tools/qchar.cpp		\
-	   ../../corelib/tools/qdatetime.cpp	\
-	   ../../corelib/tools/qhash.cpp		\
-	   ../../corelib/tools/qlistdata.cpp		\
-	   ../../corelib/tools/qlocale.cpp \
-	   ../../corelib/tools/qmap.cpp		\
-	   ../../corelib/tools/qstring.cpp		\
-	   ../../corelib/tools/qstringlist.cpp	\
-	   ../../corelib/tools/qstringmatcher.cpp \
-	   ../../corelib/tools/qvector.cpp          \
-           ../../corelib/io/qbufferedfsfileengine.cpp  \
-           ../../corelib/io/qfileengine.cpp  \
-           ../../corelib/tools/qbytearray.cpp	\
-           ../../corelib/tools/qbitarray.cpp	\
-           ../../corelib/tools/qunicodetables.cpp	\
-           ../../corelib/tools/qvsnprintf.cpp \
-           ../../corelib/tools/qregexp.cpp \
-           ../../corelib/codecs/qtextcodec.cpp \
-           ../../corelib/codecs/qutfcodec.cpp \
-           ../../corelib/codecs/qisciicodec.cpp \
-           ../../corelib/codecs/qtsciicodec.cpp \
-           ../../corelib/codecs/qlatincodec.cpp \
-           ../../corelib/codecs/qsimplecodec.cpp \
-	   ../../corelib/codecs/qfontlaocodec.cpp \
-           ../../xml/qdom.cpp \
-	   ../../xml/qxml.cpp
-
-unix:SOURCES += ../../corelib/io/qfsfileengine_unix.cpp
-
-win32:SOURCES += ../../corelib/io/qfsfileengine_win.cpp
-
-macx: {
-   QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.2 #enables weak linking for 10.2 (exported)
-   SOURCES += ../../corelib/kernel/qcore_mac.cpp
-   LIBS += -framework CoreServices
-}
-
-contains(QT_CONFIG, zlib) {
-   INCLUDEPATH += ../../3rdparty/zlib
-   SOURCES+= \
-	../3rdparty/zlib/adler32.c \
-	../3rdparty/zlib/compress.c \
-	../3rdparty/zlib/crc32.c \
-	../3rdparty/zlib/deflate.c \
-	../3rdparty/zlib/gzio.c \
-	../3rdparty/zlib/inffast.c \
-	../3rdparty/zlib/inflate.c \
-	../3rdparty/zlib/inftrees.c \
-	../3rdparty/zlib/trees.c \
-	../3rdparty/zlib/uncompr.c \
-	../3rdparty/zlib/zutil.c
-} else:!contains(QT_CONFIG, no-zlib) {
-   unix:LIBS += -lz
-#  win32:LIBS += libz.lib
-}
-
-target.path=$$[QT_INSTALL_BINS]
-INSTALLS += target
-
-DESTDIR = ../../../bin
-include(../../qt_targets.pri)
+# Input
+HEADERS += customwidgetsinfo.h \
+           databaseinfo.h \
+           driver.h \
+           globaldefs.h \
+           option.h \
+           qclass_lib_map.h \
+           treewalker.h \
+           ui4.h \
+           uic.h \
+           utils.h \
+           validator.h \
+           writedeclaration.h \
+           writeicondata.h \
+           writeicondeclaration.h \
+           writeiconinitialization.h \
+           writeinitialization.h
+SOURCES += customwidgetsinfo.cpp \
+           databaseinfo.cpp \
+           driver.cpp \
+           main.cpp \
+           treewalker.cpp \
+           ui4.cpp \
+           uic.cpp \
+           validator.cpp \
+           writedeclaration.cpp \
+           writeicondata.cpp \
+           writeicondeclaration.cpp \
+           writeiconinitialization.cpp \
+           writeinitialization.cpp
--- trunk/KDE/kdebindings/qtruby/rubylib/designer/rbuic/uic.cpp #531808:531809
@@ -32,7 +32,7 @@
 //#include "writeincludes.h"
 #include "writedeclaration.h"
 
-#include <qdom.h>
+#include <QtXml/qdom.h>
 #include <qfileinfo.h>
 #include <qregexp.h>
 #include <qtextstream.h>
--- trunk/KDE/kdebindings/qtruby/rubylib/examples/mainwindows/mdi/mainwindow.rb #531808:531809
@@ -78,7 +78,7 @@
 	
 	def open()
 	    fileName = Qt::FileDialog.getOpenFileName(self)
-	    if !fileName.empty?
+	    if !fileName.nil?
 	        existing = findMdiChild(fileName)
 	        if !existing.nil?
 	            @workspace.activeWindow = existing
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/handlers.cpp #531808:531809
@@ -22,6 +22,7 @@
 #include <QtCore/qlinkedlist.h>
 #include <QtCore/qobject.h>
 #include <QtCore/qtextcodec.h>
+#include <QtCore/qprocess.h>
 #include <QtNetwork/qhostaddress.h>
 #include <QtCore/qpair.h>
 #include <QtGui/qevent.h>
@@ -1711,6 +1712,8 @@
 DEF_VALUELIST_MARSHALLER( QRectFVector, QVector<QRectF>, QRectF )
 
 TypeHandler Qt_handlers[] = {
+    { "WId", marshall_it<WId> },
+    { "Q_PID", marshall_it<Q_PID> },
     { "QString", marshall_QString },
     { "QString&", marshall_QString },
     { "QString*", marshall_QString },
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/lib/Qt/qtruby.rb #531808:531809
@@ -1433,7 +1433,7 @@
 			if argtype == 'i'
 				if typename =~ /^int&?$|^signed int&?$|^signed$|^qint32&?$/
 					return 1
-				elsif typename =~ /^(?:short|ushort|unsigned short int|uchar|uint|long|ulong|unsigned long int|unsigned|float|double)$/
+				elsif typename =~ /^(?:short|ushort|unsigned short int|uchar|uint|long|ulong|unsigned long int|unsigned|float|double|WId|Q_PID)$/
 					return 0
 				elsif typename =~ /^(quint|qint|qulong|qlong|qreal)/
 					return 0
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/marshall_primitives.h #531808:531809
@@ -212,3 +212,20 @@
 	
 	return primitive_to_ruby<int>(*sv);
 }
+
+#if defined(Q_OS_WIN32)
+template <>
+static struct _PROCESS_INFORMATION* ruby_to_primitive<struct _PROCESS_INFORMATION*>(VALUE v)
+{
+	if(v == Qnil)
+		return 0;
+	
+	return NUM2INT(v);
+}
+
+template <>
+static VALUE primitive_to_ruby<struct _PROCESS_INFORMATION*>(struct _PROCESS_INFORMATION* sv)
+{
+	return INT2NUM(sv);
+}
+#endif
\ No newline at end of file



More information about the Kde-bindings mailing list