[Kde-bindings] branches/work/kdebindings-smoke2

Arno Rehn kde at arnorehn.de
Mon Feb 11 19:09:11 UTC 2008


SVN commit 773786 by arnorehn:

* Add a global kapp variable.

CCMAIL: kde-bindings at kde.org



 M  +4 -0      ChangeLog  
 M  +5 -2      csharp/kimono/examples/test.cs  
 M  +6 -0      csharp/kimono/kde/KApplication.cs  
 M  +2 -0      csharp/kimono/kde/KDE.cs  
 M  +4 -0      kalyptus/kalyptusCxxToKimono.pm  


--- branches/work/kdebindings-smoke2/ChangeLog #773785:773786
@@ -1,3 +1,7 @@
+2008-02-11  Arno Rehn  <arno at arnorehn.de>
+
+	* Add a global kapp variable.
+
 2008-02-10  Arno Rehn  <arno at arnorehn.de>
 
 	* Bring back the namespaces. gmcs won't crash with namespaces instead of
--- branches/work/kdebindings-smoke2/csharp/kimono/examples/test.cs #773785:773786
@@ -3,16 +3,19 @@
 using System;
 using System.Reflection;
 
-class MainClass {
+class MainClass : QObject {
 	public static void Main(string[] args) {
 		KAboutData data = new KAboutData(new QByteArray("test"), new QByteArray("test"), KDE.ki18n("test"), new QByteArray("0.1"));
 		KCmdLineArgs.Init(args, data);
-		KApplication app = new KApplication();
+		new KApplication();
 		KMainWindow mw = new KMainWindow();
 		QWidget w = new QWidget();
 		mw.SetCentralWidget(w);
 		QVBoxLayout vbox = new QVBoxLayout(w);
 		vbox.AddWidget(new KPushButton("Hello World!"));
+		KPushButton quit = new KPushButton("Quit");
+		vbox.AddWidget(quit);
+		Connect(quit, SIGNAL("clicked()"), KDE.kapp, SLOT("quit()"));
 		mw.Show();
 		KApplication.Exec();
 	}
--- branches/work/kdebindings-smoke2/csharp/kimono/kde/KApplication.cs #773785:773786
@@ -59,10 +59,14 @@
 		public KApplication(bool GUIenabled) : this((Type) null) {
 			CreateProxy();
 			interceptor.Invoke("KApplication$", "KApplication(bool)", typeof(void), typeof(bool), GUIenabled);
+			KDE.kapp = this;
+			Qt.qApp = this;
 		}
 		public KApplication() : this((Type) null) {
 			CreateProxy();
 			interceptor.Invoke("KApplication", "KApplication()", typeof(void));
+			KDE.kapp = this;
+			Qt.qApp = this;
 		}
 		/// <remarks>
 		///  Returns the application session config object.
@@ -234,6 +238,8 @@
 		public KApplication(bool GUIenabled, KComponentData cData) : this((Type) null) {
 			CreateProxy();
 			interceptor.Invoke("KApplication$#", "KApplication(bool, const KComponentData&)", typeof(void), typeof(bool), GUIenabled, typeof(KComponentData), cData);
+			KDE.kapp = this;
+			Qt.qApp = this;
 		}
 		~KApplication() {
 			interceptor.Invoke("~KApplication", "~KApplication()", typeof(void));
--- branches/work/kdebindings-smoke2/csharp/kimono/kde/KDE.cs #773785:773786
@@ -7,6 +7,8 @@
 		[DllImport("libkimono", CharSet=CharSet.Ansi)]
 		static extern IntPtr KI18N(string msg);
 		
+		public static KApplication kapp = null;
+		
 		public static KLocalizedString ki18n(string msg) {
 			GCHandle ret = (GCHandle) KI18N(msg);
 			KLocalizedString str = (KLocalizedString) ret.Target;
--- branches/work/kdebindings-smoke2/kalyptus/kalyptusCxxToKimono.pm #773785:773786
@@ -2184,6 +2184,10 @@
 				$methodCode .= "\t\tpublic $csharpClassName($csharpparams) : this((Type) null) {\n";
 				$methodCode .= "\t\t\tCreateProxy();\n";
 				$methodCode .= smokeInvocation("interceptor", \@csharpArgTypeList, "void", $mungedMethod, $signature, $addImport);
+				if ($csharpClassName eq 'KApplication') {
+					$methodCode .= "\t\t\tKDE.kapp = this;\n";
+					$methodCode .= "\t\t\tQt.qApp = this;\n";
+				}
 				$methodCode .= "\t\t}\n";
 			}
 		} elsif ( $mainClassNode->{Pure} && $isPure ) {



More information about the Kde-bindings mailing list