From f1f9132d4885beee922a7dc7af3435aa7576806f Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 30 May 2018 22:02:27 +0200 Subject: [PATCH] WIP: further refactoring of Qt binding libs --- scripts/mkqtdecl_common/produce.rb | 87 +++++++- src/gsiqt/qt4/QtCore/QtCore.pri | 4 + src/gsiqt/qt4/QtCore/QtCore.pro | 1 + src/gsiqt/qt4/QtCore/gsiDeclQtCoreAdd.cc | 178 +++++++++++++++ src/gsiqt/qt4/QtCore/gsiQtCoreCommon.h | 30 +-- src/gsiqt/qt4/QtCore/gsiQtCoreMain.cc | 9 + src/gsiqt/qt4/QtDesigner/QtDesigner.pri | 4 + .../qt4/QtDesigner/gsiQtDesignerCommon.h | 30 +-- src/gsiqt/qt4/QtDesigner/gsiQtDesignerMain.cc | 9 + src/gsiqt/qt4/QtGui/QtGui.pri | 4 + src/gsiqt/qt4/QtGui/QtGui.pro | 1 + src/gsiqt/qt4/QtGui/gsiDeclQtGuiAdd.cc | 40 ++++ src/gsiqt/qt4/QtGui/gsiQtGuiCommon.h | 30 +-- src/gsiqt/qt4/QtGui/gsiQtGuiMain.cc | 9 + src/gsiqt/qt4/QtNetwork/QtNetwork.pri | 4 + src/gsiqt/qt4/QtNetwork/QtNetwork.pro | 1 + .../qt4/QtNetwork/gsiDeclQtNetworkAdd.cc | 40 ++++ src/gsiqt/qt4/QtNetwork/gsiQtNetworkCommon.h | 30 +-- src/gsiqt/qt4/QtNetwork/gsiQtNetworkMain.cc | 9 + src/gsiqt/qt4/QtSql/QtSql.pri | 4 + src/gsiqt/qt4/QtSql/gsiQtSqlCommon.h | 30 +-- src/gsiqt/qt4/QtSql/gsiQtSqlMain.cc | 9 + src/gsiqt/qt4/QtXml/QtXml.pri | 4 + src/gsiqt/qt4/QtXml/gsiQtXmlCommon.h | 30 +-- src/gsiqt/qt4/QtXml/gsiQtXmlMain.cc | 9 + src/gsiqt/qtbasic/gsiDeclQtBasic.cc | 210 ------------------ src/gsiqt/qtbasic/gsiQt.cc | 78 ------- src/gsiqt/qtbasic/gsiQt.h | 67 +++++- src/gsiqt/qtbasic/gsiQtCoreExternals.h | 27 +++ ...llExternals.h => gsiQtDesignerExternals.h} | 17 +- src/gsiqt/qtbasic/gsiQtGuiExternals.h | 27 +++ src/gsiqt/qtbasic/gsiQtNetworkExternals.h | 27 +++ src/gsiqt/qtbasic/gsiQtSqlExternals.h | 27 +++ src/gsiqt/qtbasic/gsiQtXmlExternals.h | 27 +++ src/gsiqt/qtbasic/qtbasic.pro | 2 - src/lay/lay/gsiDeclLayApplication.cc | 4 +- src/lay/lay/gsiDeclLayHelpDialog.cc | 4 +- src/lay/lay/gsiDeclLayMainWindow.cc | 4 +- src/laybasic/laybasic/gsiDeclLayDialogs.cc | 5 +- 39 files changed, 681 insertions(+), 451 deletions(-) create mode 100644 src/gsiqt/qt4/QtCore/gsiDeclQtCoreAdd.cc create mode 100644 src/gsiqt/qt4/QtCore/gsiQtCoreMain.cc create mode 100644 src/gsiqt/qt4/QtDesigner/gsiQtDesignerMain.cc create mode 100644 src/gsiqt/qt4/QtGui/gsiDeclQtGuiAdd.cc create mode 100644 src/gsiqt/qt4/QtGui/gsiQtGuiMain.cc create mode 100644 src/gsiqt/qt4/QtNetwork/gsiDeclQtNetworkAdd.cc create mode 100644 src/gsiqt/qt4/QtNetwork/gsiQtNetworkMain.cc create mode 100644 src/gsiqt/qt4/QtSql/gsiQtSqlMain.cc create mode 100644 src/gsiqt/qt4/QtXml/gsiQtXmlMain.cc delete mode 100644 src/gsiqt/qtbasic/gsiDeclQtBasic.cc create mode 100644 src/gsiqt/qtbasic/gsiQtCoreExternals.h rename src/gsiqt/qtbasic/{gsiQtAllExternals.h => gsiQtDesignerExternals.h} (73%) create mode 100644 src/gsiqt/qtbasic/gsiQtGuiExternals.h create mode 100644 src/gsiqt/qtbasic/gsiQtNetworkExternals.h create mode 100644 src/gsiqt/qtbasic/gsiQtSqlExternals.h create mode 100644 src/gsiqt/qtbasic/gsiQtXmlExternals.h diff --git a/scripts/mkqtdecl_common/produce.rb b/scripts/mkqtdecl_common/produce.rb index 3ce1529f5..92184b66c 100755 --- a/scripts/mkqtdecl_common/produce.rb +++ b/scripts/mkqtdecl_common/produce.rb @@ -3041,7 +3041,71 @@ END end - def produce_makefile + def produce_common_header + + src_name = "gsi#{modn}Common.h" + src_path = $gen_dir + "/" + src_name + + File.open(src_path, "w") do |src| + + src.puts("/**") + src.puts(" * Common header for Qt binding definition library") + src.puts(" *") + src.puts(" * DO NOT EDIT THIS FILE. ") + src.puts(" * This file has been created automatically") + src.puts(" */") + + src.puts("") + src.puts("#include \"tlDefs.h\"") + src.puts("") + src.puts("#define FORCE_LINK_GSI_#{modn.upcase} static void force_link_gsi#{modn}_f () { extern int force_link_gsi#{modn}; force_link_gsi#{modn} = 0; }") + src.puts("") + src.puts("#if !defined(HDR_gsi#{modn}Common_h)") + src.puts("# define HDR_gsi#{modn}Common_h") + src.puts("") + src.puts("# ifdef MAKE_GSI_#{modn.upcase}_LIBRARY") + src.puts("# define GSI_#{modn.upcase}_PUBLIC DEF_INSIDE_PUBLIC") + src.puts("# define GSI_#{modn.upcase}_PUBLIC_TEMPLATE DEF_INSIDE_PUBLIC_TEMPLATE") + src.puts("# define GSI_#{modn.upcase}_LOCAL DEF_INSIDE_LOCAL") + src.puts("# else") + src.puts("# define GSI_#{modn.upcase}_PUBLIC DEF_OUTSIDE_PUBLIC") + src.puts("# define GSI_#{modn.upcase}_PUBLIC_TEMPLATE DEF_OUTSIDE_PUBLIC_TEMPLATE") + src.puts("# define GSI_#{modn.upcase}_LOCAL DEF_OUTSIDE_LOCAL") + src.puts("# endif") + src.puts("") + src.puts("#endif") + + puts("#{src_name} written.") + + end + + end + + def produce_main_source + + src_name = "gsi#{modn}Main.cc" + src_path = $gen_dir + "/" + src_name + + File.open(src_path, "w") do |src| + + src.puts("/**") + src.puts(" * Main source file for Qt binding definition library") + src.puts(" *") + src.puts(" * DO NOT EDIT THIS FILE. ") + src.puts(" * This file has been created automatically") + src.puts(" */") + + src.puts("") + src.puts("int force_link_gsi#{modn} = 0;") + src.puts("") + + puts("#{src_name} written.") + + end + + end + + def produce_pri makefile_name = modn + ".pri" makefile_path = $gen_dir + "/" + makefile_name @@ -3055,12 +3119,17 @@ END makefile.puts("# This file has been created automatically") makefile.puts("#") + makefile.puts("") + makefile.puts("SOURCES += \\") + makefile.puts(" gsi#{modn}Main.cc \\") if @source_files - makefile.puts("") - makefile.puts("SOURCES += \\") makefile.puts(@source_files.collect { |s| " $$PWD/" + s }.join(" \\\n")) end + makefile.puts("") + makefile.puts("HEADERS += gsi#{modn}Common.h") + makefile.puts("") + puts("#{makefile_name} written.") end @@ -3110,13 +3179,21 @@ else end end end + +puts("Producing class list") bp.produce_class_list puts("Producing type traits file ..") bp.produce_ttfile(conf) -puts("Producing .pro file ..") -bp.produce_makefile +puts("Producing main source file ..") +bp.produce_main_source + +puts("Producing common header file ..") +bp.produce_common_header + +puts("Producing .pri file ..") +bp.produce_pri puts("Producing external declarations ..") bp.produce_externals diff --git a/src/gsiqt/qt4/QtCore/QtCore.pri b/src/gsiqt/qt4/QtCore/QtCore.pri index 814de99d7..0c3494212 100644 --- a/src/gsiqt/qt4/QtCore/QtCore.pri +++ b/src/gsiqt/qt4/QtCore/QtCore.pri @@ -6,6 +6,7 @@ # SOURCES += \ + gsiQtCoreMain.cc \ $$PWD/gsiDeclQAbstractItemModel.cc \ $$PWD/gsiDeclQAbstractListModel.cc \ $$PWD/gsiDeclQAbstractTableModel.cc \ @@ -84,3 +85,6 @@ SOURCES += \ $$PWD/gsiDeclQt_1.cc \ $$PWD/gsiDeclQt_2.cc \ $$PWD/gsiDeclQt_3.cc + +HEADERS += gsiQtCoreCommon.h + diff --git a/src/gsiqt/qt4/QtCore/QtCore.pro b/src/gsiqt/qt4/QtCore/QtCore.pro index f9923714e..0d7c55d5b 100644 --- a/src/gsiqt/qt4/QtCore/QtCore.pro +++ b/src/gsiqt/qt4/QtCore/QtCore.pro @@ -14,6 +14,7 @@ DEPENDPATH += $$TL_INC $$GSI_INC $$DB_INC $$QTBASIC_INC LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_qtbasic SOURCES += \ + gsiDeclQtCoreAdd.cc HEADERS += \ diff --git a/src/gsiqt/qt4/QtCore/gsiDeclQtCoreAdd.cc b/src/gsiqt/qt4/QtCore/gsiDeclQtCoreAdd.cc new file mode 100644 index 000000000..e26b54ebe --- /dev/null +++ b/src/gsiqt/qt4/QtCore/gsiDeclQtCoreAdd.cc @@ -0,0 +1,178 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2018 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + + +#include "gsiQt.h" + +#include +#include +#include +#include +#include +#include + +namespace gsi_qt +{ + +// --------------------------------------------------------------------------- +// QVariant::Type implementation +// (this type is not created automatically since QVariant is implemented implicitly) + +class QVariant_Namespace { }; + +// A dummy namespace "QVariant" +gsi::Class decl_QVariant_Namespace ("Qt", "QVariant", + gsi::Methods(), + "@qt\n@brief This class represents the QVariant namespace"); + +static gsi::Enum decl_QVariant_Type_Enum ("Qt", "QVariant_Type", + gsi::enum_const ("Invalid", QVariant::Invalid, "@brief Enum constant QVariant::Invalid") + + gsi::enum_const ("Bool", QVariant::Bool, "@brief Enum constant QVariant::Bool") + + gsi::enum_const ("Int", QVariant::Int, "@brief Enum constant QVariant::Int") + + gsi::enum_const ("UInt", QVariant::UInt, "@brief Enum constant QVariant::UInt") + + gsi::enum_const ("LongLong", QVariant::LongLong, "@brief Enum constant QVariant::LongLong") + + gsi::enum_const ("ULongLong", QVariant::ULongLong, "@brief Enum constant QVariant::ULongLong") + + gsi::enum_const ("Double", QVariant::Double, "@brief Enum constant QVariant::Double") + + gsi::enum_const ("Char", QVariant::Char, "@brief Enum constant QVariant::Char") + + gsi::enum_const ("Map", QVariant::Map, "@brief Enum constant QVariant::Map") + + gsi::enum_const ("List", QVariant::List, "@brief Enum constant QVariant::List") + + gsi::enum_const ("String", QVariant::String, "@brief Enum constant QVariant::String") + + gsi::enum_const ("StringList", QVariant::StringList, "@brief Enum constant QVariant::StringList") + + gsi::enum_const ("ByteArray", QVariant::ByteArray, "@brief Enum constant QVariant::ByteArray") + + gsi::enum_const ("BitArray", QVariant::BitArray, "@brief Enum constant QVariant::BitArray") + + gsi::enum_const ("Date", QVariant::Date, "@brief Enum constant QVariant::Date") + + gsi::enum_const ("Time", QVariant::Time, "@brief Enum constant QVariant::Time") + + gsi::enum_const ("DateTime", QVariant::DateTime, "@brief Enum constant QVariant::DateTime") + + gsi::enum_const ("Url", QVariant::Url, "@brief Enum constant QVariant::Url") + + gsi::enum_const ("Locale", QVariant::Locale, "@brief Enum constant QVariant::Locale") + + gsi::enum_const ("Rect", QVariant::Rect, "@brief Enum constant QVariant::Rect") + + gsi::enum_const ("RectF", QVariant::RectF, "@brief Enum constant QVariant::RectF") + + gsi::enum_const ("Size", QVariant::Size, "@brief Enum constant QVariant::Size") + + gsi::enum_const ("SizeF", QVariant::SizeF, "@brief Enum constant QVariant::SizeF") + + gsi::enum_const ("Line", QVariant::Line, "@brief Enum constant QVariant::Line") + + gsi::enum_const ("LineF", QVariant::LineF, "@brief Enum constant QVariant::LineF") + + gsi::enum_const ("Point", QVariant::Point, "@brief Enum constant QVariant::Point") + + gsi::enum_const ("PointF", QVariant::PointF, "@brief Enum constant QVariant::PointF") + + gsi::enum_const ("RegExp", QVariant::RegExp, "@brief Enum constant QVariant::RegExp") + + gsi::enum_const ("Hash", QVariant::Hash, "@brief Enum constant QVariant::Hash") + + gsi::enum_const ("LastCoreType", QVariant::LastCoreType, "@brief Enum constant QVariant::LastCoreType") + + gsi::enum_const ("Font", QVariant::Font, "@brief Enum constant QVariant::Font") + + gsi::enum_const ("Pixmap", QVariant::Pixmap, "@brief Enum constant QVariant::Pixmap") + + gsi::enum_const ("Brush", QVariant::Brush, "@brief Enum constant QVariant::Brush") + + gsi::enum_const ("Color", QVariant::Color, "@brief Enum constant QVariant::Color") + + gsi::enum_const ("Palette", QVariant::Palette, "@brief Enum constant QVariant::Palette") + + gsi::enum_const ("Icon", QVariant::Icon, "@brief Enum constant QVariant::Icon") + + gsi::enum_const ("Image", QVariant::Image, "@brief Enum constant QVariant::Image") + + gsi::enum_const ("Polygon", QVariant::Polygon, "@brief Enum constant QVariant::Polygon") + + gsi::enum_const ("Region", QVariant::Region, "@brief Enum constant QVariant::Region") + + gsi::enum_const ("Bitmap", QVariant::Bitmap, "@brief Enum constant QVariant::Bitmap") + + gsi::enum_const ("Cursor", QVariant::Cursor, "@brief Enum constant QVariant::Cursor") + + gsi::enum_const ("SizePolicy", QVariant::SizePolicy, "@brief Enum constant QVariant::SizePolicy") + + gsi::enum_const ("KeySequence", QVariant::KeySequence, "@brief Enum constant QVariant::KeySequence") + + gsi::enum_const ("Pen", QVariant::Pen, "@brief Enum constant QVariant::Pen") + + gsi::enum_const ("TextLength", QVariant::TextLength, "@brief Enum constant QVariant::TextLength") + + gsi::enum_const ("TextFormat", QVariant::TextFormat, "@brief Enum constant QVariant::TextFormat") + + gsi::enum_const ("Matrix", QVariant::Matrix, "@brief Enum constant QVariant::Matrix") + + gsi::enum_const ("Transform", QVariant::Transform, "@brief Enum constant QVariant::Transform") + + gsi::enum_const ("Matrix4x4", QVariant::Matrix4x4, "@brief Enum constant QVariant::Matrix4x4") + + gsi::enum_const ("Vector2D", QVariant::Vector2D, "@brief Enum constant QVariant::Vector2D") + + gsi::enum_const ("Vector3D", QVariant::Vector3D, "@brief Enum constant QVariant::Vector3D") + + gsi::enum_const ("Vector4D", QVariant::Vector4D, "@brief Enum constant QVariant::Vector4D") + + gsi::enum_const ("Quaternion", QVariant::Quaternion, "@brief Enum constant QVariant::Quaternion") + + gsi::enum_const ("LastGuiType", QVariant::LastGuiType, "@brief Enum constant QVariant::LastGuiType") + + gsi::enum_const ("UserType", QVariant::UserType, "@brief Enum constant QVariant::UserType") + + gsi::enum_const ("LastType", QVariant::LastType, "@brief Enum constant QVariant::LastType"), + "@qt\n@brief This class represents the QVariant::Type enum"); + +static gsi::QFlagsClass decl_QVariant_Type_Enums ("QVariant_QFlags_Type", + "@qt\n@brief This class represents the QFlags flag set"); + +// Inject the declarations into the parent +static gsi::ClassExt inject_QVariant_Type_Enum_in_parent (decl_QVariant_Type_Enum.defs ()); +static gsi::ClassExt decl_QVariant_Type_Enum_as_child (decl_QVariant_Type_Enum, "Qt", "Type"); +static gsi::ClassExt decl_QVariant_Type_Enums_as_child (decl_QVariant_Type_Enums, "Qt", "QFlags_Type"); + +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_QString_QPair ("Qt", "QPair_QString_QString", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_QByteArray_QPair ("Qt", "QPair_QByteArray_QByteArray", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_double_QPair ("Qt", "QPair_double_double", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_double_QPointF_QPair ("Qt", "QPair_double_QPointF", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_double_QColor_QPair ("Qt", "QPair_double_QColor", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_int_int_QPair ("Qt", "QPair_int_int", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_QString_QSizeF_QPair ("Qt", "QPair_QString_QSizeF", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_double_QVariant_QPair ("Qt", "QPair_double_QVariant", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + +} diff --git a/src/gsiqt/qt4/QtCore/gsiQtCoreCommon.h b/src/gsiqt/qt4/QtCore/gsiQtCoreCommon.h index bbd8d1771..142110d43 100644 --- a/src/gsiqt/qt4/QtCore/gsiQtCoreCommon.h +++ b/src/gsiqt/qt4/QtCore/gsiQtCoreCommon.h @@ -1,28 +1,14 @@ - -/* - - KLayout Layout Viewer - Copyright (C) 2006-2018 Matthias Koefferlein - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - +/** + * Common header for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ #include "tlDefs.h" +#define FORCE_LINK_GSI_QTCORE static void force_link_gsiQtCore_f () { extern int force_link_gsiQtCore; force_link_gsiQtCore = 0; } + #if !defined(HDR_gsiQtCoreCommon_h) # define HDR_gsiQtCoreCommon_h diff --git a/src/gsiqt/qt4/QtCore/gsiQtCoreMain.cc b/src/gsiqt/qt4/QtCore/gsiQtCoreMain.cc new file mode 100644 index 000000000..08789cb86 --- /dev/null +++ b/src/gsiqt/qt4/QtCore/gsiQtCoreMain.cc @@ -0,0 +1,9 @@ +/** + * Main source file for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ + +int force_link_gsiQtCore = 0; + diff --git a/src/gsiqt/qt4/QtDesigner/QtDesigner.pri b/src/gsiqt/qt4/QtDesigner/QtDesigner.pri index 177518cfb..3d17e6fde 100644 --- a/src/gsiqt/qt4/QtDesigner/QtDesigner.pri +++ b/src/gsiqt/qt4/QtDesigner/QtDesigner.pri @@ -6,5 +6,9 @@ # SOURCES += \ + gsiQtDesignerMain.cc \ $$PWD/gsiDeclQAbstractFormBuilder.cc \ $$PWD/gsiDeclQFormBuilder.cc + +HEADERS += gsiQtDesignerCommon.h + diff --git a/src/gsiqt/qt4/QtDesigner/gsiQtDesignerCommon.h b/src/gsiqt/qt4/QtDesigner/gsiQtDesignerCommon.h index e9dca54a8..60f0d7159 100644 --- a/src/gsiqt/qt4/QtDesigner/gsiQtDesignerCommon.h +++ b/src/gsiqt/qt4/QtDesigner/gsiQtDesignerCommon.h @@ -1,28 +1,14 @@ - -/* - - KLayout Layout Viewer - Copyright (C) 2006-2018 Matthias Koefferlein - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - +/** + * Common header for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ #include "tlDefs.h" +#define FORCE_LINK_GSI_QTDESIGNER static void force_link_gsiQtDesigner_f () { extern int force_link_gsiQtDesigner; force_link_gsiQtDesigner = 0; } + #if !defined(HDR_gsiQtDesignerCommon_h) # define HDR_gsiQtDesignerCommon_h diff --git a/src/gsiqt/qt4/QtDesigner/gsiQtDesignerMain.cc b/src/gsiqt/qt4/QtDesigner/gsiQtDesignerMain.cc new file mode 100644 index 000000000..46290de22 --- /dev/null +++ b/src/gsiqt/qt4/QtDesigner/gsiQtDesignerMain.cc @@ -0,0 +1,9 @@ +/** + * Main source file for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ + +int force_link_gsiQtDesigner = 0; + diff --git a/src/gsiqt/qt4/QtGui/QtGui.pri b/src/gsiqt/qt4/QtGui/QtGui.pri index 7989c966e..8c4ec2d9a 100644 --- a/src/gsiqt/qt4/QtGui/QtGui.pri +++ b/src/gsiqt/qt4/QtGui/QtGui.pri @@ -6,6 +6,7 @@ # SOURCES += \ + gsiQtGuiMain.cc \ $$PWD/gsiDeclQAbstractButton.cc \ $$PWD/gsiDeclQAbstractGraphicsShapeItem.cc \ $$PWD/gsiDeclQAbstractItemDelegate.cc \ @@ -371,3 +372,6 @@ SOURCES += \ $$PWD/gsiDeclQWindowsStyle.cc \ $$PWD/gsiDeclQWizard.cc \ $$PWD/gsiDeclQWizardPage.cc + +HEADERS += gsiQtGuiCommon.h + diff --git a/src/gsiqt/qt4/QtGui/QtGui.pro b/src/gsiqt/qt4/QtGui/QtGui.pro index 2e17c13d5..19b62f6f6 100644 --- a/src/gsiqt/qt4/QtGui/QtGui.pro +++ b/src/gsiqt/qt4/QtGui/QtGui.pro @@ -18,6 +18,7 @@ DEPENDPATH += $$DB_INC LIBS += -lklayout_db SOURCES += \ + gsiDeclQtGuiAdd.cc HEADERS += \ diff --git a/src/gsiqt/qt4/QtGui/gsiDeclQtGuiAdd.cc b/src/gsiqt/qt4/QtGui/gsiDeclQtGuiAdd.cc new file mode 100644 index 000000000..c5b2207bb --- /dev/null +++ b/src/gsiqt/qt4/QtGui/gsiDeclQtGuiAdd.cc @@ -0,0 +1,40 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2018 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + + +#include "gsiQt.h" + +#include +#include + +namespace gsi_qt +{ + +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_QAccessibleInterfacePtr_Relation_QPair ("Qt", "QPair_QAccessibleInterfacePtr_QAccessible_Relation", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair >" +); + +} diff --git a/src/gsiqt/qt4/QtGui/gsiQtGuiCommon.h b/src/gsiqt/qt4/QtGui/gsiQtGuiCommon.h index e8b3cc077..afcc1751a 100644 --- a/src/gsiqt/qt4/QtGui/gsiQtGuiCommon.h +++ b/src/gsiqt/qt4/QtGui/gsiQtGuiCommon.h @@ -1,28 +1,14 @@ - -/* - - KLayout Layout Viewer - Copyright (C) 2006-2018 Matthias Koefferlein - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - +/** + * Common header for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ #include "tlDefs.h" +#define FORCE_LINK_GSI_QTGUI static void force_link_gsiQtGui_f () { extern int force_link_gsiQtGui; force_link_gsiQtGui = 0; } + #if !defined(HDR_gsiQtGuiCommon_h) # define HDR_gsiQtGuiCommon_h diff --git a/src/gsiqt/qt4/QtGui/gsiQtGuiMain.cc b/src/gsiqt/qt4/QtGui/gsiQtGuiMain.cc new file mode 100644 index 000000000..1a88324a8 --- /dev/null +++ b/src/gsiqt/qt4/QtGui/gsiQtGuiMain.cc @@ -0,0 +1,9 @@ +/** + * Main source file for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ + +int force_link_gsiQtGui = 0; + diff --git a/src/gsiqt/qt4/QtNetwork/QtNetwork.pri b/src/gsiqt/qt4/QtNetwork/QtNetwork.pri index 137c26be6..77841408e 100644 --- a/src/gsiqt/qt4/QtNetwork/QtNetwork.pri +++ b/src/gsiqt/qt4/QtNetwork/QtNetwork.pri @@ -6,6 +6,7 @@ # SOURCES += \ + gsiQtNetworkMain.cc \ $$PWD/gsiDeclQAbstractNetworkCache.cc \ $$PWD/gsiDeclQAbstractSocket.cc \ $$PWD/gsiDeclQAuthenticator.cc \ @@ -38,3 +39,6 @@ SOURCES += \ $$PWD/gsiDeclQTcpSocket.cc \ $$PWD/gsiDeclQUdpSocket.cc \ $$PWD/gsiDeclQUrlInfo.cc + +HEADERS += gsiQtNetworkCommon.h + diff --git a/src/gsiqt/qt4/QtNetwork/QtNetwork.pro b/src/gsiqt/qt4/QtNetwork/QtNetwork.pro index f4619c824..58544eafb 100644 --- a/src/gsiqt/qt4/QtNetwork/QtNetwork.pro +++ b/src/gsiqt/qt4/QtNetwork/QtNetwork.pro @@ -13,6 +13,7 @@ DEPENDPATH += $$TL_INC $$GSI_INC $$QTBASIC_INC LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_qtbasic SOURCES += \ + gsiDeclQtNetworkAdd.cc HEADERS += \ diff --git a/src/gsiqt/qt4/QtNetwork/gsiDeclQtNetworkAdd.cc b/src/gsiqt/qt4/QtNetwork/gsiDeclQtNetworkAdd.cc new file mode 100644 index 000000000..853de0baa --- /dev/null +++ b/src/gsiqt/qt4/QtNetwork/gsiDeclQtNetworkAdd.cc @@ -0,0 +1,40 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2018 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + + +#include "gsiQt.h" + +#include +#include + +namespace gsi_qt +{ + +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_QHostAddress_int_QPair ("Qt", "QPair_QHostAddress_int", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + +} diff --git a/src/gsiqt/qt4/QtNetwork/gsiQtNetworkCommon.h b/src/gsiqt/qt4/QtNetwork/gsiQtNetworkCommon.h index b44449419..37c6920d0 100644 --- a/src/gsiqt/qt4/QtNetwork/gsiQtNetworkCommon.h +++ b/src/gsiqt/qt4/QtNetwork/gsiQtNetworkCommon.h @@ -1,28 +1,14 @@ - -/* - - KLayout Layout Viewer - Copyright (C) 2006-2018 Matthias Koefferlein - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - +/** + * Common header for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ #include "tlDefs.h" +#define FORCE_LINK_GSI_QTNETWORK static void force_link_gsiQtNetwork_f () { extern int force_link_gsiQtNetwork; force_link_gsiQtNetwork = 0; } + #if !defined(HDR_gsiQtNetworkCommon_h) # define HDR_gsiQtNetworkCommon_h diff --git a/src/gsiqt/qt4/QtNetwork/gsiQtNetworkMain.cc b/src/gsiqt/qt4/QtNetwork/gsiQtNetworkMain.cc new file mode 100644 index 000000000..c7b1a73c6 --- /dev/null +++ b/src/gsiqt/qt4/QtNetwork/gsiQtNetworkMain.cc @@ -0,0 +1,9 @@ +/** + * Main source file for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ + +int force_link_gsiQtNetwork = 0; + diff --git a/src/gsiqt/qt4/QtSql/QtSql.pri b/src/gsiqt/qt4/QtSql/QtSql.pri index 7b5cdf145..5cb18e3de 100644 --- a/src/gsiqt/qt4/QtSql/QtSql.pri +++ b/src/gsiqt/qt4/QtSql/QtSql.pri @@ -6,6 +6,7 @@ # SOURCES += \ + gsiQtSqlMain.cc \ $$PWD/gsiDeclQSql.cc \ $$PWD/gsiDeclQSqlDatabase.cc \ $$PWD/gsiDeclQSqlDriver.cc \ @@ -20,3 +21,6 @@ SOURCES += \ $$PWD/gsiDeclQSqlRelationalTableModel.cc \ $$PWD/gsiDeclQSqlResult.cc \ $$PWD/gsiDeclQSqlTableModel.cc + +HEADERS += gsiQtSqlCommon.h + diff --git a/src/gsiqt/qt4/QtSql/gsiQtSqlCommon.h b/src/gsiqt/qt4/QtSql/gsiQtSqlCommon.h index 37945a31b..807007a07 100644 --- a/src/gsiqt/qt4/QtSql/gsiQtSqlCommon.h +++ b/src/gsiqt/qt4/QtSql/gsiQtSqlCommon.h @@ -1,28 +1,14 @@ - -/* - - KLayout Layout Viewer - Copyright (C) 2006-2018 Matthias Koefferlein - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - +/** + * Common header for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ #include "tlDefs.h" +#define FORCE_LINK_GSI_QTSQL static void force_link_gsiQtSql_f () { extern int force_link_gsiQtSql; force_link_gsiQtSql = 0; } + #if !defined(HDR_gsiQtSqlCommon_h) # define HDR_gsiQtSqlCommon_h diff --git a/src/gsiqt/qt4/QtSql/gsiQtSqlMain.cc b/src/gsiqt/qt4/QtSql/gsiQtSqlMain.cc new file mode 100644 index 000000000..9216876c2 --- /dev/null +++ b/src/gsiqt/qt4/QtSql/gsiQtSqlMain.cc @@ -0,0 +1,9 @@ +/** + * Main source file for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ + +int force_link_gsiQtSql = 0; + diff --git a/src/gsiqt/qt4/QtXml/QtXml.pri b/src/gsiqt/qt4/QtXml/QtXml.pri index 08ca42cc0..58725f5ed 100644 --- a/src/gsiqt/qt4/QtXml/QtXml.pri +++ b/src/gsiqt/qt4/QtXml/QtXml.pri @@ -6,6 +6,7 @@ # SOURCES += \ + gsiQtXmlMain.cc \ $$PWD/gsiDeclQDomAttr.cc \ $$PWD/gsiDeclQDomCDATASection.cc \ $$PWD/gsiDeclQDomCharacterData.cc \ @@ -37,3 +38,6 @@ SOURCES += \ $$PWD/gsiDeclQXmlParseException.cc \ $$PWD/gsiDeclQXmlReader.cc \ $$PWD/gsiDeclQXmlSimpleReader.cc + +HEADERS += gsiQtXmlCommon.h + diff --git a/src/gsiqt/qt4/QtXml/gsiQtXmlCommon.h b/src/gsiqt/qt4/QtXml/gsiQtXmlCommon.h index ccb92271b..e4621d49f 100644 --- a/src/gsiqt/qt4/QtXml/gsiQtXmlCommon.h +++ b/src/gsiqt/qt4/QtXml/gsiQtXmlCommon.h @@ -1,28 +1,14 @@ - -/* - - KLayout Layout Viewer - Copyright (C) 2006-2018 Matthias Koefferlein - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - +/** + * Common header for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ #include "tlDefs.h" +#define FORCE_LINK_GSI_QTXML static void force_link_gsiQtXml_f () { extern int force_link_gsiQtXml; force_link_gsiQtXml = 0; } + #if !defined(HDR_gsiQtXmlCommon_h) # define HDR_gsiQtXmlCommon_h diff --git a/src/gsiqt/qt4/QtXml/gsiQtXmlMain.cc b/src/gsiqt/qt4/QtXml/gsiQtXmlMain.cc new file mode 100644 index 000000000..d1cb8b768 --- /dev/null +++ b/src/gsiqt/qt4/QtXml/gsiQtXmlMain.cc @@ -0,0 +1,9 @@ +/** + * Main source file for Qt binding definition library + * + * DO NOT EDIT THIS FILE. + * This file has been created automatically + */ + +int force_link_gsiQtXml = 0; + diff --git a/src/gsiqt/qtbasic/gsiDeclQtBasic.cc b/src/gsiqt/qtbasic/gsiDeclQtBasic.cc deleted file mode 100644 index 7bb186614..000000000 --- a/src/gsiqt/qtbasic/gsiDeclQtBasic.cc +++ /dev/null @@ -1,210 +0,0 @@ - -/* - - KLayout Layout Viewer - Copyright (C) 2006-2018 Matthias Koefferlein - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - - -#include "gsiQt.h" - -#include -#include -#include -#include -#include -#include - -// ------------------------------------------------------------ -// Generic declarations for a pair - -namespace qt_gsi -{ - -template -struct pair_decl -{ - static typename qt_gsi::Converter::target_type pair_first(const QPair *pair) - { - return qt_gsi::Converter::toc (pair->first); - } - - static typename qt_gsi::Converter::target_type pair_second(const QPair *pair) - { - return qt_gsi::Converter::toc (pair->second); - } - - static void pair_set_first(QPair *pair, const typename qt_gsi::Converter::target_type &s) - { - pair->first = qt_gsi::Converter::toq (s); - } - - static void pair_set_second(QPair *pair, const typename qt_gsi::Converter::target_type &s) - { - pair->second = qt_gsi::Converter::toq (s); - } - - static bool pair_equal(const QPair *pair, const QPair &other) - { - return *pair == other; - } - - /* Not available for all types: (TODO: separate pair declaration for those types which do) - static bool pair_less(const QPair *pair, const QPair &other) - { - return *pair < other; - } - */ - - static QPair *pair_default_ctor() - { - return new QPair(); - } - - static QPair *pair_ctor(const typename qt_gsi::Converter::target_type &first, const typename qt_gsi::Converter::target_type &second) - { - return new QPair(qt_gsi::Converter::toq (first), qt_gsi::Converter::toq (second)); - } - - static gsi::Methods methods () - { - return - gsi::constructor("new", &pair_default_ctor, "@brief Creates a new pair") + - gsi::constructor("new", &pair_ctor, "@brief Creates a new pair from the given arguments\n@args first, second") + - gsi::method_ext("first", &pair_first, "@brief Returns the first element of the pair\n") + - gsi::method_ext("first=", &pair_set_first, "@brief Sets the first element of the pair\n@args first") + - gsi::method_ext("second", &pair_second, "@brief Returns the second element of the pair\n") + - gsi::method_ext("second=", &pair_set_second, "@brief Sets the second element of the pair\n@args second") + - gsi::method_ext("==", &pair_equal, "@brief Returns true if self is equal to the other pair\n@args other") - // not available for all types: (TODO: separate pair declaration for those types which do) - // gsi::method_ext("<", &pair_less, "@brief Returns true if self is less than the other pair\n@args other") - ; - } -}; - -} - -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_QString_QPair ("Qt", "QPair_QString_QString", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_QByteArray_QPair ("Qt", "QPair_QByteArray_QByteArray", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_double_QPair ("Qt", "QPair_double_double", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_double_QPointF_QPair ("Qt", "QPair_double_QPointF", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_double_QColor_QPair ("Qt", "QPair_double_QColor", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_QHostAddress_int_QPair ("Qt", "QPair_QHostAddress_int", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_int_int_QPair ("Qt", "QPair_int_int", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_QString_QSizeF_QPair ("Qt", "QPair_QString_QSizeF", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_double_QVariant_QPair ("Qt", "QPair_double_QVariant", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_QAccessibleInterfacePtr_Relation_QPair ("Qt", "QPair_QAccessibleInterfacePtr_QAccessible_Relation", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair >" -); - -// ------------------------------------------------------------ -// Some helper functions - -namespace qt_gsi -{ - -std::vector -to_string_vector (const QStringList &sl) -{ - std::vector sv; - sv.reserve (sl.size ()); - for (QStringList::const_iterator s = sl.begin (); s != sl.end (); ++s) { - sv.push_back (tl::to_string (*s)); - } - return sv; -} - -QStringList -to_string_list (const std::vector &sv) -{ - QStringList sl; - for (std::vector::const_iterator s = sv.begin (); s != sv.end (); ++s) { - sl.push_back (tl::to_qstring (*s)); - } - return sl; -} - -} - diff --git a/src/gsiqt/qtbasic/gsiQt.cc b/src/gsiqt/qtbasic/gsiQt.cc index a6af2d7c7..5dfd3aa6f 100644 --- a/src/gsiqt/qtbasic/gsiQt.cc +++ b/src/gsiqt/qtbasic/gsiQt.cc @@ -29,84 +29,6 @@ namespace qt_gsi { -// --------------------------------------------------------------------------- -// QVariant::Type implementation -// (this type is not created automatically since QVariant is implemented implicitly) - -class QVariant_Namespace { }; - -// A dummy namespace "QVariant" -gsi::Class decl_QVariant_Namespace ("Qt", "QVariant", - gsi::Methods(), - "@qt\n@brief This class represents the QVariant namespace"); - -static gsi::Enum decl_QVariant_Type_Enum ("Qt", "QVariant_Type", - gsi::enum_const ("Invalid", QVariant::Invalid, "@brief Enum constant QVariant::Invalid") + - gsi::enum_const ("Bool", QVariant::Bool, "@brief Enum constant QVariant::Bool") + - gsi::enum_const ("Int", QVariant::Int, "@brief Enum constant QVariant::Int") + - gsi::enum_const ("UInt", QVariant::UInt, "@brief Enum constant QVariant::UInt") + - gsi::enum_const ("LongLong", QVariant::LongLong, "@brief Enum constant QVariant::LongLong") + - gsi::enum_const ("ULongLong", QVariant::ULongLong, "@brief Enum constant QVariant::ULongLong") + - gsi::enum_const ("Double", QVariant::Double, "@brief Enum constant QVariant::Double") + - gsi::enum_const ("Char", QVariant::Char, "@brief Enum constant QVariant::Char") + - gsi::enum_const ("Map", QVariant::Map, "@brief Enum constant QVariant::Map") + - gsi::enum_const ("List", QVariant::List, "@brief Enum constant QVariant::List") + - gsi::enum_const ("String", QVariant::String, "@brief Enum constant QVariant::String") + - gsi::enum_const ("StringList", QVariant::StringList, "@brief Enum constant QVariant::StringList") + - gsi::enum_const ("ByteArray", QVariant::ByteArray, "@brief Enum constant QVariant::ByteArray") + - gsi::enum_const ("BitArray", QVariant::BitArray, "@brief Enum constant QVariant::BitArray") + - gsi::enum_const ("Date", QVariant::Date, "@brief Enum constant QVariant::Date") + - gsi::enum_const ("Time", QVariant::Time, "@brief Enum constant QVariant::Time") + - gsi::enum_const ("DateTime", QVariant::DateTime, "@brief Enum constant QVariant::DateTime") + - gsi::enum_const ("Url", QVariant::Url, "@brief Enum constant QVariant::Url") + - gsi::enum_const ("Locale", QVariant::Locale, "@brief Enum constant QVariant::Locale") + - gsi::enum_const ("Rect", QVariant::Rect, "@brief Enum constant QVariant::Rect") + - gsi::enum_const ("RectF", QVariant::RectF, "@brief Enum constant QVariant::RectF") + - gsi::enum_const ("Size", QVariant::Size, "@brief Enum constant QVariant::Size") + - gsi::enum_const ("SizeF", QVariant::SizeF, "@brief Enum constant QVariant::SizeF") + - gsi::enum_const ("Line", QVariant::Line, "@brief Enum constant QVariant::Line") + - gsi::enum_const ("LineF", QVariant::LineF, "@brief Enum constant QVariant::LineF") + - gsi::enum_const ("Point", QVariant::Point, "@brief Enum constant QVariant::Point") + - gsi::enum_const ("PointF", QVariant::PointF, "@brief Enum constant QVariant::PointF") + - gsi::enum_const ("RegExp", QVariant::RegExp, "@brief Enum constant QVariant::RegExp") + - gsi::enum_const ("Hash", QVariant::Hash, "@brief Enum constant QVariant::Hash") + - gsi::enum_const ("LastCoreType", QVariant::LastCoreType, "@brief Enum constant QVariant::LastCoreType") + - gsi::enum_const ("Font", QVariant::Font, "@brief Enum constant QVariant::Font") + - gsi::enum_const ("Pixmap", QVariant::Pixmap, "@brief Enum constant QVariant::Pixmap") + - gsi::enum_const ("Brush", QVariant::Brush, "@brief Enum constant QVariant::Brush") + - gsi::enum_const ("Color", QVariant::Color, "@brief Enum constant QVariant::Color") + - gsi::enum_const ("Palette", QVariant::Palette, "@brief Enum constant QVariant::Palette") + - gsi::enum_const ("Icon", QVariant::Icon, "@brief Enum constant QVariant::Icon") + - gsi::enum_const ("Image", QVariant::Image, "@brief Enum constant QVariant::Image") + - gsi::enum_const ("Polygon", QVariant::Polygon, "@brief Enum constant QVariant::Polygon") + - gsi::enum_const ("Region", QVariant::Region, "@brief Enum constant QVariant::Region") + - gsi::enum_const ("Bitmap", QVariant::Bitmap, "@brief Enum constant QVariant::Bitmap") + - gsi::enum_const ("Cursor", QVariant::Cursor, "@brief Enum constant QVariant::Cursor") + - gsi::enum_const ("SizePolicy", QVariant::SizePolicy, "@brief Enum constant QVariant::SizePolicy") + - gsi::enum_const ("KeySequence", QVariant::KeySequence, "@brief Enum constant QVariant::KeySequence") + - gsi::enum_const ("Pen", QVariant::Pen, "@brief Enum constant QVariant::Pen") + - gsi::enum_const ("TextLength", QVariant::TextLength, "@brief Enum constant QVariant::TextLength") + - gsi::enum_const ("TextFormat", QVariant::TextFormat, "@brief Enum constant QVariant::TextFormat") + - gsi::enum_const ("Matrix", QVariant::Matrix, "@brief Enum constant QVariant::Matrix") + - gsi::enum_const ("Transform", QVariant::Transform, "@brief Enum constant QVariant::Transform") + - gsi::enum_const ("Matrix4x4", QVariant::Matrix4x4, "@brief Enum constant QVariant::Matrix4x4") + - gsi::enum_const ("Vector2D", QVariant::Vector2D, "@brief Enum constant QVariant::Vector2D") + - gsi::enum_const ("Vector3D", QVariant::Vector3D, "@brief Enum constant QVariant::Vector3D") + - gsi::enum_const ("Vector4D", QVariant::Vector4D, "@brief Enum constant QVariant::Vector4D") + - gsi::enum_const ("Quaternion", QVariant::Quaternion, "@brief Enum constant QVariant::Quaternion") + - gsi::enum_const ("LastGuiType", QVariant::LastGuiType, "@brief Enum constant QVariant::LastGuiType") + - gsi::enum_const ("UserType", QVariant::UserType, "@brief Enum constant QVariant::UserType") + - gsi::enum_const ("LastType", QVariant::LastType, "@brief Enum constant QVariant::LastType"), - "@qt\n@brief This class represents the QVariant::Type enum"); - -static gsi::QFlagsClass decl_QVariant_Type_Enums ("QVariant_QFlags_Type", - "@qt\n@brief This class represents the QFlags flag set"); - -// Inject the declarations into the parent -static gsi::ClassExt inject_QVariant_Type_Enum_in_parent (decl_QVariant_Type_Enum.defs ()); -static gsi::ClassExt decl_QVariant_Type_Enum_as_child (decl_QVariant_Type_Enum, "Qt", "Type"); -static gsi::ClassExt decl_QVariant_Type_Enums_as_child (decl_QVariant_Type_Enums, "Qt", "QFlags_Type"); - // --------------------------------------------------------------------------- // AbstractMethodCalledException implementation diff --git a/src/gsiqt/qtbasic/gsiQt.h b/src/gsiqt/qtbasic/gsiQt.h index 204388827..e48e94197 100644 --- a/src/gsiqt/qtbasic/gsiQt.h +++ b/src/gsiqt/qtbasic/gsiQt.h @@ -419,9 +419,6 @@ public: }; #endif -std::vector to_string_vector (const QStringList &sl); -QStringList to_string_list (const std::vector &sv); - #ifdef _WIN32 template <> @@ -507,6 +504,70 @@ inline void qt_keep (const std::vector &list) } } +/** + * @brief A helper to implement QPair bindings + */ +template +struct pair_decl +{ + static typename qt_gsi::Converter::target_type pair_first(const QPair *pair) + { + return qt_gsi::Converter::toc (pair->first); + } + + static typename qt_gsi::Converter::target_type pair_second(const QPair *pair) + { + return qt_gsi::Converter::toc (pair->second); + } + + static void pair_set_first(QPair *pair, const typename qt_gsi::Converter::target_type &s) + { + pair->first = qt_gsi::Converter::toq (s); + } + + static void pair_set_second(QPair *pair, const typename qt_gsi::Converter::target_type &s) + { + pair->second = qt_gsi::Converter::toq (s); + } + + static bool pair_equal(const QPair *pair, const QPair &other) + { + return *pair == other; + } + + /* Not available for all types: (TODO: separate pair declaration for those types which do) + static bool pair_less(const QPair *pair, const QPair &other) + { + return *pair < other; + } + */ + + static QPair *pair_default_ctor() + { + return new QPair(); + } + + static QPair *pair_ctor(const typename qt_gsi::Converter::target_type &first, const typename qt_gsi::Converter::target_type &second) + { + return new QPair(qt_gsi::Converter::toq (first), qt_gsi::Converter::toq (second)); + } + + static gsi::Methods methods () + { + return + gsi::constructor("new", &pair_default_ctor, "@brief Creates a new pair") + + gsi::constructor("new", &pair_ctor, "@brief Creates a new pair from the given arguments\n@args first, second") + + gsi::method_ext("first", &pair_first, "@brief Returns the first element of the pair\n") + + gsi::method_ext("first=", &pair_set_first, "@brief Sets the first element of the pair\n@args first") + + gsi::method_ext("second", &pair_second, "@brief Returns the second element of the pair\n") + + gsi::method_ext("second=", &pair_set_second, "@brief Sets the second element of the pair\n@args second") + + gsi::method_ext("==", &pair_equal, "@brief Returns true if self is equal to the other pair\n@args other") + // not available for all types: (TODO: separate pair declaration for those types which do) + // gsi::method_ext("<", &pair_less, "@brief Returns true if self is less than the other pair\n@args other") + ; + } +}; + // Using this macro on a variable will supress the "unused variable" or "unused argument" // warning: #define __SUPPRESS_UNUSED_WARNING(x) (void)(x) diff --git a/src/gsiqt/qtbasic/gsiQtCoreExternals.h b/src/gsiqt/qtbasic/gsiQtCoreExternals.h new file mode 100644 index 000000000..a75b9431a --- /dev/null +++ b/src/gsiqt/qtbasic/gsiQtCoreExternals.h @@ -0,0 +1,27 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2018 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +# if defined(HAVE_QT5) +# include "../qt5/QtCore/gsiQtExternals.h" +# else +# include "../qt4/QtCore/gsiQtExternals.h" +# endif diff --git a/src/gsiqt/qtbasic/gsiQtAllExternals.h b/src/gsiqt/qtbasic/gsiQtDesignerExternals.h similarity index 73% rename from src/gsiqt/qtbasic/gsiQtAllExternals.h rename to src/gsiqt/qtbasic/gsiQtDesignerExternals.h index 79fdd8f3c..b7a0e9b96 100644 --- a/src/gsiqt/qtbasic/gsiQtAllExternals.h +++ b/src/gsiqt/qtbasic/gsiQtDesignerExternals.h @@ -20,23 +20,8 @@ */ - -#if !defined(HDR_gsiQtAllExternals_h) -# define HDR_gsiQtAllExternals_h - # if defined(HAVE_QT5) - -... - +# include "../qt5/QtDesigner/gsiQtExternals.h" # else - -# include "../qt4/QtCore/gsiQtExternals.h" -# include "../qt4/QtGui/gsiQtExternals.h" -# include "../qt4/QtXml/gsiQtExternals.h" -# include "../qt4/QtSql/gsiQtExternals.h" -# include "../qt4/QtNetwork/gsiQtExternals.h" # include "../qt4/QtDesigner/gsiQtExternals.h" - # endif - -#endif diff --git a/src/gsiqt/qtbasic/gsiQtGuiExternals.h b/src/gsiqt/qtbasic/gsiQtGuiExternals.h new file mode 100644 index 000000000..d29f50f8e --- /dev/null +++ b/src/gsiqt/qtbasic/gsiQtGuiExternals.h @@ -0,0 +1,27 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2018 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +# if defined(HAVE_QT5) +# include "../qt5/QtGui/gsiQtExternals.h" +# else +# include "../qt4/QtGui/gsiQtExternals.h" +# endif diff --git a/src/gsiqt/qtbasic/gsiQtNetworkExternals.h b/src/gsiqt/qtbasic/gsiQtNetworkExternals.h new file mode 100644 index 000000000..eaf881f54 --- /dev/null +++ b/src/gsiqt/qtbasic/gsiQtNetworkExternals.h @@ -0,0 +1,27 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2018 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +# if defined(HAVE_QT5) +# include "../qt5/QtNetwork/gsiQtExternals.h" +# else +# include "../qt4/QtNetwork/gsiQtExternals.h" +# endif diff --git a/src/gsiqt/qtbasic/gsiQtSqlExternals.h b/src/gsiqt/qtbasic/gsiQtSqlExternals.h new file mode 100644 index 000000000..703a3c546 --- /dev/null +++ b/src/gsiqt/qtbasic/gsiQtSqlExternals.h @@ -0,0 +1,27 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2018 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +# if defined(HAVE_QT5) +# include "../qt5/QtSql/gsiQtExternals.h" +# else +# include "../qt4/QtSql/gsiQtExternals.h" +# endif diff --git a/src/gsiqt/qtbasic/gsiQtXmlExternals.h b/src/gsiqt/qtbasic/gsiQtXmlExternals.h new file mode 100644 index 000000000..cc7696962 --- /dev/null +++ b/src/gsiqt/qtbasic/gsiQtXmlExternals.h @@ -0,0 +1,27 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2018 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +# if defined(HAVE_QT5) +# include "../qt5/QtXml/gsiQtExternals.h" +# else +# include "../qt4/QtXml/gsiQtExternals.h" +# endif diff --git a/src/gsiqt/qtbasic/qtbasic.pro b/src/gsiqt/qtbasic/qtbasic.pro index ad1a197d2..62ac540fc 100644 --- a/src/gsiqt/qtbasic/qtbasic.pro +++ b/src/gsiqt/qtbasic/qtbasic.pro @@ -14,11 +14,9 @@ LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_db SOURCES += \ gsiQt.cc \ - gsiDeclQtBasic.cc \ gsiDeclQt5Basic.cc \ gsiQtHelper.cc HEADERS += \ gsiQt.h \ gsiQtBasicCommon.h \ - gsiQtAllExternals.h diff --git a/src/lay/lay/gsiDeclLayApplication.cc b/src/lay/lay/gsiDeclLayApplication.cc index d6465c334..48a21a54d 100644 --- a/src/lay/lay/gsiDeclLayApplication.cc +++ b/src/lay/lay/gsiDeclLayApplication.cc @@ -24,9 +24,11 @@ #include "layMainWindow.h" #include "laySignalHandler.h" #include "gsiDecl.h" -#include "gsiQtAllExternals.h" +#include "gsiQtGuiExternals.h" #include "tlArch.h" +FORCE_LINK_GSI_QTGUI + namespace gsi { diff --git a/src/lay/lay/gsiDeclLayHelpDialog.cc b/src/lay/lay/gsiDeclLayHelpDialog.cc index b96c806d4..c0c5f0d0d 100644 --- a/src/lay/lay/gsiDeclLayHelpDialog.cc +++ b/src/lay/lay/gsiDeclLayHelpDialog.cc @@ -26,7 +26,9 @@ #include "layMainWindow.h" #include "laybasicCommon.h" #include "gsiDecl.h" -#include "gsiQtAllExternals.h" +#include "gsiQtGuiExternals.h" + +FORCE_LINK_GSI_QTGUI namespace tl { diff --git a/src/lay/lay/gsiDeclLayMainWindow.cc b/src/lay/lay/gsiDeclLayMainWindow.cc index 1205ec19d..62f1dfe87 100644 --- a/src/lay/lay/gsiDeclLayMainWindow.cc +++ b/src/lay/lay/gsiDeclLayMainWindow.cc @@ -22,10 +22,12 @@ #include "gsiDecl.h" -#include "gsiQtAllExternals.h" #include "gsiSignals.h" +#include "gsiQtGuiExternals.h" #include "layMainWindow.h" +FORCE_LINK_GSI_QTGUI + namespace gsi { diff --git a/src/laybasic/laybasic/gsiDeclLayDialogs.cc b/src/laybasic/laybasic/gsiDeclLayDialogs.cc index 9931ef052..cee939cde 100644 --- a/src/laybasic/laybasic/gsiDeclLayDialogs.cc +++ b/src/laybasic/laybasic/gsiDeclLayDialogs.cc @@ -22,8 +22,7 @@ #include "gsiDecl.h" #include "gsiDeclBasic.h" -#include "gsiQtAllExternals.h" - +#include "gsiQtGuiExternals.h" #include "layBrowserDialog.h" #include "layBrowserPanel.h" @@ -35,6 +34,8 @@ #include +FORCE_LINK_GSI_QTGUI + namespace gsi {