From 19df2e06d967d43fb978168919a5a0e18a835c25 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 26 Nov 2017 22:12:55 +0100 Subject: [PATCH 01/60] Integrated changes by Kazunari for MacOS build. --- build.sh | 51 ++++++++++++++++++++++++++++++++++++--------------- version.sh | 7 +++++-- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/build.sh b/build.sh index 6a6190433..ece48ac1b 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# +# # KLayout Layout Viewer # Copyright (C) 2006-2017 Matthias Koefferlein # @@ -17,10 +17,11 @@ # 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 -# +# CURR_DIR=`pwd` RUN_MAKE=1 +IS_MAC="no" HAVE_QTBINDINGS=1 HAVE_64BIT_COORD=0 @@ -46,6 +47,16 @@ MAKE_OPT="" CONFIG="release" BUILD_EXPERT=0 +# Check if building on Mac OSX Darwin family +case `uname` in + Darwin*) + IS_MAC="yes" + ;; + *) + IS_MAC="no" + ;; +esac + # Check, whether build.sh is run from the top level folder if ! [ -e src ] || ! [ -e src/klayout.pro ]; then echo "*** ERROR: run build.sh from the top level folder" @@ -200,7 +211,7 @@ done echo "Scanning installation .." echo "" -# Import version info +# Import version info . ./version.sh echo "Version Info:" @@ -212,8 +223,8 @@ echo "" # if not given, try to detect the qmake binary if [ "$QMAKE" = "" ]; then for qmake in "qmake5" "qmake-qt5" "qmake4" "qmake-qt4" "qmake"; do - if [ "$QMAKE" = "" ] && [ "`$qmake -v 2>/dev/null`" != "" ]; then - QMAKE="$qmake" + if [ "$QMAKE" = "" ] && [ "`$qmake -v 2>/dev/null`" != "" ]; then + QMAKE="$qmake" fi done fi @@ -246,8 +257,8 @@ echo "" # if not given, locate ruby interpreter (prefer 1.9, then default, finally 1.8 as fallback) if [ "$RUBY" = "" ]; then for ruby in "ruby2.4" "ruby2.3" "ruby2.2" "ruby2.1" "ruby2" "ruby1.9" "ruby" "ruby1.8"; do - if [ "$RUBY" = "" ] && [ "`$ruby -e 'puts 1' 2>/dev/null`" = "1" ]; then - RUBY="$ruby" + if [ "$RUBY" = "" ] && [ "`$ruby -e 'puts 1' 2>/dev/null`" = "1" ]; then + RUBY="$ruby" fi done fi @@ -314,7 +325,7 @@ if [ "$RUBY" != "" ] && [ "$RUBY" != "-" ]; then RUBYINCLUDE2=`$RUBY -rrbconfig -e "puts (RbConfig::CONFIG['rubyarchhdrdir'] || '')"` fi if [ "$RUBYINCLUDE2" = "" ]; then - RUBYINCLUDE2="$RUBYHDRDIR"/`$RUBY -rrbconfig -e "puts (RbConfig::CONFIG['arch'] || '')"` + RUBYINCLUDE2="$RUBYHDRDIR"/`$RUBY -rrbconfig -e "puts (RbConfig::CONFIG['arch'] || '')"` fi echo " Ruby headers found: $RUBYINCLUDE and $RUBYINCLUDE2" fi @@ -329,11 +340,11 @@ if [ "$RUBY" != "" ] && [ "$RUBY" != "-" ]; then fi -# if not given, locate Python interpreter +# if not given, locate Python interpreter if [ "$PYTHON" = "" ]; then for python in "python3.5" "python3.4" "python3.3" "python3.2" "python3.1" "python3" "python2.8" "python2.7" "python2" "python"; do - if [ "$PYTHON" = "" ] && [ "`$python -c 'print(1)' 2>/dev/null`" = "1" ]; then - PYTHON="$python" + if [ "$PYTHON" = "" ] && [ "`$python -c 'print(1)' 2>/dev/null`" = "1" ]; then + PYTHON="$python" fi done fi @@ -468,11 +479,21 @@ mkdir -p $BUILD . $(dirname $(which $0))/version.sh # qmake needs absolute paths, so we get them now: -BUILD=`readlink -f $BUILD` -BIN=`readlink -f $BIN` +# OSX does not have `readlink -f` command. Use equivalent Perl script. +if [ "$IS_MAC" = "no" ]; then + BUILD=`readlink -f $BUILD` + BIN=`readlink -f $BIN` +else + BUILD=`perl -MCwd -le 'print Cwd::abs_path(shift)' $BUILD` + BIN=`perl -MCwd -le 'print Cwd::abs_path(shift)' $BIN` +fi -if ( gmake -v >/dev/null 2>/dev/null ); then - MAKE_PRG=gmake +if [ "$IS_MAC" = "no" ]; then + if ( gmake -v >/dev/null 2>/dev/null ); then + MAKE_PRG=gmake + else + MAKE_PRG=make + fi else MAKE_PRG=make fi diff --git a/version.sh b/version.sh index 192f149dc..700ecbd8d 100644 --- a/version.sh +++ b/version.sh @@ -5,8 +5,11 @@ KLAYOUT_VERSION="0.25" # The build date -KLAYOUT_VERSION_DATE=$(date --iso-8601) +KLAYOUT_VERSION_DATE=$(date "+%Y-%m-%d") # The short SHA hash of the commit -KLAYOUT_VERSION_REV=$(git rev-parse --short HEAD) +KLAYOUT_VERSION_REV=$(git rev-parse --short HEAD 2>/dev/null) +if [ "$KLAYOUT_VERSION_REV" = "" ]; then + KLAYOUT_VERSION_REV="LatestSourcePackage" +fi From 4dbe28e9faa718293cab4fa2b297c937f4269603 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 26 Nov 2017 22:50:35 +0100 Subject: [PATCH 02/60] MacOS build fix. --- src/db/db/dbHash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db/db/dbHash.h b/src/db/db/dbHash.h index 57c9a5f45..28d56fc26 100644 --- a/src/db/db/dbHash.h +++ b/src/db/db/dbHash.h @@ -74,7 +74,7 @@ namespace DB_HASH_NAMESPACE }; #endif -#if defined(_WIN64) +#if defined(_WIN64) || defined(__APPLE__) /** * @brief Specialization missing for long long on WIN64 */ From 11cb5eb99836e043d71b556af010b29624c3f569 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 26 Nov 2017 22:51:36 +0100 Subject: [PATCH 03/60] Qt 5.8.0 compatibility --- scripts/mkqtdecl5/mkqtdecl.conf | 2 ++ src/gsiqt5/gsiDeclQtTypeTraits.h | 1 + 2 files changed, 3 insertions(+) diff --git a/scripts/mkqtdecl5/mkqtdecl.conf b/scripts/mkqtdecl5/mkqtdecl.conf index a704ebc95..ee58b82a4 100644 --- a/scripts/mkqtdecl5/mkqtdecl.conf +++ b/scripts/mkqtdecl5/mkqtdecl.conf @@ -1484,6 +1484,8 @@ final_class "QAccessibleObject" # because navigate cannot be implemented # final_class "QAccessiblePlugin" # because navigate cannot be implemented final_class "QAccessibleWidget" # because navigate cannot be implemented +no_copy_ctor "QIconEngine" + # -------------------------------------------------------------- # QtXml diff --git a/src/gsiqt5/gsiDeclQtTypeTraits.h b/src/gsiqt5/gsiDeclQtTypeTraits.h index eba0986d8..dd68128e6 100644 --- a/src/gsiqt5/gsiDeclQtTypeTraits.h +++ b/src/gsiqt5/gsiDeclQtTypeTraits.h @@ -3418,6 +3418,7 @@ template <> struct type_traits : public type_traits { class QIconEngine_Adaptor; namespace tl { template <> struct type_traits : public type_traits { + typedef tl::false_tag has_copy_constructor; }; } From 9a3c026ef470223dc4f6f67e2cefe5581a4783e8 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Tue, 28 Nov 2017 18:59:22 +0900 Subject: [PATCH 04/60] To add my Bash script for building KLayout on Mac OSX. --- macbuild/macbuildQt4.sh | 21 +++++++++++++++++++++ macbuild/macbuildQt5.sh | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 macbuild/macbuildQt4.sh create mode 100755 macbuild/macbuildQt5.sh diff --git a/macbuild/macbuildQt4.sh b/macbuild/macbuildQt4.sh new file mode 100755 index 000000000..e04c0b150 --- /dev/null +++ b/macbuild/macbuildQt4.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Using Qt 4.8.7 from Mac Ports. +# +# Ruby: OSX native +# Python: OSX native +./build.sh \ + -release \ + -qmake /opt/local/libexec/qt4/bin/qmake \ + -build ./qt4.build.macos-yosemite \ + -bin ./qt4.bin.macos-yosemite \ + -option -j4 \ + -with-qtbinding \ + -qt4 \ + -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby \ + -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ + -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ + -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib \ + -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ + -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ + | tee macbuildQt4.log diff --git a/macbuild/macbuildQt5.sh b/macbuild/macbuildQt5.sh new file mode 100755 index 000000000..6114a572d --- /dev/null +++ b/macbuild/macbuildQt5.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Using Qt 5.8.0 from Mac Ports. +# +# Ruby: OSX native +# Python: OSX native +./build.sh \ + -release \ + -qmake /opt/local/libexec/qt5/bin/qmake \ + -build ./qt5.build.macos-yosemite \ + -bin ./qt5.bin.macos-yosemite \ + -option -j4 \ + -with-qtbinding \ + -qt5 \ + -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby \ + -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ + -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ + -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib \ + -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ + -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ + | tee macbuildQt5.log From 14894e6ab75df20656a8419ca11529fd09216e89 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Sun, 10 Dec 2017 16:42:35 +0900 Subject: [PATCH 05/60] Qt::WindowOkButtonHint and Qt::WindowCancelButtonHint are supported for Windows CE. This refs #1. --- src/gsiqt5/gsiDeclQt_4.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gsiqt5/gsiDeclQt_4.cc b/src/gsiqt5/gsiDeclQt_4.cc index b7686491a..fdceadbce 100644 --- a/src/gsiqt5/gsiDeclQt_4.cc +++ b/src/gsiqt5/gsiDeclQt_4.cc @@ -21,9 +21,9 @@ */ /** -* @file gsiDeclQt_4.cc +* @file gsiDeclQt_4.cc * -* DO NOT EDIT THIS FILE. +* DO NOT EDIT THIS FILE. * This file has been created automatically */ @@ -153,9 +153,15 @@ static gsi::Enum decl_Qt_WindowType_Enum ("Qt_WindowType", gsi::enum_const ("MacWindowToolBarButtonHint", Qt::MacWindowToolBarButtonHint, "@brief Enum constant Qt::MacWindowToolBarButtonHint") + gsi::enum_const ("BypassGraphicsProxyWidget", Qt::BypassGraphicsProxyWidget, "@brief Enum constant Qt::BypassGraphicsProxyWidget") + gsi::enum_const ("NoDropShadowWindowHint", Qt::NoDropShadowWindowHint, "@brief Enum constant Qt::NoDropShadowWindowHint") + +#if defined(__APPLE__) + // Qt::WindowOkButtonHint and Qt::WindowCancelButtonHint are supported for Windows CE. + // By Kazunari Sekigawa (December 10, 2017) + gsi::enum_const ("WindowFullscreenButtonHint", Qt::WindowFullscreenButtonHint, "@brief Enum constant Qt::WindowFullscreenButtonHint"), +#else gsi::enum_const ("WindowFullscreenButtonHint", Qt::WindowFullscreenButtonHint, "@brief Enum constant Qt::WindowFullscreenButtonHint") + gsi::enum_const ("WindowOkButtonHint", Qt::WindowOkButtonHint, "@brief Enum constant Qt::WindowOkButtonHint") + gsi::enum_const ("WindowCancelButtonHint", Qt::WindowCancelButtonHint, "@brief Enum constant Qt::WindowCancelButtonHint"), +#endif "@qt\n@brief This class represents the Qt::WindowType enum"); static gsi::QFlagsClass decl_Qt_WindowType_Enums ("Qt_QFlags_WindowType", From bbe87ad5d9098de59a4313aa1592a7d6a8c0aee5 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Mon, 11 Dec 2017 22:45:28 +0900 Subject: [PATCH 06/60] To build klayout 0.25 on MacOS High-Sierra with Qt 5.9.3 from MacPorts. This refs #1. --- macbuild/macbuildQt4.sh | 10 +++++----- macbuild/macbuildQt5.sh | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/macbuild/macbuildQt4.sh b/macbuild/macbuildQt4.sh index e04c0b150..4153ebc0d 100755 --- a/macbuild/macbuildQt4.sh +++ b/macbuild/macbuildQt4.sh @@ -7,15 +7,15 @@ ./build.sh \ -release \ -qmake /opt/local/libexec/qt4/bin/qmake \ - -build ./qt4.build.macos-yosemite \ - -bin ./qt4.bin.macos-yosemite \ - -option -j4 \ + -build ./qt4.build.macos-high-sierra \ + -bin ./qt4.bin.macos-high-sierra \ + -option -j2 \ -with-qtbinding \ -qt4 \ - -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby \ + -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby \ -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ - -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib \ + -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib \ -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ | tee macbuildQt4.log diff --git a/macbuild/macbuildQt5.sh b/macbuild/macbuildQt5.sh index 6114a572d..32034dc0f 100755 --- a/macbuild/macbuildQt5.sh +++ b/macbuild/macbuildQt5.sh @@ -1,21 +1,21 @@ #!/bin/bash -# Using Qt 5.8.0 from Mac Ports. +# Using Qt 5.9.3 from Mac Ports. # # Ruby: OSX native # Python: OSX native ./build.sh \ -release \ -qmake /opt/local/libexec/qt5/bin/qmake \ - -build ./qt5.build.macos-yosemite \ - -bin ./qt5.bin.macos-yosemite \ - -option -j4 \ + -build ./qt5.build.macos-high-sierra \ + -bin ./qt5.bin.macos-high-sierra \ + -option -j2 \ -with-qtbinding \ -qt5 \ - -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby \ + -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby \ -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ - -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib \ + -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib \ -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ | tee macbuildQt5.log From b49db04fb4ed9f21fb54ed1c0ff4517a6566955d Mon Sep 17 00:00:00 2001 From: klayoutmatthias Date: Mon, 11 Dec 2017 23:19:01 +0000 Subject: [PATCH 07/60] Fixed MacOS build The LLVM STL implementation does not recognize "typedef void iterator_traits" as dummy declaration. It will fall back to an empty traits struct. Using the default "forward_iterator_tag" for the iterator_traits solves this compile issue. --- src/db/db/dbArray.h | 2 +- src/db/db/gsiDeclDbLayoutQuery.cc | 2 +- src/db/db/gsiDeclDbShape.cc | 4 ++-- src/gsi/gsi/gsiIterators.h | 2 ++ src/laybasic/laybasic/gsiDeclLayLayoutView.cc | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/db/db/dbArray.h b/src/db/db/dbArray.h index 083a02843..253a043bb 100644 --- a/src/db/db/dbArray.h +++ b/src/db/db/dbArray.h @@ -1208,7 +1208,7 @@ struct array_iterator typedef void pointer_type; typedef void difference_type; typedef void pointer; - typedef void iterator_category; + typedef std::forward_iterator_tag iterator_category; /** * @brief The default constructor diff --git a/src/db/db/gsiDeclDbLayoutQuery.cc b/src/db/db/gsiDeclDbLayoutQuery.cc index 5f2b47ec2..0c417e0fc 100644 --- a/src/db/db/gsiDeclDbLayoutQuery.cc +++ b/src/db/db/gsiDeclDbLayoutQuery.cc @@ -70,7 +70,7 @@ struct LayoutQueryIteratorWrapper { typedef db::LayoutQueryIterator &reference; // Dummy declarations - typedef void iterator_category; + typedef std::forward_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; diff --git a/src/db/db/gsiDeclDbShape.cc b/src/db/db/gsiDeclDbShape.cc index 69b926d5d..96dbf44c1 100644 --- a/src/db/db/gsiDeclDbShape.cc +++ b/src/db/db/gsiDeclDbShape.cc @@ -954,7 +954,7 @@ struct ConvertingIteratorWrapper typedef T value_type; typedef T reference; typedef void pointer; - typedef void iterator_category; + typedef std::forward_iterator_tag iterator_category; ConvertingIteratorWrapper (double dbu, const I &b, const I &e) : m_b (b), m_e (e), m_dbu (dbu) @@ -989,7 +989,7 @@ struct ConvertingFreeIteratorWrapper typedef T value_type; typedef T reference; typedef void pointer; - typedef void iterator_category; + typedef std::forward_iterator_tag iterator_category; ConvertingFreeIteratorWrapper (double dbu, const I &b) : m_b (b), m_dbu (dbu) diff --git a/src/gsi/gsi/gsiIterators.h b/src/gsi/gsi/gsiIterators.h index 35c53253f..87d69fdcd 100644 --- a/src/gsi/gsi/gsiIterators.h +++ b/src/gsi/gsi/gsiIterators.h @@ -28,6 +28,8 @@ #include "tlTypeTraits.h" #include "gsiSerialisation.h" +#include + // For a comprehensive documentation see gsi.h namespace gsi diff --git a/src/laybasic/laybasic/gsiDeclLayLayoutView.cc b/src/laybasic/laybasic/gsiDeclLayLayoutView.cc index 0d28c0693..3ce4c3c90 100644 --- a/src/laybasic/laybasic/gsiDeclLayLayoutView.cc +++ b/src/laybasic/laybasic/gsiDeclLayLayoutView.cc @@ -320,7 +320,7 @@ namespace { typedef lay::LayerPropertiesNodeRef value_type; typedef lay::LayerPropertiesNodeRef reference; // Dummy declarations required for std::iterator_traits - typedef void iterator_category; + typedef std::forward_iterator_tag iterator_category; typedef void difference_type; typedef void pointer; From 74fa72de55f245364e5f0d8b9d341c6c8eb090c8 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Tue, 12 Dec 2017 18:21:34 +0900 Subject: [PATCH 08/60] To modify Bash script for Yosemite. This refs #1. --- macbuild/{macbuildQt4.sh => macbuildQt4-yosemite.sh} | 0 macbuild/{macbuildQt5.sh => macbuildQt5-yosemite.sh} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename macbuild/{macbuildQt4.sh => macbuildQt4-yosemite.sh} (100%) rename macbuild/{macbuildQt5.sh => macbuildQt5-yosemite.sh} (100%) diff --git a/macbuild/macbuildQt4.sh b/macbuild/macbuildQt4-yosemite.sh similarity index 100% rename from macbuild/macbuildQt4.sh rename to macbuild/macbuildQt4-yosemite.sh diff --git a/macbuild/macbuildQt5.sh b/macbuild/macbuildQt5-yosemite.sh similarity index 100% rename from macbuild/macbuildQt5.sh rename to macbuild/macbuildQt5-yosemite.sh From 9e3b4681e23ddb0c998ff4c698964bb7c111f52a Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Tue, 12 Dec 2017 18:22:34 +0900 Subject: [PATCH 09/60] To modify Bash script for Yosemite. This refs #1. --- macbuild/macbuildQt4-yosemite.sh | 10 +++++----- macbuild/macbuildQt5-yosemite.sh | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/macbuild/macbuildQt4-yosemite.sh b/macbuild/macbuildQt4-yosemite.sh index 4153ebc0d..e04c0b150 100755 --- a/macbuild/macbuildQt4-yosemite.sh +++ b/macbuild/macbuildQt4-yosemite.sh @@ -7,15 +7,15 @@ ./build.sh \ -release \ -qmake /opt/local/libexec/qt4/bin/qmake \ - -build ./qt4.build.macos-high-sierra \ - -bin ./qt4.bin.macos-high-sierra \ - -option -j2 \ + -build ./qt4.build.macos-yosemite \ + -bin ./qt4.bin.macos-yosemite \ + -option -j4 \ -with-qtbinding \ -qt4 \ - -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby \ + -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby \ -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ - -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib \ + -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib \ -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ | tee macbuildQt4.log diff --git a/macbuild/macbuildQt5-yosemite.sh b/macbuild/macbuildQt5-yosemite.sh index 32034dc0f..6114a572d 100755 --- a/macbuild/macbuildQt5-yosemite.sh +++ b/macbuild/macbuildQt5-yosemite.sh @@ -1,21 +1,21 @@ #!/bin/bash -# Using Qt 5.9.3 from Mac Ports. +# Using Qt 5.8.0 from Mac Ports. # # Ruby: OSX native # Python: OSX native ./build.sh \ -release \ -qmake /opt/local/libexec/qt5/bin/qmake \ - -build ./qt5.build.macos-high-sierra \ - -bin ./qt5.bin.macos-high-sierra \ - -option -j2 \ + -build ./qt5.build.macos-yosemite \ + -bin ./qt5.bin.macos-yosemite \ + -option -j4 \ -with-qtbinding \ -qt5 \ - -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby \ + -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby \ -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ - -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib \ + -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib \ -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ | tee macbuildQt5.log From bded8f9fa4d650b4a1ae9375ae7382c420f00773 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Tue, 12 Dec 2017 20:50:23 +0900 Subject: [PATCH 10/60] When KLayout 0.25 is built with Qt 5.8.0 or later, this workaround is not required. This refs #1. --- src/lay/lay/layMainWindow.cc | 455 ++++++++++++++++++----------------- 1 file changed, 230 insertions(+), 225 deletions(-) diff --git a/src/lay/lay/layMainWindow.cc b/src/lay/lay/layMainWindow.cc index 4b9e7953f..4ef98a3bf 100644 --- a/src/lay/lay/layMainWindow.cc +++ b/src/lay/lay/layMainWindow.cc @@ -37,7 +37,7 @@ #include #include -#if defined(__APPLE__) +#if defined(__APPLE__) && (QT_VERSION < 0x050401) // A workaround for the issue of Qt 4.8.x when handling "File Reference URL" in OSX // By Kazunari Sekigawa (November 12, 2015) // Search down for my name for more details! @@ -106,7 +106,7 @@ const int max_dirty_files = 15; // ------------------------------------------------------------- class ProgressDialog - : public QDialog, + : public QDialog, public tl::Object { public: @@ -171,7 +171,7 @@ private: // ------------------------------------------------------------- -class ControlWidgetStack +class ControlWidgetStack : public QFrame { public: @@ -245,7 +245,7 @@ public: mp_bglabel->hide (); } } - + QWidget *widget (size_t index) { if (index < m_widgets.size ()) { @@ -268,7 +268,7 @@ protected: void resize_children () { - // set the geometry of all children + // set the geometry of all children for (std::vector ::iterator child = m_widgets.begin (); child != m_widgets.end (); ++child) { if (*child) { (*child)->setGeometry (0, 0, width (), height ()); @@ -283,7 +283,7 @@ protected: // ------------------------------------------------------------- -class ViewWidgetStack +class ViewWidgetStack : public QWidget { public: @@ -335,7 +335,7 @@ public: } } } - + LayoutView *widget (size_t index) { if (index < m_widgets.size ()) { @@ -358,7 +358,7 @@ protected: void resize_children () { - // set the geometry of all children + // set the geometry of all children for (std::vector ::iterator child = m_widgets.begin (); child != m_widgets.end (); ++child) { (*child)->setGeometry (0, 0, width (), height ()); } @@ -436,7 +436,7 @@ static MainWindow *mw_instance = 0; MainWindow * MainWindow::instance () { - return mw_instance; + return mw_instance; } // ----------------------------------- @@ -571,7 +571,7 @@ MainWindow::MainWindow (QApplication *app, const char *name) mp_tech_status_label = new QLabel (mp_status_bar); mp_tech_status_label->setObjectName (QString::fromUtf8 ("tech_status_label")); mp_tech_status_label->setMinimumSize (QSize (100, 0)); - mp_tech_status_label->setToolTip (QObject::tr ("Current technology")); + mp_tech_status_label->setToolTip (QObject::tr ("Current technology")); mp_status_bar->addWidget (mp_tech_status_label); QLabel *sel_status_icon = new QLabel (mp_status_bar); @@ -580,7 +580,7 @@ MainWindow::MainWindow (QApplication *app, const char *name) mp_msg_label = new QLabel (mp_status_bar); mp_msg_label->setObjectName (QString::fromUtf8 ("msg_label")); - mp_msg_label->setToolTip (QObject::tr ("General status")); + mp_msg_label->setToolTip (QObject::tr ("General status")); mp_status_bar->addWidget (mp_msg_label, 1); QLabel *xy_status_icon = new QLabel (mp_status_bar); @@ -597,14 +597,14 @@ MainWindow::MainWindow (QApplication *app, const char *name) mp_cpx_label->setObjectName (QString::fromUtf8 ("cpx_label")); mp_cpx_label->setAlignment (Qt::AlignVCenter | Qt::AlignRight); mp_cpx_label->setMinimumSize (100, 0); - mp_cpx_label->setToolTip (QObject::tr ("Current cursor position (x)")); + mp_cpx_label->setToolTip (QObject::tr ("Current cursor position (x)")); cp_frame_ly->addWidget (mp_cpx_label); cp_frame_ly->insertSpacing (-1, 6); mp_cpy_label = new QLabel (mp_cp_frame); mp_cpy_label->setObjectName (QString::fromUtf8 ("cpy_label")); mp_cpy_label->setAlignment (Qt::AlignVCenter | Qt::AlignRight); mp_cpy_label->setMinimumSize (100, 0); - mp_cpy_label->setToolTip (QObject::tr ("Current cursor position (y)")); + mp_cpy_label->setToolTip (QObject::tr ("Current cursor position (y)")); cp_frame_ly->addWidget (mp_cpy_label); cp_frame_ly->insertSpacing (-1, 6); @@ -623,28 +623,28 @@ MainWindow::MainWindow (QApplication *app, const char *name) // create file dialogs: // session file dialog - mp_session_fdia = new lay::FileDialog (this, - tl::to_string (QObject::tr ("Session File")), - tl::to_string (QObject::tr ("Session files (*.lys);;All files (*)")), + mp_session_fdia = new lay::FileDialog (this, + tl::to_string (QObject::tr ("Session File")), + tl::to_string (QObject::tr ("Session files (*.lys);;All files (*)")), "lys"); // bookmarks file dialog - mp_bookmarks_fdia = new lay::FileDialog (this, - tl::to_string (QObject::tr ("Bookmarks File")), - tl::to_string (QObject::tr ("Bookmark files (*.lyb);;All files (*)")), + mp_bookmarks_fdia = new lay::FileDialog (this, + tl::to_string (QObject::tr ("Bookmarks File")), + tl::to_string (QObject::tr ("Bookmark files (*.lyb);;All files (*)")), "lyb"); // layer properties - mp_lprops_fdia = new lay::FileDialog (this, - tl::to_string (QObject::tr ("Layer Properties File")), - tl::to_string (QObject::tr ("Layer properties files (*.lyp);;All files (*)")), + mp_lprops_fdia = new lay::FileDialog (this, + tl::to_string (QObject::tr ("Layer Properties File")), + tl::to_string (QObject::tr ("Layer properties files (*.lyp);;All files (*)")), "lyp"); // screenshots - mp_screenshot_fdia = new lay::FileDialog (this, - tl::to_string (QObject::tr ("Screenshot")), - tl::to_string (QObject::tr ("PNG files (*.png);;All files (*)")), + mp_screenshot_fdia = new lay::FileDialog (this, + tl::to_string (QObject::tr ("Screenshot")), + tl::to_string (QObject::tr ("PNG files (*.png);;All files (*)")), "png"); - + // layout file dialog std::string fmts = tl::to_string (QObject::tr ("All layout files (")); for (tl::Registrar::iterator rdr = tl::Registrar::begin (); rdr != tl::Registrar::end (); ++rdr) { @@ -737,11 +737,11 @@ MainWindow::~MainWindow () mp_assistant = 0; } -void +void MainWindow::init_menu () { // default menu layout - + MenuLayoutEntry empty_menu [] = { MenuLayoutEntry::last () }; @@ -1010,7 +1010,7 @@ MainWindow::init_menu () lay::LayoutView::init_menu (*mp_menu); lay::Navigator::init_menu (*mp_menu); - // Fill the mode menu file items from the intrinsic mouse modes + // Fill the mode menu file items from the intrinsic mouse modes // TODO: map the intrinsic modes to standard plugins and remove this code along // with related code in LayoutView. After this we can simplify the menu inititialization // inside PluginDeclaration as well. @@ -1030,7 +1030,7 @@ MainWindow::init_menu () if (tab) { name = std::string (*t, 0, tab - t->c_str ()); title = tab + 1; - } + } Action action (title); action.set_checkable (true); @@ -1073,14 +1073,14 @@ MainWindow::init_menu () for (std::vector::const_iterator g = edit_mode_grp.begin (); g != edit_mode_grp.end (); ++g) { mp_menu->action (*g).set_visible (! view_mode); } - + std::vector view_mode_grp = mp_menu->group ("view_mode"); for (std::vector::const_iterator g = view_mode_grp.begin (); g != view_mode_grp.end (); ++g) { mp_menu->action (*g).set_visible (view_mode); } } -void +void MainWindow::dock_widget_visibility_changed (bool /*visible*/) { if (sender () == mp_lp_dock_widget) { @@ -1294,8 +1294,8 @@ MainWindow::about_to_exec () // TODO: later, each view may get it's own editable flag if (lay::Application::instance () && !lay::Application::instance ()->is_editable ()) { - TipDialog td (this, - tl::to_string (QObject::tr ("KLayout has been started in viewer mode. In this mode, editor functions are not available.\n\nTo enable these functions, start KLayout in editor mode by using the \"-e\" command line switch or select it as the default mode in the setup dialog. Choose \"Setup\" in the \"File\" menu and check \"Use editing mode by default\" on the \"Editing Mode\" page in the \"Application\" section.")), + TipDialog td (this, + tl::to_string (QObject::tr ("KLayout has been started in viewer mode. In this mode, editor functions are not available.\n\nTo enable these functions, start KLayout in editor mode by using the \"-e\" command line switch or select it as the default mode in the setup dialog. Choose \"Setup\" in the \"File\" menu and check \"Use editing mode by default\" on the \"Editing Mode\" page in the \"Application\" section.")), "editor-mode"); if (td.exec_dialog ()) { // Don't bother the user with more dialogs. @@ -1306,8 +1306,8 @@ MainWindow::about_to_exec () f = false; config_get (cfg_no_stipple, f); if (f) { - TipDialog td (this, - tl::to_string (QObject::tr ("Layers are shown without fill because fill has been intentionally turned off. This can be confusing since selecting a stipple does not have an effect in this case.\n\nTo turn this feature off, uncheck \"Show Layers Without Fill\" in the \"View\" menu.")), + TipDialog td (this, + tl::to_string (QObject::tr ("Layers are shown without fill because fill has been intentionally turned off. This can be confusing since selecting a stipple does not have an effect in this case.\n\nTo turn this feature off, uncheck \"Show Layers Without Fill\" in the \"View\" menu.")), "no-stipple"); if (td.exec_dialog ()) { // Don't bother the user with more dialogs. @@ -1318,8 +1318,8 @@ MainWindow::about_to_exec () f = false; config_get (cfg_hide_empty_layers, f); if (f) { - TipDialog td (this, - tl::to_string (QObject::tr ("The \"Hide Empty Layers\" feature is enabled. This can be confusing, in particular in edit mode, because layers are not shown although they are actually present.\n\nTo disable this feature, uncheck \"Hide Empty Layers\" in the layer panel's context menu.")), + TipDialog td (this, + tl::to_string (QObject::tr ("The \"Hide Empty Layers\" feature is enabled. This can be confusing, in particular in edit mode, because layers are not shown although they are actually present.\n\nTo disable this feature, uncheck \"Hide Empty Layers\" in the layer panel's context menu.")), "hide-empty-layers"); if (td.exec_dialog ()) { // Don't bother the user with more dialogs. @@ -1330,9 +1330,9 @@ MainWindow::about_to_exec () edt::combine_mode_type cm = edt::CM_Add; config_get (edt::cfg_edit_combine_mode, cm, edt::CMConverter ()); if (lay::Application::instance ()->is_editable () && cm != edt::CM_Add) { - lay::TipDialog td (QApplication::activeWindow (), + lay::TipDialog td (QApplication::activeWindow (), tl::to_string (QObject::tr ("The background combination mode of the shape editor is set to some other mode than 'Add'.\n" - "This can be confusing, because a shape may not be drawn as expected.\n\nTo switch back to normal mode, choose 'Add' for the background combination mode in the toolbar.")), + "This can be confusing, because a shape may not be drawn as expected.\n\nTo switch back to normal mode, choose 'Add' for the background combination mode in the toolbar.")), "has-non-add-edit-combine-mode"); if (td.exec_dialog ()) { // Don't bother the user with more dialogs. @@ -1341,13 +1341,13 @@ MainWindow::about_to_exec () } } -void +void MainWindow::tech_message (const std::string &s) { mp_tech_status_label->setText(tl::to_qstring (s)); } -void +void MainWindow::format_message () { QFontMetrics fm (mp_msg_label->font ()); @@ -1401,7 +1401,7 @@ MainWindow::format_message () mp_msg_label->setToolTip (tl::to_qstring (full_message)); } -void +void MainWindow::message (const std::string &s, int ms) { m_message = s; @@ -1416,7 +1416,7 @@ MainWindow::clear_message () m_message_timer.start (0); } -void +void MainWindow::message_timer () { m_message.clear (); @@ -1426,7 +1426,7 @@ MainWindow::message_timer () void MainWindow::config_finalize () { - // Not set the window state: this ensures we have handled cfg_window_geometry + // Not set the window state: this ensures we have handled cfg_window_geometry // before we restore the state if (! m_config_window_state.empty ()) { QByteArray state = QByteArray::fromBase64 (m_config_window_state.c_str ()); @@ -1442,7 +1442,7 @@ MainWindow::config_finalize () std::vector group = menu ()->group ("default_grids_group"); for (std::vector::const_iterator t = group.begin (); t != group.end (); ++t) { - std::vector items = menu ()->items (*t); + std::vector items = menu ()->items (*t); for (std::vector::const_iterator i = items.begin (); i != items.end (); ++i) { menu ()->delete_item (*i); } @@ -1474,11 +1474,11 @@ MainWindow::config_finalize () } - // make the changes visible in the setup form if the form is visible + // make the changes visible in the setup form if the form is visible mp_setup_form->setup (); } -bool +bool MainWindow::configure (const std::string &name, const std::string &value) { std::map >::iterator ca = m_configuration_actions.find (name); @@ -1498,7 +1498,7 @@ MainWindow::configure (const std::string &name, const std::string &value) } else if (name == cfg_circle_points) { - // pseudo-configuration: set db::set_num_circle_points + // pseudo-configuration: set db::set_num_circle_points int cp = 16; tl::from_string (value, cp); if (cp != int (db::num_circle_points ())) { @@ -1513,7 +1513,7 @@ MainWindow::configure (const std::string &name, const std::string &value) m_default_grids.clear (); m_default_grids_updated = true; - // convert the list of grids to a list of doubles + // convert the list of grids to a list of doubles while (! ex.at_end ()) { double g = 0.0; if (! ex.try_read (g)) { @@ -1535,7 +1535,7 @@ MainWindow::configure (const std::string &name, const std::string &value) palette.from_string (value); } } catch (...) { - // ignore errors: just reset the palette + // ignore errors: just reset the palette palette = lay::StipplePalette::default_palette (); } @@ -1573,7 +1573,7 @@ MainWindow::configure (const std::string &name, const std::string &value) palette.from_string (value); } } catch (...) { - // ignore errors: just reset the palette + // ignore errors: just reset the palette palette = lay::ColorPalette::default_palette (); } @@ -1615,7 +1615,7 @@ MainWindow::configure (const std::string &name, const std::string &value) } else if (name == cfg_window_state) { - // restore the state on config_finalize to ensure we have handled it after + // restore the state on config_finalize to ensure we have handled it after // restoring the geometry m_config_window_state = value; return true; @@ -1788,7 +1788,7 @@ MainWindow::edits_enabled () const return !current_view () || current_view ()->edits_enabled (); } -void +void MainWindow::edits_enabled_changed () { bool enable = edits_enabled (); @@ -1799,10 +1799,10 @@ MainWindow::edits_enabled_changed () } } -void +void MainWindow::libraries_changed () { - // if the libraries have changed, remove all selections and cancel any operations to avoid + // if the libraries have changed, remove all selections and cancel any operations to avoid // that the view refers to an invalid instance or shape for (std::vector ::iterator vp = mp_views.begin (); vp != mp_views.end (); ++vp) { (*vp)->clear_selection (); @@ -1819,7 +1819,7 @@ MainWindow::read_dock_widget_state () config_set (cfg_show_layer_toolbox, tl::to_string (!mp_layer_toolbox_dock_widget->isHidden ())); } -void +void MainWindow::update_dock_widget_state () { if (m_hp_visible) { @@ -1879,7 +1879,7 @@ MainWindow::exit () } } -int +int MainWindow::dirty_files (std::string &dirty_files) { int dirty_layouts = 0; @@ -1917,7 +1917,7 @@ MainWindow::can_close () bool can_close = false; - can_close = (QMessageBox::warning (this, + can_close = (QMessageBox::warning (this, QObject::tr ("Application Busy"), QObject::tr ("The application is busy.\nYou can close the application now, but any unsaved data will be lost.\n\nPress 'Yes' to end the application now."), QMessageBox::Yes | QMessageBox::No, @@ -1972,7 +1972,7 @@ MainWindow::do_close () void MainWindow::save_state_to_config () { - // save the dock widget state with all views closed (that state can be + // save the dock widget state with all views closed (that state can be // used for staring klayout without any layout) config_set (cfg_window_geometry, (const char *) saveGeometry ().toBase64 ().data ()); config_set (cfg_window_state, (const char *) saveState ().toBase64 ().data ()); @@ -1984,7 +1984,7 @@ MainWindow::resizeEvent (QResizeEvent *) format_message (); } -void +void MainWindow::closeEvent (QCloseEvent *event) { if (! m_exited) { @@ -2137,7 +2137,7 @@ MainWindow::index_of (const lay::LayoutView *view) const return -1; } -int +int MainWindow::current_view_index () const { return index_of (current_view ()); @@ -2149,7 +2149,7 @@ MainWindow::current_view () const return lay::LayoutView::current (); } -void +void MainWindow::cm_show_properties () { if (current_view ()) { @@ -2157,7 +2157,7 @@ MainWindow::cm_show_properties () } } -void +void MainWindow::cm_delete () { BEGIN_PROTECTED @@ -2172,7 +2172,7 @@ MainWindow::cm_delete () END_PROTECTED } -void +void MainWindow::cm_lv_paste () { BEGIN_PROTECTED @@ -2180,7 +2180,7 @@ MainWindow::cm_lv_paste () END_PROTECTED } -void +void MainWindow::cm_lv_cut () { BEGIN_PROTECTED @@ -2188,7 +2188,7 @@ MainWindow::cm_lv_cut () END_PROTECTED } -void +void MainWindow::cm_lv_copy () { BEGIN_PROTECTED @@ -2196,7 +2196,7 @@ MainWindow::cm_lv_copy () END_PROTECTED } -void +void MainWindow::cm_cell_paste () { BEGIN_PROTECTED @@ -2204,7 +2204,7 @@ MainWindow::cm_cell_paste () END_PROTECTED } -void +void MainWindow::cm_cell_cut () { BEGIN_PROTECTED @@ -2212,7 +2212,7 @@ MainWindow::cm_cell_cut () END_PROTECTED } -void +void MainWindow::cm_cell_copy () { BEGIN_PROTECTED @@ -2220,14 +2220,14 @@ MainWindow::cm_cell_copy () END_PROTECTED } -void +void MainWindow::cm_duplicate () { BEGIN_PROTECTED if (current_view () && current_view ()->has_selection ()) { - // Do duplicate simply by concatenating copy & paste currently. + // Do duplicate simply by concatenating copy & paste currently. // Save the clipboard state before in order to preserve the current content db::Clipboard saved_clipboard; db::Clipboard::instance ().swap (saved_clipboard); @@ -2248,7 +2248,7 @@ MainWindow::cm_duplicate () END_PROTECTED } -void +void MainWindow::cm_copy () { BEGIN_PROTECTED @@ -2261,7 +2261,7 @@ MainWindow::cm_copy () END_PROTECTED } -void +void MainWindow::cm_paste () { BEGIN_PROTECTED @@ -2275,7 +2275,7 @@ MainWindow::cm_paste () END_PROTECTED } -void +void MainWindow::cm_cut () { BEGIN_PROTECTED @@ -2289,7 +2289,7 @@ MainWindow::cm_cut () END_PROTECTED } -void +void MainWindow::intrinsic_mode_triggered () { BEGIN_PROTECTED @@ -2322,7 +2322,7 @@ MainWindow::select_mode (int m) // Update the actions by checking the one that is selected programmatically. Use the toolbar menu for reference. // TODO: this code needs to be kept aligned with the implementation of PluginDeclaration::init_menu () - // It's not easy to move the functionality to PluginDeclaration because some of the modes are not mapped to + // It's not easy to move the functionality to PluginDeclaration because some of the modes are not mapped to // Plugin's yet (selection, move). std::vector items = menu ()->items ("@toolbar"); for (std::vector::const_iterator i = items.begin (); i != items.end (); ++i) { @@ -2336,7 +2336,7 @@ MainWindow::select_mode (int m) } } -void +void MainWindow::enable_all () { BEGIN_PROTECTED @@ -2348,7 +2348,7 @@ MainWindow::enable_all () END_PROTECTED } -void +void MainWindow::disable_all () { BEGIN_PROTECTED @@ -2360,7 +2360,7 @@ MainWindow::disable_all () END_PROTECTED } -void +void MainWindow::cm_unselect_all () { BEGIN_PROTECTED @@ -2385,7 +2385,7 @@ MainWindow::cm_select_all () BEGIN_PROTECTED if (current_view ()) { - // TODO: "select all" with an empty box is not well implemented in most services. + // TODO: "select all" with an empty box is not well implemented in most services. // Hence we use the overlapp box currently. current_view ()->select (current_view ()->full_box (), lay::Editable::Replace); } @@ -2393,7 +2393,7 @@ MainWindow::cm_select_all () END_PROTECTED } -void +void MainWindow::cm_undo () { BEGIN_PROTECTED @@ -2427,7 +2427,7 @@ MainWindow::cm_redo () END_PROTECTED } -void +void MainWindow::bookmark_menu_show () { if (mp_menu->is_valid ("bookmark_menu.goto_bookmark_menu")) { @@ -2450,7 +2450,7 @@ MainWindow::bookmark_menu_show () QAction *action = goto_bookmark_menu->addAction (tl::to_qstring (bookmarks.name (i))); action->setObjectName (tl::to_qstring (tl::sprintf ("bookmark_%d", i + 1))); gtf::action_connect (action, SIGNAL (triggered ()), this, SLOT (goto_bookmark ())); - action->setData (QVariant (int (i))); + action->setData (QVariant (int (i))); } } @@ -2708,7 +2708,7 @@ MainWindow::cm_zoom_out () END_PROTECTED } -void +void MainWindow::update_action_states () { try { @@ -2781,7 +2781,7 @@ MainWindow::update_action_states () void MainWindow::cm_redraw () { - BEGIN_PROTECTED + BEGIN_PROTECTED redraw (); END_PROTECTED } @@ -2797,7 +2797,7 @@ MainWindow::redraw () void MainWindow::cm_cancel () { - BEGIN_PROTECTED + BEGIN_PROTECTED cancel (); END_PROTECTED } @@ -2862,10 +2862,10 @@ MainWindow::load_layer_properties (const std::string &fn, int cv_index, bool all } } -bool +bool MainWindow::is_single_cv_layer_properties_file (const std::string &fn) { - // If the file contains information for a single layout but we have multiple ones, + // If the file contains information for a single layout but we have multiple ones, // show the dialog to determine what layout to apply the information to. std::vector props; try { @@ -2878,7 +2878,7 @@ MainWindow::is_single_cv_layer_properties_file (const std::string &fn) lay::LayerPropertiesList::load (in, props); } - // Collect all cv indices in the layer properties + // Collect all cv indices in the layer properties std::set cv; for (std::vector::const_iterator p = props.begin (); p != props.end (); ++p) { for (lay::LayerPropertiesConstIterator lp = p->begin_const_recursive (); ! lp.at_end (); ++lp) { @@ -2967,8 +2967,8 @@ MainWindow::cm_save_session () std::string df_list; int dirty_layouts = dirty_files (df_list); - if (dirty_layouts == 0 || - QMessageBox::warning (this, + if (dirty_layouts == 0 || + QMessageBox::warning (this, QObject::tr ("Save Needed For Some Layouts"), tl::to_qstring (tl::to_string (QObject::tr ("The following layouts need saving.\nThese layouts must be saved manually:\n\n")) + df_list + "\n\nPress 'Ok' to continue."), QMessageBox::Ok | QMessageBox::Cancel, @@ -3092,9 +3092,9 @@ MainWindow::cm_select_cell () CellSelectionForm form (0, current_view (), "cell_selection_form"); - if (form.exec () == QDialog::Accepted && + if (form.exec () == QDialog::Accepted && form.selected_cellview_index () >= 0) { - current_view ()->select_cell (form.selected_cellview ().combined_unspecific_path (), form.selected_cellview_index ()); + current_view ()->select_cell (form.selected_cellview ().combined_unspecific_path (), form.selected_cellview_index ()); current_view ()->set_current_cell_path (form.selected_cellview_index (), form.selected_cellview ().combined_unspecific_path ()); current_view ()->zoom_fit (); } @@ -3369,25 +3369,25 @@ MainWindow::select_view (int index) } } -void +void MainWindow::cm_open_too () { open (2); } -void +void MainWindow::cm_open_new_view () { open (1); } -void +void MainWindow::cm_open () { open (0); } -void +void MainWindow::cm_pull_in () { BEGIN_PROTECTED @@ -3469,13 +3469,13 @@ MainWindow::cm_writer_options () mp_layout_save_options->edit_global_options (this, lay::Technologies::instance ()); } -void +void MainWindow::cm_new_panel () { create_view (); } -void +void MainWindow::cm_new_layout () { BEGIN_PROTECTED @@ -3517,13 +3517,13 @@ MainWindow::call_on_current_view (void (lay::LayoutView::*func) (), const std::s END_PROTECTED } -void +void MainWindow::cm_adjust_origin () { call_on_current_view (&lay::LayoutView::cm_align_cell_origin, tl::to_string (QObject::tr ("adjust cell origin"))); } -void +void MainWindow::cm_new_cell () { // TODO: move this function to lay::LayoutView @@ -3535,7 +3535,7 @@ MainWindow::cm_new_cell () throw tl::Exception (tl::to_string (QObject::tr ("No view open to create a new cell inside"))); } - NewCellPropertiesDialog cell_prop_dia (this); + NewCellPropertiesDialog cell_prop_dia (this); if (cell_prop_dia.exec_dialog (& curr->cellview (curr->active_cellview_index ())->layout (), m_new_cell_cell_name, m_new_cell_window_size)) { db::cell_index_type new_ci = curr->new_cell (curr->active_cellview_index (), m_new_cell_cell_name.c_str ()); @@ -3565,127 +3565,127 @@ MainWindow::cm_lay_convert_to_static () call_on_current_view (&lay::LayoutView::cm_lay_convert_to_static, tl::to_string (QObject::tr ("convert all cells to static"))); } -void +void MainWindow::cm_lay_move () { call_on_current_view (&lay::LayoutView::cm_lay_move, tl::to_string (QObject::tr ("move layout"))); } -void +void MainWindow::cm_lay_scale () { call_on_current_view (&lay::LayoutView::cm_lay_scale, tl::to_string (QObject::tr ("scale layout"))); } -void +void MainWindow::cm_lay_free_rot () { call_on_current_view (&lay::LayoutView::cm_lay_free_rot, tl::to_string (QObject::tr ("free rotation of layout"))); } -void +void MainWindow::cm_lay_rot_ccw () { call_on_current_view (&lay::LayoutView::cm_lay_rot_ccw, tl::to_string (QObject::tr ("counter clockwise rotation of layout"))); } -void +void MainWindow::cm_lay_rot_cw () { call_on_current_view (&lay::LayoutView::cm_lay_rot_cw, tl::to_string (QObject::tr ("clockwise rotation of layout"))); } -void +void MainWindow::cm_lay_flip_y () { call_on_current_view (&lay::LayoutView::cm_lay_flip_y, tl::to_string (QObject::tr ("vertical flip of layout"))); } -void +void MainWindow::cm_lay_flip_x () { call_on_current_view (&lay::LayoutView::cm_lay_flip_x, tl::to_string (QObject::tr ("horizontal flip of layout"))); } -void +void MainWindow::cm_sel_move () { call_on_current_view (&lay::LayoutView::cm_sel_move, tl::to_string (QObject::tr ("move selection"))); } -void +void MainWindow::cm_sel_move_to () { call_on_current_view (&lay::LayoutView::cm_sel_move_to, tl::to_string (QObject::tr ("move selection to position"))); } -void +void MainWindow::cm_sel_scale () { call_on_current_view (&lay::LayoutView::cm_sel_scale, tl::to_string (QObject::tr ("scale selection"))); } -void +void MainWindow::cm_sel_free_rot () { call_on_current_view (&lay::LayoutView::cm_sel_free_rot, tl::to_string (QObject::tr ("free rotation of selection"))); } -void +void MainWindow::cm_sel_rot_ccw () { call_on_current_view (&lay::LayoutView::cm_sel_rot_ccw, tl::to_string (QObject::tr ("counter clockwise rotation of selection"))); } -void +void MainWindow::cm_sel_rot_cw () { call_on_current_view (&lay::LayoutView::cm_sel_rot_cw, tl::to_string (QObject::tr ("clockwise rotation of selection"))); } -void +void MainWindow::cm_sel_flip_y () { call_on_current_view (&lay::LayoutView::cm_sel_flip_y, tl::to_string (QObject::tr ("vertical flip of selection"))); } -void +void MainWindow::cm_sel_flip_x () { call_on_current_view (&lay::LayoutView::cm_sel_flip_x, tl::to_string (QObject::tr ("horizontal flip of selection"))); } -void +void MainWindow::cm_edit_layer () { call_on_current_view (&lay::LayoutView::cm_edit_layer, tl::to_string (QObject::tr ("edit a layer specification"))); } -void +void MainWindow::cm_delete_layer () { call_on_current_view (&lay::LayoutView::cm_delete_layer, tl::to_string (QObject::tr ("delete a layer"))); } -void +void MainWindow::cm_clear_layer () { call_on_current_view (&lay::LayoutView::cm_clear_layer, tl::to_string (QObject::tr ("clear a layer"))); } -void +void MainWindow::cm_copy_layer () { call_on_current_view (&lay::LayoutView::cm_copy_layer, tl::to_string (QObject::tr ("copy layer"))); } -void +void MainWindow::cm_new_layer () { call_on_current_view (&lay::LayoutView::cm_new_layer, tl::to_string (QObject::tr ("create a new layer"))); } -void +void MainWindow::cm_layout_props () { BEGIN_PROTECTED @@ -3701,7 +3701,7 @@ MainWindow::cm_layout_props () END_PROTECTED } -void +void MainWindow::cm_layout_stats () { BEGIN_PROTECTED @@ -3717,7 +3717,7 @@ MainWindow::cm_layout_stats () END_PROTECTED } -void +void MainWindow::cm_clone () { BEGIN_PROTECTED @@ -3744,7 +3744,7 @@ MainWindow::clone_current_view () connect (view, SIGNAL (clear_current_pos ()), this, SLOT (clear_current_pos ())); mp_views.push_back (view); - // we must resize the widget here to set the geometry properly. + // we must resize the widget here to set the geometry properly. // This is required to make zoom_fit work. view->setGeometry (0, 0, mp_view_stack->width (), mp_view_stack->height ()); view->show (); @@ -3785,31 +3785,31 @@ MainWindow::clone_current_view () update_dock_widget_state (); } -void +void MainWindow::cm_close_all () { interactive_close_view (-1, false); } - -void + +void MainWindow::cm_close () { interactive_close_view (index_of (lay::LayoutView::current ()), false); } - + void MainWindow::tab_close_requested (int index) { interactive_close_view (index, true); } -void +void MainWindow::interactive_close_view (int index, bool all_cellviews) { if (index < 0) { // close all views - + bool can_close = true; int dirty_layouts = 0; @@ -3886,7 +3886,7 @@ MainWindow::interactive_close_view (int index, bool all_cellviews) SelectCellViewForm form (0, view (index), tl::to_string (QObject::tr ("Select Layouts To Close"))); form.set_selection (view (index)->active_cellview_index ()); - + if (form.exec () != QDialog::Accepted) { return; } @@ -3897,7 +3897,7 @@ MainWindow::interactive_close_view (int index, bool all_cellviews) } } - + } else if (view (index)->cellviews () > 0) { selected.push_back (0); } @@ -3931,8 +3931,8 @@ MainWindow::interactive_close_view (int index, bool all_cellviews) } } - // only report layouts as dirty which will vanish if we would close all layouts - if (count <= 0) { + // only report layouts as dirty which will vanish if we would close all layouts + if (count <= 0) { ++dirty_layouts; if (dirty_layouts == max_dirty_files) { dirty_files += "\n..."; @@ -3993,13 +3993,13 @@ MainWindow::interactive_close_view (int index, bool all_cellviews) } -void +void MainWindow::close_current_view () { close_view (index_of (lay::LayoutView::current ())); } -void +void MainWindow::close_view (int index) { if (view (index)) { @@ -4057,8 +4057,8 @@ MainWindow::close_view (int index) void MainWindow::cm_reload () -{ - BEGIN_PROTECTED +{ + BEGIN_PROTECTED if (current_view ()) { @@ -4068,11 +4068,11 @@ MainWindow::cm_reload () SelectCellViewForm form (0, current_view (), tl::to_string (QObject::tr ("Select Layouts To Reload"))); form.select_all (); - + if (form.exec () == QDialog::Accepted) { selected = form.selected_cellviews (); } - + } else if (current_view ()->cellviews () > 0) { selected.push_back (0); } @@ -4172,7 +4172,7 @@ MainWindow::add_mru (const std::string &fn_rel, const std::string &tech) config_set (cfg_mru, config_str); } -void +void MainWindow::file_menu_show () { if (mp_menu->is_valid ("file_menu.open_recent_menu")) { @@ -4263,10 +4263,10 @@ MainWindow::open_recent () END_PROTECTED } -void +void MainWindow::open (int mode) { - BEGIN_PROTECTED + BEGIN_PROTECTED static std::vector files; if (! mp_layout_fdia->get_open (files)) { @@ -4340,7 +4340,7 @@ MainWindow::create_layout (const std::string &technology, int mode) return create_or_load_layout (0, 0, technology, mode); } -int +int MainWindow::do_create_view () { // create a new view @@ -4355,7 +4355,7 @@ MainWindow::do_create_view () mp_views.push_back (view); - // we must resize the widget here to set the geometry properly. + // we must resize the widget here to set the geometry properly. // This is required to make zoom_fit work. view->setGeometry (0, 0, mp_view_stack->width (), mp_view_stack->height ()); view->show (); @@ -4430,7 +4430,7 @@ MainWindow::create_or_load_layout (const std::string *filename, const db::LoadLa } } - unsigned int cv_index = 0; + unsigned int cv_index = 0; try { @@ -4517,7 +4517,7 @@ MainWindow::update_tab_title (int i) } } -void +void MainWindow::view_title_changed () { int i = index_of (dynamic_cast (sender ())); @@ -4558,10 +4558,10 @@ MainWindow::grid_micron () const return m_grid_micron; } -void +void MainWindow::cm_inc_max_hier () { - BEGIN_PROTECTED + BEGIN_PROTECTED int new_to = get_max_hier_levels () + 1; set_hier_levels (std::make_pair (get_min_hier_levels (), new_to)); @@ -4569,10 +4569,10 @@ MainWindow::cm_inc_max_hier () END_PROTECTED } -void +void MainWindow::cm_dec_max_hier () { - BEGIN_PROTECTED + BEGIN_PROTECTED int new_to = get_max_hier_levels () > 0 ? get_max_hier_levels () - 1 : 0; set_hier_levels (std::make_pair (std::min (get_min_hier_levels (), new_to), new_to)); @@ -4580,10 +4580,10 @@ MainWindow::cm_dec_max_hier () END_PROTECTED } -void +void MainWindow::cm_max_hier () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->max_hier (); @@ -4592,31 +4592,31 @@ MainWindow::cm_max_hier () END_PROTECTED } -void +void MainWindow::cm_max_hier_0 () { - BEGIN_PROTECTED + BEGIN_PROTECTED set_hier_levels (std::make_pair (std::min (get_min_hier_levels (), 0), 0)); END_PROTECTED } -void +void MainWindow::cm_max_hier_1 () { - BEGIN_PROTECTED + BEGIN_PROTECTED set_hier_levels (std::make_pair (std::min (get_min_hier_levels (), 0), 1)); END_PROTECTED } -void +void MainWindow::set_hier_levels (std::pair l) { if (current_view () && l != get_hier_levels ()) { current_view ()->set_hier_levels (l); - } + } } -std::pair +std::pair MainWindow::get_hier_levels () const { if (current_view ()) { @@ -4628,10 +4628,10 @@ MainWindow::get_hier_levels () const } } -void +void MainWindow::cm_prev_display_state () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (has_prev_display_state ()) { current_view ()->prev_display_state (); @@ -4640,7 +4640,7 @@ MainWindow::cm_prev_display_state () END_PROTECTED } -bool +bool MainWindow::has_prev_display_state () { if (current_view ()) { @@ -4650,10 +4650,10 @@ MainWindow::has_prev_display_state () } } -void +void MainWindow::cm_next_display_state () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (has_next_display_state ()) { current_view ()->next_display_state (); @@ -4662,7 +4662,7 @@ MainWindow::cm_next_display_state () END_PROTECTED } -bool +bool MainWindow::has_next_display_state () { if (current_view ()) { @@ -4672,7 +4672,7 @@ MainWindow::has_next_display_state () } } -void +void MainWindow::set_synchronous (bool sync_mode) { m_synchronous = sync_mode; @@ -4682,7 +4682,7 @@ MainWindow::set_synchronous (bool sync_mode) } void -MainWindow::current_pos (double x, double y, bool dbu_units) +MainWindow::current_pos (double x, double y, bool dbu_units) { mp_cpx_label->setText (tl::to_qstring (dbu_units ? tl::db_to_string (x) : tl::micron_to_string (x))); mp_cpy_label->setText (tl::to_qstring (dbu_units ? tl::db_to_string (y) : tl::micron_to_string (y))); @@ -4822,7 +4822,7 @@ MainWindow::cm_technologies () } } -void +void MainWindow::show_macro_editor (const std::string &cat, bool add) { lay::MacroController *mc = lay::MacroController::instance (); @@ -4864,14 +4864,14 @@ MainWindow::cm_show_assistant () mp_assistant->raise (); } -void +void MainWindow::show_help (const QString &url) { show_assistant_url (tl::to_string (url), true); } -void -MainWindow::show_assistant_url (const std::string &url, bool modal) +void +MainWindow::show_assistant_url (const std::string &url, bool modal) { if (modal) { @@ -4894,8 +4894,8 @@ MainWindow::show_assistant_url (const std::string &url, bool modal) } } -void -MainWindow::show_assistant_topic (const std::string &s, bool modal) +void +MainWindow::show_assistant_topic (const std::string &s, bool modal) { if (modal) { @@ -4966,7 +4966,7 @@ MainWindow::create_config_action (const std::string &cname, const std::string &c return ca; } -void +void MainWindow::register_config_action (const std::string &name, lay::ConfigureAction *action) { std::map >::iterator ca = m_configuration_actions.insert (std::make_pair (name, std::vector ())).first; @@ -4978,8 +4978,8 @@ MainWindow::register_config_action (const std::string &name, lay::ConfigureActio ca->second.push_back (action); } - -void + +void MainWindow::unregister_config_action (const std::string &name, lay::ConfigureAction *action) { std::map >::iterator ca = m_configuration_actions.find (name); @@ -4993,10 +4993,10 @@ MainWindow::unregister_config_action (const std::string &name, lay::ConfigureAct } } -void +void MainWindow::menu_activated (const std::string &symbol) { - // TODO: this can be part of the Plugin scheme, but the plugin root has no idea which is the active + // TODO: this can be part of the Plugin scheme, but the plugin root has no idea which is the active // view. if (current_view ()) { current_view ()->menu_activated (symbol); @@ -5027,7 +5027,7 @@ MainWindow::cm_cell_user_properties () void MainWindow::cm_cell_delete () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_cell_delete (); @@ -5039,7 +5039,7 @@ MainWindow::cm_cell_delete () void MainWindow::cm_cell_replace () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_cell_replace (); @@ -5051,7 +5051,7 @@ MainWindow::cm_cell_replace () void MainWindow::cm_cell_rename () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_cell_rename (); @@ -5063,7 +5063,7 @@ MainWindow::cm_cell_rename () void MainWindow::cm_cell_flatten () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_cell_flatten (); @@ -5075,7 +5075,7 @@ MainWindow::cm_cell_flatten () void MainWindow::cm_cell_select () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_cell_select (); @@ -5087,7 +5087,7 @@ MainWindow::cm_cell_select () void MainWindow::cm_cell_hide () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_cell_hide (); @@ -5099,7 +5099,7 @@ MainWindow::cm_cell_hide () void MainWindow::cm_cell_show () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_cell_show (); @@ -5111,7 +5111,7 @@ MainWindow::cm_cell_show () void MainWindow::cm_cell_show_all () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_cell_show_all (); @@ -5123,7 +5123,7 @@ MainWindow::cm_cell_show_all () void MainWindow::cm_lv_select_all () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_select_all (); @@ -5135,7 +5135,7 @@ MainWindow::cm_lv_select_all () void MainWindow::cm_lv_new_tab () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_new_tab (); @@ -5147,7 +5147,7 @@ MainWindow::cm_lv_new_tab () void MainWindow::cm_lv_rename_tab () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_rename_tab (); @@ -5159,7 +5159,7 @@ MainWindow::cm_lv_rename_tab () void MainWindow::cm_lv_remove_tab () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_remove_tab (); @@ -5171,7 +5171,7 @@ MainWindow::cm_lv_remove_tab () void MainWindow::cm_lv_make_invalid () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_make_invalid (); @@ -5183,7 +5183,7 @@ MainWindow::cm_lv_make_invalid () void MainWindow::cm_lv_make_valid () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_make_valid (); @@ -5195,7 +5195,7 @@ MainWindow::cm_lv_make_valid () void MainWindow::cm_lv_hide_all () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_hide_all (); @@ -5207,7 +5207,7 @@ MainWindow::cm_lv_hide_all () void MainWindow::cm_lv_hide () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_hide (); @@ -5219,7 +5219,7 @@ MainWindow::cm_lv_hide () void MainWindow::cm_lv_show_only () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_show_only (); @@ -5231,7 +5231,7 @@ MainWindow::cm_lv_show_only () void MainWindow::cm_lv_show_all () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_show_all (); @@ -5243,7 +5243,7 @@ MainWindow::cm_lv_show_all () void MainWindow::cm_lv_show () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_show (); @@ -5255,7 +5255,7 @@ MainWindow::cm_lv_show () void MainWindow::cm_lv_rename () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_rename (); @@ -5267,7 +5267,7 @@ MainWindow::cm_lv_rename () void MainWindow::cm_lv_delete () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_delete (); @@ -5279,7 +5279,7 @@ MainWindow::cm_lv_delete () void MainWindow::cm_lv_insert () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_insert (); @@ -5291,7 +5291,7 @@ MainWindow::cm_lv_insert () void MainWindow::cm_lv_group () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_group (); @@ -5303,7 +5303,7 @@ MainWindow::cm_lv_group () void MainWindow::cm_lv_ungroup () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_ungroup (); @@ -5315,7 +5315,7 @@ MainWindow::cm_lv_ungroup () void MainWindow::cm_lv_source () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_source (); @@ -5327,7 +5327,7 @@ MainWindow::cm_lv_source () void MainWindow::cm_lv_sort_by_name () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_sort_by_name (); @@ -5339,7 +5339,7 @@ MainWindow::cm_lv_sort_by_name () void MainWindow::cm_lv_sort_by_ild () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_sort_by_ild (); @@ -5351,7 +5351,7 @@ MainWindow::cm_lv_sort_by_ild () void MainWindow::cm_lv_sort_by_idl () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_sort_by_idl (); @@ -5363,7 +5363,7 @@ MainWindow::cm_lv_sort_by_idl () void MainWindow::cm_lv_sort_by_ldi () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_sort_by_ldi (); @@ -5375,7 +5375,7 @@ MainWindow::cm_lv_sort_by_ldi () void MainWindow::cm_lv_sort_by_dli () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_sort_by_dli (); @@ -5387,7 +5387,7 @@ MainWindow::cm_lv_sort_by_dli () void MainWindow::cm_lv_regroup_by_index () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_regroup_by_index (); @@ -5399,7 +5399,7 @@ MainWindow::cm_lv_regroup_by_index () void MainWindow::cm_lv_regroup_by_datatype () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_regroup_by_datatype (); @@ -5411,7 +5411,7 @@ MainWindow::cm_lv_regroup_by_datatype () void MainWindow::cm_lv_regroup_by_layer () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_regroup_by_layer (); @@ -5423,7 +5423,7 @@ MainWindow::cm_lv_regroup_by_layer () void MainWindow::cm_lv_regroup_flatten () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_regroup_flatten (); @@ -5435,7 +5435,7 @@ MainWindow::cm_lv_regroup_flatten () void MainWindow::cm_lv_expand_all () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_expand_all (); @@ -5447,7 +5447,7 @@ MainWindow::cm_lv_expand_all () void MainWindow::cm_lv_add_missing () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_add_missing (); @@ -5459,7 +5459,7 @@ MainWindow::cm_lv_add_missing () void MainWindow::cm_lv_remove_unused () { - BEGIN_PROTECTED + BEGIN_PROTECTED if (current_view ()) { current_view ()->cm_remove_unused (); @@ -5468,7 +5468,7 @@ MainWindow::cm_lv_remove_unused () END_PROTECTED } -void +void MainWindow::dragEnterEvent(QDragEnterEvent *event) { if (event->mimeData () && event->mimeData ()->hasUrls () && event->mimeData ()->urls ().size () >= 1) { @@ -5476,7 +5476,7 @@ MainWindow::dragEnterEvent(QDragEnterEvent *event) } } -void +void MainWindow::dropEvent(QDropEvent *event) { BEGIN_PROTECTED @@ -5492,12 +5492,12 @@ MainWindow::dropEvent(QDropEvent *event) if (eff_url.scheme () == QString::fromUtf8 ("file")) { path = url->toLocalFile (); -#if defined(__APPLE__) +#if defined(__APPLE__) && (QT_VERSION < 0x050401) //---------------------------------------------------------------------------------------- // By Kazunari Sekigawa (November 12, 2015) // // [Issue] - // When drag & dropping an GDS2/OASIS file from Finder, an error like below flags on: + // When drag & dropping a GDS2/OASIS file from Finder, an error like below flags on: // Unable to open file: /.file/id=6571367.1783076 (errno=20) // http://klayout.de/forum/comments.php?DiscussionID=733&page=1#Item_0 // @@ -5509,6 +5509,11 @@ MainWindow::dropEvent(QDropEvent *event) // https://bugreports.qt.io/browse/QTBUG-40449 // Sub: OS X Yosemite drag and drop file QUrl in this format: "file:///.file/id=......" //---------------------------------------------------------------------------------------- + // By Kazunari Sekigawa (December 12, 2017) + // + // This bug has been fixed in Qt 5.4.1. + // When KLayout 0.25 is built with Qt 5.8.0 or later, this workaround is not required. + //---------------------------------------------------------------------------------------- QString keystring = QString::fromUtf8("/.file/id="); if ( path.startsWith(keystring) ) { @@ -5640,7 +5645,7 @@ MainWindow::dropEvent(QDropEvent *event) END_PROTECTED } -void +void MainWindow::plugin_registered (lay::PluginDeclaration *cls) { // store current state in configuration @@ -5657,7 +5662,7 @@ MainWindow::plugin_registered (lay::PluginDeclaration *cls) config_setup (); } -void +void MainWindow::plugin_removed (lay::PluginDeclaration *cls) { cls->remove_menu_items (); From 0bb09eb2bac2ceafc8c8e092d15b1da69bd8525c Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Tue, 12 Dec 2017 22:20:53 +0900 Subject: [PATCH 11/60] Improve Bash scripts for building for Mac OSX. This refs #1. --- macbuild/macbuildQt4-yosemite.sh | 126 +++++++++++++++++++++++++++---- macbuild/macbuildQt5-yosemite.sh | 126 +++++++++++++++++++++++++++---- 2 files changed, 220 insertions(+), 32 deletions(-) diff --git a/macbuild/macbuildQt4-yosemite.sh b/macbuild/macbuildQt4-yosemite.sh index e04c0b150..9c619726d 100755 --- a/macbuild/macbuildQt4-yosemite.sh +++ b/macbuild/macbuildQt4-yosemite.sh @@ -1,21 +1,115 @@ #!/bin/bash - +#------------------------------------------------------------------------------ # Using Qt 4.8.7 from Mac Ports. # # Ruby: OSX native # Python: OSX native -./build.sh \ - -release \ - -qmake /opt/local/libexec/qt4/bin/qmake \ - -build ./qt4.build.macos-yosemite \ - -bin ./qt4.bin.macos-yosemite \ - -option -j4 \ - -with-qtbinding \ - -qt4 \ - -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby \ - -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ - -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ - -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib \ - -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ - -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ - | tee macbuildQt4.log +#------------------------------------------------------------------------------ +MacRuby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby +MacRubyInc=/System/Library/Frameworks/Ruby.framework/Headers +MacRubyLib=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib + +MacPython=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python +MacPythonInc=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 +MacPythonLib=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib + +MacQMake=/opt/local/libexec/qt4/bin/qmake +MacBinDir=./qt4.build.macos-yosemite +MacBuildDir=./qt4.bin.macos-yosemite +MacBuildLog=macbuildQt4-yosemite.log +#------------------------------------------------------------------------------ +function WithRubyPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt4 \ + -ruby $MacRuby \ + -rbinc $MacRubyInc \ + -rblib $MacRubyLib \ + -python $MacPython \ + -pyinc $MacPythonInc \ + -pylib $MacPythonLib 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithRuby() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt4 \ + -ruby $MacRuby \ + -rbinc $MacRubyInc \ + -rblib $MacRubyLib \ + -nopython 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt4 \ + -noruby \ + -python $MacPython \ + -pyinc $MacPythonInc \ + -pylib $MacPythonLib 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithoutRubytPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt4 \ + -noruby \ + -nopython 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function Usage() { + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "This script is for building KLayout for Mac OSX Yosemite" + echo " with Qt 4.8.7 from MacPorts" + echo "" + echo "USAGE:" + echo " $0 < 0 | 1 | 2 | 3 >" + echo " 0: support neither Ruby nor Python" + echo " 1: support both Ruby and Python" + echo " 2: support Ruby only" + echo " 3: support Python only" + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "" +} +#------------------------------------------------------------------------------ +if [ $# -ne 1 ]; then + Usage + exit +else + if [ "$1" = "0" ]; then + WithoutRubytPython + elif [ "$1" = "1" ]; then + WithRubyPython + elif [ "$1" = "2" ]; then + WithRuby + elif [ "$1" = "3" ]; then + WithPython + else + Usage + exit + fi +fi +#---------- +# EOF +#---------- diff --git a/macbuild/macbuildQt5-yosemite.sh b/macbuild/macbuildQt5-yosemite.sh index 6114a572d..6ecea529e 100755 --- a/macbuild/macbuildQt5-yosemite.sh +++ b/macbuild/macbuildQt5-yosemite.sh @@ -1,21 +1,115 @@ #!/bin/bash - +#------------------------------------------------------------------------------ # Using Qt 5.8.0 from Mac Ports. # # Ruby: OSX native # Python: OSX native -./build.sh \ - -release \ - -qmake /opt/local/libexec/qt5/bin/qmake \ - -build ./qt5.build.macos-yosemite \ - -bin ./qt5.bin.macos-yosemite \ - -option -j4 \ - -with-qtbinding \ - -qt5 \ - -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby \ - -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ - -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ - -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib \ - -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ - -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ - | tee macbuildQt5.log +#------------------------------------------------------------------------------ +MacRuby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby +MacRubyInc=/System/Library/Frameworks/Ruby.framework/Headers +MacRubyLib=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib + +MacPython=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python +MacPythonInc=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 +MacPythonLib=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib + +MacQMake=/opt/local/libexec/qt5/bin/qmake +MacBinDir=./qt5.build.macos-yosemite +MacBuildDir=./qt5.bin.macos-yosemite +MacBuildLog=macbuildQt5-yosemite.log +#------------------------------------------------------------------------------ +function WithRubyPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt5 \ + -ruby $MacRuby \ + -rbinc $MacRubyInc \ + -rblib $MacRubyLib \ + -python $MacPython \ + -pyinc $MacPythonInc \ + -pylib $MacPythonLib 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithRuby() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt5 \ + -ruby $MacRuby \ + -rbinc $MacRubyInc \ + -rblib $MacRubyLib \ + -nopython 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt5 \ + -noruby \ + -python $MacPython \ + -pyinc $MacPythonInc \ + -pylib $MacPythonLib 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithoutRubytPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt5 \ + -noruby \ + -nopython 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function Usage() { + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "This script is for building KLayout for Mac OSX Yosemite" + echo " with Qt 5.8.0 from MacPorts" + echo "" + echo "USAGE:" + echo " $0 < 0 | 1 | 2 | 3 >" + echo " 0: support neither Ruby nor Python" + echo " 1: support both Ruby and Python" + echo " 2: support Ruby only" + echo " 3: support Python only" + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "" +} +#------------------------------------------------------------------------------ +if [ $# -ne 1 ]; then + Usage + exit +else + if [ "$1" = "0" ]; then + WithoutRubytPython + elif [ "$1" = "1" ]; then + WithRubyPython + elif [ "$1" = "2" ]; then + WithRuby + elif [ "$1" = "3" ]; then + WithPython + else + Usage + exit + fi +fi +#---------- +# EOF +#---------- From 6acbe946fed06995c15dbff7c86d5af7e2df67fa Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Wed, 13 Dec 2017 06:51:23 +0900 Subject: [PATCH 12/60] Improve Bash scripts for building for Mac OSX. This refs #4. --- macbuild/{macbuildQt4.sh => macbuildQt4-highsierra.sh} | 0 macbuild/{macbuildQt5.sh => macbuildQt5-highsierra.sh} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename macbuild/{macbuildQt4.sh => macbuildQt4-highsierra.sh} (100%) rename macbuild/{macbuildQt5.sh => macbuildQt5-highsierra.sh} (100%) diff --git a/macbuild/macbuildQt4.sh b/macbuild/macbuildQt4-highsierra.sh similarity index 100% rename from macbuild/macbuildQt4.sh rename to macbuild/macbuildQt4-highsierra.sh diff --git a/macbuild/macbuildQt5.sh b/macbuild/macbuildQt5-highsierra.sh similarity index 100% rename from macbuild/macbuildQt5.sh rename to macbuild/macbuildQt5-highsierra.sh From 94cc87bc32f107a7df7293c2329d31763f210718 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Wed, 13 Dec 2017 06:59:17 +0900 Subject: [PATCH 13/60] Improve Bash scripts for building for Mac OSX. This refs #4. --- macbuild/macbuildQt4-highsierra.sh | 126 +++++++++++++++++++++++++---- macbuild/macbuildQt5-highsierra.sh | 125 ++++++++++++++++++++++++---- 2 files changed, 221 insertions(+), 30 deletions(-) diff --git a/macbuild/macbuildQt4-highsierra.sh b/macbuild/macbuildQt4-highsierra.sh index 4153ebc0d..280ddab40 100755 --- a/macbuild/macbuildQt4-highsierra.sh +++ b/macbuild/macbuildQt4-highsierra.sh @@ -1,21 +1,117 @@ #!/bin/bash +#------------------------------------------------------------------------------ # Using Qt 4.8.7 from Mac Ports. # # Ruby: OSX native # Python: OSX native -./build.sh \ - -release \ - -qmake /opt/local/libexec/qt4/bin/qmake \ - -build ./qt4.build.macos-high-sierra \ - -bin ./qt4.bin.macos-high-sierra \ - -option -j2 \ - -with-qtbinding \ - -qt4 \ - -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby \ - -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ - -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ - -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib \ - -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ - -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ - | tee macbuildQt4.log +#------------------------------------------------------------------------------ +MacRuby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby +MacRubyInc=/System/Library/Frameworks/Ruby.framework/Headers +MacRubyLib=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib + +MacPython=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python +MacPythonInc=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 +MacPythonLib=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib + +MacQMake=/opt/local/libexec/qt4/bin/qmake +MacBinDir=./qt4.build.macos-highsierra +MacBuildDir=./qt4.bin.macos-highsierra +MacBuildLog=macbuildQt4-highsierra.log +#------------------------------------------------------------------------------ +function WithRubyPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt4 \ + -ruby $MacRuby \ + -rbinc $MacRubyInc \ + -rblib $MacRubyLib \ + -python $MacPython \ + -pyinc $MacPythonInc \ + -pylib $MacPythonLib 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithRuby() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt4 \ + -ruby $MacRuby \ + -rbinc $MacRubyInc \ + -rblib $MacRubyLib \ + -nopython 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt4 \ + -noruby \ + -python $MacPython \ + -pyinc $MacPythonInc \ + -pylib $MacPythonLib 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithoutRubytPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt4 \ + -noruby \ + -nopython 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function Usage() { + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "This script is for building KLayout for macOS High Sierra" + echo " with Qt 4.8.7 from MacPorts" + echo "" + echo "USAGE:" + echo " $0 < 0 | 1 | 2 | 3 >" + echo " 0: support neither Ruby nor Python" + echo " 1: support both Ruby and Python" + echo " 2: support Ruby only" + echo " 3: support Python only" + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "" +} +#------------------------------------------------------------------------------ +if [ $# -ne 1 ]; then + Usage + exit +else + if [ "$1" = "0" ]; then + WithoutRubytPython + elif [ "$1" = "1" ]; then + WithRubyPython + elif [ "$1" = "2" ]; then + WithRuby + elif [ "$1" = "3" ]; then + WithPython + else + Usage + exit + fi +fi +#---------- +# EOF +#---------- + diff --git a/macbuild/macbuildQt5-highsierra.sh b/macbuild/macbuildQt5-highsierra.sh index 32034dc0f..8d3a0bb8e 100755 --- a/macbuild/macbuildQt5-highsierra.sh +++ b/macbuild/macbuildQt5-highsierra.sh @@ -1,21 +1,116 @@ #!/bin/bash +#------------------------------------------------------------------------------ # Using Qt 5.9.3 from Mac Ports. # # Ruby: OSX native # Python: OSX native -./build.sh \ - -release \ - -qmake /opt/local/libexec/qt5/bin/qmake \ - -build ./qt5.build.macos-high-sierra \ - -bin ./qt5.bin.macos-high-sierra \ - -option -j2 \ - -with-qtbinding \ - -qt5 \ - -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby \ - -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ - -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ - -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib \ - -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ - -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ - | tee macbuildQt5.log +#------------------------------------------------------------------------------ +MacRuby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby +MacRubyInc=/System/Library/Frameworks/Ruby.framework/Headers +MacRubyLib=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib + +MacPython=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python +MacPythonInc=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 +MacPythonLib=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib + +MacQMake=/opt/local/libexec/qt5/bin/qmake +MacBinDir=./qt5.build.macos-highsierra +MacBuildDir=./qt5.bin.macos-highsierra +MacBuildLog=macbuildQt5-highsierra.log +#------------------------------------------------------------------------------ +function WithRubyPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt5 \ + -ruby $MacRuby \ + -rbinc $MacRubyInc \ + -rblib $MacRubyLib \ + -python $MacPython \ + -pyinc $MacPythonInc \ + -pylib $MacPythonLib 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithRuby() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt5 \ + -ruby $MacRuby \ + -rbinc $MacRubyInc \ + -rblib $MacRubyLib \ + -nopython 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt5 \ + -noruby \ + -python $MacPython \ + -pyinc $MacPythonInc \ + -pylib $MacPythonLib 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function WithoutRubytPython() { + ./build.sh \ + -release \ + -qmake $MacQMake \ + -build $MacBinDir \ + -bin $MacBuildDir \ + -option -j4 \ + -with-qtbinding \ + -qt5 \ + -noruby \ + -nopython 2>&1 | tee $MacBuildLog +} +#------------------------------------------------------------------------------ +function Usage() { + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "This script is for building KLayout for macOS High Sierra" + echo " with Qt 5.9.3 from MacPorts" + echo "" + echo "USAGE:" + echo " $0 < 0 | 1 | 2 | 3 >" + echo " 0: support neither Ruby nor Python" + echo " 1: support both Ruby and Python" + echo " 2: support Ruby only" + echo " 3: support Python only" + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "" +} +#------------------------------------------------------------------------------ +if [ $# -ne 1 ]; then + Usage + exit +else + if [ "$1" = "0" ]; then + WithoutRubytPython + elif [ "$1" = "1" ]; then + WithRubyPython + elif [ "$1" = "2" ]; then + WithRuby + elif [ "$1" = "3" ]; then + WithPython + else + Usage + exit + fi +fi +#---------- +# EOF +#---------- From 0c25e8cab1763bc763339a1a7f81baab0e32178f Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 12 Dec 2017 23:23:13 +0100 Subject: [PATCH 14/60] Maybe fixed a linker issue (db::GDS2Writer vtable not found) --- src/db/db/dbGDS2Writer.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/db/db/dbGDS2Writer.cc b/src/db/db/dbGDS2Writer.cc index 1a4b13f61..b01824e56 100644 --- a/src/db/db/dbGDS2Writer.cc +++ b/src/db/db/dbGDS2Writer.cc @@ -45,34 +45,34 @@ GDS2Writer::GDS2Writer () m_progress.set_unit (1024 * 1024); } -inline void +void GDS2Writer::write_byte (unsigned char b) { mp_stream->put ((const char *) &b, 1); } -inline void +void GDS2Writer::write_record_size (int16_t i) { gds2h (i); mp_stream->put ( (char*)(&i), sizeof (i)); } -inline void +void GDS2Writer::write_record (int16_t i) { gds2h (i); mp_stream->put ( (char*)(&i), sizeof (i)); } -inline void +void GDS2Writer::write_short (int16_t i) { gds2h (i); mp_stream->put ( (char*)(&i), sizeof (i)); } -inline void +void GDS2Writer::write_int (int32_t l) { gds2h (l); From 3c920b5938d8ae5e003bc4b0264f7e5ce36678c1 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Sat, 16 Dec 2017 13:52:53 +0900 Subject: [PATCH 15/60] Remove individual script files for building for Mac OSX. This refs #4. --- macbuild/macbuildQt4-highsierra.sh | 117 ----------------------------- macbuild/macbuildQt4-yosemite.sh | 115 ---------------------------- macbuild/macbuildQt5-highsierra.sh | 116 ---------------------------- macbuild/macbuildQt5-yosemite.sh | 115 ---------------------------- 4 files changed, 463 deletions(-) delete mode 100755 macbuild/macbuildQt4-highsierra.sh delete mode 100755 macbuild/macbuildQt4-yosemite.sh delete mode 100755 macbuild/macbuildQt5-highsierra.sh delete mode 100755 macbuild/macbuildQt5-yosemite.sh diff --git a/macbuild/macbuildQt4-highsierra.sh b/macbuild/macbuildQt4-highsierra.sh deleted file mode 100755 index 280ddab40..000000000 --- a/macbuild/macbuildQt4-highsierra.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash - -#------------------------------------------------------------------------------ -# Using Qt 4.8.7 from Mac Ports. -# -# Ruby: OSX native -# Python: OSX native -#------------------------------------------------------------------------------ -MacRuby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -MacRubyInc=/System/Library/Frameworks/Ruby.framework/Headers -MacRubyLib=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib - -MacPython=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python -MacPythonInc=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -MacPythonLib=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib - -MacQMake=/opt/local/libexec/qt4/bin/qmake -MacBinDir=./qt4.build.macos-highsierra -MacBuildDir=./qt4.bin.macos-highsierra -MacBuildLog=macbuildQt4-highsierra.log -#------------------------------------------------------------------------------ -function WithRubyPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt4 \ - -ruby $MacRuby \ - -rbinc $MacRubyInc \ - -rblib $MacRubyLib \ - -python $MacPython \ - -pyinc $MacPythonInc \ - -pylib $MacPythonLib 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithRuby() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt4 \ - -ruby $MacRuby \ - -rbinc $MacRubyInc \ - -rblib $MacRubyLib \ - -nopython 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt4 \ - -noruby \ - -python $MacPython \ - -pyinc $MacPythonInc \ - -pylib $MacPythonLib 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithoutRubytPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt4 \ - -noruby \ - -nopython 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function Usage() { - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "This script is for building KLayout for macOS High Sierra" - echo " with Qt 4.8.7 from MacPorts" - echo "" - echo "USAGE:" - echo " $0 < 0 | 1 | 2 | 3 >" - echo " 0: support neither Ruby nor Python" - echo " 1: support both Ruby and Python" - echo " 2: support Ruby only" - echo " 3: support Python only" - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "" -} -#------------------------------------------------------------------------------ -if [ $# -ne 1 ]; then - Usage - exit -else - if [ "$1" = "0" ]; then - WithoutRubytPython - elif [ "$1" = "1" ]; then - WithRubyPython - elif [ "$1" = "2" ]; then - WithRuby - elif [ "$1" = "3" ]; then - WithPython - else - Usage - exit - fi -fi -#---------- -# EOF -#---------- - diff --git a/macbuild/macbuildQt4-yosemite.sh b/macbuild/macbuildQt4-yosemite.sh deleted file mode 100755 index 9c619726d..000000000 --- a/macbuild/macbuildQt4-yosemite.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------ -# Using Qt 4.8.7 from Mac Ports. -# -# Ruby: OSX native -# Python: OSX native -#------------------------------------------------------------------------------ -MacRuby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -MacRubyInc=/System/Library/Frameworks/Ruby.framework/Headers -MacRubyLib=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib - -MacPython=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python -MacPythonInc=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -MacPythonLib=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib - -MacQMake=/opt/local/libexec/qt4/bin/qmake -MacBinDir=./qt4.build.macos-yosemite -MacBuildDir=./qt4.bin.macos-yosemite -MacBuildLog=macbuildQt4-yosemite.log -#------------------------------------------------------------------------------ -function WithRubyPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt4 \ - -ruby $MacRuby \ - -rbinc $MacRubyInc \ - -rblib $MacRubyLib \ - -python $MacPython \ - -pyinc $MacPythonInc \ - -pylib $MacPythonLib 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithRuby() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt4 \ - -ruby $MacRuby \ - -rbinc $MacRubyInc \ - -rblib $MacRubyLib \ - -nopython 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt4 \ - -noruby \ - -python $MacPython \ - -pyinc $MacPythonInc \ - -pylib $MacPythonLib 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithoutRubytPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt4 \ - -noruby \ - -nopython 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function Usage() { - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "This script is for building KLayout for Mac OSX Yosemite" - echo " with Qt 4.8.7 from MacPorts" - echo "" - echo "USAGE:" - echo " $0 < 0 | 1 | 2 | 3 >" - echo " 0: support neither Ruby nor Python" - echo " 1: support both Ruby and Python" - echo " 2: support Ruby only" - echo " 3: support Python only" - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "" -} -#------------------------------------------------------------------------------ -if [ $# -ne 1 ]; then - Usage - exit -else - if [ "$1" = "0" ]; then - WithoutRubytPython - elif [ "$1" = "1" ]; then - WithRubyPython - elif [ "$1" = "2" ]; then - WithRuby - elif [ "$1" = "3" ]; then - WithPython - else - Usage - exit - fi -fi -#---------- -# EOF -#---------- diff --git a/macbuild/macbuildQt5-highsierra.sh b/macbuild/macbuildQt5-highsierra.sh deleted file mode 100755 index 8d3a0bb8e..000000000 --- a/macbuild/macbuildQt5-highsierra.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -#------------------------------------------------------------------------------ -# Using Qt 5.9.3 from Mac Ports. -# -# Ruby: OSX native -# Python: OSX native -#------------------------------------------------------------------------------ -MacRuby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -MacRubyInc=/System/Library/Frameworks/Ruby.framework/Headers -MacRubyLib=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib - -MacPython=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python -MacPythonInc=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -MacPythonLib=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib - -MacQMake=/opt/local/libexec/qt5/bin/qmake -MacBinDir=./qt5.build.macos-highsierra -MacBuildDir=./qt5.bin.macos-highsierra -MacBuildLog=macbuildQt5-highsierra.log -#------------------------------------------------------------------------------ -function WithRubyPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt5 \ - -ruby $MacRuby \ - -rbinc $MacRubyInc \ - -rblib $MacRubyLib \ - -python $MacPython \ - -pyinc $MacPythonInc \ - -pylib $MacPythonLib 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithRuby() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt5 \ - -ruby $MacRuby \ - -rbinc $MacRubyInc \ - -rblib $MacRubyLib \ - -nopython 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt5 \ - -noruby \ - -python $MacPython \ - -pyinc $MacPythonInc \ - -pylib $MacPythonLib 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithoutRubytPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt5 \ - -noruby \ - -nopython 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function Usage() { - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "This script is for building KLayout for macOS High Sierra" - echo " with Qt 5.9.3 from MacPorts" - echo "" - echo "USAGE:" - echo " $0 < 0 | 1 | 2 | 3 >" - echo " 0: support neither Ruby nor Python" - echo " 1: support both Ruby and Python" - echo " 2: support Ruby only" - echo " 3: support Python only" - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "" -} -#------------------------------------------------------------------------------ -if [ $# -ne 1 ]; then - Usage - exit -else - if [ "$1" = "0" ]; then - WithoutRubytPython - elif [ "$1" = "1" ]; then - WithRubyPython - elif [ "$1" = "2" ]; then - WithRuby - elif [ "$1" = "3" ]; then - WithPython - else - Usage - exit - fi -fi -#---------- -# EOF -#---------- diff --git a/macbuild/macbuildQt5-yosemite.sh b/macbuild/macbuildQt5-yosemite.sh deleted file mode 100755 index 6ecea529e..000000000 --- a/macbuild/macbuildQt5-yosemite.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------ -# Using Qt 5.8.0 from Mac Ports. -# -# Ruby: OSX native -# Python: OSX native -#------------------------------------------------------------------------------ -MacRuby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -MacRubyInc=/System/Library/Frameworks/Ruby.framework/Headers -MacRubyLib=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib - -MacPython=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python -MacPythonInc=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -MacPythonLib=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib - -MacQMake=/opt/local/libexec/qt5/bin/qmake -MacBinDir=./qt5.build.macos-yosemite -MacBuildDir=./qt5.bin.macos-yosemite -MacBuildLog=macbuildQt5-yosemite.log -#------------------------------------------------------------------------------ -function WithRubyPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt5 \ - -ruby $MacRuby \ - -rbinc $MacRubyInc \ - -rblib $MacRubyLib \ - -python $MacPython \ - -pyinc $MacPythonInc \ - -pylib $MacPythonLib 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithRuby() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt5 \ - -ruby $MacRuby \ - -rbinc $MacRubyInc \ - -rblib $MacRubyLib \ - -nopython 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt5 \ - -noruby \ - -python $MacPython \ - -pyinc $MacPythonInc \ - -pylib $MacPythonLib 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function WithoutRubytPython() { - ./build.sh \ - -release \ - -qmake $MacQMake \ - -build $MacBinDir \ - -bin $MacBuildDir \ - -option -j4 \ - -with-qtbinding \ - -qt5 \ - -noruby \ - -nopython 2>&1 | tee $MacBuildLog -} -#------------------------------------------------------------------------------ -function Usage() { - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "This script is for building KLayout for Mac OSX Yosemite" - echo " with Qt 5.8.0 from MacPorts" - echo "" - echo "USAGE:" - echo " $0 < 0 | 1 | 2 | 3 >" - echo " 0: support neither Ruby nor Python" - echo " 1: support both Ruby and Python" - echo " 2: support Ruby only" - echo " 3: support Python only" - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "" -} -#------------------------------------------------------------------------------ -if [ $# -ne 1 ]; then - Usage - exit -else - if [ "$1" = "0" ]; then - WithoutRubytPython - elif [ "$1" = "1" ]; then - WithRubyPython - elif [ "$1" = "2" ]; then - WithRuby - elif [ "$1" = "3" ]; then - WithPython - else - Usage - exit - fi -fi -#---------- -# EOF -#---------- From 9b9d68a6385015e94e88384317e28c005b04eb67 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Sat, 16 Dec 2017 13:58:42 +0900 Subject: [PATCH 16/60] Prepare Python scripts for building for Mac OSX. This refs #4. --- macbuild/ReadMe.txt | 25 +++ macbuild/build4mac.py | 390 ++++++++++++++++++++++++++++++++++++++ macbuild/build4mac_env.py | 143 ++++++++++++++ 3 files changed, 558 insertions(+) create mode 100644 macbuild/ReadMe.txt create mode 100755 macbuild/build4mac.py create mode 100755 macbuild/build4mac_env.py diff --git a/macbuild/ReadMe.txt b/macbuild/ReadMe.txt new file mode 100644 index 000000000..4c3d8d693 --- /dev/null +++ b/macbuild/ReadMe.txt @@ -0,0 +1,25 @@ +<< Draft >> + +This directory "macbuild" contains different files required to build KLayout +version 0.25 or later for different Max OSX including: + * Yosemite (10.10) + * El Capitan (10.11) + * Sierra (10.12) + * High Sierra (10.13) + +By default, Qt framework is the from Mac Ports (https://www.macports.org/) which +is usually located under: + /opt/local/libexec/qt5/ + +Also by default, supported script languages, i.e,, Ruby and Python, are those +standard ones bundled with the OS. +However, you are able to choose other options like Python from Anaconda. + +etc. etc. + + +Make a symbolic link from the parent directory like: + build4mac.py -> macbuild/build4mac.py +then execute the Python script to build with appropriate options if required. + +[End of File] diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py new file mode 100755 index 000000000..0e61bd5e1 --- /dev/null +++ b/macbuild/build4mac.py @@ -0,0 +1,390 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + +#=============================================================================== +# File: "macbuild/build4mac.py" +# +# The main script for building KLayout (http://www.klayout.de/index.php) +# version 0.25 or later on different Apple Mac OSX platforms. +#=============================================================================== +from __future__ import print_function # to use print() of Python 3 in Python >= 2.7 +import sys +import os +import platform +import optparse +import subprocess + +#------------------------------------------------------------------------------- +## To import global dictionaries of different modules +#------------------------------------------------------------------------------- +mydir = os.path.dirname(os.path.abspath(__file__)) +sys.path.append( mydir + "/macbuild" ) +from build4mac_env import * + +#------------------------------------------------------------------------------- +## To set global variables including present directory and platform info. +#------------------------------------------------------------------------------- +def SetGlobals(): + global PresentDir # present directory + global Usage # string on usage + global BuildBash # the main build Bash script + global Platform # platform + global ModuleQt # Qt module to be used + global ModuleRuby # Ruby module to be used + global ModulePython # Python module to be used + global NoQtBindings # True if not creating Qt bindings for Ruby scripts + global MakeOptions # options passed to `make` + global DebugMode # True if debug mode build + global CheckComOnly # True if check the command line only + # auxiliary variables on platform + global System # 6-tuple from platform.uname() + global Node # - do - + global Release # - do - + global Version # - do - + global Machine # - do - + global Processor # - do - + global Bit # machine bit-size + + Usage = "\n" + Usage += "---------------------------------------------------------------------------------------------\n" + Usage += "<< Usage of 'build4mac.py' >>\n" + Usage += " for building KLayout 0.25 or later on different Apple Mac OSX platforms.\n" + Usage += "\n" + Usage += "$ [python] build4mac.py \n" + Usage += " option & argument : comment on option if any | default value\n" + Usage += " -----------------------------------------------------------------------+---------------\n" + Usage += " : * key type names below are case insensitive * | \n" + Usage += " : 'nil' = not to support the script language | \n" + Usage += " : 'Sys' = using the OS standard script language | \n" + Usage += " [-q|--qt ] : type=['Qt4MacPorts', 'Qt5MacPorts'] | qt5macports \n" + Usage += " [-r|--ruby ] : type=['nil', 'Sys', 'RubySource'] | sys \n" + Usage += " [-p|--python ] : type=['nil', 'Sys', 'Anaconda27', 'Anaconda36'] | sys \n" + Usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled \n" + Usage += " [-m|--make