[Kde-bindings] playground/bindings/kimono

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sun Feb 4 11:33:36 UTC 2007


SVN commit 630064 by rdale:

* Added a a Qyoto Debug class for turning on debugging options
  Example usage:

	Debug.SetDebug(QtDebugChannel.QTDB_VIRTUAL);

  This will show the virtual method callbacks from the Smoke lib

CCMAIL: kde-bindings at kde.org



 M  +6 -0      ChangeLog  
 M  +33 -1     Qyoto.cs  
 M  +1 -1      examples/qdbus/chat/chat.cs  
 M  +6 -0      qyoto.cpp  


--- trunk/playground/bindings/kimono/ChangeLog #630063:630064
@@ -1,7 +1,13 @@
 2007-01-05  Richard Dale  <rdale at foton.es>
 
 	* Updated the project TODO list
+	* Added a a Qyoto Debug class for turning on debugging options
+	  Example usage:
 
+		Debug.SetDebug(QtDebugChannel.QTDB_VIRTUAL);
+
+	  This will show the virtual method callbacks from the Smoke lib
+
 2007-01-04  Richard Dale  <rdale at foton.es>
 
 	* The SmokeMethod attribute constructor now takes three arguments,
--- trunk/playground/bindings/kimono/Qyoto.cs #630063:630064
@@ -9,7 +9,39 @@
 	using System.Text;
 	using System.Text.RegularExpressions;
 	using System.Runtime.InteropServices;
-	
+
+	public enum DebugLevel {
+		Off, 
+		Minimal, 
+		High, 
+		Extensive
+	}
+
+	public enum QtDebugChannel {
+		QTDB_NONE = 0x00,
+		QTDB_AMBIGUOUS = 0x01,
+		QTDB_METHOD_MISSING = 0x02,
+		QTDB_CALLS = 0x04,
+		QTDB_GC = 0x08,
+		QTDB_VIRTUAL = 0x10,
+		QTDB_VERBOSE = 0x20,
+		QTDB_ALL = QTDB_VERBOSE | QTDB_VIRTUAL | QTDB_GC | QTDB_CALLS | QTDB_METHOD_MISSING | QTDB_AMBIGUOUS
+	}
+
+	public class Debug {
+		[DllImport("libqyoto", CharSet=CharSet.Ansi)]
+		public static extern void SetDebug(QtDebugChannel debugChannel);
+
+		public static DebugLevel debugLevel = DebugLevel.Off;
+
+		public static void SetDebugLevel(DebugLevel level) {
+			debugLevel = level;
+			if (level == DebugLevel.Extensive) {
+				SetDebug(QtDebugChannel.QTDB_ALL);
+			}
+		}
+	}
+
 	public class Qyoto : System.Object
 	{
 		[DllImport("libqyoto", CharSet=CharSet.Ansi)]
--- trunk/playground/bindings/kimono/examples/qdbus/chat/chat.cs #630063:630064
@@ -135,7 +135,7 @@
         new QApplication(args);
     
         if (!QDBusConnection.SessionBus().IsConnected()) {
-            Console.WriteLine("Cannot connect to the D-BUS session bus.\n" +
+            Console.Write("Cannot connect to the D-BUS session bus.\n" +
                      "Please check your system settings and try again.\n");
             return 1;
         }
--- trunk/playground/bindings/kimono/qyoto.cpp #630063:630064
@@ -912,6 +912,12 @@
 
 extern "C" {
 
+void
+SetDebug(int channel) 
+{
+	do_debug = channel;
+}
+
 int 
 FindMethodId(char * classname, char * mungedname, char * signature) 
 {



More information about the Kde-bindings mailing list