Mercurial > projects > qtd
comparison generator/typesystem_gui-java.java @ 372:a032df77b6ab
Simple debug helper. Unittests. Meta-object for polymorphic non-QObjects
author | Max Samukha <maxter@spambox.com> |
---|---|
date | Thu, 08 Jul 2010 17:19:05 +0300 |
parents | 12cec2d14e1c |
children | e67ce7c21758 |
comparison
equal
deleted
inserted
replaced
370:7fd4b69378bf | 372:a032df77b6ab |
---|---|
20 * http://www.fsf.org/licensing/licenses/info/GPLv2.html and | 20 * http://www.fsf.org/licensing/licenses/info/GPLv2.html and |
21 * http://www.gnu.org/copyleft/gpl.html. In addition, as a special | 21 * http://www.gnu.org/copyleft/gpl.html. In addition, as a special |
22 * exception, Nokia gives you certain additional rights. These rights | 22 * exception, Nokia gives you certain additional rights. These rights |
23 * are described in the Nokia Qt GPL Exception version 1.2, included in | 23 * are described in the Nokia Qt GPL Exception version 1.2, included in |
24 * the file GPL_EXCEPTION.txt in this package. | 24 * the file GPL_EXCEPTION.txt in this package. |
25 * | 25 * |
26 * Qt for Windows(R) Licensees | 26 * Qt for Windows(R) Licensees |
27 * As a special exception, Nokia, as the sole copyright holder for Qt | 27 * As a special exception, Nokia, as the sole copyright holder for Qt |
28 * Designer, grants users of the Qt/Eclipse Integration plug-in the | 28 * Designer, grants users of the Qt/Eclipse Integration plug-in the |
29 * right for the Qt/Eclipse Integration to link to functionality | 29 * right for the Qt/Eclipse Integration to link to functionality |
30 * provided by Qt Designer and its related libraries. | 30 * provided by Qt Designer and its related libraries. |
168 /* | 168 /* |
169 private native void add_private(long nid, int x, int y); | 169 private native void add_private(long nid, int x, int y); |
170 | 170 |
171 @QtBlockedSlot | 171 @QtBlockedSlot |
172 public final QPolygon add(int x, int y) { | 172 public final QPolygon add(int x, int y) { |
173 add_private(__nativeId(), x, y); | 173 add_private(qtdNativeId(), x, y); |
174 return this; | 174 return this; |
175 } | 175 } |
176 | 176 |
177 @QtBlockedSlot | 177 @QtBlockedSlot |
178 public final QPolygon add(QPoint pt) { | 178 public final QPolygon add(QPoint pt) { |
179 add_private(__nativeId(), pt.x(), pt.y()); | 179 add_private(qtdNativeId(), pt.x(), pt.y()); |
180 return this; | 180 return this; |
181 } | 181 } |
182 | 182 |
183 @QtBlockedSlot | 183 @QtBlockedSlot |
184 public final QPolygon add(QPolygon p) { | 184 public final QPolygon add(QPolygon p) { |
185 int size = p.size(); | 185 int size = p.size(); |
186 long nid = __nativeId(); | 186 long nid = qtdNativeId(); |
187 for (int i = 0; i < size; ++i) { | 187 for (int i = 0; i < size; ++i) { |
188 QPoint pt = p.at(i); | 188 QPoint pt = p.at(i); |
189 add_private(nid, pt.x(), pt.y()); | 189 add_private(nid, pt.x(), pt.y()); |
190 } | 190 } |
191 return this; | 191 return this; |
197 /* | 197 /* |
198 private native void add_private(long nid, double x, double y); | 198 private native void add_private(long nid, double x, double y); |
199 | 199 |
200 @QtBlockedSlot | 200 @QtBlockedSlot |
201 public final QPolygonF add(double x, double y) { | 201 public final QPolygonF add(double x, double y) { |
202 add_private(__nativeId(), x, y); | 202 add_private(qtdNativeId(), x, y); |
203 return this; | 203 return this; |
204 } | 204 } |
205 | 205 |
206 @QtBlockedSlot | 206 @QtBlockedSlot |
207 public final QPolygonF add(QPointF pt) { | 207 public final QPolygonF add(QPointF pt) { |
208 add_private(__nativeId(), pt.x(), pt.y()); | 208 add_private(qtdNativeId(), pt.x(), pt.y()); |
209 return this; | 209 return this; |
210 } | 210 } |
211 | 211 |
212 @QtBlockedSlot | 212 @QtBlockedSlot |
213 public final QPolygonF add(QPolygonF p) { | 213 public final QPolygonF add(QPolygonF p) { |
214 int size = p.size(); | 214 int size = p.size(); |
215 long nid = __nativeId(); | 215 long nid = qtdNativeId(); |
216 for (int i = 0; i < size; ++i) { | 216 for (int i = 0; i < size; ++i) { |
217 QPointF pt = p.at(i); | 217 QPointF pt = p.at(i); |
218 add_private(nid, pt.x(), pt.y()); | 218 add_private(nid, pt.x(), pt.y()); |
219 } | 219 } |
220 return this; | 220 return this; |
355 Gray = new QColor(Qt.GlobalColor.gray); | 355 Gray = new QColor(Qt.GlobalColor.gray); |
356 DarkGray = new QColor(Qt.GlobalColor.darkGray); | 356 DarkGray = new QColor(Qt.GlobalColor.darkGray); |
357 LightGray = new QColor(Qt.GlobalColor.lightGray); | 357 LightGray = new QColor(Qt.GlobalColor.lightGray); |
358 Transparent = new QColor(Qt.GlobalColor.transparent); | 358 Transparent = new QColor(Qt.GlobalColor.transparent); |
359 Color0 = new QColor(Qt.GlobalColor.color0); | 359 Color0 = new QColor(Qt.GlobalColor.color0); |
360 Color1 = new QColor(Qt.GlobalColor.color1); | 360 Color1 = new QColor(Qt.GlobalColor.color1); |
361 } | 361 } |
362 | 362 |
363 public static const QColor White; | 363 public static const QColor White; |
364 public static const QColor Black; | 364 public static const QColor Black; |
365 public static const QColor Red; | 365 public static const QColor Red; |
366 public static const QColor DarkRed; | 366 public static const QColor DarkRed; |
367 public static const QColor Green; | 367 public static const QColor Green; |
480 private import qtd.String; | 480 private import qtd.String; |
481 | 481 |
482 public this(string[] xpm) { | 482 public this(string[] xpm) { |
483 this(toStringzArray(xpm)); | 483 this(toStringzArray(xpm)); |
484 } | 484 } |
485 | 485 |
486 public this(string fileName, string format = null, int flags = Qt.ImageConversionFlag.AutoColor) { | 486 public this(string fileName, string format = null, int flags = Qt.ImageConversionFlag.AutoColor) { |
487 this(fileName, toStringz(format), flags); | 487 this(fileName, toStringz(format), flags); |
488 } | 488 } |
489 | 489 |
490 /* | 490 /* |
491 public this(string fileName, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { | 491 public this(string fileName, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { |
492 this(fileName, toStringz(format), flags); | 492 this(fileName, toStringz(format), flags); |
493 } | 493 } |
494 */ | 494 */ |
512 */ | 512 */ |
513 | 513 |
514 public final bool loadFromData(QByteArray data, string format, int flags = Qt.ImageConversionFlag.AutoColor) { | 514 public final bool loadFromData(QByteArray data, string format, int flags = Qt.ImageConversionFlag.AutoColor) { |
515 return loadFromData(data, toStringz(format), flags); | 515 return loadFromData(data, toStringz(format), flags); |
516 } | 516 } |
517 | 517 |
518 /* public final bool loadFromData(QByteArray data, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { | 518 /* public final bool loadFromData(QByteArray data, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { |
519 return loadFromData(data, toStringz(format), flags); | 519 return loadFromData(data, toStringz(format), flags); |
520 } | 520 } |
521 */ | 521 */ |
522 | 522 |
595 | 595 |
596 if (receiver is null) | 596 if (receiver is null) |
597 __rcUrlHandlers.remove(scheme); | 597 __rcUrlHandlers.remove(scheme); |
598 else | 598 else |
599 __rcUrlHandlers[scheme] = receiver; | 599 __rcUrlHandlers[scheme] = receiver; |
600 | 600 |
601 setUrlHandler(scheme, receiver, "handleUrl"); | 601 setUrlHandler(scheme, receiver, "handleUrl"); |
602 }*/ | 602 }*/ |
603 }// class | 603 }// class |
604 | 604 |
605 class QWizardPage___ extends QWizardPage { | 605 class QWizardPage___ extends QWizardPage { |
853 } | 853 } |
854 */ | 854 */ |
855 }// class | 855 }// class |
856 | 856 |
857 class QFileDialog___ extends QFileDialog { | 857 class QFileDialog___ extends QFileDialog { |
858 | 858 |
859 public static string getOpenFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) { | 859 public static string getOpenFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) { |
860 string res; | 860 string res; |
861 string _selectedFilter = ""; | 861 string _selectedFilter = ""; |
862 qtd_QFileDialog_getOpenFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.__nativeId, caption, dir, filter, _selectedFilter, 0); | 862 qtd_QFileDialog_getOpenFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.qtdNativeId, caption, dir, filter, _selectedFilter, 0); |
863 return res; | 863 return res; |
864 } | 864 } |
865 | 865 |
866 public static string getSaveFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) { | 866 public static string getSaveFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) { |
867 string res; | 867 string res; |
868 string _selectedFilter = ""; | 868 string _selectedFilter = ""; |
869 qtd_QFileDialog_getSaveFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.__nativeId, caption, dir, filter, _selectedFilter, 0); | 869 qtd_QFileDialog_getSaveFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.qtdNativeId, caption, dir, filter, _selectedFilter, 0); |
870 return res; | 870 return res; |
871 } | 871 } |
872 | 872 |
873 public static class Filter { | 873 public static class Filter { |
874 public this(string filter) { | 874 public this(string filter) { |
875 this.filter = filter; | 875 this.filter = filter; |
876 } | 876 } |
877 | 877 |
953 } | 953 } |
954 | 954 |
955 }// class | 955 }// class |
956 | 956 |
957 class QAction___ extends QAction { | 957 class QAction___ extends QAction { |
958 | 958 |
959 public final void setShortcut(string key) { | 959 public final void setShortcut(string key) { |
960 setShortcut(new QKeySequence(key)); | 960 setShortcut(new QKeySequence(key)); |
961 } | 961 } |
962 /* | 962 /* |
963 private QActionGroup __rcActionGroup = null; | 963 private QActionGroup __rcActionGroup = null; |
1006 } | 1006 } |
1007 | 1007 |
1008 public final void setBrush(QPixmap pm) { | 1008 public final void setBrush(QPixmap pm) { |
1009 setBrush(new QBrush(pm)); | 1009 setBrush(new QBrush(pm)); |
1010 } | 1010 } |
1011 | 1011 |
1012 public final void drawConvexPolygon(in QPoint[] points) { | 1012 public final void drawConvexPolygon(in QPoint[] points) { |
1013 qtd_QPainter_drawConvexPolygon_nativepointerQPoint_int(__nativeId, points.ptr, points.length); | 1013 qtd_QPainter_drawConvexPolygon_nativepointerQPoint_int(qtdNativeId, points.ptr, points.length); |
1014 } | 1014 } |
1015 | 1015 |
1016 public final void drawConvexPolygon(in QPointF[] points) { | 1016 public final void drawConvexPolygon(in QPointF[] points) { |
1017 qtd_QPainter_drawConvexPolygon_nativepointerQPointF_int(__nativeId, points.ptr, points.length); | 1017 qtd_QPainter_drawConvexPolygon_nativepointerQPointF_int(qtdNativeId, points.ptr, points.length); |
1018 } | 1018 } |
1019 | 1019 |
1020 public final void drawLines(in QLine[] lines) { | 1020 public final void drawLines(in QLine[] lines) { |
1021 qtd_QPainter_drawLines_nativepointerQLine_int(__nativeId, lines.ptr, lines.length); | 1021 qtd_QPainter_drawLines_nativepointerQLine_int(qtdNativeId, lines.ptr, lines.length); |
1022 } | 1022 } |
1023 | 1023 |
1024 public final void drawLines(in QLineF[] lines) { | 1024 public final void drawLines(in QLineF[] lines) { |
1025 qtd_QPainter_drawLines_nativepointerQLineF_int(__nativeId, lines.ptr, lines.length); | 1025 qtd_QPainter_drawLines_nativepointerQLineF_int(qtdNativeId, lines.ptr, lines.length); |
1026 } | 1026 } |
1027 | 1027 |
1028 public final void drawPolygon(in QPoint[] points, Qt.FillRule fillRule = Qt.FillRule.OddEvenFill) { | 1028 public final void drawPolygon(in QPoint[] points, Qt.FillRule fillRule = Qt.FillRule.OddEvenFill) { |
1029 qtd_QPainter_drawPolygon_nativepointerQPoint_int_FillRule(__nativeId, points.ptr, points.length, fillRule); | 1029 qtd_QPainter_drawPolygon_nativepointerQPoint_int_FillRule(qtdNativeId, points.ptr, points.length, fillRule); |
1030 } | 1030 } |
1031 | 1031 |
1032 public final void drawPolygon(in QPointF[] points, Qt.FillRule fillRule = Qt.FillRule.OddEvenFill) { | 1032 public final void drawPolygon(in QPointF[] points, Qt.FillRule fillRule = Qt.FillRule.OddEvenFill) { |
1033 qtd_QPainter_drawPolygon_nativepointerQPointF_int_FillRule(__nativeId, points.ptr, points.length, fillRule); | 1033 qtd_QPainter_drawPolygon_nativepointerQPointF_int_FillRule(qtdNativeId, points.ptr, points.length, fillRule); |
1034 } | 1034 } |
1035 | 1035 |
1036 public final void drawPolyline(in QPoint[] points) { | 1036 public final void drawPolyline(in QPoint[] points) { |
1037 qtd_QPainter_drawPolyline_nativepointerQPoint_int(__nativeId, points.ptr, points.length); | 1037 qtd_QPainter_drawPolyline_nativepointerQPoint_int(qtdNativeId, points.ptr, points.length); |
1038 } | 1038 } |
1039 | 1039 |
1040 public final void drawPolyline(in QPointF[] points) { | 1040 public final void drawPolyline(in QPointF[] points) { |
1041 qtd_QPainter_drawPolyline_nativepointerQPointF_int(__nativeId, points.ptr, points.length); | 1041 qtd_QPainter_drawPolyline_nativepointerQPointF_int(qtdNativeId, points.ptr, points.length); |
1042 } | 1042 } |
1043 | 1043 |
1044 public final void drawPoints(in QPoint[] points) { | 1044 public final void drawPoints(in QPoint[] points) { |
1045 qtd_QPainter_drawPoints_nativepointerQPoint_int(__nativeId, points.ptr, points.length); | 1045 qtd_QPainter_drawPoints_nativepointerQPoint_int(qtdNativeId, points.ptr, points.length); |
1046 } | 1046 } |
1047 | 1047 |
1048 public final void drawPoints(in QPointF[] points) { | 1048 public final void drawPoints(in QPointF[] points) { |
1049 qtd_QPainter_drawPoints_nativepointerQPointF_int(__nativeId, points.ptr, points.length); | 1049 qtd_QPainter_drawPoints_nativepointerQPointF_int(qtdNativeId, points.ptr, points.length); |
1050 } | 1050 } |
1051 | 1051 |
1052 public final void drawRects(in QRect[] rects) { | 1052 public final void drawRects(in QRect[] rects) { |
1053 qtd_QPainter_drawRects_nativepointerQRect_int(__nativeId, rects.ptr, rects.length); | 1053 qtd_QPainter_drawRects_nativepointerQRect_int(qtdNativeId, rects.ptr, rects.length); |
1054 } | 1054 } |
1055 | 1055 |
1056 public final void drawRects(in QRectF[] rects) { | 1056 public final void drawRects(in QRectF[] rects) { |
1057 qtd_QPainter_drawRects_nativepointerQRectF_int(__nativeId, rects.ptr, rects.length); | 1057 qtd_QPainter_drawRects_nativepointerQRectF_int(qtdNativeId, rects.ptr, rects.length); |
1058 } | 1058 } |
1059 /* | 1059 /* |
1060 public static QPaintDeviceInterface redirected(QPaintDeviceInterface device, qt.core.QPoint offset) { | 1060 public static QPaintDeviceInterface redirected(QPaintDeviceInterface device, qt.core.QPoint offset) { |
1061 return redirected(device, offset == null ? null : offset.nativePointer()); | 1061 return redirected(device, offset == null ? null : offset.nativePointer()); |
1062 } | 1062 } |
1078 | 1078 |
1079 this(string[] args) | 1079 this(string[] args) |
1080 { | 1080 { |
1081 // if (m_instance != null) | 1081 // if (m_instance != null) |
1082 // throw new RuntimeException("QCoreApplication can only be initialized once"); | 1082 // throw new RuntimeException("QCoreApplication can only be initialized once"); |
1083 | 1083 |
1084 argc = args.length; | 1084 argc = args.length; |
1085 argv = toStringzArray(args); | 1085 argv = toStringzArray(args); |
1086 this(&argc, argv); | 1086 this(&argc, argv); |
1087 | 1087 |
1088 // m_instance.aboutToQuit.connect(m_instance, "disposeOfMyself()"); | 1088 // m_instance.aboutToQuit.connect(m_instance, "disposeOfMyself()"); |
1089 } | 1089 } |
1090 | 1090 |
1091 private int argc; | 1091 private int argc; |
1092 private char **argv; | 1092 private char **argv; |
1093 | 1093 |
1094 /* public static QApplication instance() { | 1094 /* public static QApplication instance() { |
1095 if (type() != Type.Tty) | 1095 if (type() != Type.Tty) |
1201 | 1201 |
1202 /* | 1202 /* |
1203 * Gets the widget's window frame margins. | 1203 * Gets the widget's window frame margins. |
1204 * | 1204 * |
1205 * @returns An object containing the margins in left, right, top and bottom coordinates. | 1205 * @returns An object containing the margins in left, right, top and bottom coordinates. |
1206 | 1206 |
1207 @QtBlockedSlot | 1207 @QtBlockedSlot |
1208 public final QMarginsF getWindowFrameMargins() { | 1208 public final QMarginsF getWindowFrameMargins() { |
1209 QNativePointer left = new QNativePointer(QNativePointer.Type.Double); | 1209 QNativePointer left = new QNativePointer(QNativePointer.Type.Double); |
1210 QNativePointer top = new QNativePointer(QNativePointer.Type.Double); | 1210 QNativePointer top = new QNativePointer(QNativePointer.Type.Double); |
1211 QNativePointer right = new QNativePointer(QNativePointer.Type.Double); | 1211 QNativePointer right = new QNativePointer(QNativePointer.Type.Double); |
1684 | 1684 |
1685 }// class | 1685 }// class |
1686 | 1686 |
1687 class QInputDialog___ extends QInputDialog { | 1687 class QInputDialog___ extends QInputDialog { |
1688 public static double getDouble(QWidget _parent, string title, string label, double value = 0, double minValue = -2147483647, double maxValue = 2147483647, int decimals = 1, ref bool ok = false, int flags = 0) { | 1688 public static double getDouble(QWidget _parent, string title, string label, double value = 0, double minValue = -2147483647, double maxValue = 2147483647, int decimals = 1, ref bool ok = false, int flags = 0) { |
1689 return qtd_QInputDialog_getDouble_private_QWidget_string_string_double_double_double_int_nativepointerbool_WindowFlags(_parent is null ? null : _parent.__nativeId, title, label, value, minValue, maxValue, decimals, &ok, flags); | 1689 return qtd_QInputDialog_getDouble_private_QWidget_string_string_double_double_double_int_nativepointerbool_WindowFlags(_parent is null ? null : _parent.qtdNativeId, title, label, value, minValue, maxValue, decimals, &ok, flags); |
1690 } | 1690 } |
1691 | 1691 |
1692 static if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0)) | 1692 static if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0)) |
1693 { | 1693 { |
1694 public static int getInt(QWidget _parent, string title, string label, int value = 0, int minValue = -2147483647, int maxValue = 2147483647, int step = 1, ref bool ok = false, int flags = 0) { | 1694 public static int getInt(QWidget _parent, string title, string label, int value = 0, int minValue = -2147483647, int maxValue = 2147483647, int step = 1, ref bool ok = false, int flags = 0) { |
1695 return qtd_QInputDialog_getInt_private_QWidget_string_string_int_int_int_int_nativepointerbool_WindowFlags(_parent is null ? null : _parent.__nativeId, title, label, value, minValue, maxValue, step, &ok, flags); | 1695 return qtd_QInputDialog_getInt_private_QWidget_string_string_int_int_int_int_nativepointerbool_WindowFlags(_parent is null ? null : _parent.qtdNativeId, title, label, value, minValue, maxValue, step, &ok, flags); |
1696 } | 1696 } |
1697 } | 1697 } |
1698 | 1698 |
1699 public static string getItem(QWidget _parent, string title, string label, QList!(string) items, int current = 0, bool editable = true, ref bool ok = false, int flags = 0) { | 1699 public static string getItem(QWidget _parent, string title, string label, QList!(string) items, int current = 0, bool editable = true, ref bool ok = false, int flags = 0) { |
1700 return getItem_private(_parent, title, label, items, current, editable, &ok, flags); | 1700 return getItem_private(_parent, title, label, items, current, editable, &ok, flags); |
1701 } | 1701 } |
1702 | 1702 |
1703 public static string getText(QWidget _parent, string title, string label, QLineEdit.EchoMode echo = QLineEdit.EchoMode.Normal, string text = null, ref bool ok = false, int flags = 0) { | 1703 public static string getText(QWidget _parent, string title, string label, QLineEdit.EchoMode echo = QLineEdit.EchoMode.Normal, string text = null, ref bool ok = false, int flags = 0) { |
1704 string res; | 1704 string res; |
1705 qtd_QInputDialog_getText_private_QWidget_string_string_EchoMode_string_nativepointerbool_WindowFlags(&res, _parent is null ? null : _parent.__nativeId, title, label, echo, text, &ok, flags); | 1705 qtd_QInputDialog_getText_private_QWidget_string_string_EchoMode_string_nativepointerbool_WindowFlags(&res, _parent is null ? null : _parent.qtdNativeId, title, label, echo, text, &ok, flags); |
1706 return res; | 1706 return res; |
1707 } | 1707 } |
1708 }// class | 1708 }// class |
1709 | 1709 |
1710 class QFont___ extends QFont { | 1710 class QFont___ extends QFont { |
1711 version(D_Version2) | 1711 version(D_Version2) |
1712 { | 1712 { |
1713 void opAssign(in QFont arg__1) { | 1713 void opAssign(in QFont arg__1) { |
1714 this.__nativeId = qtd_QFont_QFont_QFont(arg__1 is null ? null : (cast(QFont)arg__1).__nativeId); | 1714 this.qtdNativeId = qtd_QFont_QFont_QFont(arg__1 is null ? null : (cast(QFont)arg__1).qtdNativeId); |
1715 } | 1715 } |
1716 } | 1716 } |
1717 }// class" | 1717 }// class" |