diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:44:01 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:44:01 +0000 |
commit | 479f5f799523bffbcc83dff581a2299c047c6fff (patch) | |
tree | 186aae707ed02aac6c7cab2fb14e97f72aca5e36 /qtsharp/src/bindings/static/QtSignal.cs | |
parent | f1dbff6145c98324ff82e34448b7483727e8ace4 (diff) | |
download | tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.tar.gz tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'qtsharp/src/bindings/static/QtSignal.cs')
-rw-r--r-- | qtsharp/src/bindings/static/QtSignal.cs | 160 |
1 files changed, 80 insertions, 80 deletions
diff --git a/qtsharp/src/bindings/static/QtSignal.cs b/qtsharp/src/bindings/static/QtSignal.cs index f76291f5..0889f3b0 100644 --- a/qtsharp/src/bindings/static/QtSignal.cs +++ b/qtsharp/src/bindings/static/QtSignal.cs @@ -28,7 +28,7 @@ namespace Qt { using System.Runtime.InteropServices; using System.Reflection; - internal class QtSignal: QObject, IDisposable { + internal class QtSignal: TQObject, IDisposable { internal static bool traceConnects; static QtSignal () @@ -36,7 +36,7 @@ namespace Qt { traceConnects = false; } - private QObject sender; + private TQObject sender; private string signal; private string name; private string args; @@ -47,7 +47,7 @@ namespace Qt { get { return MakeSigId(sender, signal); } } - public QObject Sender { + public TQObject Sender { get { return sender; } } @@ -75,7 +75,7 @@ namespace Qt { get { return slots; } } - public QtSignal (QObject sender, string signal): base (NoSignalInit.Instance) + public QtSignal (TQObject sender, string signal): base (NoSignalInit.Instance) { this.sender = sender; this.signal = signal; @@ -101,7 +101,7 @@ namespace Qt { return sender.CsSignalMap.Contains(signal); } - internal static bool Connect(QObject sender, string signal, QObject receiver, string slot) + internal static bool Connect(TQObject sender, string signal, TQObject receiver, string slot) { if (IsSlot(signal)) { return false; @@ -114,7 +114,7 @@ namespace Qt { return ConnectSignalToSlot(sender, NormalizeParam(signal), receiver, NormalizeParam(slot)); } - private static bool ConnectSignalToSlot(QObject sender, string signal, QObject receiver, string slot) + private static bool ConnectSignalToSlot(TQObject sender, string signal, TQObject receiver, string slot) { QtSignal sigobj; QtSlot slotobj = new QtSlot(receiver, slot); @@ -162,120 +162,120 @@ namespace Qt { switch (slotobj.Args) { case "()": del = Delegate.CreateDelegate (typeof (del_void), receiver, slotobj.Name); - slotobj.WrapperPtr = csharp_connect_void (sender.RawObject, SIGNAL (signal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_void (sender.RawObject, TQT_SIGNAL (signal), receiver.RawObject, del); break; case "(bool)": del = Delegate.CreateDelegate (typeof (del_bool), receiver, slotobj.Name); - slotobj.WrapperPtr = csharp_connect_bool (sender.RawObject, SIGNAL (signal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_bool (sender.RawObject, TQT_SIGNAL (signal), receiver.RawObject, del); break; case "(short)": del = Delegate.CreateDelegate (typeof (del_short), receiver, slotobj.Name); - slotobj.WrapperPtr = csharp_connect_short (sender.RawObject, SIGNAL (signal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_short (sender.RawObject, TQT_SIGNAL (signal), receiver.RawObject, del); break; case "(int)": del = Delegate.CreateDelegate (typeof (del_int), receiver, slotobj.Name); - slotobj.WrapperPtr = csharp_connect_int (sender.RawObject, SIGNAL (signal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_int (sender.RawObject, TQT_SIGNAL (signal), receiver.RawObject, del); break; case "(long)": del = Delegate.CreateDelegate (typeof (del_long), receiver, slotobj.Name); - slotobj.WrapperPtr = csharp_connect_long (sender.RawObject, SIGNAL (signal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_long (sender.RawObject, TQT_SIGNAL (signal), receiver.RawObject, del); break; case "(float)": del = Delegate.CreateDelegate (typeof (del_float), receiver, slotobj.Name); - slotobj.WrapperPtr = csharp_connect_float (sender.RawObject, SIGNAL (signal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_float (sender.RawObject, TQT_SIGNAL (signal), receiver.RawObject, del); break; case "(double)": del = Delegate.CreateDelegate (typeof (del_double), receiver, slotobj.Name); - slotobj.WrapperPtr = csharp_connect_double (sender.RawObject, SIGNAL (signal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_double (sender.RawObject, TQT_SIGNAL (signal), receiver.RawObject, del); break; - case "(QString)": - realsignal = sigobj.Name + "(const QString&)"; + case "(TQString)": + realsignal = sigobj.Name + "(const TQString&)"; Console.WriteLine("Connecting signal, sigobj.Name = {0}, realsignal = {1}", sigobj.Name, realsignal); del = Delegate.CreateDelegate (typeof (del_QString), slotobj, "SlotBridge_QString"); - slotobj.WrapperPtr = csharp_connect_QString (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QString (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QDockWindow)": - realsignal = sigobj.Name + "(QDockWindow*)"; + case "(TQDockWindow)": + realsignal = sigobj.Name + "(TQDockWindow*)"; del = Delegate.CreateDelegate (typeof (del_QDockWindow), slotobj, "SlotBridge_QDockWindow"); - slotobj.WrapperPtr = csharp_connect_QDockWindow (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QDockWindow (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QDropEvent)": - realsignal = sigobj.Name + "(QDropEvent*)"; + case "(TQDropEvent)": + realsignal = sigobj.Name + "(TQDropEvent*)"; del = Delegate.CreateDelegate (typeof (del_QDropEvent), slotobj, "SlotBridge_QDropEvent"); - slotobj.WrapperPtr = csharp_connect_QDropEvent (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QDropEvent (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QDropEvent,QListViewItem)": - realsignal = sigobj.Name + "(QDropEvent*,QListViewItem*)"; + case "(TQDropEvent,TQListViewItem)": + realsignal = sigobj.Name + "(TQDropEvent*,TQListViewItem*)"; del = Delegate.CreateDelegate (typeof (del_QDropEventQListViewItem), slotobj, "SlotBridge_QDropEventQListViewItem"); - slotobj.WrapperPtr = csharp_connect_QDropEventQListViewItem (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QDropEventQListViewItem (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QIconViewItem)": - realsignal = sigobj.Name + "(QIconViewItem*)"; + case "(TQIconViewItem)": + realsignal = sigobj.Name + "(TQIconViewItem*)"; del = Delegate.CreateDelegate (typeof (del_QIconViewItem), slotobj, "SlotBridge_QIconViewItem"); - slotobj.WrapperPtr = csharp_connect_QIconViewItem (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QIconViewItem (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QListBoxItem)": - realsignal = sigobj.Name + "(QListBoxItem*)"; + case "(TQListBoxItem)": + realsignal = sigobj.Name + "(TQListBoxItem*)"; del = Delegate.CreateDelegate (typeof (del_QListBoxItem), slotobj, "SlotBridge_QListBoxItem"); - slotobj.WrapperPtr = csharp_connect_QListBoxItem (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QListBoxItem (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QListViewItem)": - realsignal = sigobj.Name + "(QListViewItem*)"; + case "(TQListViewItem)": + realsignal = sigobj.Name + "(TQListViewItem*)"; del = Delegate.CreateDelegate (typeof (del_QListViewItem), slotobj, "SlotBridge_QListViewItem"); - slotobj.WrapperPtr = csharp_connect_QListViewItem (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QListViewItem (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QListViewItem,QListViewItem)": - realsignal = sigobj.Name + "(QListViewItem*,QListViewItem*)"; + case "(TQListViewItem,TQListViewItem)": + realsignal = sigobj.Name + "(TQListViewItem*,TQListViewItem*)"; del = Delegate.CreateDelegate (typeof (del_QListViewItemQListViewItem), slotobj, "SlotBridge_QListViewItemQListViewItem"); - slotobj.WrapperPtr = csharp_connect_QListViewItemQListViewItem (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QListViewItemQListViewItem (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QListViewItem,QListViewItem,QListViewItem)": - realsignal = sigobj.Name + "(QListViewItem*,QListViewItem*,QListViewItem*)"; + case "(TQListViewItem,TQListViewItem,TQListViewItem)": + realsignal = sigobj.Name + "(TQListViewItem*,TQListViewItem*,TQListViewItem*)"; del = Delegate.CreateDelegate (typeof (del_QListViewItemQListViewItemQListViewItem), slotobj, "SlotBridge_QListViewItemQListViewItemQListViewItem"); - slotobj.WrapperPtr = csharp_connect_QListViewItemQListViewItemQListViewItem (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QListViewItemQListViewItemQListViewItem (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QNetworkOperation)": - realsignal = sigobj.Name + "(QNetworkOperation*)"; + case "(TQNetworkOperation)": + realsignal = sigobj.Name + "(TQNetworkOperation*)"; del = Delegate.CreateDelegate (typeof (del_QNetworkOperation), slotobj, "SlotBridge_QNetworkOperation"); - slotobj.WrapperPtr = csharp_connect_QNetworkOperation (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QNetworkOperation (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QObject)": - realsignal = sigobj.Name + "(QObject*)"; + case "(TQObject)": + realsignal = sigobj.Name + "(TQObject*)"; del = Delegate.CreateDelegate (typeof (del_QObject), slotobj, "SlotBridge_QObject"); - slotobj.WrapperPtr = csharp_connect_QObject (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QObject (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QToolBar)": - realsignal = sigobj.Name + "(QToolBar*)"; + case "(TQToolBar)": + realsignal = sigobj.Name + "(TQToolBar*)"; del = Delegate.CreateDelegate (typeof (del_QToolBar), slotobj, "SlotBridge_QToolBar"); - slotobj.WrapperPtr = csharp_connect_QToolBar (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QToolBar (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(QWidget)": - realsignal = sigobj.Name + "(QWidget*)"; + case "(TQWidget)": + realsignal = sigobj.Name + "(TQWidget*)"; del = Delegate.CreateDelegate (typeof (del_QWidget), slotobj, "SlotBridge_QWidget"); - slotobj.WrapperPtr = csharp_connect_QWidget (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_QWidget (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(int,QIconViewItem)": - realsignal = sigobj.Name + "(int,QIconViewItem*)"; + case "(int,TQIconViewItem)": + realsignal = sigobj.Name + "(int,TQIconViewItem*)"; del = Delegate.CreateDelegate (typeof (del_intQIconViewItem), slotobj, "SlotBridge_intQIconViewItem"); - slotobj.WrapperPtr = csharp_connect_intQIconViewItem (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_intQIconViewItem (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; - case "(int,QListBoxItem)": - realsignal = sigobj.Name + "(int,QListBoxItem*)"; + case "(int,TQListBoxItem)": + realsignal = sigobj.Name + "(int,TQListBoxItem*)"; del = Delegate.CreateDelegate (typeof (del_intQListBoxItem), slotobj, "SlotBridge_intQListBoxItem"); - slotobj.WrapperPtr = csharp_connect_intQListBoxItem (sender.RawObject, SIGNAL (realsignal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_intQListBoxItem (sender.RawObject, TQT_SIGNAL (realsignal), receiver.RawObject, del); break; case "(int,bool)": del = Delegate.CreateDelegate (typeof (del_intbool), receiver, slotobj.Name); - slotobj.WrapperPtr = csharp_connect_intbool (sender.RawObject, SIGNAL (signal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_intbool (sender.RawObject, TQT_SIGNAL (signal), receiver.RawObject, del); break; case "(int,int)": del = Delegate.CreateDelegate (typeof (del_intint), receiver, slotobj.Name); - slotobj.WrapperPtr = csharp_connect_intint (sender.RawObject, SIGNAL (signal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_intint (sender.RawObject, TQT_SIGNAL (signal), receiver.RawObject, del); break; case "(int,int,int)": del = Delegate.CreateDelegate (typeof (del_intintint), receiver, slotobj.Name); - slotobj.WrapperPtr = csharp_connect_intintint (sender.RawObject, SIGNAL (signal), receiver.RawObject, del); + slotobj.WrapperPtr = csharp_connect_intintint (sender.RawObject, TQT_SIGNAL (signal), receiver.RawObject, del); break; default: throw new ArgumentException ("Unsupported method prototype for C++ signal -> C# slot connection: " + slotobj.Args); @@ -292,12 +292,12 @@ namespace Qt { // ...a C++ slot. C++ slots are C# methods, so we should never get here. else { throw new ArgumentException(receiver+" has no slot '"+slot+"'"); - // return qt_QObject_connect1(sender.RawObject, SIGNAL(signal), receiver.RawObject, SLOT(slot)); + // return qt_QObject_connect1(sender.RawObject, TQT_SIGNAL(signal), receiver.RawObject, TQT_SLOT(slot)); } } } - private static bool ConnectSignalToSignal(QObject sender, string signal, QObject receiver, string target) + private static bool ConnectSignalToSignal(TQObject sender, string signal, TQObject receiver, string target) { if (traceConnects) ErrMsg ("ConnectSignalToSlot: ({0}) {1}, {2}, ({3}) {4}, {5}", sender.RawObject, sender, signal, @@ -330,15 +330,15 @@ namespace Qt { string mangle = MangleArgs(args); // HACK Wrap target signal in a slot and connect the slot to the sender. - return Connect(sender, SIGNAL(signal), targetobj, SLOT("Emit_"+mangle+args)); + return Connect(sender, TQT_SIGNAL(signal), targetobj, TQT_SLOT("Emit_"+mangle+args)); } // ...a C++ signal else - return qt_QObject_connect1(sender.RawObject, SIGNAL(signal), receiver.RawObject, SIGNAL(target)); + return qt_QObject_connect1(sender.RawObject, TQT_SIGNAL(signal), receiver.RawObject, TQT_SIGNAL(target)); } } - internal static bool Disconnect(QObject sender, string signal, QObject receiver, string slot) + internal static bool Disconnect(TQObject sender, string signal, TQObject receiver, string slot) { if (signal == null && receiver == null && slot == null) return DisconnectAll(sender); @@ -356,7 +356,7 @@ namespace Qt { return DisconnectSignalFromSlot(sender, NormalizeParam(signal), receiver, NormalizeParam(slot)); } - private static bool DisconnectSignalFromSlot(QObject sender, string signal, QObject receiver, string slot) + private static bool DisconnectSignalFromSlot(TQObject sender, string signal, TQObject receiver, string slot) { if (traceConnects) ErrMsg ("DisconnectSignalFromSlot: ({0}) {1}, {2}, ({3}) {4}, {5}", sender.RawObject, sender, signal, @@ -410,12 +410,12 @@ namespace Qt { // ...a C++ slot. C++ slots are C# methods, so we should never get here. else { throw new ArgumentException(receiver+" has no slot '"+slot+"'"); - // return qt_QObject_disconnect2(sender.RawObject, SIGNAL(signal), receiver.RawObject, SLOT(slot)); + // return qt_QObject_disconnect2(sender.RawObject, TQT_SIGNAL(signal), receiver.RawObject, TQT_SLOT(slot)); } } } - private static bool DisconnectSignalFromSignal(QObject sender, string signal, QObject receiver, string target) + private static bool DisconnectSignalFromSignal(TQObject sender, string signal, TQObject receiver, string target) { if (traceConnects) ErrMsg ("DisconnectSignalFromSignal: ({0}) {1}, {2}, ({3}) {4}, {5}", sender.RawObject, sender, signal, @@ -449,16 +449,16 @@ namespace Qt { if (receiver.CsSignalMap.Contains(target)) { QtSignal targetobj = receiver.CsSignalMap[target]; string args = "(" + target.Split(new char[] {'('})[1]; - return Disconnect(sender, SIGNAL(signal), targetobj, SLOT("emit_"+args)); + return Disconnect(sender, TQT_SIGNAL(signal), targetobj, TQT_SLOT("emit_"+args)); } // ...a C++ signal else { - return qt_QObject_disconnect2(sender.RawObject, SIGNAL(signal), receiver.RawObject, SLOT(target)); + return qt_QObject_disconnect2(sender.RawObject, TQT_SIGNAL(signal), receiver.RawObject, TQT_SLOT(target)); } } } - private static bool DisconnectAll(QObject sender) + private static bool DisconnectAll(TQObject sender) { if (traceConnects) ErrMsg ("DisconnectAll: ({0}) {1}", sender.RawObject, sender); @@ -474,12 +474,12 @@ namespace Qt { foreach (QtSignal signal in signals) foreach (QtSlot slot in new ArrayList (signal.Slots)) - Disconnect (sender, SIGNAL (signal.Signal), slot.Receiver, SLOT (slot.Slot)); + Disconnect (sender, TQT_SIGNAL (signal.Signal), slot.Receiver, TQT_SLOT (slot.Slot)); return true; } - private static bool DisconnectReceiver(QObject sender, QObject receiver) + private static bool DisconnectReceiver(TQObject sender, TQObject receiver) { if (traceConnects) ErrMsg ("DisconnectReceiver: ({0}) {1}, ({2}) {3}", sender.RawObject, sender, receiver.RawObject, receiver); @@ -495,12 +495,12 @@ namespace Qt { foreach (QtSignal signal in signals) foreach (QtSlot slot in new ArrayList (signal.Slots)) - Disconnect (signal.Sender, SIGNAL (signal.Name), receiver, SLOT (slot.Name)); + Disconnect (signal.Sender, TQT_SIGNAL (signal.Name), receiver, TQT_SLOT (slot.Name)); return true; } - private static bool DisconnectSignal(QObject sender, string signal) + private static bool DisconnectSignal(TQObject sender, string signal) { if (traceConnects) ErrMsg ("DisconnectSignal: ({0}) {1}, {2}", sender.RawObject, sender, signal); @@ -509,14 +509,14 @@ namespace Qt { QtSignal sig = map[signal]; if (sig != null) { foreach (QtSlot slot in new ArrayList (sig.Slots)) - Disconnect (sender, SIGNAL(signal), slot.Receiver, SLOT(slot.Slot)); + Disconnect (sender, TQT_SIGNAL(signal), slot.Receiver, TQT_SLOT(slot.Slot)); } } return true; } - private static bool DisconnectSignalFromReceiver (QObject sender, string signal, QObject receiver) + private static bool DisconnectSignalFromReceiver (TQObject sender, string signal, TQObject receiver) { if (traceConnects) ErrMsg ("DisconnectSignalFromReceiver: ({0}) {1}, {2}, ({3}), {4}", sender.RawObject, sender, @@ -527,7 +527,7 @@ namespace Qt { if (sig != null) { foreach (QtSlot slot in new ArrayList (sig.Slots)) if (slot.Receiver == receiver) - Disconnect (sender, signal, receiver, SLOT (slot.Name)); + Disconnect (sender, signal, receiver, TQT_SLOT (slot.Name)); } } @@ -561,7 +561,7 @@ namespace Qt { */ } - private static string MakeSigId(QObject sender, string signal) + private static string MakeSigId(TQObject sender, string signal) { return sender.RawObject.ToString()+signal; } |