[Kde-bindings] playground/bindings/kimono

Richard Dale Richard_Dale at tipitina.demon.co.uk
Fri Feb 9 14:47:45 UTC 2007


SVN commit 631924 by rdale:

* Added the graphicsview/collidingmice example
* Fixed code generation of the csrcc tool, and added a static
  constructor
* Added a cmake rule for a ${CSRCC_PATH} variable

CCMAIL: kde-bindings at kde.org



 M  +10 -0     CMakeLists.txt  
 M  +4 -0      ChangeLog  
 M  +2 -1      examples/CMakeLists.txt  
 A             examples/graphicsview (directory)  
 A             examples/graphicsview/CMakeLists.txt  
 A             examples/graphicsview/collidingmice (directory)  
 A             examples/graphicsview/collidingmice/CMakeLists.txt  
 A             examples/graphicsview/collidingmice/images (directory)  
 AM            examples/graphicsview/collidingmice/images/cheese.jpg  
 A             examples/graphicsview/collidingmice/main.cs  
 A             examples/graphicsview/collidingmice/mice.qrc  
 A             examples/graphicsview/collidingmice/mouse.cs  
 M  +13 -3     tools/csrcc/rcc.cpp  


--- trunk/playground/bindings/kimono/CMakeLists.txt #631923:631924
@@ -49,6 +49,16 @@
 	MESSAGE (STATUS "Looking for uics - found - ${UICS_PATH}")
 ENDIF (NOT UICS_PATH)
 
+# find 'csrcc'
+MESSAGE (STATUS "Looking for csrcc")
+FIND_PROGRAM (CSRCC_PATH csrcc)
+IF (NOT CSRCC_PATH)
+	MESSAGE (STATUS "Looking for csrcc - not found")
+	MESSAGE (FATAL_ERROR "csrcc was not found on your system")
+ELSE (NOT CSRCC_PATH)
+	MESSAGE (STATUS "Looking for csrcc - found - ${CSRCC_PATH}")
+ENDIF (NOT CSRCC_PATH)
+
 INCLUDE_DIRECTORIES (${QT_INCLUDES})
 ADD_LIBRARY (qyoto SHARED ${SRC_CPP})
 TARGET_LINK_LIBRARIES (qyoto smokeqt ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
--- trunk/playground/bindings/kimono/ChangeLog #631923:631924
@@ -2,6 +2,10 @@
 
 	* Renamed CreateStrongReference() as IsInstanceContained()
 	* Added 'csrcc', a C# version of the Qt rcc tool
+	* Added the graphicsview/collidingmice example
+	* Fixed code generation of the csrcc tool, and added a static
+	  constructor
+	* Added a cmake rule for a ${CSRCC_PATH} variable
 
 2007-02-08  Arno Rehn  <arno at arnorehn.de>
 
--- trunk/playground/bindings/kimono/examples/CMakeLists.txt #631923:631924
@@ -1,5 +1,6 @@
+ADD_SUBDIRECTORY(graphicsview)
+ADD_SUBDIRECTORY(qdbus)
 ADD_SUBDIRECTORY(tutorial)
-ADD_SUBDIRECTORY(qdbus)
 ADD_SUBDIRECTORY(widgets)
 
 
** trunk/playground/bindings/kimono/examples/graphicsview/collidingmice/images/cheese.jpg #property svn:mime-type
   + application/octet-stream
--- trunk/playground/bindings/kimono/tools/csrcc/rcc.cpp #631923:631924
@@ -467,7 +467,14 @@
         fprintf(out,  "*****************************************************************************/\n\n");
         fprintf(out, "using Qyoto;\n");
         fprintf(out, "using System.Runtime.InteropServices;\n\n");
-        fprintf(out, "public class QCleanupResources__dest_class__ {\n\n");
+
+        QString initName = mInitName;
+        if(!initName.isEmpty()) {
+            initName.prepend("_");
+            initName.replace(QRegExp("[^a-zA-Z0-9_]"), "_");
+        }
+
+        fprintf(out, "public class QCleanupResources%s__dest_class__ {\n\n", initName.toLatin1().constData());
         fprintf(out, "[DllImport(\"libqyoto\", CharSet=CharSet.Ansi)]\n");
         fprintf(out, "public static extern void qRegisterResourceData(int flag, byte[] resource_struct, byte[] resource_name, byte[] resource_data);\n\n");
         fprintf(out, "[DllImport(\"libqyoto\", CharSet=CharSet.Ansi)]\n");
@@ -620,16 +627,19 @@
         }
 
         //init
-        fprintf(out, "int QInitResources%s()\n{\n", initName.toLatin1().constData());
+        fprintf(out, "static int QInitResources%s()\n{\n", initName.toLatin1().constData());
         fprintf(out, "    qRegisterResourceData(0x01, qt_resource_struct, "
                      "qt_resource_name, qt_resource_data);\n");
         fprintf(out, "    return 1;\n");
         fprintf(out, "}\n\n");
 //        fprintf(out, "Q_CONSTRUCTOR_FUNCTION(qInitResources%s)\n",
 //                initName.toLatin1().constData());
+        fprintf(out, "static QCleanupResources%s__dest_class__() {\n", initName.toLatin1().constData());
+        fprintf(out, "    QInitResources%s();\n", initName.toLatin1().constData());
+        fprintf(out, "}\n\n");
 
         //cleanup
-        fprintf(out, "int QCleanupResources%s()\n{\n", initName.toLatin1().constData());
+        fprintf(out, "static int QCleanupResources%s()\n{\n", initName.toLatin1().constData());
         fprintf(out, "    qUnregisterResourceData(0x01, qt_resource_struct, "
                      "qt_resource_name, qt_resource_data);\n");
         fprintf(out, "    return 1;\n");



More information about the Kde-bindings mailing list