Add auto-generated qt bindings.
This commit is contained in:
Родитель
97695b95e7
Коммит
70d7895777
|
@ -65,6 +65,7 @@ src/QtTest/qttest
|
|||
src/QtTest/Makefile
|
||||
src/generator2/generator
|
||||
src/generator2/Makefile
|
||||
src/qt/Makefile
|
||||
src/Makefile
|
||||
tests2/Makefile
|
||||
Makefile
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
top_srcdir = ../..
|
||||
|
||||
INTEROP_DLL = \
|
||||
$(top_srcdir)/src/Mono.VisualC.Interop/bin/Debug/Mono.VisualC.Interop.dll
|
||||
|
||||
all: hello.exe
|
||||
|
||||
qt-gui.xml: qt-gui.h
|
||||
gccxml -fxml=$@ --gccxml-cxxflags "`pkg-config --cflags QtCore QtGui`" qt-gui.h
|
||||
|
||||
generated: qt-gui.xml
|
||||
$(RM) -r generated
|
||||
mono --debug $(top_srcdir)/src/generator2/bin/Debug/generator.exe -o=generated -ns=Qt.Gui -lib=QtGui --filters=qt-gui-filters.txt qt-gui.xml
|
||||
|
||||
libQtGui-inline.so: qt-gui.cpp
|
||||
g++ `pkg-config --cflags QtCore QtGui` --shared -fPIC -o $@ -fkeep-inline-functions qt-gui.cpp `pkg-config --libs QtCore QtGui`
|
||||
|
||||
Qt.Gui-binding.dll: generated
|
||||
mcs -out:$@ -target:library -unsafe -r:$(INTEROP_DLL) generated/*.cs
|
||||
|
||||
hello.exe: Qt.Gui-binding.dll hello.cs libQtGui-inline.so
|
||||
mcs -out:$@ -target:exe -r:$(INTEROP_DLL) -r:Qt.Gui-binding.dll hello.cs
|
||||
|
||||
clean:
|
||||
$(RM) -rf generated hello.exe qt-gui.xml Qt.Gui-binding.dll libQtGui-inline.so
|
||||
|
||||
run: hello.exe
|
||||
MONO_PATH=$(top_srcdir)/src/Mono.VisualC.Interop/bin/Debug mono hello.exe
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using Qt.Gui;
|
||||
|
||||
using Mono.VisualC.Interop;
|
||||
|
||||
namespace QtTest {
|
||||
class MainClass {
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
int argc = args.Length;
|
||||
using (QApplication app = new QApplication (ref argc, args, 0x040602)) {
|
||||
QPushButton hello = new QPushButton (QString.FromUtf8 ("Hello", 5), null);
|
||||
hello.Resize (100, 30);
|
||||
hello.Show ();
|
||||
CppLibrary.SaveInteropAssembly ();
|
||||
QApplication.Exec ();
|
||||
}
|
||||
/*
|
||||
using (QPushButton hello = new QPushButton ("Hello world!"),
|
||||
hello2 = new QPushButton ("Another button")) {
|
||||
|
||||
hello.Resize (100, 30);
|
||||
hello2.Resize (200, 30);
|
||||
|
||||
//CppLibrary.SaveInteropAssembly ();
|
||||
hello.Visible = true;
|
||||
hello2.Visible = true;
|
||||
|
||||
app.Exec ();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
QObject
|
||||
QApplication
|
||||
QCoreApplication
|
||||
QWidget
|
||||
QAbstractButton
|
||||
QPushButton
|
||||
QPaintDevice
|
||||
QString
|
||||
QSize
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
/*
|
||||
* These are not in the unix version of qt, and -fkeep-inline-functions will generate
|
||||
* references to their vtables etc., making the library unloadable.
|
||||
*/
|
||||
#define QT_NO_STYLE_WINDOWSVISTA
|
||||
#define QT_NO_STYLE_WINDOWSXP
|
||||
#define QT_NO_STYLE_S60
|
||||
#define QT_NO_STYLE_WINDOWSCE
|
||||
#define QT_NO_STYLE_WINDOWSMOBILE
|
||||
#define QT_NO_QWSEMBEDWIDGET
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
|
||||
int main ()
|
||||
{
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
#include <QtCore>
|
||||
#include <QtGui>
|
Загрузка…
Ссылка в новой задаче