Browse Source

Commit last qt bindings work from the summer

pull/1/head
Alex Corrado 14 years ago
parent
commit
5d096f616b
  1. 4
      qt/Makefile.am
  2. 2
      qt/demos/hello.cs
  3. 16
      qt/qt-gui-filters.xml
  4. 1
      qt/qt-gui.h
  5. 13
      qt/src/QFlags.cs
  6. 20
      qt/src/QPoint.cs

4
qt/Makefile.am

@ -9,7 +9,9 @@ HANDWRITTEN = \ @@ -9,7 +9,9 @@ HANDWRITTEN = \
QCoreApplication.cs \
QSize.cs \
QPushButton.cs \
QWidget.cs
QWidget.cs \
QPoint.cs \
QFlags.cs
all: hello.exe

2
qt/demos/hello.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using Qt.Gui;
using Qt.Gui.Qt;
using Mono.Cxxi;
@ -12,6 +13,7 @@ namespace QtTest { @@ -12,6 +13,7 @@ namespace QtTest {
using (QPushButton hello = new QPushButton ("Hello world!")) {
hello.Resize (200, 30);
QObject.Connect (hello, "2clicked()", app, "1aboutQt()", ConnectionType.AutoConnection);
hello.SetVisible (true);
QApplication.Exec ();

16
qt/qt-gui-filters.xml

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
The type of external implementation can be specified:
class (default) -> this type is implemented as a managed reference type
struct -> this type is implemented as a managed value type. when passed as pointer or reference, the managed "ref" prefix will be used
Rename -> include this type in the generated output, but rename to the specified managed type (specified in "to" attribute, "implementation" attribute also allowed)
The default behavior is Include. Change the default by specifying the default attribute on the top-level Filter tag.
Specify exceptions to the default behavior with child nodes named after one of the modes above…
@ -16,12 +16,26 @@ @@ -16,12 +16,26 @@
<Filter default="Exclude">
<Include>QObject</Include>
<Include>Qt</Include>
<Include>Qt::ConnectionType</Include>
<Include>Qt::KeyboardModifier</Include>
<Include>Qt::MouseButton</Include>
<Include>Qt::ButtonState</Include>
<Include>QApplication</Include>
<Include>QCoreApplication</Include>
<Include>QWidget</Include>
<Include>QAbstractButton</Include>
<Include>QPushButton</Include>
<Include>QPaintDevice</Include>
<Include>QEvent</Include>
<Include>QInputEvent</Include>
<Include>QMouseEvent</Include>
<Include>QTimerEvent</Include>
<External implementation="struct">QString</External>
<External implementation="struct">QSize</External>
<External implementation="struct">QPoint</External>
<External implementation="struct">QFlags&lt;Qt::KeyboardModifier&gt;</External>
</Filter>

1
qt/qt-gui.h

@ -1,2 +1,3 @@ @@ -1,2 +1,3 @@
#include "QApplication"
#include "qevent.h"
#include "QPushButton"

13
qt/src/QFlags.cs

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
using System;
using System.Runtime.InteropServices;
using Mono.Cxxi;
namespace Qt.Gui {
[StructLayout (LayoutKind.Sequential)]
public struct QFlags<T> where T : struct {
public T Value;
}
}

20
qt/src/QPoint.cs

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
using System;
using System.Runtime.InteropServices;
using Mono.Cxxi;
namespace Qt.Gui {
[StructLayout (LayoutKind.Sequential)]
public struct QPoint {
private int xy, yx; //Wtf.. on Mac the order is y, x; elsewhere x, y
public QPoint (int x, int y)
{
//FIXME: do some snazzy stuff to get this right.. for now, I'm a mac user :P
this.yx = x;
this.xy = y;
}
}
}
Loading…
Cancel
Save