From 0472b9ea603003d59fd885d499ff176ca0bf7890 Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Wed, 27 Nov 2019 13:51:27 +0100 Subject: [PATCH 01/15] macOS: fix tooltips not closing on Catalina. --- src/platform/guimac.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/platform/guimac.mm b/src/platform/guimac.mm index a5763c90..cb939cf7 100644 --- a/src/platform/guimac.mm +++ b/src/platform/guimac.mm @@ -16,6 +16,7 @@ using namespace SolveSpace; + (NSToolTipManager *)sharedToolTipManager; - (void)setInitialToolTipDelay:(double)delay; - (void)orderOutToolTip; +- (void)abortToolTip; - (void)_displayTemporaryToolTipForView:(id)arg1 withString:(id)arg2; @end @@ -909,7 +910,11 @@ public: NSToolTipManager *nsToolTipManager = [NSToolTipManager sharedToolTipManager]; if(newText.empty()) { - [nsToolTipManager orderOutToolTip]; + if ([nsToolTipManager respondsToSelector:@selector(abortToolTip)]) { + [nsToolTipManager abortToolTip]; + } else { + [nsToolTipManager orderOutToolTip]; + } } else { [nsToolTipManager _displayTemporaryToolTipForView:ssView withString:Wrap(newText)]; } From 0b786e6e2bcdeab58e6d164aa4cdc895e158907c Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 2 Dec 2019 18:51:46 +0000 Subject: [PATCH 02/15] CMake: review minimum required CMake version. It turns out that using cmake_policy(VERSION) is effectively same as using cmake_minimum_required(VERSION) because it is a hard error if the CMake running the script is too old. As such, replace 22525e65 with two changes: * Set the minimum required version to 3.7.2 (Debian stretch), which also configures policies. * If CMake is at least as new as 3.11.0, then set the policies according to that version. This should actually have the intended behavior. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bfd04d0..d442eee9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,10 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) " mkdir build && cd build && cmake ..") endif() -cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR) -cmake_policy(VERSION 3.11) +cmake_minimum_required(VERSION 3.7.2 FATAL_ERROR) +if(NOT CMAKE_VERSION VERSION_LESS 3.11.0) + cmake_policy(VERSION 3.11.0) +endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") set(CMAKE_CXX_STANDARD 11) From 69baf52432babf1c5386ab58fee359ddafd65761 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 4 Dec 2019 13:57:10 +0000 Subject: [PATCH 03/15] Linux: fix Z-order in scalable icon. --- res/freedesktop/solvespace-scalable.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/freedesktop/solvespace-scalable.svg b/res/freedesktop/solvespace-scalable.svg index 7be996e0..0d060d12 100644 --- a/res/freedesktop/solvespace-scalable.svg +++ b/res/freedesktop/solvespace-scalable.svg @@ -5,8 +5,8 @@ - + From 64c0f62b92a35a83b2c7620ee264db383b54283a Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 6 Dec 2019 15:21:51 +0000 Subject: [PATCH 04/15] Win32: mark all remaining functions as Unicode. NFC. Some were missing the *W suffix. --- src/platform/guiwin.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/platform/guiwin.cpp b/src/platform/guiwin.cpp index bd1b42e7..2f6ce523 100644 --- a/src/platform/guiwin.cpp +++ b/src/platform/guiwin.cpp @@ -73,9 +73,9 @@ namespace Platform { void CheckLastError(const char *file, int line, const char *function, const char *expr) { if(GetLastError() != S_OK) { LPWSTR messageW; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, - NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPWSTR)&messageW, 0, NULL); + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPWSTR)&messageW, 0, NULL); std::string message; message += ssprintf("File %s, line %u, function %s:\n", file, line, function); @@ -203,8 +203,8 @@ public: uint32_t ThawInt(const std::string &key, uint32_t defaultValue) { DWORD value; DWORD type, length = sizeof(value); - LSTATUS result = RegQueryValueEx(GetKey(), &Widen(key)[0], 0, - &type, (BYTE *)&value, &length); + LSTATUS result = RegQueryValueExW(GetKey(), &Widen(key)[0], 0, + &type, (BYTE *)&value, &length); if(result == ERROR_SUCCESS && type == REG_DWORD) { return value; } @@ -219,8 +219,8 @@ public: double ThawFloat(const std::string &key, double defaultValue) { double value; DWORD type, length = sizeof(value); - LSTATUS result = RegQueryValueEx(GetKey(), &Widen(key)[0], 0, - &type, (BYTE *)&value, &length); + LSTATUS result = RegQueryValueExW(GetKey(), &Widen(key)[0], 0, + &type, (BYTE *)&value, &length); if(result == ERROR_SUCCESS && type == REG_QWORD) { return value; } @@ -237,13 +237,13 @@ public: std::string ThawString(const std::string &key, const std::string &defaultValue) { DWORD type, length = 0; - LSTATUS result = RegQueryValueEx(GetKey(), &Widen(key)[0], 0, - &type, NULL, &length); + LSTATUS result = RegQueryValueExW(GetKey(), &Widen(key)[0], 0, + &type, NULL, &length); if(result == ERROR_SUCCESS && type == REG_SZ) { std::wstring valueW; valueW.resize(length / 2 - 1); - sscheck(RegQueryValueEx(GetKey(), &Widen(key)[0], 0, - &type, (BYTE *)&valueW[0], &length)); + sscheck(RegQueryValueExW(GetKey(), &Widen(key)[0], 0, + &type, (BYTE *)&valueW[0], &length)); return Narrow(valueW); } return defaultValue; @@ -538,7 +538,7 @@ public: static bool registered; if(registered) return; - WNDCLASSEX wc = {}; + WNDCLASSEXW wc = {}; wc.cbSize = sizeof(wc); wc.style = CS_BYTEALIGNCLIENT|CS_BYTEALIGNWINDOW|CS_OWNDC|CS_DBLCLKS; wc.lpfnWndProc = WndProc; @@ -549,7 +549,7 @@ public: IMAGE_ICON, 16, 16, 0); wc.hCursor = LoadCursorW(NULL, IDC_ARROW); wc.lpszClassName = L"SolveSpace"; - sscheck(RegisterClassEx(&wc)); + sscheck(RegisterClassExW(&wc)); registered = true; } @@ -702,7 +702,7 @@ public: // The wndproc may be called from within CreateWindowEx, and before we've associated // the window with the WindowImplWin32. In that case, just defer to the default wndproc. if(window == NULL) { - return DefWindowProc(h, msg, wParam, lParam); + return DefWindowProcW(h, msg, wParam, lParam); } #if defined(HAVE_SPACEWARE) @@ -999,7 +999,7 @@ public: sscheck(SetForegroundWindow(hParent)); break; } else { - return DefWindowProc(h, msg, wParam, lParam); + return DefWindowProcW(h, msg, wParam, lParam); } } @@ -1042,7 +1042,7 @@ public: } default: - return DefWindowProc(h, msg, wParam, lParam); + return DefWindowProcW(h, msg, wParam, lParam); } return 0; From 16c5fa6889202f2059b52c4a89599910541dd1a0 Mon Sep 17 00:00:00 2001 From: ruevs Date: Tue, 17 Dec 2019 14:02:26 +0200 Subject: [PATCH 05/15] Fix eight trivial "implicit conversion 'double' to 'int'" warnings. NFC. --- src/render/rendergl1.cpp | 8 ++++---- src/solvespace.cpp | 4 ++-- src/srf/surface.cpp | 2 +- src/toolbar.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/render/rendergl1.cpp b/src/render/rendergl1.cpp index 3e6feb0b..ef34bc52 100644 --- a/src/render/rendergl1.cpp +++ b/src/render/rendergl1.cpp @@ -708,8 +708,8 @@ void OpenGl1Renderer::UpdateProjection() { UnSelectPrimitive(); glViewport(0, 0, - camera.width * camera.pixelRatio, - camera.height * camera.pixelRatio); + (GLsizei)(camera.width * camera.pixelRatio), + (GLsizei)(camera.height * camera.pixelRatio)); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -821,8 +821,8 @@ void OpenGl1Renderer::FinishFrame() { } std::shared_ptr OpenGl1Renderer::ReadFrame() { - int width = camera.width * camera.pixelRatio; - int height = camera.height * camera.pixelRatio; + int width = (int)(camera.width * camera.pixelRatio); + int height = (int)(camera.height * camera.pixelRatio); std::shared_ptr pixmap = Pixmap::Create(Pixmap::Format::RGB, (size_t)width, (size_t)height); glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, &pixmap->data[0]); diff --git a/src/solvespace.cpp b/src/solvespace.cpp index 1a1df147..4d191368 100644 --- a/src/solvespace.cpp +++ b/src/solvespace.cpp @@ -361,7 +361,7 @@ std::string SolveSpaceUI::MmToStringSI(double v, int dim) { } v /= pow((viewUnits == Unit::INCHES) ? 25.4 : 1000, dim); - int vdeg = floor((log10(fabs(v))) / dim); + int vdeg = (int)((log10(fabs(v))) / dim); std::string unit; if(fabs(v) > 0.0) { int sdeg = 0; @@ -371,7 +371,7 @@ std::string SolveSpaceUI::MmToStringSI(double v, int dim) { : SelectSIPrefixMm(vdeg); v /= pow(10.0, sdeg * dim); } - int pdeg = ceil(log10(fabs(v) + 1e-10)); + int pdeg = (int)ceil(log10(fabs(v) + 1e-10)); return ssprintf("%#.*g%s%s%s", pdeg + UnitDigitsAfterDecimal(), v, compact ? "" : " ", unit.c_str(), DimToString(dim)); } diff --git a/src/srf/surface.cpp b/src/srf/surface.cpp index b90fb55f..a61713c3 100644 --- a/src/srf/surface.cpp +++ b/src/srf/surface.cpp @@ -646,7 +646,7 @@ void SShell::MakeFromHelicalRevolutionOf(SBezierLoopSet *sbls, Vector pt, Vector // for testing - hard code the axial distance, and number of sections. // distance will need to be parameters in the future. double dist = distf - dists; - int sections = fabs(anglef - angles) / (PI / 2) + 1; + int sections = (int)(fabs(anglef - angles) / (PI / 2) + 1); double wedge = (anglef - angles) / sections; if(CheckNormalAxisRelationship(sbls, pt, axis, anglef-angles, distf-dists)) { diff --git a/src/toolbar.cpp b/src/toolbar.cpp index b1718204..4d0b8839 100644 --- a/src/toolbar.cpp +++ b/src/toolbar.cpp @@ -219,7 +219,7 @@ bool GraphicsWindow::ToolbarDrawOrHitTest(int mx, int my, UiCanvas *canvas, { if(hitCommand) *hitCommand = icon.command; if(hitX) *hitX = x - boxhw; - if(hitY) *hitY = height - (y + boxhw); + if(hitY) *hitY = (int)height - (y + boxhw); } } From d5351c48e3460550ebcbaa810ce45063c1dbea32 Mon Sep 17 00:00:00 2001 From: Maximilian Federle Date: Sat, 23 Nov 2019 21:45:32 +0100 Subject: [PATCH 06/15] snap: build snaps on Travis via remote-build. We invoke builds on Launchpad in stage "deploy" and release it into the edge channel of the Snap Store. The deploy stage is blocked on fails of the test stage, so we don't release snaps with failing tests. --- .travis.yml | 25 +++++++++++++++++++++++++ .travis/build-snap.sh | 15 +++++++++++++++ .travis/launchpad-credentials.enc | Bin 0 -> 224 bytes 3 files changed, 40 insertions(+) create mode 100755 .travis/build-snap.sh create mode 100644 .travis/launchpad-credentials.enc diff --git a/.travis.yml b/.travis.yml index 9dbf0369..1544ef3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,3 +25,28 @@ jobs: on: repo: solvespace/solvespace tags: true + - stage: deploy + name: "Snap" + os: linux + dist: bionic + addons: + snaps: + - name: snapcraft + confinement: classic + script: ./.travis/build-snap.sh + deploy: + - provider: snap + skip_cleanup: true + snap: pkg/snap/*.snap + channel: edge + on: + branch: master + tags: false + - provider: snap + skip_cleanup: true + snap: pkg/snap/*.snap + channel: edge,beta + on: + branch: master + tags: true + diff --git a/.travis/build-snap.sh b/.travis/build-snap.sh new file mode 100755 index 00000000..d824b383 --- /dev/null +++ b/.travis/build-snap.sh @@ -0,0 +1,15 @@ +#!/bin/sh -xe + +lp_data_dir="$HOME/.local/share/snapcraft/provider/launchpad" +lp_credentials="$lp_data_dir/credentials" + +mkdir -p "$lp_data_dir" +openssl aes-256-cbc -K $encrypted_c4bc81f026a2_key -iv $encrypted_c4bc81f026a2_iv \ + -in .travis/launchpad-credentials.enc \ + -out "$lp_credentials" -d +chmod 600 "$lp_credentials" + +./pkg/snap/build.sh remote-build \ + --launchpad-user solvespace \ + --launchpad-accept-public-upload \ + --build-on=amd64,arm64,armhf,i386 diff --git a/.travis/launchpad-credentials.enc b/.travis/launchpad-credentials.enc new file mode 100644 index 0000000000000000000000000000000000000000..5eba3cca8d33bb4a74b3ba3e16e2ba9386aed6af GIT binary patch literal 224 zcmV<603ZKgph6-3zoy0tXgIY!>i6M+dUZj*-`(E?wsYF>r!Bz8^PiU?4`vw|Q}>Z;pZ8$`R6EG`(BcE13d zh~XeM$}hlxwwL6)TL{i;WIzkkOi?;2=>tTznXKORAsBjGLMdj$%@Q+W413Zvex?me zZB6|=cmIC>y%bkY2?aB?;W7Ia&uE#hM1y^ST?Es&E!tbbfi?|+K>b$RcBNIOnt Date: Wed, 22 Jan 2020 15:37:14 +0100 Subject: [PATCH 07/15] snap: Release snaps to store via script instead of snap provider dpl-snap only supports pushing one snap at a time. Instead of many repetitive deploy statements, we use our own script to loop over the snaps to be released. --- .travis.yml | 10 ++++------ .travis/deploy-snap.sh | 8 ++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100755 .travis/deploy-snap.sh diff --git a/.travis.yml b/.travis.yml index 1544ef3d..9e3fa792 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,17 +35,15 @@ jobs: confinement: classic script: ./.travis/build-snap.sh deploy: - - provider: snap + - provider: script + script: ./.travis/deploy-snap.sh edge skip_cleanup: true - snap: pkg/snap/*.snap - channel: edge on: branch: master tags: false - - provider: snap + - provider: script + script: ./.travis/deploy-snap.sh edge,beta skip_cleanup: true - snap: pkg/snap/*.snap - channel: edge,beta on: branch: master tags: true diff --git a/.travis/deploy-snap.sh b/.travis/deploy-snap.sh new file mode 100755 index 00000000..91674a7c --- /dev/null +++ b/.travis/deploy-snap.sh @@ -0,0 +1,8 @@ +#!/bin/sh -e + +channels="$1" +echo "$SNAP_TOKEN" | snapcraft login --with - + +for snap in ./pkg/snap/*.snap; do + snapcraft push "$snap" --release "$channels" +done From 72bc71cc9d0a60413575ee3c705e3a74f6901d96 Mon Sep 17 00:00:00 2001 From: Maximilian Federle Date: Thu, 23 Jan 2020 18:05:13 +0100 Subject: [PATCH 08/15] README: add snap as an installation option. --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index e878c970..94eb67f3 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,20 @@ the SolveSpace maintainers for each stable release. [rel]: https://github.com/solvespace/solvespace/releases +### Via Snap Store + +Builds from master are automatically released to the `edge` channel in the Snap Store. Those packages contain the latest improvements, but receive less testing than release builds. + +Future official releases will appear in the `stable` channel. + +[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/solvespace) + +Or install from a terminal: + +``` +snap install --edge solvespace +``` + ### Via third-party binary packages _Third-party_ nightly binary packages for Debian and Ubuntu are available From 3ed1719de2dc6e0525c94de78353d076623e46e4 Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Wed, 5 Feb 2020 06:34:33 +0100 Subject: [PATCH 09/15] Fix immediate editing of reference constraints. Before this commit, if immediate editing of constraints was enabled, then when adding a reference constraint, an editor was incorrectly opened. --- src/constraint.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/constraint.cpp b/src/constraint.cpp index 8ab76f27..fb5c74cb 100644 --- a/src/constraint.cpp +++ b/src/constraint.cpp @@ -196,9 +196,6 @@ void Constraint::MenuConstrain(Command id) { c.valA = 0; c.ModifyToSatisfy(); AddConstraint(&c); - if (SS.immediatelyEditDimension) { - SS.GW.EditConstraint(c.h); - } break; } @@ -610,9 +607,6 @@ void Constraint::MenuConstrain(Command id) { c.ModifyToSatisfy(); AddConstraint(&c); - if (SS.immediatelyEditDimension) { - SS.GW.EditConstraint(c.h); - } break; } @@ -769,6 +763,10 @@ void Constraint::MenuConstrain(Command id) { } } + if ((id == Command::DISTANCE_DIA || id == Command::ANGLE) && SS.immediatelyEditDimension) { + SS.GW.EditConstraint(c.h); + } + SS.GW.ClearSelection(); } From 65ab59503acd100a84eeb6402c29dcd06593480d Mon Sep 17 00:00:00 2001 From: Maximilian Federle Date: Sat, 8 Feb 2020 15:42:01 +0100 Subject: [PATCH 10/15] snap: Build snaps on Travis without remote-build & drop i386 + armhf Snapcraft's remote-build does not fit the requirements of CI, so replace it with builds running directly on Travis: 1. Builds on Travis can run independently, whereas remote-build competes for the same resource (Launchpad) and will potentially block if multiple commits require building in succession. 2. Snapcrafts CLI for remote-build is not designed to be easily scriptable. 3. Travis recently introduced building on arm64, so builds for arm64 are now very fast and don't require emulation. We do not build for armhf and i386 any more because they are of little relevance on the desktop. --- .travis.yml | 16 ++++++++++------ .travis/build-snap.sh | 15 ++------------- .travis/launchpad-credentials.enc | Bin 224 -> 0 bytes 3 files changed, 12 insertions(+), 19 deletions(-) delete mode 100644 .travis/launchpad-credentials.enc diff --git a/.travis.yml b/.travis.yml index 9e3fa792..0d215176 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,14 +25,16 @@ jobs: on: repo: solvespace/solvespace tags: true - - stage: deploy - name: "Snap" + - &deploy-snap + stage: deploy + name: Snap amd64 os: linux + arch: amd64 dist: bionic addons: - snaps: - - name: snapcraft - confinement: classic + snaps: + - name: snapcraft + confinement: classic script: ./.travis/build-snap.sh deploy: - provider: script @@ -47,4 +49,6 @@ jobs: on: branch: master tags: true - + - <<: *deploy-snap + name: Snap arm64 + arch: arm64 diff --git a/.travis/build-snap.sh b/.travis/build-snap.sh index d824b383..634e01c4 100755 --- a/.travis/build-snap.sh +++ b/.travis/build-snap.sh @@ -1,15 +1,4 @@ #!/bin/sh -xe -lp_data_dir="$HOME/.local/share/snapcraft/provider/launchpad" -lp_credentials="$lp_data_dir/credentials" - -mkdir -p "$lp_data_dir" -openssl aes-256-cbc -K $encrypted_c4bc81f026a2_key -iv $encrypted_c4bc81f026a2_iv \ - -in .travis/launchpad-credentials.enc \ - -out "$lp_credentials" -d -chmod 600 "$lp_credentials" - -./pkg/snap/build.sh remote-build \ - --launchpad-user solvespace \ - --launchpad-accept-public-upload \ - --build-on=amd64,arm64,armhf,i386 +sudo apt-get update +sudo ./pkg/snap/build.sh --destructive-mode diff --git a/.travis/launchpad-credentials.enc b/.travis/launchpad-credentials.enc deleted file mode 100644 index 5eba3cca8d33bb4a74b3ba3e16e2ba9386aed6af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 224 zcmV<603ZKgph6-3zoy0tXgIY!>i6M+dUZj*-`(E?wsYF>r!Bz8^PiU?4`vw|Q}>Z;pZ8$`R6EG`(BcE13d zh~XeM$}hlxwwL6)TL{i;WIzkkOi?;2=>tTznXKORAsBjGLMdj$%@Q+W413Zvex?me zZB6|=cmIC>y%bkY2?aB?;W7Ia&uE#hM1y^ST?Es&E!tbbfi?|+K>b$RcBNIOnt Date: Sat, 8 Feb 2020 17:47:36 +0100 Subject: [PATCH 11/15] snap: Add missing sudo in Travis deploy step Running the build step with sudo necessitates running the deploy step with sudo too. Otherwise, we face permission problems. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0d215176..26d94da9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,13 +38,13 @@ jobs: script: ./.travis/build-snap.sh deploy: - provider: script - script: ./.travis/deploy-snap.sh edge + script: sudo ./.travis/deploy-snap.sh edge skip_cleanup: true on: branch: master tags: false - provider: script - script: ./.travis/deploy-snap.sh edge,beta + script: sudo ./.travis/deploy-snap.sh edge,beta skip_cleanup: true on: branch: master From 1cd727d9dc28c10cfc8ad4b674799afda92550f9 Mon Sep 17 00:00:00 2001 From: Maximilian Federle Date: Thu, 13 Feb 2020 16:20:52 +0100 Subject: [PATCH 12/15] snap: Remove superfluous files from package Remove all files from snap that are already included in the base snap or in any connected content snaps. The main advantage is the massively reduced snap size: From ~70 MB down to ~6 MB. --- pkg/snap/snap/snapcraft.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/snap/snap/snapcraft.yaml b/pkg/snap/snap/snapcraft.yaml index e17ecda1..ce0c45ef 100644 --- a/pkg/snap/snap/snapcraft.yaml +++ b/pkg/snap/snap/snapcraft.yaml @@ -26,7 +26,7 @@ apps: extensions: [gnome-3-28] plugs: [opengl, unity7, home, removable-media, gsettings, network] environment: - __EGL_VENDOR_LIBRARY_DIRS: $SNAP/usr/share/glvnd/egl_vendor.d + __EGL_VENDOR_LIBRARY_DIRS: $SNAP/gnome-platform/usr/share/glvnd/egl_vendor.d:$SNAP/usr/share/glvnd/egl_vendor.d cli: command: usr/bin/solvespace-cli plugs: [home, removable-media, network] @@ -71,6 +71,14 @@ parts: - libglibmm-2.4-1v5 - libpangomm-1.4-1v5 - libsigc++-2.0-0v5 - - libglew2.0 - - libegl-mesa0 - - libdrm2 + cleanup: + after: [solvespace] + plugin: nil + build-snaps: [core18, gnome-3-28-1804] + override-prime: | + # Remove all files from snap that are already included in the base snap or in + # any connected content snaps + set -eux + for snap in "core18" "gnome-3-28-1804"; do # List all content-snaps and base snaps you're using here + cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \; + done From bae84b27e48e50b89b0e781be46fce2796b33000 Mon Sep 17 00:00:00 2001 From: Maximilian Federle Date: Thu, 13 Feb 2020 17:10:37 +0100 Subject: [PATCH 13/15] snap: Fix missing extension for cli solvespace-cli needs the gnome-3-28 extension to find its libraries. --- pkg/snap/snap/snapcraft.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/snap/snap/snapcraft.yaml b/pkg/snap/snap/snapcraft.yaml index ce0c45ef..940d0837 100644 --- a/pkg/snap/snap/snapcraft.yaml +++ b/pkg/snap/snap/snapcraft.yaml @@ -29,6 +29,7 @@ apps: __EGL_VENDOR_LIBRARY_DIRS: $SNAP/gnome-platform/usr/share/glvnd/egl_vendor.d:$SNAP/usr/share/glvnd/egl_vendor.d cli: command: usr/bin/solvespace-cli + extensions: [gnome-3-28] plugs: [home, removable-media, network] parts: From f6a774d7bf4896716219bcd846ddd4341c4abaa2 Mon Sep 17 00:00:00 2001 From: ruevs Date: Wed, 18 Dec 2019 16:51:17 +0200 Subject: [PATCH 14/15] Fix some trivial warnings found by MSVC. NFC. Found with /W4 by MSVC 2019 (Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28314) A bunch of implicit casts 'double' to 'float' and one 'int64_t' to 'unsigned'. .\src\platform\guiwin.cpp(1237): warning C4701: potentially uninitialized local variable 'cursorName' used .\src\platform\guiwin.cpp(1237): warning C4703: potentially uninitialized local pointer variable 'cursorName' used .\src\solvespace.cpp(805,30): warning C4456: declaration of 'gs' hides previous local declaration .\src\solvespace.cpp(715,17): message : see declaration of 'gs' .\src\solvespace.cpp(849,47): warning C4456: declaration of 'e' hides previous local declaration .\src\solvespace.cpp(847,29): message : see declaration of 'e' .\src\render\render.h(288,51): warning C4458: declaration of 'camera' hides class member .\src\render\render.h(271,17): message : see declaration of 'SolveSpace::SurfaceRenderer::camera' .\src\render\render.h(289,57): warning C4458: declaration of 'lighting' hides class member .\src\render\render.h(272,17): message : see declaration of 'SolveSpace::SurfaceRenderer::lighting' --- src/export.cpp | 14 +++++++------- src/platform/guiwin.cpp | 2 +- src/render/render.h | 4 ++-- src/solvespace.cpp | 5 ++--- src/textscreens.cpp | 5 +++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/export.cpp b/src/export.cpp index 621fa2e6..31c6c375 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -917,13 +917,13 @@ void SolveSpaceUI::ExportMeshAsQ3doTo(FILE *f, SMesh *sm) { } Vector faceNormal = t.Normal(); - auto a = q3d::Vector3(t.a.x/s, t.a.y/s, t.a.z/s); - auto b = q3d::Vector3(t.b.x/s, t.b.y/s, t.b.z/s); - auto c = q3d::Vector3(t.c.x/s, t.c.y/s, t.c.z/s); - auto fn = q3d::Vector3(faceNormal.x, faceNormal.y, faceNormal.x); - auto n1 = q3d::Vector3(t.normals[0].x, t.normals[0].y, t.normals[0].z); - auto n2 = q3d::Vector3(t.normals[1].x, t.normals[1].y, t.normals[1].z); - auto n3 = q3d::Vector3(t.normals[2].x, t.normals[2].y, t.normals[2].z); + auto a = q3d::Vector3((float)(t.a.x/s), (float)(t.a.y/s), (float)(t.a.z/s)); + auto b = q3d::Vector3((float)(t.b.x/s), (float)(t.b.y/s), (float)(t.b.z/s)); + auto c = q3d::Vector3((float)(t.c.x/s), (float)(t.c.y/s), (float)(t.c.z/s)); + auto fn = q3d::Vector3((float)faceNormal.x, (float)faceNormal.y, (float)faceNormal.x); + auto n1 = q3d::Vector3((float)t.normals[0].x, (float)t.normals[0].y, (float)t.normals[0].z); + auto n2 = q3d::Vector3((float)t.normals[1].x, (float)t.normals[1].y, (float)t.normals[1].z); + auto n3 = q3d::Vector3((float)t.normals[2].x, (float)t.normals[2].y, (float)t.normals[2].z); auto tri = q3d::CreateTriangle(builder, &a, &b, &c, &fn, &n1, &n2, &n3); materialTriangles[color].push_back(tri); } diff --git a/src/platform/guiwin.cpp b/src/platform/guiwin.cpp index 2f6ce523..8a54deed 100644 --- a/src/platform/guiwin.cpp +++ b/src/platform/guiwin.cpp @@ -1227,7 +1227,7 @@ public: } void SetCursor(Cursor cursor) override { - LPWSTR cursorName; + LPWSTR cursorName = IDC_ARROW; switch(cursor) { case Cursor::POINTER: cursorName = IDC_ARROW; break; case Cursor::HAND: cursorName = IDC_HAND; break; diff --git a/src/render/render.h b/src/render/render.h index 70d5863f..b1692f13 100644 --- a/src/render/render.h +++ b/src/render/render.h @@ -285,8 +285,8 @@ public: const Camera &GetCamera() const override { return camera; } // ViewportCanvas interface. - void SetCamera(const Camera &camera) override { this->camera = camera; } - void SetLighting(const Lighting &lighting) override { this->lighting = lighting; } + void SetCamera(const Camera &cam) override { this->camera = cam; } + void SetLighting(const Lighting &light) override { this->lighting = light; } void DrawLine(const Vector &a, const Vector &b, hStroke hcs) override; void DrawEdges(const SEdgeList &el, hStroke hcs) override; diff --git a/src/solvespace.cpp b/src/solvespace.cpp index 4d191368..a3a53caa 100644 --- a/src/solvespace.cpp +++ b/src/solvespace.cpp @@ -802,7 +802,6 @@ void SolveSpaceUI::MenuAnalyze(Command id) { case Command::AREA: { Group *g = SK.GetGroup(SS.GW.activeGroup); SS.GW.GroupSelection(); - auto const &gs = SS.GW.gs; if(gs.faces > 0) { std::vector faces; @@ -844,8 +843,8 @@ void SolveSpaceUI::MenuAnalyze(Command id) { if(gs.n > 0 && gs.n == gs.entities) { double perimeter = 0.0; for(int i = 0; i < gs.entities; i++) { - Entity *e = SK.entity.FindById(gs.entity[i]); - SEdgeList *el = e->GetOrGenerateEdges(); + Entity *en = SK.entity.FindById(gs.entity[i]); + SEdgeList *el = en->GetOrGenerateEdges(); for(const SEdge &e : el->l) { perimeter += e.b.Minus(e.a).Magnitude(); } diff --git a/src/textscreens.cpp b/src/textscreens.cpp index 7e942393..1ea8f133 100644 --- a/src/textscreens.cpp +++ b/src/textscreens.cpp @@ -604,7 +604,7 @@ void TextWindow::ScreenStepDimGo(int link, uint32_t v) { if(time - SS.TW.stepDim.time < STEP_MILLIS) { SS.TW.stepDim.timer->RunAfterNextFrame(); } else { - SS.TW.stepDim.timer->RunAfter(time - SS.TW.stepDim.time - STEP_MILLIS); + SS.TW.stepDim.timer->RunAfter((unsigned)(time - SS.TW.stepDim.time - STEP_MILLIS)); } SS.TW.stepDim.time = time; } else { @@ -758,7 +758,8 @@ void TextWindow::EditControlDone(std::string s) { Group *g = SK.group.FindByIdNoOops(SS.TW.shown.group); if(!g) break; - g->color = RgbaColor::FromFloat(rgb.x, rgb.y, rgb.z, g->color.alphaF()); + g->color = RgbaColor::FromFloat((float)rgb.x, (float)rgb.y, (float)rgb.z, + g->color.alphaF()); SS.MarkGroupDirty(g->h); SS.GW.ClearSuper(); From 8ef3cacc332c004a364e1e65c308e2892058905f Mon Sep 17 00:00:00 2001 From: ruevs Date: Wed, 18 Dec 2019 17:10:37 +0200 Subject: [PATCH 15/15] Fix a bug with 3Dconnexion: SpaceMouse A warning found with /W4 by MSVC 2019 (Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28314) is an actual bug. How does the SpaceMouse (I do not have one) work at all when the global `hSpaceWareDriverClass` is NULL?! .\src\platform\guiwin.cpp(1392,34): warning C4459: declaration of 'hSpaceWareDriverClass' hides global declaration .\src\platform\guiwin.cpp(1389,13): message : see declaration of 'SolveSpace::Platform::hSpaceWareDriverClass' --- src/platform/guiwin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/guiwin.cpp b/src/platform/guiwin.cpp index 8a54deed..70160bbc 100644 --- a/src/platform/guiwin.cpp +++ b/src/platform/guiwin.cpp @@ -1389,7 +1389,7 @@ WindowRef CreateWindow(Window::Kind kind, WindowRef parentWindow) { static HWND hSpaceWareDriverClass; void Open3DConnexion() { - HWND hSpaceWareDriverClass = FindWindowW(L"SpaceWare Driver Class", NULL); + hSpaceWareDriverClass = FindWindowW(L"SpaceWare Driver Class", NULL); if(hSpaceWareDriverClass != NULL) { SiInitialize(); }