[Kde-bindings] KDE/kdebindings/csharp/qyoto
Arno Rehn
kde at arnorehn.de
Thu Dec 10 19:38:56 UTC 2009
SVN commit 1061139 by arnorehn:
Apply two patches from Benjamin Sonnemann:
* Fix the remaining P/Invokes so they don't include the 'lib'
prefix in the library name.
* Don't crash if ain invalid QModelIndex is returned.
Thanks for the patches!
CCMAIL: kde-bindings at kde.org
CCMAIL: mail at sonnemann-it.de
M +3 -1 core/QAbstractItemModelExtras.cs
M +5 -5 core/QItemModel.cs
M +3 -3 core/QMetaTypeExtras.cs
M +3 -1 core/QModelIndexExtras.cs
M +4 -4 core/QObjectExtras.cs
M +2 -2 core/QVariantExtras.cs
M +1 -1 core/QtExtras.cs
M +2 -2 gui/QAbstractItemDelegateInternal.cs
M +3 -3 gui/QAbstractItemViewInternal.cs
M +6 -6 gui/QAbstractProxyModelInternal.cs
M +5 -5 gui/QAbstractTextDocumentLayoutInternal.cs
M +2 -2 gui/QStringListModelExtras.cs
M +1 -1 qdbus/QDBusReply.cs
M +1 -1 sql/QSqlQueryModelExtras.cs
M +2 -2 tools/csrcc/rcc.cpp
--- trunk/KDE/kdebindings/csharp/qyoto/core/QAbstractItemModelExtras.cs #1061138:1061139
@@ -5,7 +5,7 @@
using System.Runtime.InteropServices;
public abstract partial class QAbstractItemModel : QObject {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
public static extern IntPtr AbstractItemModelCreateIndex(IntPtr obj, int row, int column, IntPtr ptr);
private struct HandleRef {
@@ -38,6 +38,8 @@
static public void DerefIndexHandle(object o) {
HandleRef reference;
+ if( o == null)
+ return;
if (handleMap.TryGetValue(o, out reference)) {
reference.refCount -= 1;
--- trunk/KDE/kdebindings/csharp/qyoto/core/QItemModel.cs #1061138:1061139
@@ -5,19 +5,19 @@
[SmokeClass("QAbstractItemModel")]
internal class QItemModel : QAbstractItemModel {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern int QAbstractItemModelColumnCount(IntPtr obj, IntPtr modelIndex);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern int QAbstractItemModelRowCount(IntPtr obj, IntPtr modelIndex);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractItemModelParent(IntPtr obj, IntPtr modelIndex);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractItemModelData(IntPtr obj, IntPtr modelIndex, int role);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractItemModelIndex(IntPtr obj, int row, int column, IntPtr modelIndex);
protected QItemModel(Type dummy) : base((Type) null) {}
--- trunk/KDE/kdebindings/csharp/qyoto/core/QMetaTypeExtras.cs #1061138:1061139
@@ -27,13 +27,13 @@
public delegate void Destructor(IntPtr obj);
public delegate IntPtr Constructor(IntPtr copy);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern void DestroyObject(string name, IntPtr ptr);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr CreateObject(string name, IntPtr other);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern int QMetaTypeRegisterType(string name, Destructor dtor, Constructor ctor);
public static int RegisterType<T>() {
--- trunk/KDE/kdebindings/csharp/qyoto/core/QModelIndexExtras.cs #1061138:1061139
@@ -4,11 +4,13 @@
using System.Runtime.InteropServices;
public partial class QModelIndex : Object, IDisposable {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
public static extern IntPtr ModelIndexInternalPointer(IntPtr obj);
public object InternalPointer() {
IntPtr ptr = ModelIndexInternalPointer((IntPtr) GCHandle.Alloc(this));
+ if(ptr == IntPtr.Zero)
+ return null;
return ((GCHandle) ptr).Target;
}
}
--- trunk/KDE/kdebindings/csharp/qyoto/core/QObjectExtras.cs #1061138:1061139
@@ -14,17 +14,17 @@
public partial class QObject : Qt, IDisposable {
private delegate void AddToListFn(IntPtr obj);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
private static extern IntPtr FindQObjectChild(IntPtr parent, string childName);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
private static extern void FindQObjectChildren(IntPtr parent, IntPtr regexp,
string childName, AddToListFn addFn);
- [DllImport("libqyotoshared", CharSet=CharSet.Ansi)]
+ [DllImport("qyotoshared", CharSet=CharSet.Ansi)]
private static extern bool ConnectDelegate(IntPtr obj, string signal, Delegate d, IntPtr handle);
- [DllImport("libqyotoshared", CharSet=CharSet.Ansi)]
+ [DllImport("qyotoshared", CharSet=CharSet.Ansi)]
private static extern bool DisconnectDelegate(IntPtr obj, string signal, Delegate d);
public static bool Connect(QObject obj, string signal, SlotFunc d) {
--- trunk/KDE/kdebindings/csharp/qyoto/core/QVariantExtras.cs #1061138:1061139
@@ -8,10 +8,10 @@
public partial class QVariant : Object, IDisposable {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QVariantValue(string typeName, IntPtr variant);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QVariantFromValue(int type, IntPtr value);
public T Value<T>() {
--- trunk/KDE/kdebindings/csharp/qyoto/core/QtExtras.cs #1061138:1061139
@@ -7,7 +7,7 @@
using System.Reflection;
public partial class Qt : Object {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
private static extern IntPtr qyoto_qt_metacast(IntPtr obj, string target);
public static QApplication qApp = null;
--- trunk/KDE/kdebindings/csharp/qyoto/gui/QAbstractItemDelegateInternal.cs #1061138:1061139
@@ -5,10 +5,10 @@
[SmokeClass("QAbstractItemDelegate")]
internal class QAbstractItemDelegateInternal : QAbstractItemDelegate {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern void QAbstractItemDelegatePaint(IntPtr obj, IntPtr painter, IntPtr option, IntPtr index);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractItemDelegateSizeHint(IntPtr obj, IntPtr option, IntPtr index);
protected QAbstractItemDelegateInternal(Type dummy) : base((Type) null) {}
--- trunk/KDE/kdebindings/csharp/qyoto/gui/QAbstractItemViewInternal.cs #1061138:1061139
@@ -5,13 +5,13 @@
[SmokeClass("QAbstractItemView")]
internal class QAbstractItemViewInternal : QAbstractItemView {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractItemViewIndexAt(IntPtr obj, IntPtr point);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern void QAbstractItemViewScrollTo(IntPtr obj, IntPtr index, int hint);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractItemViewVisualRect(IntPtr obj, IntPtr index);
public QAbstractItemViewInternal(Type dummy) : base((Type) dummy) {}
--- trunk/KDE/kdebindings/csharp/qyoto/gui/QAbstractProxyModelInternal.cs #1061138:1061139
@@ -5,22 +5,22 @@
[SmokeClass("QAbstractProxyModel")]
internal class QAbstractProxyModelInternal : QAbstractProxyModel {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern int QAbstractItemModelColumnCount(IntPtr obj, IntPtr modelIndex);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern int QAbstractItemModelRowCount(IntPtr obj, IntPtr modelIndex);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractItemModelParent(IntPtr obj, IntPtr modelIndex);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractItemModelIndex(IntPtr obj, int row, int column, IntPtr modelIndex);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractProxyModelMapToSource(IntPtr obj, IntPtr proxyIndex);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractProxyModelMapFromSource(IntPtr obj, IntPtr sourceIndex);
protected QAbstractProxyModelInternal(Type dummy) : base((Type) null) {}
--- trunk/KDE/kdebindings/csharp/qyoto/gui/QAbstractTextDocumentLayoutInternal.cs #1061138:1061139
@@ -5,19 +5,19 @@
[SmokeClass("QAbstractTextDocumentLayout")]
internal class QAbstractTextDocumentLayoutInternal : QAbstractTextDocumentLayout {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractTextDocumentLayoutBlockBoundingRect(IntPtr obj, IntPtr block);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractTextDocumentLayoutDocumentSize(IntPtr obj);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern IntPtr QAbstractTextDocumentLayoutFrameBoundingRect(IntPtr obj, IntPtr frame);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern int QAbstractTextDocumentLayoutHitTest(IntPtr obj, IntPtr point, int accuracy);
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
static extern int QAbstractTextDocumentLayoutPageCount(IntPtr obj);
protected QAbstractTextDocumentLayoutInternal(Type dummy) : base((Type) null) {}
--- trunk/KDE/kdebindings/csharp/qyoto/gui/QStringListModelExtras.cs #1061138:1061139
@@ -5,7 +5,7 @@
public partial class QStringListModel : QAbstractListModel, IDisposable {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
public static extern IntPtr QAbstractItemModelParent(IntPtr obj, IntPtr ix);
public override QModelIndex Parent(QModelIndex index) {
@@ -15,7 +15,7 @@
return result;
}
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
public static extern int QAbstractItemModelColumnCount(IntPtr obj, IntPtr ix);
public override int ColumnCount(QModelIndex index) {
--- trunk/KDE/kdebindings/csharp/qyoto/qdbus/QDBusReply.cs #1061138:1061139
@@ -5,7 +5,7 @@
using System.Collections.Generic;
public class QDBusReply<T> {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
private static extern void qyoto_qdbus_reply_fill(IntPtr msg, IntPtr error, IntPtr variant);
public QDBusReply(QDBusMessage reply) {
--- trunk/KDE/kdebindings/csharp/qyoto/sql/QSqlQueryModelExtras.cs #1061138:1061139
@@ -5,7 +5,7 @@
public partial class QSqlQueryModel : QAbstractTableModel, IDisposable {
- [DllImport("libqyoto", CharSet=CharSet.Ansi)]
+ [DllImport("qyoto", CharSet=CharSet.Ansi)]
public static extern IntPtr QAbstractItemModelParent(IntPtr obj, IntPtr ix);
public override QModelIndex Parent(QModelIndex index) {
--- trunk/KDE/kdebindings/csharp/qyoto/tools/csrcc/rcc.cpp #1061138:1061139
@@ -475,9 +475,9 @@
}
fprintf(out, "public class QInitResources%s__dest_class__ {\n\n", initName.toLatin1().constData());
- fprintf(out, "[DllImport(\"libqyoto\", CharSet=CharSet.Ansi)]\n");
+ fprintf(out, "[DllImport(\"qyoto\", CharSet=CharSet.Ansi)]\n");
fprintf(out, "public static unsafe extern void QyotoRegisterResourceData(int flag, byte * resource_struct, byte * resource_name, byte * resource_data);\n\n");
- fprintf(out, "[DllImport(\"libqyoto\", CharSet=CharSet.Ansi)]\n");
+ fprintf(out, "[DllImport(\"qyoto\", CharSet=CharSet.Ansi)]\n");
fprintf(out, "public static unsafe extern void QyotoUnregisterResourceData(int flag, byte * resource_struct, byte * resource_name, byte * resource_data);\n\n");
} else if(mFormat == Binary) {
fprintf(out,"qres");
More information about the Kde-bindings
mailing list