diff --git a/qt/Makefile.am b/qt/Makefile.am index d43bee2a..f229f2f6 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -8,7 +8,8 @@ HANDWRITTEN = \ QApplication.cs \ QCoreApplication.cs \ QSize.cs \ - QPushButton.cs + QPushButton.cs \ + QWidget.cs all: hello.exe @@ -25,8 +26,8 @@ generated: qt-gui-filters.xml qt-gui.xml $(RM) -r generated $(MONO) --debug $(top_srcdir)/bin/Debug/generator.exe -o=generated -ns=Qt.Gui -lib=QtGui --filters=$^ -#libQtGui-inline.so: qt-gui.cpp -# $(CXX) -m32 -I. -framework QtGui -framework QtCore -DQ_WS_MAC --shared -fPIC -o $@ -fkeep-inline-functions qt-gui.cpp +libQtGui-inline.so: qt-gui.cpp + $(CXX) -m32 -I. -framework QtGui -framework QtCore --shared -fPIC -o $@ -fkeep-inline-functions -fdump-class-hierarchy qt-gui.cpp Qt.Gui-binding.dll: generated $(addprefix src/,$(HANDWRITTEN)) $(GMCS) -debug -out:$@ -target:library -unsafe -r:$(INTEROP_DLL) generated/*.cs $(addprefix src/,$(HANDWRITTEN)) diff --git a/qt/demos/hello.cs b/qt/demos/hello.cs index 2fb6c655..112178d4 100644 --- a/qt/demos/hello.cs +++ b/qt/demos/hello.cs @@ -11,8 +11,7 @@ namespace QtTest { using (QApplication app = new QApplication ()) { using (QPushButton hello = new QPushButton ("Hello world!")) { - var sz = new QSize (100, 30); - hello.Resize (ref sz); + hello.Resize (200, 30); hello.SetVisible (true); QApplication.Exec (); diff --git a/qt/src/QSize.cs b/qt/src/QSize.cs index 5d9b6f75..a5b9eb7e 100644 --- a/qt/src/QSize.cs +++ b/qt/src/QSize.cs @@ -7,13 +7,13 @@ namespace Qt.Gui { [StructLayout (LayoutKind.Sequential)] public struct QSize { - public int wd; - public int ht; + public int Width; + public int Height; public QSize (int w, int h) { - wd = w; - ht = h; + this.Width = w; + this.Height = h; } } } diff --git a/qt/src/QWidget.cs b/qt/src/QWidget.cs new file mode 100644 index 00000000..b7a92c45 --- /dev/null +++ b/qt/src/QWidget.cs @@ -0,0 +1,16 @@ +using System; +using System.Runtime.InteropServices; +using Mono.Cxxi; + +namespace Qt.Gui { + public partial class QWidget { + + public void Resize (int width, int height) + { + var size = new QSize (width, height); + impl.resize (Native, ref size); + } + + } +} + diff --git a/src/Mono.Cxxi/Abi/CppAbi.cs b/src/Mono.Cxxi/Abi/CppAbi.cs index 8456ab92..2016a1be 100644 --- a/src/Mono.Cxxi/Abi/CppAbi.cs +++ b/src/Mono.Cxxi/Abi/CppAbi.cs @@ -76,7 +76,7 @@ namespace Mono.Cxxi.Abi { public virtual MethodType GetMethodType (CppTypeInfo typeInfo, MethodInfo imethod) { - if (IsInline (imethod) && typeInfo.Library.InlineMethodPolicy == InlineMethods.NotPresent) + if (IsInline (imethod) && !IsVirtual (imethod) && typeInfo.Library.InlineMethodPolicy == InlineMethods.NotPresent) return MethodType.NotImplemented; else if (imethod.IsDefined (typeof (ConstructorAttribute), false)) return MethodType.NativeCtor; diff --git a/src/generator/Generator.cs b/src/generator/Generator.cs index e0103a49..35a08122 100644 --- a/src/generator/Generator.cs +++ b/src/generator/Generator.cs @@ -190,15 +190,8 @@ public class Generator { if (!klass.Node.HasValue ("members")) continue; - List members = new List (); - foreach (string id in klass.Node ["members"].Split (' ')) { - if (id == "") - continue; - members.Add (Node.IdToNode [id]); - } - int fieldCount = 0; - foreach (Node n in members) { + foreach (Node n in klass.Node ["members"].Split (new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select (id => Node.IdToNode [id])) { bool ctor = false; bool dtor = false; bool skip = false; @@ -236,6 +229,9 @@ public class Generator { if (!n.CheckValue ("access", "public")) // exclude non-public methods skip = true; + if (n.IsTrue ("inline") && InlinePolicy == InlineMethods.NotPresent) + skip = true; + string name = dtor ? "Destruct" : n.Name; var method = new Method (n) {