diff --git a/.circleci/config.yml b/.circleci/config.yml index 39312b18..e88c3957 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,15 +26,16 @@ std-filters: &std-filters workflows: build_all: jobs: -### -------------------- +## ---------------------- ## OpenCPN 5.8 Plugins ## ---------------------- - build-android-arm64: <<: *std-filters - build-android-armhf: <<: *std-filters - - build-macos-wx32: - <<: *std-filters +# macos-universal covers this, duplicate. +# - build-macos-wx32: +# <<: *std-filters - build-flatpak-arm64-2208: <<: *std-filters - build-flatpak-x86-2208: @@ -49,44 +50,40 @@ workflows: <<: *std-filters - build-debian-x86_64-12-bookworm: <<: *std-filters -## KEEP needed for Raspbian OpenCPN v5.8(wx32) + - build-debian-armhf-11-bullseye: + <<: *std-filters + - build-debian-arm64-11-bullseye: + <<: *std-filters + - build-debian-x86_64-11-bullseye: + <<: *std-filters +## KEEP needed for Jammy with wx32 - build-ubuntu-x86_64-2204-jammy: <<: *std-filters -## --------------------- -## OpenCPN 5.6.2 Plugins -## --------------------- -## Frozen - 28/05/2023 + - build-macos-universal: + <<: *std-filters + +## ------------------------------------------- +## OpenCPN 5.6.2 Plugins Frozen - 28/05/2023 +## ------------------------------------------ +## Circleci will not build for macos 11 so removed - 18/10/2023 - build-macos: <<: *std-filters -## Appveyor also builds for Windows. -## Frozen - 28/05/2023 -## - build-msvc-2022: -## <<: *std-filters -## Frozen - 28/05/2023 +## Appveyor no longer builds for Windows. + - build-msvc-2022: + <<: *std-filters - build-debian-armhf-10-buster: <<: *std-filters -## Frozen - 28/05/2023 - build-debian-armhf-10-buster-gtk3: <<: *std-filters -## Frozen - 28/05/2023 - build-debian-arm64-10-buster: <<: *std-filters -## Frozen - 28/05/2023 - build-debian-x86_64-10-buster: - <<: *std-filters -## Frozen - 28/05/2023 - - build-debian-armhf-11-bullseye: - <<: *std-filters -## Frozen - 28/05/2023 - - build-debian-arm64-11-bullseye: - <<: *std-filters -## Frozen - 28/05/2023 - - build-debian-x86_64-11-bullseye: <<: *std-filters + ## ------------------------------------- ## UBUNTU OS Frozen - 28/05/2023 DROP ## ------------------------------------- -## KEEP needed for Raspbian OpenCPN v5.6 +## KEEP needed for Raspbian OpenCPN v5.6 - build-ubuntu-armhf-1804-buster: <<: *std-filters ## - build-ubuntu-x86_64-1804-bionic: @@ -118,7 +115,7 @@ commands: condition: <> steps: - run: sudo apt install -y python3-pip - - run: python3.8 -m pip install cloudsmith-cli + - run: python3 -m pip install cloudsmith-cli - when: condition: <> steps: @@ -133,12 +130,12 @@ commands: # provide the wxWidgets QT information. jobs: -## -------------------- +## --------------------- ## OpenCPN 5.8 Plugins ## --------------------- build-android-arm64: docker: - - image: cimg/android:2021.10.2-ndk + - image: cimg/android:2023.12-ndk resource_class: large environment: - OCPN_TARGET: android-arm64 @@ -151,10 +148,11 @@ jobs: install-python: true build-android-armhf: docker: - - image: cimg/android:2021.10.2-ndk + - image: cimg/android:2023.12-ndk resource_class: large environment: - OCPN_TARGET: android-armhf + - DEPLOY_USE_ORB: true steps: - checkout - run: chmod a+x ci/*.sh @@ -163,8 +161,7 @@ jobs: install-python: true build-macos-wx32: macos: - xcode: "12.5.1" - resource_class: macos.x86.medium.gen2 + xcode: "13.4" environment: - OCPN_TARGET: macos - CLOUDSMITH_PKG_EXT: pkg @@ -175,6 +172,33 @@ jobs: - run: chmod a+x ci/*.sh - run: bash ci/circleci-build-macos.sh - deploy-code + build-macos-universal: + macos: + xcode: "12.5.1" + environment: + - OCPN_TARGET: macos + - CMAKE_BUILD_PARALLEL_LEVEL: 2 + - WX_VER: 32 + steps: + - checkout + - run: sudo chmod go+w /usr/local + - restore_cache: + key: "{{checksum \"build-deps/macos-cache-stamp\"}}\ + -{{checksum \"cmake/MacosWxwidgets.cmake\"}}\ + -{{checksum \"ci/circleci-build-macos-universal.sh\"}}" + - run: ci/circleci-build-macos-universal.sh + - save_cache: + key: "{{checksum \"build-deps/macos-cache-stamp\"}}\ + -{{checksum \"cmake/MacosWxwidgets.cmake\"}}\ + -{{checksum \"ci/circleci-build-macos-universal.sh\"}}" + paths: + - /tmp/local.cache.tar + - /Users/distiller/project/cache + - run: > + sh -c "otool -L build/*.dylib" + - run: > + sh -c "cat build/*.xml" + - deploy-code build-msvc-wx32-2022: executor: name: win/server-2022 @@ -277,7 +301,61 @@ jobs: command: ci/circleci-build-ubuntu-docker.sh no_output_timeout: 30m - deploy-code -## KEEP needed for Raspbian OpenCPN v5.8(wx32) + build-debian-armhf-11-bullseye: + machine: + image: ubuntu-2004:202104-01 + environment: + - OCPN_TARGET=bullseye-armhf + - DOCKER_IMAGE=jongough/debian-armhf:bullseye + - BUILD_FLAGS=-j3 + - BUILD_ENV=debian + - BUILD_GTK3: true + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-debian-arm64-11-bullseye: + machine: + image: ubuntu-2004:202104-01 + environment: + - OCPN_TARGET=bullseye-arm64 + - DOCKER_IMAGE=arm64v8/debian:bullseye-backports + - BUILD_FLAGS=-j3 + - BUILD_ENV=debian + - BUILD_GTK3: true + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-debian-x86_64-11-bullseye: + docker: + - image: circleci/buildpack-deps:bullseye-scm + environment: + - OCPN_TARGET: bullseye + - BUILD_GTK3: true + - DEPLOY_USE_ORB: true + - BUILD_ENV=debian + steps: + - checkout + - run: > + echo "deb-src http://ftp.us.debian.org/debian bullseye main" + | sudo tee -a /etc/apt/sources.list + - run: > + echo "deb-src http://ftp.us.debian.org/debian bullseye-updates main" + | sudo tee -a /etc/apt/sources.list + - run: cat /etc/apt/sources.list + - run: chmod a+x ci/*.sh + - run: ci/circleci-build-debian.sh + - deploy-code +## KEEP needed for OpenCPN v5.8 Jammy wx32 build build-ubuntu-x86_64-2204-jammy: docker: - image: cimg/base:edge-22.04 @@ -294,7 +372,7 @@ jobs: - run: > echo "deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates main" | sudo tee -a /etc/apt/sources.list - run: > - echo "deb [trusted=yes] https://ppa.launchpadcontent.net/bdbcat/opencpn/ubuntu/ jammy main" | sudo tee -a /etc/apt/sources.list + echo "deb [trusted=yes] https://ppa.launchpadcontent.net/opencpn/opencpn/ubuntu/ jammy main" | sudo tee -a /etc/apt/sources.list - run: cat /etc/apt/sources.list - run: chmod a+x ci/*.sh - run: ci/circleci-build-debian.sh @@ -304,32 +382,35 @@ jobs: ## --------------------- build-macos: macos: - xcode: "12.5.1" - resource_class: macos.x86.medium.gen2 + xcode: "13.4" environment: - OCPN_TARGET: macos - CLOUDSMITH_PKG_EXT: pkg - DEPLOY_USE_ORB: true - - WX_VER: 312 + - WX_VER: 315 steps: - checkout - run: chmod a+x ci/*.sh - run: bash ci/circleci-build-macos.sh - deploy-code -## Appveyor builds Windows including WinXT. -## If below is used, will WinXT work? +## Appveyor doesn't build for Windows now. +## If below is used, WinXT will not work. build-msvc-2022: - executor: win/server-2022 + executor: + name: win/server-2022 + shell: cmd.exe environment: - OCPN_TARGET: MSVC - MSVC_VERSION: 2022 - WX_VER: 31 - - DEPLOY_USE_ORB: true steps: - checkout - - run: ci/circleci-build-msvc + - run: + privileged: False + shell: cmd.exe + command: ci\circleci-build-msvc.bat - deploy-code: - install-python: true + DEPLOY-USE-ORB: false build-debian-armhf-10-buster: machine: image: ubuntu-2004:202104-01 @@ -398,64 +479,11 @@ jobs: - run: chmod a+x ci/*.sh - run: ci/circleci-build-debian.sh - deploy-code - build-debian-armhf-11-bullseye: - machine: - image: ubuntu-2004:202104-01 - environment: - - OCPN_TARGET=bullseye-armhf - - DOCKER_IMAGE=jongough/debian-armhf:bullseye - - BUILD_FLAGS=-j3 - - BUILD_ENV=debian - - BUILD_GTK3: true - - DEPLOY_USE_ORB: true - steps: - - checkout - - run: chmod a+x ./ci/*.sh - - run: - command: ci/circleci-build-ubuntu-docker.sh - no_output_timeout: 30m - - deploy-code - build-debian-arm64-11-bullseye: - machine: - image: ubuntu-2004:202104-01 - environment: - - OCPN_TARGET=bullseye-arm64 - - DOCKER_IMAGE=arm64v8/debian:bullseye-backports - - BUILD_FLAGS=-j3 - - BUILD_ENV=debian - - BUILD_GTK3: true - - DEPLOY_USE_ORB: true - steps: - - checkout - - run: chmod a+x ./ci/*.sh - - run: - command: ci/circleci-build-ubuntu-docker.sh - no_output_timeout: 30m - - deploy-code - build-debian-x86_64-11-bullseye: - docker: - - image: circleci/buildpack-deps:bullseye-scm - environment: - - OCPN_TARGET: bullseye - - BUILD_GTK3: true - - DEPLOY_USE_ORB: true - - BUILD_ENV=debian - steps: - - checkout - - run: > - echo "deb-src http://ftp.us.debian.org/debian bullseye main" - | sudo tee -a /etc/apt/sources.list - - run: > - echo "deb-src http://ftp.us.debian.org/debian bullseye-updates main" - | sudo tee -a /etc/apt/sources.list - - run: cat /etc/apt/sources.list - - run: chmod a+x ci/*.sh - - run: ci/circleci-build-debian.sh - - deploy-code + ## ------------------------------------------- ## Ubuntu OS - Generally deprecated and not used. ## ------------------------------------------- -## KEEP needed for Raspbian OpenCPN v5.6 +## KEEP needed for Raspbian OpenCPN v5.6 build-ubuntu-armhf-1804-buster: machine: image: ubuntu-2004:202104-01 @@ -547,4 +575,4 @@ jobs: - run: cat /etc/apt/sources.list - run: chmod a+x ci/*.sh - run: ci/circleci-build-debian.sh - - deploy-code \ No newline at end of file + - deploy-code diff --git a/.circleci/config.yml.bak b/.circleci/config.yml.bak new file mode 100644 index 00000000..24500311 --- /dev/null +++ b/.circleci/config.yml.bak @@ -0,0 +1,577 @@ +--- +version: 2.1 + +parameters: + run_workflow_deploy: + type: boolean + default: true + +## Start of build control of O58 and O562 plugins +## run_workflow_deploy_O58 +## type: boolean +## default: true +## run_workflow_deploy_O562 +## type: boolean +## default: false + +std-filters: &std-filters + filters: + branches: + ignore: + - devel + - tmp + tags: + only: /.*/ + +workflows: + build_all: + jobs: +## ---------------------- +## OpenCPN 5.8 Plugins +## ---------------------- + - build-android-arm64: + <<: *std-filters + - build-android-armhf: + <<: *std-filters + - build-macos-wx32: + <<: *std-filters + - build-flatpak-arm64-2208: + <<: *std-filters + - build-flatpak-x86-2208: + <<: *std-filters +## flatpak-armhf has Insufficient performance. +## Appveyor can also build for Windows. + - build-msvc-wx32-2022: + <<: *std-filters + - build-debian-arm64-12-bookworm: + <<: *std-filters + - build-debian-armhf-12-bookworm: + <<: *std-filters + - build-debian-x86_64-12-bookworm: + <<: *std-filters + - build-debian-armhf-11-bullseye: + <<: *std-filters + - build-debian-arm64-11-bullseye: + <<: *std-filters + - build-debian-x86_64-11-bullseye: + <<: *std-filters +## KEEP needed for Jammy with wx32 + - build-ubuntu-x86_64-2204-jammy: + <<: *std-filters + - build-macos-universal: + <<: *std-filters + +## ------------------------------------------- +## OpenCPN 5.6.2 Plugins Frozen - 28/05/2023 +## ------------------------------------------ +## Circleci will not build for macos 11 so removed - 18/10/2023 + - build-macos: + <<: *std-filters +## Appveyor no longer builds for Windows. + - build-msvc-2022: + <<: *std-filters + - build-debian-armhf-10-buster: + <<: *std-filters + - build-debian-armhf-10-buster-gtk3: + <<: *std-filters + - build-debian-arm64-10-buster: + <<: *std-filters + - build-debian-x86_64-10-buster: + <<: *std-filters + +## ------------------------------------- +## UBUNTU OS Frozen - 28/05/2023 DROP +## ------------------------------------- +## KEEP needed for Raspbian OpenCPN v5.6 + - build-ubuntu-armhf-1804-buster: + <<: *std-filters +## - build-ubuntu-x86_64-1804-bionic: +## <<: *std-filters +## - build-ubuntu-x86_64-1804-bionic-gtk3: +## <<: *std-filters +## - build-ubuntu-armhf-2004-focal-gtk3: +## <<: *std-filters +## - build-ubuntu-x86_64-2004-focal-gtk3: +## <<: *std-filters +orbs: + cloudsmith: cloudsmith/cloudsmith@1.0.4 + win: circleci/windows@5.0 + +commands: + deploy-code: + parameters: + install-python: + type: boolean + default: false + DEPLOY-USE-ORB: + type: boolean + default: true + steps: + - when: + condition: <> + steps: + - when: + condition: <> + steps: + - run: sudo apt install -y python3-pip + - run: python3 -m pip install cloudsmith-cli + - when: + condition: <> + steps: + - cloudsmith/ensure-api-key + - cloudsmith/install-cli + - run: bash ci/cloudsmith-upload.sh + + # if you want to use a local proxy add Acquire::http::Proxy \"http://192.168.1.1:3142\"; to a file called circleci-cache/apt-proxy. This will require + # --volume {your local directory}/circleci-cache:/home/circleci/circleci-cache + # on the circleci local command line so that the docker image script can have access to the directory + # if you are on a slow or data limited internet link you can put a copy of master.zip here, or allow one to be downloaded by the script, as it is used by the android builds to + # provide the wxWidgets QT information. + +jobs: +## --------------------- +## OpenCPN 5.8 Plugins +## --------------------- + build-android-arm64: + docker: + - image: cimg/android:2023.12-ndk + resource_class: large + environment: + - OCPN_TARGET: android-arm64 + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ci/*.sh + - run: bash ci/circleci-build-android-arm64.sh + - deploy-code: + install-python: true + build-android-armhf: + docker: + - image: cimg/android:2023.12-ndk + resource_class: large + environment: + - OCPN_TARGET: android-armhf + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ci/*.sh + - run: bash ci/circleci-build-android-armhf.sh + - deploy-code: + install-python: true + build-macos-wx32: + macos: + xcode: "13.4" + environment: + - OCPN_TARGET: macos + - CLOUDSMITH_PKG_EXT: pkg + - DEPLOY_USE_ORB: true + - WX_VER: 32 + steps: + - checkout + - run: chmod a+x ci/*.sh + - run: bash ci/circleci-build-macos.sh + - deploy-code + build-macos-universal: + macos: + xcode: "12.5.1" + environment: + - OCPN_TARGET: macos + - CMAKE_BUILD_PARALLEL_LEVEL: 2 + - WX_VER: 32 + steps: + - checkout + - run: sudo chmod go+w /usr/local + - restore_cache: + key: "{{checksum \"build-deps/macos-cache-stamp\"}}\ + -{{checksum \"cmake/MacosWxwidgets.cmake\"}}\ + -{{checksum \"ci/circleci-build-macos-universal.sh\"}}" + - run: ci/circleci-build-macos-universal.sh + - save_cache: + key: "{{checksum \"build-deps/macos-cache-stamp\"}}\ + -{{checksum \"cmake/MacosWxwidgets.cmake\"}}\ + -{{checksum \"ci/circleci-build-macos-universal.sh\"}}" + paths: + - /tmp/local.cache.tar + - /Users/distiller/project/cache + - run: > + sh -c "otool -L build/*.dylib" + - run: > + sh -c "cat build/*.xml" + - deploy-code + build-msvc-wx32-2022: + executor: + name: win/server-2022 + shell: cmd.exe + environment: + - OCPN_TARGET: MSVC + - MSVC_VERSION: 2022 + - WX_VER: 32 + steps: + - checkout + - run: + privileged: False + shell: cmd.exe + command: ci\circleci-build-msvc.bat + - deploy-code: + DEPLOY-USE-ORB: false + build-flatpak-arm64-2208: + machine: + image: ubuntu-2004:202101-01 + resource_class: arm.medium + environment: + - OCPN_TARGET: flatpak-arm64 + - FLATPAK_BRANCH: stable + - CLOUDSMITH_PKG_EXT: gz + - SDK_VER: 22.08 + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ci/*.sh + - run: + command: bash ci/circleci-build-flatpak.sh + - deploy-code + build-flatpak-x86-2208: + machine: + image: ubuntu-2004:202010-01 + environment: + - OCPN_TARGET: flatpak + - FLATPAK_BRANCH: beta + - CLOUDSMITH_PKG_EXT: gz + - SDK_VER: 22.08 + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ci/*.sh + - run: + command: bash ci/circleci-build-flatpak.sh + no_output_timeout: 30m + - deploy-code + build-debian-arm64-12-bookworm: + machine: + image: ubuntu-2004:202104-01 + environment: + - OCPN_TARGET=bookworm-arm64 + - DOCKER_IMAGE=arm64v8/debian:bookworm + - BUILD_FLAGS=-j3 + - BUILD_ENV=debian + - WX_VER: 32 + - BUILD_GTK3: true + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-debian-armhf-12-bookworm: + machine: + image: ubuntu-2004:202104-01 + resource_class: arm.medium + environment: + - OCPN_TARGET=bookworm-armhf + - DOCKER_IMAGE=arm32v7/debian:bookworm + - BUILD_FLAGS=-j3 + - BUILD_ENV=debian + - WX_VER: 32 + - BUILD_GTK3: true + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-debian-x86_64-12-bookworm: + machine: + image: ubuntu-2004:202104-01 + environment: + - OCPN_TARGET: bookworm + - BUILD_GTK3: true + - WX_VER: 32 + - DEPLOY_USE_ORB: true + - BUILD_ENV=debian + - DOCKER_IMAGE=debian:bookworm + steps: + - checkout + - run: chmod a+x ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-debian-armhf-11-bullseye: + machine: + image: ubuntu-2004:202104-01 + environment: + - OCPN_TARGET=bullseye-armhf + - DOCKER_IMAGE=jongough/debian-armhf:bullseye + - BUILD_FLAGS=-j3 + - BUILD_ENV=debian + - BUILD_GTK3: true + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-debian-arm64-11-bullseye: + machine: + image: ubuntu-2004:202104-01 + environment: + - OCPN_TARGET=bullseye-arm64 + - DOCKER_IMAGE=arm64v8/debian:bullseye-backports + - BUILD_FLAGS=-j3 + - BUILD_ENV=debian + - BUILD_GTK3: true + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-debian-x86_64-11-bullseye: + docker: + - image: circleci/buildpack-deps:bullseye-scm + environment: + - OCPN_TARGET: bullseye + - BUILD_GTK3: true + - DEPLOY_USE_ORB: true + - BUILD_ENV=debian + steps: + - checkout + - run: > + echo "deb-src http://ftp.us.debian.org/debian bullseye main" + | sudo tee -a /etc/apt/sources.list + - run: > + echo "deb-src http://ftp.us.debian.org/debian bullseye-updates main" + | sudo tee -a /etc/apt/sources.list + - run: cat /etc/apt/sources.list + - run: chmod a+x ci/*.sh + - run: ci/circleci-build-debian.sh + - deploy-code +## KEEP needed for OpenCPN v5.8 Jammy wx32 build + build-ubuntu-x86_64-2204-jammy: + docker: + - image: cimg/base:edge-22.04 + environment: + - BUILD_GTK3: true + - WX_VER: 32 + - OCPN_TARGET: jammy + - DEPLOY_USE_ORB: true + - BUILD_ENV=ubuntu + steps: + - checkout + - run: > + echo "deb-src http://us.archive.ubuntu.com/ubuntu/ jammy main" | sudo tee -a /etc/apt/sources.list + - run: > + echo "deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates main" | sudo tee -a /etc/apt/sources.list + - run: > + echo "deb [trusted=yes] https://ppa.launchpadcontent.net/opencpn/opencpn/ubuntu/ jammy main" | sudo tee -a /etc/apt/sources.list + - run: cat /etc/apt/sources.list + - run: chmod a+x ci/*.sh + - run: ci/circleci-build-debian.sh + - deploy-code +## --------------------- +## OpenCPN 5.6.2 Plugins +## --------------------- + build-macos: + macos: + xcode: "13.4" + environment: + - OCPN_TARGET: macos + - CLOUDSMITH_PKG_EXT: pkg + - DEPLOY_USE_ORB: true + - WX_VER: 315 + steps: + - checkout + - run: chmod a+x ci/*.sh + - run: bash ci/circleci-build-macos.sh + - deploy-code +## Appveyor doesn't build for Windows now. +## If below is used, WinXT will not work. + build-msvc-2022: + executor: + name: win/server-2022 + shell: cmd.exe + environment: + - OCPN_TARGET: MSVC + - MSVC_VERSION: 2022 + - WX_VER: 31 + steps: + - checkout + - run: + privileged: False + shell: cmd.exe + command: ci\circleci-build-msvc.bat + - deploy-code: + DEPLOY-USE-ORB: false + build-debian-armhf-10-buster: + machine: + image: ubuntu-2004:202104-01 + environment: + - OCPN_TARGET=buster-armhf + - DOCKER_IMAGE=jongough/debian-armhf:buster + - BUILD_FLAGS=-j3 + - BUILD_ENV=debian + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-debian-armhf-10-buster-gtk3: + machine: + image: ubuntu-2004:202104-01 + environment: + - OCPN_TARGET=buster-armhf + - DOCKER_IMAGE=jongough/debian-armhf:buster + - BUILD_FLAGS=-j3 + - BUILD_ENV=debian + - BUILD_GTK3: true + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-debian-arm64-10-buster: + machine: + image: ubuntu-2004:202104-01 + resource_class: arm.medium + environment: + - OCPN_TARGET=buster-arm64 + - DOCKER_IMAGE=jongough/debian-arm64:buster + - BUILD_FLAGS=-j3 + - BUILD_ENV=debian + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-debian-x86_64-10-buster: + docker: + - image: circleci/buildpack-deps:buster-scm + environment: + - OCPN_TARGET: buster + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: > + echo "deb-src http://ftp.us.debian.org/debian buster main" + | sudo tee -a /etc/apt/sources.list + - run: > + echo "deb-src http://ftp.us.debian.org/debian buster-updates main" + | sudo tee -a /etc/apt/sources.list + - run: cat /etc/apt/sources.list + - run: chmod a+x ci/*.sh + - run: ci/circleci-build-debian.sh + - deploy-code + +## ------------------------------------------- +## Ubuntu OS - Generally deprecated and not used. +## ------------------------------------------- +## KEEP needed for Raspbian OpenCPN v5.6 + build-ubuntu-armhf-1804-buster: + machine: + image: ubuntu-2004:202104-01 + environment: + - OCPN_TARGET=buster-armhf + - DOCKER_IMAGE=jongough/ubuntu-armhf:18.04 + - BUILD_FLAGS=-j3 + - BUILD_ENV=ubuntu + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-ubuntu-x86_64-1804-bionic: + docker: + - image: cimg/base:stable-18.04 + environment: + - OCPN_TARGET: bionic + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: > + echo "deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main" + | sudo tee -a /etc/apt/sources.list + - run: > + echo "deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main" + | sudo tee -a /etc/apt/sources.list + - run: cat /etc/apt/sources.list + - run: chmod a+x ci/*.sh + - run: ci/circleci-build-debian.sh + - deploy-code + build-ubuntu-x86_64-1804-bionic-gtk3: + docker: + - image: cimg/base:stable-18.04 + environment: + - BUILD_GTK3: true + - OCPN_TARGET: bionic-gtk3 + - DEPLOY_USE_ORB: true + - BUILD_ENV=ubuntu + steps: + - checkout + - run: > + echo "deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main" + | sudo tee -a /etc/apt/sources.list + - run: > + echo "deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main" + | sudo tee -a /etc/apt/sources.list + - run: cat /etc/apt/sources.list + - run: chmod a+x ci/*.sh + - run: ci/circleci-build-debian.sh + - deploy-code + build-ubuntu-armhf-2004-focal-gtk3: + machine: + image: ubuntu-2004:202104-01 + environment: + - OCPN_TARGET=focal-armhf + - OCPN_BRANCH=master + - DOCKER_IMAGE=jongough/ubuntu-armhf:20.04 + - BUILD_FLAGS=-j3 + - BUILD_ENV=ubuntu + - TZ="America/New_York" + - DEBIAN_FRONTEND="noninteractive" + - BUILD_GTK3: true + - DEPLOY_USE_ORB: true + steps: + - checkout + - run: chmod a+x ./ci/*.sh + - run: + command: ci/circleci-build-ubuntu-docker.sh + no_output_timeout: 30m + - deploy-code + build-ubuntu-x86_64-2004-focal-gtk3: + docker: + - image: cimg/base:stable-20.04 + environment: + - BUILD_GTK3: true + - OCPN_TARGET: focal-gtk3 + - DEPLOY_USE_ORB: true + - BUILD_ENV=ubuntu + steps: + - checkout + - run: > + echo "deb-src http://us.archive.ubuntu.com/ubuntu/ focal main" | sudo tee -a /etc/apt/sources.list + - run: > + echo "deb-src http://us.archive.ubuntu.com/ubuntu/ focal-updates main" | sudo tee -a /etc/apt/sources.list + - run: cat /etc/apt/sources.list + - run: chmod a+x ci/*.sh + - run: ci/circleci-build-debian.sh + - deploy-code diff --git a/.gitignore b/.gitignore index b9ab7071..2cfb9c45 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ -./build* +cmake-build* +build/* +.idea* +.directory po/POTFILES.in.test temp tmp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..43e07706 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "opencpn-libs"] + path = opencpn-libs + url = https://github.com/OpenCPN/opencpn-libs.git + branch = main diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f4625eda..00000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: cpp - -matrix: - include: -# The following 2 env: sections are now being done in circleci but are left here for examples -# - env: -# - OCPN_TARGET=stretch-armhf -# - DOCKER_IMAGE=raspbian/stretch -# - BUILD_FLAGS="-j2" -# - BUILD_ENV=raspbian -# services: -# - docker -# before_script: -# - travis_wait 120 sleep infinity & bash ./ci/travis-build-raspbian-armhf-part1.sh -# script: -# - travis_wait 120 sleep infinity & bash ./ci/travis-build-raspbian-armhf-part2.sh -# - env: -# - OCPN_TARGET=buster-armhf -# - DOCKER_IMAGE=jongough/raspbian-buster:plugin_build_tooling_current -# - BUILD_FLAGS=-j2 -# - BUILD_ENV=raspbian -# services: -# - docker -# before_script: -# - travis_wait 120 sleep infinity & bash ./ci/travis-build-raspbian-armhf-part1.sh -# script: -# - travis_wait 120 sleep infinity & bash ./ci/travis-build-raspbian-armhf-part2.sh -# The following env: section is for arm64 has now been moved to run in circleci -# - env: -# - OCPN_TARGET=bionic-armh64 -# - BUILD_GTK3=true -# - DOCKER_IMAGE=arm64v8/ubuntu:18.04 -# - BUILD_FLAGS=-j2 -# - BUILD_ENV=ubuntu -# services: -# - docker -# before_script: -# - travis_wait 120 sleep infinity & bash ./ci/travis-build-raspbian-armhf-part1.sh -# script: -# - travis_wait 120 sleep infinity & bash ./ci/travis-build-raspbian-armhf-part2.sh -# - bash ./ci/cloudsmith-upload.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e194ed4..5b2d1765 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ ## Author: Sean d'Epagnier ##*************************************************************************** ## * Copyright (C) 2010 by Sean d'Epagnier * +## * License: GPLv3+ ## * This program is free software; you can redistribute it and/or modify * ## * it under the terms of the GNU General Public License as published by * ## * the Free Software Foundation; either version 2 of the License, or * @@ -17,15 +18,15 @@ ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, * ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * #----------------------------------------------------------------------------- -# Frontend2 Author: Jon Gough TP v1.0.253.0 07/08/2023 DD/MM/YYYY format +# Frontend2 Author: Jon Gough +# Testplugin(TP) v1.0.286.3 29/12/2023 DD/MM/YYYY format # buildCI:yes useODAPI:no validateJSON:no # --------------------------------------------------------------------------- -## ----- When changing this file do NOT change the order in which sections occur ----- ## -## ----- Changes should only be made between the section blocks that identify where ----- ## -## ----- these changes should be. The whole configuration process relies on this ----- ## -## ----- sequence to be successful ----- ## - -##----- Modify section below to include all the details for your plugin ----- ## +## -- When changing this file do NOT change the order of the sections. -- ## +## -- Make changes only between the section blocks identified -- ## +## -- The whole configuration process relies on this sequence for success.-- ## +## +## -- Modify section below to include all the details for your plugin. -- ## set(CMLOC "CMakeLists: ") @@ -36,8 +37,9 @@ if(COMMAND cmake_policy) cmake_policy(SET CMP0043 NEW) endif(POLICY CMP0043) cmake_policy(SET CMP0048 NEW) -# Need cmake 3.13 to implement this, but raspbian builds are at 3.7.2 and bionic at 3.10 and xenial builds at 3.5.1 -# cmake_policy(SET CMP0076 NEW) + if(POLICY CMP0076) + cmake_policy(SET CMP0076 NEW) + endif(POLICY CMP0076) if(POLICY CMP0077) cmake_policy(SET CMP0077 NEW) endif(POLICY CMP0077) @@ -50,22 +52,23 @@ set(TITLE_NAME "weatherrouting") set(PACKAGE_CONTACT "Sean d'Epagnier") set(PACKAGE "weather_routing_pi") set(SHORT_DESCRIPTION "Compute optimal routes based on weather and constraints.") -set(LONG_DESCRIPTION "WR features include: optimal routing subject to various constraints based on weather data, automatic boat polar computation.") +set(LONG_DESCRIPTION "WR features include: optimal routing subject to various constraints based on weather data, automatic boat polar computation.") set(VERSION_MAJOR "1") set(VERSION_MINOR "15") -set(VERSION_PATCH "3") -set(VERSION_TWEAK "0") -set(VERSION_DATE "31/08/2023")#DD/MM/YYYY format +set(VERSION_PATCH "18") +set(VERSION_TWEAK "6") +set(VERSION_DATE "21/01/2023")#DD/MM/YYYY format set(OCPN_MIN_VERSION "ov58") + set(OCPN_API_VERSION_MAJOR "1") -set(OCPN_API_VERSION_MINOR "16") -set(TP_COMMENT " * Release for O571 or o58 using CI") +set(OCPN_API_VERSION_MINOR "17") +set(TP_COMMENT " * Release using CI") set(PARENT "opencpn") -#Used to set up a local webserver with git loaded, for testing purposes. -#Now set in plugin configure, needed to build flatpak, also locally. +#Use to set up a local webserver with git installed. +#Default is github.com. Now set in pluginconfigure.cmake #set(GIT_REPOSITORY_SERVER "github.com") ## Specifies Cloudsmith upload repository suffix for each catalog @@ -78,30 +81,25 @@ set(ALPHA "alpha") #Standard Repos #set(CLOUDSMITH_BASE_REPOSITORY "opencpn-plugins") #Ricks's customization set(CLOUDSMITH_BASE_REPOSITORY "weather-routing") #without the _pi +# Set the following to use OpenCPN cloudsmith repositories instead of own repositories set(CLOUDSMITH_USER "opencpn") -#set(CLOUDSMITH_USER "rick-gleason") +# set(CLOUDSMITH_USER "rick-gleason") -# Set Plugin info-url, summary and description -set(XML_INFO_URL "https://opencpn.org/OpenCPN/plugins/weatherroute.html") +set(XML_INFO_URL "https://opencpn.org/OpenCPN/plugins/weatherroute.html") set(XML_SUMMARY ${SHORT_DESCRIPTION}) set(XML_DESCRIPTION ${LONG_DESCRIPTION}) -## ----- Modify section above to include all the details for your plugin ----- ## -## ----- Modify section below if there are special requirements for the plugin ----- ## +## ----- Modify section above to include all the details for your plugin ------- ## +## ----- Modify section below if there are special requirements for the plugin --## option(PLUGIN_USE_SVG "Use SVG graphics" ON) set(CMAKE_CXX_STANDARD 11) -# Use local version of GLU library -# requires libs/glu directory -set(USE_LOCAL_GLU TRUE) # Prefer libGL.so to libOpenGL.so, see CMP0072 set(OpenGL_GL_PREFERENCE "LEGACY") #not operational -# Don't use local version of GLU library -#set(USE_LOCAL_GLU FALSE) #not operational - -option(USE_GL "Enable OpenGL support" ON) #WxRoute requires on +# For Weatherfax this must be set ON or it fails to compile +option(USE_GL "Enable OpenGL support" ON) message(STATUS "${CMLOC}USE_GL: ${USE_GL}") if("${CMAKE_BUILD_TYPE}" STREQUAL "") @@ -110,34 +108,37 @@ endif("${CMAKE_BUILD_TYPE}" STREQUAL "") set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "" "Debug" "Release" "RelWithDebInfo" "MinSizeRel") message(STATUS "${CMLOC}Build type: ${CMAKE_BUILD_TYPE}") -## ----- The statements below are used to setup standard variables that are required by the CMAKE process - do not remove ----- ## +## ----- Statements below used to setup standard variables required by the CMAKE process -- Do not remove - ## project(${PACKAGE}) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -#======================================================== +##======================================================== + include("PluginSetup") -#======================================================== -## ----- The above is used to setup standard variables that are required by the CMAKE process - do not remove ----- ## -## ----- Modify section below if there are special requirements for the plugin ----- ## + +##======================================================== +## ----- Above sets up standard variables required by CMAKE - Do not remove -----## +## ----- Modify section below if there are special requirements for the plugin --## set(CMAKE_VERBOSE_MAKEFILE "Activate verbose mode for make files" ON) option(Plugin_CXX11 "Use c++11" OFF) -## ----- Modify section above if there are special requirements for the plugin ----- ## -## ----- do not change next section - needed to configure build process ----- ## -#=========================================================== +## ----- Modify section above if there are special requirements for the plugin --## +## ----- Do not change next section - needed to configure build process ---------## +##=========================================================== + include("PluginConfigure") -#=========================================================== -## ----- do not change section above - needed to configure build process ----- ## -## ----- Change below to match project requirements for source, headers, etc. ----- ## + +##=========================================================== +## ----- Do not change section above - needed to configure build process --------## +## ----- Change below to match project requirements for source, headers, etc. ---## add_definitions(-DUSE_S57) -#======== Below from cmakelists.txt weather_routing_pi -# ----Remember to Add your project Set(SRCS and set(HDRS etc.. +## ---- Section Below - Add your project SET(SRCS and SET(HDRS etc.. SET(SRCS src/weather_routing_pi.cpp @@ -195,120 +196,89 @@ SET (HDRS include/navobj_util.h ) -set(EXTSRC -) -set(EXTINCLUDE - extinclude/ODAPI.h - extinclude/ODJSONSchemas.h -) - -set(LIBSSRC libs/wxJSON/src/jsonreader.cpp libs/wxJSON/src/jsonval.cpp libs/wxJSON/src/jsonwriter.cpp) - -set(LIBHDRS - libs/GL/gl.h - libs/GL/gl_private.h - libs/GL/glext.h - libs/GL/glu.h - libs/wxJSON/include/json_defs.h - libs/wxJSON/include/jsonreader.h - libs/wxJSON/include/jsonval.h - libs/wxJSON/include/jsonwriter.h) add_definitions(-DPLUGIN_USE_SVG) -set(EXTINCLUDE_DIR ${EXTINCLUDE_DIR} extinclude libs/ocpn-api/) - - -# ----- If using JSON validation in plugin section below is needed ----- ## - +## ----- Section above - Add your project SET(SRCS and SET(HDRS etc.-------## +## ----- If using JSON validation in plugin section below is needed --------## # Do not need Json Schema Validation +## ----- If using JSON validation in plugin section above is needed --------## -# ----- If using JSON validation in plugin section above is needed ----- ## - -##================================================================================ -## Required to collect all the set( headers and SRCS - Adjust as required +##============================================================= +## Change as required to collect all the set( headers and SRCS ## This add_library can be used in conditionals below. -##================================================================================ - - - -SET(SRC ${SRCS} ${HDRS} ${SRC_LIBTESS2} ) - - - -##========================================= +##============================================================= +SET(SRC ${SRCS} ${HDRS} ) ##============================================================= -# Modify/configure 'Include' Directories below for the Plugin +## Modify/configure 'Include' Directories below for the Plugin ##============================================================= include_directories(BEFORE ${PROJECT_SOURCE_DIR}/include) -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/ocpninclude) -#include_directories(BEFORE ${PROJECT_SOURCE_DIR}/ocpnsrc/glu/include) -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/${EXTINCLUDE_DIR}) -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/) -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/GL) -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/ocpn-api) -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/wxJSON/include) -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/pugixml) -## -## ----- Change above to match project requirements for android build ----- ## -## - -#if(QT_ANDROID) -# include_directories( ${PROJECT_SOURCE_DIR}/extinclude/GLES2) -#endif(QT_ANDROID) - -##================================================= -target_sources(${PACKAGE_NAME} PUBLIC ${SRC}) -##================================================= +## Change target_sources to match your project needs. +##============================================================== +target_sources(${PACKAGE_NAME} PUBLIC ${SRC} ) +##============================================================== if(NOT OCPN_FLATPAK_CONFIG) - # Build environment not available when flatpak is being configured so following statements will not work + # Build environment not available when flatpak is being configured + # so following statements will not work message(STATUS "${CMLOC}Adding target link libraries to ${PACKAGE_NAME}") - add_subdirectory(libs/tinyxml) + if (WIN32) + add_subdirectory(opencpn-libs/WindowsHeaders) + target_link_libraries(${PACKAGE_NAME} windows::headers) + endif (WIN32) + + add_subdirectory(opencpn-libs/api-17) + target_link_libraries(${PACKAGE_NAME} ocpn::api) + add_subdirectory(opencpn-libs/tinyxml) target_link_libraries(${PACKAGE_NAME} ocpn::tinyxml) -endif(NOT OCPN_FLATPAK_CONFIG) -add_definitions(-DTIXML_USE_STL) + add_subdirectory(opencpn-libs/odapi) + target_link_libraries(${PACKAGE_NAME} ocpn::odapi) -# -# ----- If using JSON validation in plugin section below is needed ----- ## -# + add_subdirectory(opencpn-libs/jsonlib) + target_link_libraries(${PACKAGE_NAME} ocpn::jsonlib) -# Do not need Json Schema Validation + add_subdirectory(opencpn-libs/plugin_dc) + target_link_libraries(${PACKAGE_NAME} ocpn::plugin-dc) + add_subdirectory(opencpn-libs/pugixml) + target_link_libraries(${PACKAGE_NAME} ocpn::pugixml) -# ----- If using JSON validation in plugin section above is needed ----- ## -# + IF(NOT UNIX) + add_subdirectory(opencpn-libs/bzip2) + target_link_libraries(${PACKAGE_NAME} ocpn::bzip2) + ENDIF(NOT UNIX) -## -## ----- Change above to match project requirements ----- ## -## + add_subdirectory(opencpn-libs/libtess2) + target_link_libraries(${PACKAGE_NAME} ocpn::libtess2) + +endif(NOT OCPN_FLATPAK_CONFIG) + +add_definitions(-DTIXML_USE_STL) ## -## ----- do not change next section - needed to configure build process ----- ## +## ----- If using JSON validation section below is needed ---------------## ## -IF(NOT UNIX) - include_directories(src/zlib-1.2.3) - include_directories(libs/bzip2) - add_subdirectory(libs/bzip2) - target_link_libraries(${PACKAGE_NAME} ocpn::bzip2) -ENDIF(NOT UNIX) +# Do not need Json Schema Validation + + +##------- Change below to match project requirements --------------------## IF(WIN32) IF(MSVC) - include_directories(${PROJECT_SOURCE_DIR}/buildwin/include) + #include_directories(${PROJECT_SOURCE_DIR}/buildwin/include) target_link_libraries(${PACKAGE_NAME} "${PROJECT_SOURCE_DIR}/buildwin/zlib1.lib") ELSE() # MINGW @@ -316,42 +286,26 @@ IF(WIN32) ENDIF() ENDIF() -#------- Change below to match project requirements -------------- +##------- Change below to match project requirements -------------- # Needed for android builds if(QT_ANDROID) include_directories(BEFORE ${qt_android_include}) endif(QT_ANDROID) -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/jsoncpp) -add_subdirectory(libs/jsoncpp) -target_link_libraries(${PACKAGE_NAME} ${PACKAGE_NAME}_LIB_PLUGINJSON) - -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/plugingl/include) -add_subdirectory(libs/plugingl) -target_link_libraries(${PACKAGE_NAME} ocpn::plugingl) +## Needed for all builds Do not change - needed to build app -------------## +##=============================================================== -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/libtess2/include) -add_subdirectory(libs/libtess2) -target_link_libraries(${PACKAGE_NAME} ocpn::libtess2) - -IF (MSVC) -include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/pugixml) -add_subdirectory(libs/pugixml) -target_link_libraries(${PACKAGE_NAME} ocpn::pugixml) -ENDIF (MSVC) - -# Needed for all builds -# ----- Do not change - needed to build app ----- ## -#======================================================== include("PluginInstall") include("PluginLocalization") include("PluginPackage") -#======================================================== -## ----- do not change section above - needed to configure build process ----- ## -## + +##================================================================ +## ----- Do not change section above - needed to configure build process --## + message(STATUS "${CMLOC}include directories: ") get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) foreach(dir ${dirs}) message(STATUS "${CMLOC}dir='${dir}'") endforeach() + diff --git a/Frontend2.md b/Frontend2.md deleted file mode 100644 index a327ae88..00000000 --- a/Frontend2.md +++ /dev/null @@ -1,185 +0,0 @@ -# FRONTEND 2 v1.0.124 - -GOAL: Assist plugin developers to convert their plugins to the Plugin Manager system which: -1. Uses tarballs and metadata.xml files to store the necessary files and provide information. -1. Deploys directly to Cloudsmith repositories (or another location) -1. Files are accessed by OpenCPN Plugin Manager -1. Installed via options > Plugins > Plugin Manager Catalogs "master" and "beta" url in the metadata files -1. During installation. - -This "Frontend2" configuration is found in jongough/testplugin_pi and is easier to configure all from CMakeLists.txt. -"Frontend1" can be found in the current versions of bdbcat/Oesenc_pi and rgleason/Vdr_pi. - - -## RENAME EXISTING DIRECTORIES AND FILES - -#### Important: -1. Make these changes on a new branch "frontend2" or "ci" (if possible). -1. Keep your currently working "master" branch intact. -1. Create a new branch EG: 'git checkout -b frontend2 master' -1. Work in the new branch. - -#### Preparation: -1. Rename CMakeLists.txt ----> CMakeLists.save.txt for reference -1. Rename appveyor.yml ----> appveyor.save.yml for reference -1. Rename .travis.yml ----> .travis.save.yml for reference -1. Rename the cmake directory ---> "cmake.save" for reference -1. Keep any other specialized plugin directories - -#### KEEP these directories, don't over-write them!: -- Include -- Data -- src -- po -- Any other specific plugin directories essential to your plugin. - - -## FOLDERS & FILES copied from TESTPLUGIN_PI - -#### Add these Directories + Sub-directories + Files - -Copy the following directories and files from testplugin_pi to the same location in the plugin directory you are working on: -- testplugin_pi/.circleci -- testplugin_pi/api-16 -- testplugin_pi/ci -- testplugin_pi/cmake -- testplugin_pi/buildosx -- testplugin_pi/mingw -- testplugin_pi/extinclude (JSON Validation - only Ocpn_draw, watchdog, weather_routing) -- testplugin_pi/extsrc (JSON Validation - only Ocpn_draw, watchdog, weather_routing) - -#### Files -Review and Compare these files, deployment to Cloudsmith is required. -- testplugin_pi/appveyor.yml (compare with your file) -- testplugin_pi/.travis.yml (compare with your file) -- testplugin_pi/CMakeLists.txt (see in line notes, major editing comparing to old file) -- See notes below for more detail - -#### Directories NOT needed -The following directories and files are not needed from testplugin_pi -- testplugin_pi/data -- testplugin_pi/forms -- testplugin_pi/include -- testplugin_pi/lib -- testplugin_pi/ocpninclude -- testplugin_pi/ocpnsrc -- testplugin_pi/src - - -## CHANGES REQUIRED - -1. Rename CMakeLists.txt, appveyor.yml, .travis.yml adding .save for reference. -1. Modify CMakeLists.txt file, following the in-line notes - - Modify Personal Specifics about Line 20 to 75. - - Enter setup information: - - Plugin name types - - CommonName -search "plugin"_pi.cpp for "GetCommon" - - Version numbers and date - - Parent, Package and Git User. Git Repository - - Cloudsmith User - - Cloudsmith Base Repository (optional) - - Plugin XML Info_url, Summary and Description - - In the section that replaces testplugin specific code: - - Modify/configure the set(SRCS and HDRS and 'Include' Directories using CMakeLists.save.txt - - Modify/configure 'Set(SRCS & HDRS' Directories using CMakeLists.save.txt - - Modify/configure 'Add Library' listings for the plugin. - - Make sure all your necessary libraries are found. - - Add/Modify a statement like this to join all of your project's set( - - EG: add_library(${PACKAGE_NAME} SHARED ${SRCS} ${HDRS} ${NMEA0183} ${LIBSSRC}) -1. API Number must be at least 1.16 for the new Plugin Manager, due to a change in how directories are found and location. -1. API Names have been changed from MY_API_VERSION_MAJOR and MY_API_VERSION_MINOR, to OCPN_API_VERSION_MAJOR/MINOR - - OCPN_API_VERSION_MAJOR/MINOR are now used in cmake/in-files/version.h.in - - In the file (pluginname_pi).cpp the are several lines which need to be changed from MY_API_VERSION_MAJOR/MINOR to - - EG: "return OCPN_API_VERSION_MAJOR;" - - EG: "return OCPN_API_VERSION_MINOR;" - - Also in file (pluginname_pi).cpp find wxString (pluginname_pi)::GetCommonName() and change - - return _("(pluginname-pi)"); to - - return _T(PLUGIN_COMMON_NAME); - - In the file (plugin_pi).h there are several lines which need to be commented out. - - // #define MY_API_VERSION_MAJOR 1 - - // #define MY_API_VERSION_MINOR 16 - - or removed. - - Because the new values definitions are defined in cmake/in-files/version.h.in -1. Cmake Files are somewhat generic, but often can be plugin specific, depending on the plugin. - - Review the cmake.save files one by one with the new ones and make necessary adjustments. - - Configuring this is not simple and requires knowledge about the plugin operation. -1. Get the ci/environment scripts working on Circleci, Appveyor and .travis-ci -1. Then get the uploads to Cloudsmith working. - - First create your Cloudsmith Account, then join the OpenCPN Organization as a member of the Plugins Team. - - Once you are accepted as a member, you will be able to create three repositories for your plugin. - - The management of Cloudsmith has advised that Organizations will in the future be restricted to having repositories in the Organization's Folder, so it is best to start out that way. - - Configuration of uploads to Cloudsmith destinations: - - ci\cloudsmith-upload.sh points to ..cmake\in-files\cloudsmith-upload.sh.in - - See for standard repository directories. - - @CLOUDSMITH_BASE_REPOSITORY@-prod - - @CLOUDSMITH_BASE_REPOSITORY@-beta - - @CLOUDSMITH_BASE_REPOSITORY@-alpha - - The Frontend2 defaults to 'CLOUDSMITH_BASE_REPOSTORY' = 'yoour Github Repository', however you should set this value in CMakeLists.txt as "opencpn" - - In the organization "OpenCPN" create (pluginname)-alpha, (pluginname)-beta and (pluginname)-alpha repositories. - - Make sure that you select "Open Source", not just "public". It must be "Open Source" - - See the more detailed instructions in the Developer's Manual wiki. - - For custom Cloudsmith repository destinations, modify if needed. - - - -## DEPLOYMENT - -The current setup for Frontend2 plugins does this: -- Non-Master branch - Push with no tag -> Alpha repository -- Non-Master branch - Push with tag -> Beta repository -- Master branch - Push with no tag -> Beta repository -- Master branch - Push with tag -> Prod repository - - There are several ways to issue a "push with tag" or "tagged push" - - See https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:developer_manual:pi_installer_procedure#deploy_to_prod_repository - $ git commit -am "my last changes") - $ git tag v[new version number] - $ git push OR - $ git push origin refs/tags/tag_a - -Not preferred: - $ git push --tags origin master:master <--- Is not preferred due possibility of pushing all old tags.. - -Example: -1. Change version number and date in CMakeLists.txt . Save -1. git add CMakeLists.txt -1. git commit -am "v1.9.5.10" -1. git tag v1.9.5.10 -1. git push origin refs/tags/v1.9.5.10 - - Enumerating objects: 5, done. - - remote: Resolving deltas: 100% (2/2), completed with 2 local objects. - - To https://github.com/xxxx/weatherfax_pi.git - - * [new tag] v1.9.5.10 -> v1.9.5.10 -1. git push origin master - -For information about building locally for local deployment refer to Read-Build.md - - -### Weatherfax_pi specific differences from testplugin_pi "Frontend2" - -Weatherfax_pi needs to have sound support for Windows and Mingw, additionally use with rtlsdr requires additional files. - -1. circleci/config.yml -same -1. ci/ all scripts same except - - ci/control weatherfax has 'build librtlsdr-dev' - - ci/circleci-build-mingw.sh downloads and installs portauduio & PVWcon32.exe - - wget https://downloads.sourceforge.net/project/opencpnplugins/opencpn_packaging_data/PVW32Con.exe - - wget https://downloads.sourceforge.net/project/opencpnplugins/opencpn_packaging_data/portaudio-vc12.7z - - 7za e portaudio-vc12.7z -o../buildwin -y - - mv PVW32Con.exe ../buildwin/. -1. cmake/ all the files in testplugin are used in weatherfax and are identical -1. cmake/ weatherfax has 3-4 of its own files too -1. cmake/in-files/ has all the same files -1. extinclude all the same -1. extsrc all the same -1. mingw - - opencpn-deps.spec file has - - BuildRequires: p7zip - - BuildRequires: wget -1. .travis.yml same -1. appveyor.yml (same except the path & name of plugin and the api key) -1. CMakeLists.txt -similar, very different in places, - - personnal settings, - - "USE_GL ON" for weatherfax, - - plugin name is different, - - libraries and includes all different. \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..94a9ed02 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README b/README.md similarity index 100% rename from README rename to README.md diff --git a/Read-Build.md b/Read-Build.md deleted file mode 100644 index 8d92521b..00000000 --- a/Read-Build.md +++ /dev/null @@ -1,188 +0,0 @@ -## Weather Fax Plugin for OpenCPN - -Implement weather fax ability for opencpn. -This includes retrieval via sound card (radio fax) as well as the internet, or local image files. - - -### Compiling - -* git clone git://github.com/seandepagnier/weatherfax_pi.git - -Normal Linux Build -* mkdir build -* cd build -* cmake .. -* make -* sudo make install - -Normal Linux Build and manually deploy to cloudsmith for testing -* cmake -DCMAKE_BUILD_TYPE=Release .. -* make -j4 -* make package -* ./cloudsmith-upload.sh -You will find xml and tarball files. - -Windows (visual studio) Build -* wxWidgets 3.1.2 required -* cmake -T v141_xp .. -* cmake --build . --target package --configure Release - -Windows (Visual Studio) Build using VS Command Prompt: -* wxWidgets 3.1.2 required -* cmake -G "Visual Studio 15 2017" -T v141_xp .. -* cmake --build . --config release --target package -It builds and creates ..tar.gz files and xml. -The tarball does not have the xml file - -Windows visual studio) Build for Opencpn v4 (old): -* wxWidgets 3.0.2 required -* cd .. -* cd build -* To produce a binary compatible with Windows XP, you must set the respective toolset -* cmake -T v120_xp .. - - -### Build tarball and metadate.xml locally to test. - -Git clone the latest plugin, create a new build directory, go into that and issue the requisite commands. - -For Windows: -* Install "git on windows" to get a bash prompt. -* Download and Unzip http://opencpn.navnux.org/build_deps/OpenCPN_buildwin-4.99a.7z into buildwin directory. -* Start Git-Gui (Bash prompt) and navigate to your local plugin build directory -* Make sure the plugin build directory is completely empty. (required for success) -* From the build directory, Execute the following at the Git-Gui prompt: - * cmake -T v141_xp .. - * cmake --build . --target package --config release - * ./cloudsmith-upload.sh -Note that the cloudsmith-upload.sh script process updates the 'xml' file target-url path -and adds that metadata.xml file to the tarball. - -For Linux: -* Make sure you are in the correct, clean (empty) directory for a build - * cmake -DWXWIDGETS_FORCE_VERSION=3.0 -DCMAKE_BUILD_TYPE=Release .. - * make -j4 - * make package - * ./cloudsmith-upload.sh -Under linux change the number of -j4 to how many processors you have, -I use -j12 (6 real processors, 2 threads per processor AMD Ryzen 5 1600). -Under windows VS will pick the number of processor automatically. - - -### Deployment Repository - -The script cloudsmith-uploads.sh which is created at runtime from cmake/in-files/cloudsmith-upload.sh.in -uploads the .tar.gz and .xml artifacts to cloudsmith -1. Builds are uploaded to one of PROD, BETA or ALPHA repositories -1. The repository depends on the branch and use of tag to determine which repo. - 1. ALPHA: Non-master branch no tag - 1. BETA: Non-master branch with annotated tag - 1. BETA: Master branch no tag - 1. PROD: Master branch with annotated tag -If this script is used on CIRCLECI, TRAVIS or APPVEYOR it will upload the correct files to the chosen repository -If this script is used locally it will build the correct artifacts but will not do the upload - - -### Add Plugin to the Plugin Manager Catalog - -Add your new Metadata xml to Plugin Manager Catalog -Make Pull Request to github.com/OpenCPN/Plugiins - -After Circleci, Travis and Appveyor have built the environments and deployed to one of the Cloudsmith Repositories, the resultant metadata files (.xml) must be copied and pushed up too the plugins master branch github.com/OpenCPN/plugins to become part of the the master catalog. Jon Gough has provided some bash/python scripts that accomplish copy to your local branch to assist or you can simply do this part manually. - -Generally try not to use raw git commands unless really needed, In Linux & Windows install the 'beta' testing version (for free opensource work) SmartGit (sometimes it hasn't had all the capabilities of git). - - -#### Use Smartgit https://www.syntevo.com/smartgit/ - -Initially Fork opencpn/plugins to your github remote account, single time. -Start with a clean clone of the source (upstream) git, then keep using this until it becomes too much of a mess, then start over. - -Do the following for every change that needs/has new xml: -1. Git pull upstream master -1. Git Create new local branch, i.e. rg_master or rg_beta or rg_alpha or rg_experimental -1. Checkout to new branch -1. Delete your old xml files you no longer want -1. Run 'download_xml_bash.sh' with the correct parameters for your Cloudsmith repository and build -1. Add new xml files to git in your local repository (this is called staging in SmartGit) -1. Commit these updates -1. Push your commit to your remote repository 'origin' -1. Goto your origin repository on the web -1. Create the pull request for the upstream repository -1. Check the outcome of its test action (it will run the validate_xml.sh script on what you have provided) - -When you are notified your pull request has been accepted, then delete the following: -1. Your local branch you made the changes in -1. Your remote branch (can be done through SmartGit in one dialog). -For the next change just start at the 'git pull upstream master' (just below the top). - -When you create the pull request to opencpn/plugins master branch (which adds new and removes old xml files for your build), the remote git will now do validation checking (you can do this locally if you want, just use the validate_xml.sh script) and the ocpn-plugins.xml build. Unless there is more than one person working on a plugin at one time and updating the same xml files there should be no collisions. - - -#### Use a Manual process (not using Smartgit). - -Initial Setup of Remote Fork and Local Repository -1. From the web browser httpls/github.com/username/ "Fork" the OpenCPN/plugins repository to create your remote repository. -1. From your local machine in the github folder, to create a local 'plugins' repository -1. Git clone https://github.com/OpenCPN/plugins.git (upstream) - -Set remote upstream and origin -1. Git remote add upstream https://github.com/OpenCPN/plugins.git Set the 'upstream' remote -1. Git remote add origin https://github.com/username/plugins.git Set the 'origin' remote - -Create a new local branch, i.e. rg_master or rg_beta or rg_alpha or rg_experimental using upstream/master -1. Example: git checkout -b 'rg-master' upstream/master -1. Now in the metadata folder remove/delete all of 'your' plugin files that are no longer wanted. -1. Leave the other xml files from other plugins intact and without change. -1. For Windows, if you have a firewall/antivirus, you must permitting scripts to run in your settings, - -Use the Git-Gui (bash prompt) from your local github/plugins' folder, to run Jon's bash script. -1. Run: 'download_xml_bash.sh' with the correct parameters for your cloudsmith repository and build. -1. Examples - 1. ./download_xml_bash.sh - 1. ./download_xml_bash.sh testplugin_pi 1.0.114.0 jon-gough prod - 1. ./download_xml_bash.sh weather-routing 1.13.8.0 opencpn prod - -Then add the changed files, commit and push to remote origin rg-master branch -1. git add metadata/ To add the metadata files -1. git commit -am "[pluginname] v[version number]" Commit the metadata files -1. git push -u origin rg-master (Does the same as two commands 'git branch --set-upstream-to=origin/jg_master' and 'git push') - -Goto upstream/master in a web browser and create pull request to OpenCPN/plugins master <---- from [gitusername]/plugins rg-master -We can leave the local rg-master branch in place until the next job (see above) - -When you are notified your PR has been accepted, we need to clean up our git plugins repository. -1. git checkout master Checkout the local master branch -1. git branch origin -d [or -D] rg-master Delete local rg-master -1. git push --delete origin rg-master Delete remote origin rg-master - -Create an identical local copy of upstream/master as a new branch "rg-master" -1. git checkout -b rg-master upstream/master - - -### Windows Specific Libraries for Certain Plugins - -The Windows compilation of weatherfax_pi is dependent on these files -We can also use the "Extra" Folders for this - (need to augment this) - -1. Under windows, you must find the file "opencpn.lib" (Visual Studio) or "libopencpn.dll.a" (mingw) which is built in the build directory after compiling opencpn. This file must be copied to the plugin directory. -1. There are also some libraries and an external program needed: - 1. http://sourceforge.net/projects/opencpnplugins/files/opencpn_packaging_data/portaudio-vc12.7z/download - 1. http://sourceforge.net/projects/opencpnplugins/files/opencpn_packaging_data/PVW32Con.exe/download (not an archive, this one just copy to buildwin) - 1. Unpack all these files into the buildwin directory as the compile is dependent on these. - - -### OSX Specific Libraries - -The OS X compilation of weatherfax_pi is dependent on these files - -1. Under OS X the port audio library is needed. Install it using ```brew install portaudio``` -1. There is a zip file containing header and library files: - 1. http://sourceforge.net/projects/opencpnplugins/files/weatherfax_pi/OSXportaudiofiles.zip/download - 1. Download this file and unzip it in the /usr/local directory as the compile is dependent on these. - 1. Then make create-pkg command will include the library in the package. - - -### License - -The plugin code is licensed under the terms of the GPL v3+ diff --git a/appveyor.yml b/appveyor.yml index 5035436c..a5df9ac1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,8 +4,8 @@ clone_depth: 10 platform: -# - x64 - - Win32 +# - x64 +# - Win32 configuration: Release test: OFF @@ -82,6 +82,7 @@ for: before_build: - cd c:\project\ocpn_project + - git submodule update --init opencpn-libs - ps: Start-FileDownload https://downloads.sourceforge.net/project/opencpnplugins/opencpn_packaging_data/PVW32Con.exe - rm -rf build && mkdir build && cd build - ps: Start-FileDownload https://sourceforge.net/projects/opencpnplugins/files/opencpn.lib diff --git a/bld.bat b/bld.bat index 32a47c8b..e079de52 100644 --- a/bld.bat +++ b/bld.bat @@ -1,10 +1,20 @@ REM FE2 Testplugin + +REM Requires wxWidgets setup +REM C:\Users\fcgle\source\wxWidgets-3.1.2 +REM C:\Users\fcgle\source\wxWidgets-3.2.2 +REM Visual Studio 15 2017 installed +REM Visual Studio 17 2022 installed REM -------------------------------------- REM For Opencpn 5.8 and wxWidgets-3.2.2 using Visual Studio 15 2017 REM -------------------------------------- REM Used for local builds and testing. -REM Use bash prompt because of the cloudsmith-upload.sh at the end. +REM Create an empty "[plugin]/build" directory +REM Use MSVC Command Prompt from [plugin]root directory ".\bld.bat" +REM Find the errors in the build\output.txt file +REM Then use bash prompt to run cloudsmith-upload.sh command "BASH ./bld.bat" +REM This adds the metadata file to the tarball gz file. REM Set local environment using wxWidgets-3.2.2 set "wxDIR=%WXWIN%" set "wxWidgets_ROOT_DIR=%WXWIN%" diff --git a/build-deps/macos-cache-stamp b/build-deps/macos-cache-stamp new file mode 100644 index 00000000..612bd695 --- /dev/null +++ b/build-deps/macos-cache-stamp @@ -0,0 +1,4 @@ +# Any change in this file will cause the macos cache to be invalidated +# i. e., that the homebrew dependencies are downloaded and wxwidgets +# rebuilt. For example, change the stock 'v1' to 'v2' +v1 diff --git a/ci/circleci-build-android-arm64.sh b/ci/circleci-build-android-arm64.sh old mode 100644 new mode 100755 index 1e20bd7f..4d7a4822 --- a/ci/circleci-build-android-arm64.sh +++ b/ci/circleci-build-android-arm64.sh @@ -9,6 +9,8 @@ set -xe pwd +git submodule update --init opencpn-libs + ls -la # FOR LOCAL BUILD - have a local version to avoid big download each run - need to stage it but not commit it. DO NOT COMMIT AND PUSH master.zip @@ -58,43 +60,25 @@ mkdir -p build cd build rm -f CMakeCache.txt -COMPDIR=$(find ~/. -regex ".*/ndk/22.[0-9].[0-9]*") -cmake \ +# Install python to get a recent version of cmake +sudo apt install python3-pip +python3 -m pip install --user --force-reinstall -q pip setuptools +sudo apt remove python3-six python3-colorama python3-urllib3 +export LC_ALL=C.UTF-8 LANG=C.UTF-8 +python3 -m pip install --user -q cmake -vv + +last_ndk=$(ls -d /home/circleci/android-sdk/ndk/* | tail -1) +test -d /opt/android || sudo mkdir -p /opt/android +sudo ln -sf $last_ndk /opt/android/ndk + +cmake -DCMAKE_TOOLCHAIN_FILE=cmake/android-aarch64-toolchain.cmake \ -D_wx_selected_config=androideabi-qt-arm64 \ -DwxQt_Build=build_android_release_64_static_O3 \ -DQt_Build=build_arm64/qtbase \ - -DCMAKE_AR=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar \ - -DCMAKE_CXX_COMPILER=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang++ \ - -DCMAKE_C_COMPILER=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang \ -DOCPN_Android_Common=OCPNAndroidCommon-master \ - -DCMAKE_INSTALL_PREFIX=/ \ .. -# Get number of processors and use this on make to speed up build -#procs=$(awk -F- '{print $2}' /sys/fs/cgroup/cpuset/cpuset.cpus) -#procs=$((procs + 1)) -#make_cmd="make -j"$procs -#eval $make_cmd -make package - -# All below for local docker build -#ls -l +make VERBOSE=1 -#xml=$(ls *.xml) -#tarball=$(ls *.tar.gz) -#tarball_basename=${tarball##*/} - -#echo $xml -#echo $tarball -#echo $tarball_basename -#sudo sed -i -e "s|@filename@|$tarball_basename|" $xml - - -#tmpdir=repack.$$ -#sudo rm -rf $tmpdir && sudo mkdir $tmpdir -#sudo tar -C $tmpdir -xf $tarball_basename -#sudo cp oesenc-plugin-android-arm64-16.xml metadata.xml -#sudo cp metadata.xml $tmpdir -#sudo tar -C $tmpdir -czf $tarball_basename . -#sudo rm -rf $tmpdir +make package diff --git a/ci/circleci-build-android-armhf.sh b/ci/circleci-build-android-armhf.sh old mode 100644 new mode 100755 index 0ee03b2d..7aa1145e --- a/ci/circleci-build-android-armhf.sh +++ b/ci/circleci-build-android-armhf.sh @@ -8,6 +8,8 @@ set -xe pwd +git submodule update --init opencpn-libs + ls -la #sudo apt-get -q update @@ -75,44 +77,25 @@ mkdir -p build cd build rm -f CMakeCache.txt -COMPDIR=$(find ~/. -regex ".*/ndk/22.[0-9].[0-9]*") -cmake \ +# Install python to get a recent version of cmake +sudo apt install python3-pip +python3 -m pip install --user --force-reinstall -q pip setuptools +sudo apt remove python3-six python3-colorama python3-urllib3 +export LC_ALL=C.UTF-8 LANG=C.UTF-8 +python3 -m pip install --user -q cmake -vv + +last_ndk=$(ls -d /home/circleci/android-sdk/ndk/* | tail -1) +test -d /opt/android || sudo mkdir -p /opt/android +sudo ln -sf $last_ndk /opt/android/ndk + +cmake -DCMAKE_TOOLCHAIN_FILE=cmake/android-armhf-toolchain.cmake \ -D_wx_selected_config=androideabi-qt-armhf \ -DwxQt_Build=build_android_release_19_static_O3 \ -DQt_Build=build_arm32_19_O3/qtbase \ - -DCMAKE_AR=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar \ - -DCMAKE_CXX_COMPILER=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang++ \ - -DCMAKE_C_COMPILER=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang \ -DOCPN_Android_Common=OCPNAndroidCommon-master \ - -DCMAKE_INSTALL_PREFIX=/ \ .. -# Get number of processors and use this on make to speed up build -procs=$(awk -F- '{print $2}' /sys/fs/cgroup/cpuset/cpuset.cpus) -procs=$((procs + 1)) -make_cmd="make -j"$procs -eval $make_cmd +make VERBOSE=1 make package - -# All below for local docker build -#ls -l - -#xml=$(ls *.xml) -#tarball=$(ls *.tar.gz) -#tarball_basename=${tarball##*/} - -#echo $xml -#echo $tarball -#echo $tarball_basename -#sudo sed -i -e "s|@filename@|$tarball_basename|" $xml - - -#tmpdir=repack.$$ -#sudo rm -rf $tmpdir && sudo mkdir $tmpdir -#sudo tar -C $tmpdir -xf $tarball_basename -#sudo cp oesenc-plugin-android-armhf-16.xml metadata.xml -#sudo cp metadata.xml $tmpdir -#sudo tar -C $tmpdir -czf $tarball_basename . -#sudo rm -rf $tmpdir diff --git a/ci/circleci-build-debian.sh b/ci/circleci-build-debian.sh old mode 100755 new mode 100644 index fb4631b1..5ba7d036 --- a/ci/circleci-build-debian.sh +++ b/ci/circleci-build-debian.sh @@ -33,6 +33,9 @@ if test -f "$EXTRA_LIBS"; then fi pwd + +git submodule update --init opencpn-libs + sudo mk-build-deps --install ./ci/control sudo apt-get --allow-unauthenticated install ./*all.deb || : diff --git a/ci/circleci-build-flatpak.sh b/ci/circleci-build-flatpak.sh index de9ad5d0..df94ed95 100755 --- a/ci/circleci-build-flatpak.sh +++ b/ci/circleci-build-flatpak.sh @@ -45,6 +45,8 @@ if test -f "$EXTRA_LIBS"; then done < $EXTRA_LIBS fi +git submodule update --init opencpn-libs + if [ -n "$CI" ]; then sudo apt update diff --git a/ci/circleci-build-macos-new.sh b/ci/circleci-build-macos-new.sh deleted file mode 100644 index 0dd25ab5..00000000 --- a/ci/circleci-build-macos-new.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# -# Build the MacOS artifacts - -set -xe - -# -# Check if the cache is with us. If not, re-install brew. -brew list --versions libexif || brew update-reset - -for pkg in cairo cmake gettext libarchive libexif python wget; do - brew list --versions $pkg || brew install $pkg || brew install $pkg || : - brew link --overwrite $pkg || brew install $pkg -done - -wget -q http://opencpn.navnux.org/build_deps/wx312_opencpn50_macos109.tar.xz -tar xJf wx312_opencpn50_macos109.tar.xz -C /tmp - -export MACOSX_DEPLOYMENT_TARGET=10.9 - -rm -rf build && mkdir build && cd build -cmake \ - -DwxWidgets_CONFIG_EXECUTABLE=/tmp/wx312_opencpn50_macos109/bin/wx-config \ - -DCMAKE_INSTALL_PREFIX="/" \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \ - .. -make tarball - -wget -q http://opencpn.navnux.org/build_deps/Packages.dmg -hdiutil attach Packages.dmg -sudo installer -pkg "/Volumes/Packages 1.2.5/Install Packages.pkg" -target "/" -make create-pkg diff --git a/ci/circleci-build-macos-universal.sh b/ci/circleci-build-macos-universal.sh new file mode 100755 index 00000000..7940f428 --- /dev/null +++ b/ci/circleci-build-macos-universal.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + + +# Build the MacOS artifacts + + +# Copyright (c) 2021 Alec Leamas +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +set -x + +# Load local environment if it exists i. e., this is a local build +if [ -f ~/.config/local-build.rc ]; then source ~/.config/local-build.rc; fi + +git submodule update --init opencpn-libs + +# If applicable, restore /usr/local from cache. +if [[ -n "$CI" && -f /tmp/local.cache.tar ]]; then + sudo rm -rf /usr/local/* + sudo tar -C /usr -xf /tmp/local.cache.tar +fi + +# Set up build directory +rm -rf build && mkdir build + +# Create a log file. +exec > >(tee build/build.log) 2>&1 + +export MACOSX_DEPLOYMENT_TARGET=10.10 + +# Return latest version of $1, optionally using option $2 +pkg_version() { brew list --versions $2 $1 | tail -1 | awk '{print $2}'; } + +# +# Check if the cache is with us. If not, re-install brew. +brew list --versions libexif || brew update-reset + +# Install packaged dependencies +for pkg in cmake gettext libarchive libexif python wget openssl@3; do + brew list --versions $pkg || brew install $pkg || brew install $pkg || : + brew link --overwrite $pkg || brew install $pkg +done + +#Install prebuilt dependencies +wget -q https://dl.cloudsmith.io/public/nohal/opencpn-plugins/raw/files/macos_deps_universal.tar.xz \ + -O /tmp/macos_deps_universal.tar.xz +sudo tar -C /usr/local -xJf /tmp/macos_deps_universal.tar.xz + +export OPENSSL_ROOT_DIR='/usr/local' + +# Build and package +cd build +cmake \ + "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}" \ + -DCMAKE_INSTALL_PREFIX= \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ + -DOCPN_TARGET_TUPLE="darwin-wx32;10;universal" \ + -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ + .. + +if [[ -z "$CI" ]]; then + echo '$CI not found in environment, assuming local setup' + echo "Complete build using 'cd build; make tarball' or so." + exit 0 +fi + +# nor-reproducible error on first invocation, seemingly tarball-conf-stamp +# is not created as required. +#make VERBOSE=1 tarball || make VERBOSE=1 tarball +make +make install +make package +make package + +# Create the cached /usr/local archive +if [ -n "$CI" ]; then + tar -C /usr -cf /tmp/local.cache.tar local +fi diff --git a/ci/circleci-build-macos.sh b/ci/circleci-build-macos.sh old mode 100755 new mode 100644 index 914a7687..c95d2cf7 --- a/ci/circleci-build-macos.sh +++ b/ci/circleci-build-macos.sh @@ -23,12 +23,12 @@ if [ -n "$WX_VER" ] && [ "$WX_VER" -eq "32" ]; then WX_CONFIG="--prefix=/tmp/wx321_opencpn50_macos1010" MACOSX_DEPLOYMENT_TARGET=10.10 else - echo "Building for WXVERSION 312"; - WX_URL=https://download.opencpn.org/s/rwoCNGzx6G34tbC/download - WX_DOWNLOAD=/tmp/wx312B_opencpn50_macos109.tar.xz - WX_EXECUTABLE=/tmp/wx312B_opencpn50_macos109/bin/wx-config - WX_CONFIG="--prefix=/tmp/wx312B_opencpn50_macos109" - MACOSX_DEPLOYMENT_TARGET=10.9 + echo "Building for WXVERSION 315"; + WX_URL=https://download.opencpn.org/s/MCiRiq4fJcKD56r/download + WX_DOWNLOAD=/tmp/wx315_opencpn50_macos1010.tar.xz + WX_EXECUTABLE=/tmp/wx315_opencpn50_macos1010/bin/wx-config + WX_CONFIG="--prefix=/tmp/wx315_opencpn50_macos1010" + MACOSX_DEPLOYMENT_TARGET=10.10 fi # Download required binaries using wget, since curl causes an issue with Xcode 13.1 and some specific certificates. @@ -66,25 +66,30 @@ fi export MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET +# MacOS .pkg installer is deprecated in OCPN 5.6.2+ # use brew to get Packages.pkg -if brew list --cask --versions packages; then - version=$(brew list --cask --versions packages) - version="${version/"packages "/}" - sudo installer \ - -pkg /usr/local/Caskroom/packages/$version/packages/Packages.pkg \ - -target / -else - brew install --cask packages -fi +#if brew list --cask --versions packages; then +# version=$(brew list --cask --versions packages) +# version="${version/"packages "/}" +# sudo installer \ +# -pkg /usr/local/Caskroom/packages/$version/packages/Packages.pkg \ +# -target / +#else +# brew install --cask packages +#fi + +git submodule update --init opencpn-libs rm -rf build && mkdir build && cd build cmake \ -DwxWidgets_CONFIG_EXECUTABLE=$WX_EXECUTABLE \ -DwxWidgets_CONFIG_OPTIONS=$WX_CONFIG \ - -DCMAKE_INSTALL_PREFIX= \ + -DCMAKE_INSTALL_PREFIX=app/files \ + -DBUILD_TYPE_PACKAGE:STRING=tarball \ -DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET \ "/" \ .. -make -sj2 +make +make install make package diff --git a/ci/circleci-build-msvc.bat b/ci/circleci-build-msvc.bat index 7d9c4650..f29dbeff 100644 --- a/ci/circleci-build-msvc.bat +++ b/ci/circleci-build-msvc.bat @@ -1,6 +1,7 @@ :: :: Build the msvc artifacts :: + set "SCRIPTDIR=%~dp0" set "GIT_HOME=C:\Program Files\Git" if "%CONFIGURATION%" == "" set "CONFIGURATION=RelWithDebInfo" @@ -27,6 +28,10 @@ if errorlevel 1 ( call "%VS_HOME%\Community\VC\Auxiliary\Build\vcvars32.bat" ) +git submodule update --init opencpn-libs + +dir + if exist build (rmdir /s /q build) mkdir build && cd build dir diff --git a/ci/circleci-build-trusty.sh b/ci/circleci-build-trusty.sh deleted file mode 100644 index 667d6a1a..00000000 --- a/ci/circleci-build-trusty.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -# -# Build the Trusty Ubuntu artifacts -# -set -xe -sudo apt-get -qq update -sudo apt-get install devscripts equivs gdebi libglu1-mesa-dev - -# Install extra build libs -ME=$(echo ${0##*/} | sed 's/\.sh//g') -EXTRA_LIBS=extras/extra_libs.txt -if test -f "$EXTRA_LIBS"; then - while read line; do - sudo apt-get install $line - done < $EXTRA_LIBS -fi -EXTRA_LIBS=extras/${ME}_extra_libs.txt -if test -f "$EXTRA_LIBS"; then - while read line; do - sudo apt-get install $line - done < $EXTRA_LIBS -fi - -rm -rf build && mkdir build && cd build -mk-build-deps ../ci/control -sudo gdebi -n ./*all.deb || : -sudo apt-get --allow-unauthenticated install -f -rm -f ./*all.deb - -tag=$(git tag --contains HEAD) - -CMAKE_GTK3="" - -if [ -n "$BUILD_GTK3" ] && [ "$BUILD_GTK3" = "true" ]; then - sudo update-alternatives --set wx-config /usr/lib/*-linux-*/wx/config/gtk3-unicode-3.0 - CMAKE_GTK3="-DBUILD_GTK3=true" -fi - -if [ -n "$tag" ]; then - cmake -DCMAKE_BUILD_TYPE=Release $CMAKE_GTK3 -DCMAKE_INSTALL_PREFIX=/usr/local .. -else - cmake -DCMAKE_BUILD_TYPE=Debug $CMAKE_GTK3 -DCMAKE_INSTALL_PREFIX=/usr/local .. -fi - -make -j2 -make package -ls -l diff --git a/ci/circleci-build-ubuntu-docker.sh b/ci/circleci-build-ubuntu-docker.sh index eddc2674..7b0e8182 100644 --- a/ci/circleci-build-ubuntu-docker.sh +++ b/ci/circleci-build-ubuntu-docker.sh @@ -4,6 +4,12 @@ # Build for Raspbian and debian in a docker container # +cd ~/project + +git submodule update --init opencpn-libs + +ls -la ~/project + # bailout on errors and echo commands. set -x sudo apt-get -y --allow-unauthenticated update diff --git a/ci/control.bak b/ci/control.bak new file mode 100644 index 00000000..e477ebe8 --- /dev/null +++ b/ci/control.bak @@ -0,0 +1,41 @@ +Source: opencpn +Build-Depends: debhelper (>= 9), + cmake3 | cmake (>> 3.5.0), + curl, + libarchive-dev, + libbz2-dev, + libcairo2-dev, + libcurl4-openssl-dev, + libelf-dev, + libexif-dev, + libgdk-pixbuf2.0-dev, + liblz4-dev, + liblzma-dev, + libpango1.0-dev, + libsqlite3-dev, + libtinyxml-dev, + libunarr-dev | base-files (<< 11), + libgtk2.0-dev, + libgtk-3-dev, + libwxsvg-dev | base-files (<< 11), + base-files (>=12) | libwxgtk3.0-dev | libwxgtk3.0-gtk3-dev, + base-files (>=12) | libwxgtk3.0-0v5 | libwxgtk3.0-gtk3-0v5, + base-files (>=12) | libwxgtk-webview3.0-dev | libwxgtk-webview3.0-gtk3-dev, + base-files (<< 12) | libwxgtk3.2-dev (>= 3.2.2), + base-files (<< 12) | libwxgtk-webview3.2-dev (>= 3.2.2), + portaudio19-dev, + python3-pip, + python3-setuptools + +Standards-Version: 4.3.0 +Homepage: https://opencpn.org + +Description: Packages needed to build opencpn on debian. + The Build-Depends field can be used to install dependencies + using something like: + . + . sudo apt install devscripts equivs + . sudo mk-build-deps --install ci/control + . + These packages are available in trusty+. The base-files + fallback is for optional packages available in later releases. diff --git a/ci/extras/build-ubuntu-x86_64-2204-jammy_extra_libs.txt b/ci/extras/build-ubuntu-x86_64-2204-jammy_extra_libs.txt deleted file mode 100644 index 5378ad09..00000000 --- a/ci/extras/build-ubuntu-x86_64-2204-jammy_extra_libs.txt +++ /dev/null @@ -1,2 +0,0 @@ -libwxgtk3.2-dev - diff --git a/ci/travis-build-raspbian-armhf-part1.sh b/ci/travis-build-raspbian-armhf-part1.sh deleted file mode 100644 index 2156ec4e..00000000 --- a/ci/travis-build-raspbian-armhf-part1.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -# -# Travis build for raspian part 1 -# - -# bailout on errors and echo commands. -set -xe -sudo apt-get -qq update - -DOCKER_SOCK="unix:///var/run/docker.sock" - -echo "DOCKER_OPTS=\"-H tcp://127.0.0.1:2375 -H $DOCKER_SOCK -s devicemapper\"" \ - | sudo tee /etc/default/docker > /dev/null -sudo service docker restart; -sleep 5; - -if [ "$BUILD_ENV" = "raspbian" ]; then - docker run --rm --privileged multiarch/qemu-user-static:register --reset -else - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -fi - -docker run --privileged -d -ti -e "container=docker" \ - -v ~/source_top:/source_top \ - -v $(pwd):/ci-source:rw \ - $DOCKER_IMAGE /bin/bash - -DOCKER_CONTAINER_ID=$(sudo docker ps | grep $BUILD_ENV | awk '{print $1}') - -docker exec -ti $DOCKER_CONTAINER_ID apt-get update -docker exec -ti $DOCKER_CONTAINER_ID echo "------\nEND apt-get update\n" - -docker exec -ti $DOCKER_CONTAINER_ID apt-get -y install git cmake build-essential cmake gettext wx-common libgtk2.0-dev libwxgtk3.0-dev libbz2-dev libcurl4-openssl-dev libexpat1-dev libcairo2-dev libarchive-dev liblzma-dev libexif-dev lsb-release - - diff --git a/ci/travis-build-raspbian-armhf-part2.sh b/ci/travis-build-raspbian-armhf-part2.sh deleted file mode 100644 index 833b2343..00000000 --- a/ci/travis-build-raspbian-armhf-part2.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -# -# Travis build for raspbian part 2 -# - -# bailout on errors and echo commands. -set -xe - -DOCKER_CONTAINER_ID=$(sudo docker ps | grep $BUILD_ENV | awk '{print $1}') - -echo $TRAVIS_BRANCH -echo $OCPN_TARGET -echo $BUILD_GTK3 - -docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec \ - "export TRAVIS=$TRAVIS; export TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG; export TRAVIS_BRANCH=$TRAVIS_BRANCH; export TRAVIS_TAG=$TRAVIS_TAG; export OCPN_TARGET=$OCPN_TARGET; export BUILD_FLAGS=$BUILD_FLAGS; export BUILD_GTK3=$BUILD_GTK3; rm -rf ci-source/build; mkdir ci-source/build; cd ci-source/build; cmake ..; make $BUILD_FLAGS; make package; chmod -R a+rw ../build;" - -echo "Stopping" -docker ps -a -docker stop $DOCKER_CONTAINER_ID -docker rm -v $DOCKER_CONTAINER_ID - diff --git a/cmake-build-debug/zh_TW.mo b/cmake-build-debug/zh_TW.mo new file mode 100644 index 00000000..debc2cfb Binary files /dev/null and b/cmake-build-debug/zh_TW.mo differ diff --git a/cmake/FindTinyXML.cmake b/cmake/FindTinyXML.cmake deleted file mode 100644 index 0041f591..00000000 --- a/cmake/FindTinyXML.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# * Find TinyXML -# - Find the native TinyXML includes and library -# TINYXML_FOUND - True if TinyXML found. -# TINYXML_INCLUDE_DIR - where to find tinyxml.h, etc. -# TINYXML_LIBRARIES - List of libraries when using TinyXML. -# - -if(TINYXML_INCLUDE_DIR) - # Already in cache, be silent - set(TinyXML_FIND_QUIETLY TRUE) -endif(TINYXML_INCLUDE_DIR) - -find_path(TINYXML_INCLUDE_DIR "tinyxml.h" PATH_SUFFIXES "tinyxml") - -find_library( - TINYXML_LIBRARIES - NAMES "tinyxml" - PATH_SUFFIXES "tinyxml") - -# handle the QUIETLY and REQUIRED arguments and set TINYXML_FOUND to TRUE if all listed variables are TRUE -include("FindPackageHandleStandardArgs") -find_package_handle_standard_args("TinyXML" DEFAULT_MSG TINYXML_INCLUDE_DIR TINYXML_LIBRARIES) - -mark_as_advanced(TINYXML_INCLUDE_DIR TINYXML_LIBRARIES) diff --git a/cmake/MacosWxwidgets.cmake b/cmake/MacosWxwidgets.cmake new file mode 100644 index 00000000..cfecf086 --- /dev/null +++ b/cmake/MacosWxwidgets.cmake @@ -0,0 +1,90 @@ +# ~~~ +# Summary: If required, rebuild wxwidgets for macos from source. +# License: GPLv3+ +# Copyright (c) 2022 Alec Leamas +# ~~~ + +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. + +cmake_minimum_required(VERSION 3.20.0) + +set(wx_repo https://github.com/wxWidgets/wxWidgets.git) +set(wx_tag v3.2.2.1) + +option(IGNORE_SYSTEM_WX "Never use system wxWidgets installation" FALSE) + +# Check if we have done the wxWidgets build already +# +if(DEFINED wx_config) + return() +endif() + +# Check if there is a usable wxwidgets anyway +# +set(cache_dir ${PROJECT_SOURCE_DIR}/cache) + +if(IGNORE_SYSTEM_WX) + set(WX_CONFIG_PROG ${cache_dir}/lib/wx/config/osx_cocoa-unicode-3.2) +else() + find_program( + WX_CONFIG_PROG + NAMES wx-config osx_cocoa-unicode-3.2 + HINTS ${PROJECT_SOURCE_DIR}/cache/lib/wx/config /usr/local/lib/wx/config) +endif() +if(WX_CONFIG_PROG) + execute_process( + COMMAND ${WX_CONFIG_PROG} --version + RESULT_VARIABLE wx_status + OUTPUT_VARIABLE wx_version + ERROR_FILE /dev/null COMMAND_ECHO STDOUT + OUTPUT_STRIP_TRAILING_WHITESPACE) +else() + set(wx_status 1) +endif() + +if(${wx_status} EQUAL 0) + set(wx_config + ${WX_CONFIG_PROG} + CACHE FILEPATH "") + set(ENV{WX_CONFIG} ${WX_CONFIG_PROG}) + if(${wx_version} VERSION_GREATER_EQUAL 3.2) + return() + endif() +endif() + +if(NOT EXISTS ${cache_dir}) + file(MAKE_DIRECTORY ${cache_dir}) +endif() + +# Download sources and get the source directory +# +include(FetchContent) +FetchContent_Declare( + wxwidgets + GIT_REPOSITORY ${wx_repo} + GIT_TAG ${wx_tag}) +FetchContent_Populate(wxwidgets) +FetchContent_GetProperties(wxwidgets SOURCE_DIR wxwidgets_src_dir) + +execute_process(COMMAND git submodule update --init 3rdparty/pcre + WORKING_DIRECTORY ${wxwidgets_src_dir}) +execute_process( + COMMAND + ./configure --with-cxx=11 --with-macosx-version-min=10.10 --enable-unicode + --with-osx-cocoa --enable-aui --disable-debug --with-opengl + --enable-macosx_arch=arm64,x86_64 --enable-universal_binary=arm64,x86_64 + --without-subdirs --prefix=${cache_dir} + WORKING_DIRECTORY ${wxwidgets_src_dir}) +math(_nproc ${OCPN_NPROC} * 2) # Assuming two threads/cpu +execute_process(COMMAND make -j${_nproc} WORKING_DIRECTORY ${wxwidgets_src_dir}) +execute_process(COMMAND sudo make install + WORKING_DIRECTORY ${wxwidgets_src_dir}) + +set(wx_config ${cache_dir}/lib/wx/config/osx_cocoa-unicode-3.2) +if(NOT EXISTS ${wx_config}) + message(FATAL_ERROR "Cannot locate wx-config tool at ${wx_config}") +endif() +set(ENV{WX_CONFIG} ${wx_config}) diff --git a/cmake/PluginConfigure.cmake b/cmake/PluginConfigure.cmake index 890b27a2..cbe0140a 100644 --- a/cmake/PluginConfigure.cmake +++ b/cmake/PluginConfigure.cmake @@ -112,7 +112,7 @@ if(NOT SKIP_VERSION_CONFIG) endif() set(BUILD_INCLUDE_PATH ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) unset(PLUGIN_EXTRA_VERSION_VARS CACHE) - find_file(PLUGIN_EXTRA_VERSION_VARS NAMES version.h.extra PATHS cmake/in-files NO_DEFAULT_PATH ) + find_file(PLUGIN_EXTRA_VERSION_VARS NAMES version.h.extra PATHS ${CMAKE_CURRENT_LIST_DIR}/in-files NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) if(${PLUGIN_EXTRA_VERSION_VARS} STREQUAL "PLUGIN_EXTRA_VERSION_VARS-NOTFOUND") message(STATUS "${CMLOC}PLUGIN_EXTRA_VERSION_VARS: Not Found") set(EXTRA_VERSION_INFO "") @@ -121,7 +121,7 @@ if(NOT SKIP_VERSION_CONFIG) configure_file(${PLUGIN_EXTRA_VERSION_VARS} ${BUILD_INCLUDE_PATH}/include/version_extra.h) set(EXTRA_VERSION_INFO "#include \"version_extra.h\"") endif() - find_file(PLUGIN_EXTRA_FORMBUILDER_HEADERS NAMES extra_formbuilder_headers.h.in PATHS cmake/in-files NO_DEFAULT_PATH) + find_file(PLUGIN_EXTRA_FORMBUILDER_HEADERS NAMES extra_formbuilder_headers.h.in PATHS ${CMAKE_CURRENT_LIST_DIR}/in-files NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) message(STATUS "${CMLOC}PLUGIN_EXTRA_FORMBUILDER_HEADERS: ${PLUGIN_EXTRA_FORMBUILDER_HEADERS}") if(${PLUGIN_EXTRA_FORMBUILDER_HEADERS} STREQUAL "PLUGIN_EXTRA_FORMBUILDER_HEADERS-NOTFOUND") message(STATUS "${CMLOC}PLUGIN_EXTRA_FORMBUILDER_HEADERS: Not found") @@ -129,8 +129,8 @@ if(NOT SKIP_VERSION_CONFIG) message(STATUS "${CMLOC}PLUGIN_EXTRA_FORMBUILDER_HEADERS: Found") configure_file(${PLUGIN_EXTRA_FORMBUILDER_HEADERS} ${BUILD_INCLUDE_PATH}/include/extra_formbuilder_headers.h) endif() - configure_file(cmake/in-files/version.h.in ${BUILD_INCLUDE_PATH}/include/version.h) - configure_file(cmake/in-files/wxWTranslateCatalog.h.in ${BUILD_INCLUDE_PATH}/include/wxWTranslateCatalog.h) + configure_file(${CMAKE_CURRENT_LIST_DIR}/in-files/version.h.in ${BUILD_INCLUDE_PATH}/include/version.h) + configure_file(${CMAKE_CURRENT_LIST_DIR}/in-files/wxWTranslateCatalog.h.in ${BUILD_INCLUDE_PATH}/include/wxWTranslateCatalog.h) include_directories(${BUILD_INCLUDE_PATH}/include) if(MINGW) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE_SAVE}) @@ -233,7 +233,10 @@ if(DEFINED ENV{OCPN_TARGET}) else() set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}") set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}") - endif() + if(APPLE AND CMAKE_OSX_ARCHITECTURES) + set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${COMPOUND_ARCH_DASH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}") + endif() +endif() else() if(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW OR MSVC) set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}") @@ -245,7 +248,7 @@ else() endif(DEFINED ENV{OCPN_TARGET}) if(OCPN_FLATPAK_CONFIG) message(STATUS "${CMLOG}Checking for flatpak extensions") - find_file(PLUGIN_FLATPAK_ARGS NAMES flatpak_args.in PATHS cmake/in-files NO_DEFAULT_PATH ) + find_file(PLUGIN_FLATPAK_ARGS NAMES flatpak_args.in PATHS ${CMAKE_CURRENT_LIST_DIR}/in-files NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) if(${PLUGIN_FLATPAK_ARGS} STREQUAL "PLUGIN_FLATPAK_ARGS-NOTFOUND") message(STATUS "${CMLOC}PLUGIN_FLATPAK_ARGS: Not Found") set(finish_args "") @@ -254,7 +257,7 @@ if(OCPN_FLATPAK_CONFIG) message(STATUS "${CMLOC}PLUGIN_FLATPAK_ARGS: ${PLUGIN_FLATPAK_ARGS}") file(READ ${PLUGIN_FLATPAK_ARGS} finish_args) endif() - find_file(PLUGIN_FLATPAK_OPTIONS NAMES flatpak_options.in PATHS cmake/in-files NO_DEFAULT_PATH ) + find_file(PLUGIN_FLATPAK_OPTIONS NAMES flatpak_options.in PATHS ${CMAKE_CURRENT_LIST_DIR}/in-files NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) if(${PLUGIN_FLATPAK_OPTIONS} STREQUAL "PLUGIN_FLATPAK_OPTIONS-NOTFOUND") message(STATUS "${CMLOC}PLUGIN_FLATPAK_OPTIONS: Not Found") set(build_options "") @@ -262,7 +265,7 @@ if(OCPN_FLATPAK_CONFIG) message(STATUS "${CMLOC}build_options: Found") file(READ ${PLUGIN_FLATPAK_OPTIONS} build_options) endif() - find_file(PLUGIN_FLATPAK_EXTRA_MODULES NAMES flatpak_extra_modules.in PATHS cmake/in-files NO_DEFAULT_PATH ) + find_file(PLUGIN_FLATPAK_EXTRA_MODULES NAMES flatpak_extra_modules.in PATHS ${CMAKE_CURRENT_LIST_DIR}/in-files NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) if(${PLUGIN_FLATPAK_EXTRA_MODULES} STREQUAL "PLUGIN_FLATPAK_EXTRA_MODULES-NOTFOUND") message(STATUS "${CMLOC}PLUGIN_FLATPAK_EXTRA_MODULES: Not Found") set(flatpak_extra_modules "") @@ -437,8 +440,6 @@ IF(DEFINED _wx_selected_config) MESSAGE (STATUS "${CMLOC}Using GLESv2 for Android") ADD_DEFINITIONS(-DUSE_ANDROID_GLES2) ADD_DEFINITIONS(-DUSE_GLSL) - include_directories( ${PROJECT_SOURCE_DIR}/libs/glshim/include/GLES ) - set(EXTINCLUDE_DIR ${EXTINCLUDE_DIR} ${PROJECT_SOURCE_DIR}/libs/glshim/include/GLES) ENDIF(_wx_selected_config MATCHES "androideabi-qt") ENDIF(DEFINED _wx_selected_config) @@ -454,7 +455,7 @@ IF(QT_ANDROID) set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-soname,libgorp.so ") #set(CMAKE_POSITION_INDEPENDENT_CODE ON) - SET(CMAKE_CXX_FLAGS "-pthread -fPIC") + SET(CMAKE_CXX_FLAGS "-pthread -fPIC ") ## Compiler flags add_compile_options("-Wno-inconsistent-missing-override" @@ -491,15 +492,7 @@ if((NOT OPENGLES_FOUND) AND (NOT QT_ANDROID)) message(STATUS "${CMLOC}OpenGL disabled by option...") endif(USE_GL MATCHES "ON") - if(USE_LOCAL_GLU) - message(STATUS "${CMLOC} Adding local GLU") - add_subdirectory(libs/glu) - message(STATUS "${CMLOC}PACKAGE_NAME: ${PACKAGE_NAME}") - target_link_libraries(${PACKAGE_NAME} "GLU_static") - #set(OPENGL_LIBRARIES "GLU_static" ${OPENGL_LIBRARIES}) - add_definitions(-DocpnUSE_GL) - message(STATUS "${CMLOC} Revised GL Lib (with local): " ${OPENGL_LIBRARIES}) - elseif(OPENGL_FOUND) + if(OPENGL_FOUND) set(wxWidgets_USE_LIBS ${wxWidgets_USE_LIBS} gl) include_directories(${OPENGL_INCLUDE_DIR}) @@ -642,7 +635,7 @@ else(NOT QT_ANDROID) # Needed for android builds include_directories(BEFORE ${qt_android_include}) - + endif(NOT QT_ANDROID) find_package(Gettext REQUIRED) diff --git a/cmake/PluginConfigure.cmake.bak b/cmake/PluginConfigure.cmake.bak new file mode 100644 index 00000000..0d274b5b --- /dev/null +++ b/cmake/PluginConfigure.cmake.bak @@ -0,0 +1,643 @@ +# --------------------------------------------------------------------------- +# Author: Jon Gough (Based on the work of Sean D'Epagnier and Pavel Kalian) Copyright: 2019 License: GPLv3+ +# --------------------------------------------------------------------------- + +set(SAVE_CMLOC ${CMLOC}) +set(CMLOC "PluginConfigure: ") + +message(STATUS "${CMLOC}*** Staging to build ${PACKAGE_NAME} ***") + +message(STATUS "${CMLOC}CIRCLECI: ${CIRCLECLI}, Env CIRCLECI: $ENV{CIRCLECI}") +message(STATUS "${CMLOC}TRAVIS: ${TRAVIS}, Env TRAVIS: $ENV{TRAVIS}") + +set(GIT_REPOSITORY "") + +if($ENV{CIRCLECI}) + set(GIT_REPOSITORY "$ENV{CIRCLE_PROJECT_USERNAME}/$ENV{CIRCLE_PROJECT_REPONAME}") + set(GIT_REPOSITORY_BRANCH "$ENV{CIRCLE_BRANCH}") + set(GIT_REPOSITORY_TAG "$ENV{CIRCLE_TAG}") +elseif($ENV{TRAVIS}) + set(GIT_REPOSITORY "$ENV{TRAVIS_REPO_SLUG}") + set(GIT_REPOSITORY_BRANCH "$ENV{TRAVIS_BRANCH}") + set(GIT_REPOSITORY_TAG "$ENV{TRAVIS_TAG}") + if("${GIT_REPOSITORY_BRANCH}" STREQUAL "${GIT_REPOSITORY_TAG}") + # Travis sets TRAVIS_BRANCH to TRAVIS_TAG for tagged builds. Need to clear this setting + set(GIT_REPOSITORY_BRANCH "") + endif() +elseif($ENV{APPVEYOR}) + set(GIT_REPOSITORY "$ENV{APPVEYOR_REPO_NAME}") + set(GIT_REPOSITORY_BRANCH "$ENV{APPVEYOR_REPO_BRANCH}") + set(GIT_REPOSITORY_TAG "$ENV{APPVEYOR_REPO_TAG_NAME}") +else() + if("${GIT_REPOSITORY_EXISTS}" STREQUAL "0") + # Get the current working branch + execute_process( + COMMAND git rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_REPOSITORY_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE) + if("${GIT_REPOSITORY_BRANCH}" STREQUAL "") + message(STATUS "${CMLOC}Setting default GIT repository branch - master") + set(GIT_REPOSITORY_BRANCH "master") + endif() + execute_process( + COMMAND git tag --contains + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_REPOSITORY_TAG OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND git status --porcelain -b + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_STATUS OUTPUT_STRIP_TRAILING_WHITESPACE) + string(FIND ${GIT_STATUS} "..." START_TRACKED) + if(NOT START_TRACKED EQUAL -1) + string(FIND ${GIT_STATUS} "/" END_TRACKED) + math(EXPR START_TRACKED "${START_TRACKED}+3") + math(EXPR END_TRACKED "${END_TRACKED}-${START_TRACKED}") + string(SUBSTRING ${GIT_STATUS} ${START_TRACKED} ${END_TRACKED} GIT_REPOSITORY_REMOTE) + message(STATUS "${CMLOC}GIT_REPOSITORY_REMOTE: ${GIT_REPOSITORY_REMOTE}") + execute_process( + COMMAND git remote get-url ${GIT_REPOSITORY_REMOTE} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_REPOSITORY_URL OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE GIT_REMOTE_ERROR) + if(NOT GIT_REMOTE_ERROR STREQUAL "") + message(STATUS "${CMLOC}Command error: ${GIT_REMOTE_ERROR}") + message(STATUS "${CMLOC}Using default repository") + else() + string(FIND ${GIT_REPOSITORY_URL} ${GIT_REPOSITORY_SERVER} START_URL REVERSE) + string(LENGTH ${GIT_REPOSITORY_SERVER} STRING_LENGTH) + math(EXPR START_URL "${START_URL}+1+${STRING_LENGTH}") + string(LENGTH ${GIT_REPOSITORY_URL} STRING_LENGTH) + message(STATUS "${CMLOC}START_URL: ${START_URL}, STRING_LENGTH: ${STRING_LENGTH}") + string(SUBSTRING ${GIT_REPOSITORY_URL} ${START_URL} ${STRING_LENGTH} GIT_REPOSITORY) + endif() + else() + message(STATUS "${CMLOC}Branch is not tracking a remote branch") + endif() + else() + message(STATUS "${CMLOC}This directory does not contain git or git is not available") + set(GIT_REPOSITORY "") + set(GIT_REPOSITORY_BRANCH "") + set(GIT_REPOSITORY_TAG "") + endif() +endif() +message(STATUS "${CMLOC}GIT_REPOSITORY: ${GIT_REPOSITORY}") +message(STATUS "${CMLOC}Git Branch: \"${GIT_REPOSITORY_BRANCH}\"") +message(STATUS "${CMLOC}Git Tag: \"${GIT_REPOSITORY_TAG}\"") +if("${GIT_REPOSITORY_BRANCH}" STREQUAL "") + set(GIT_BRANCH_OR_TAG "tag") + set(GIT_REPOSITORY_ITEM ${GIT_REPOSITORY_TAG}) +else() + set(GIT_BRANCH_OR_TAG "branch") + set(GIT_REPOSITORY_ITEM ${GIT_REPOSITORY_BRANCH}) +endif() +message(STATUS "${CMLOC}GIT_BRANCH_OR_TAG: ${GIT_BRANCH_OR_TAG}") +message(STATUS "${CMLOC}GIT_REPOSITORY_ITEM: ${GIT_REPOSITORY_ITEM}") + +if(NOT DEFINED CLOUDSMITH_BASE_REPOSITORY AND NOT ${GIT_REPOSITORY} STREQUAL "") + string(FIND ${GIT_REPOSITORY} "/" START_NAME REVERSE) + math(EXPR START_NAME "${START_NAME}+1") + string(LENGTH ${GIT_REPOSITORY} STRING_LENGTH) + message(STATUS "${CMLOC}START_NAME: ${START_NAME}, STRING_LENGTH: ${STRING_LENGTH}") + string(SUBSTRING ${GIT_REPOSITORY} ${START_NAME} ${STRING_LENGTH} CLOUDSMITH_BASE_REPOSITORY) +endif() +message(STATUS "${CMLOC}CLOUDSMITH_BASE_REPOSITORY: ${CLOUDSMITH_BASE_REPOSITORY}") + +# Process files in in-files sub directory into the build output directory, thereby allowing building from a read-only source tree. +if(NOT SKIP_VERSION_CONFIG) + if(MINGW) + message(STATUS "${CMLOC}Temporarily allowing different search path for MINGW") + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE_SAVE ${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE}) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + endif() + set(BUILD_INCLUDE_PATH ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) + unset(PLUGIN_EXTRA_VERSION_VARS CACHE) + find_file(PLUGIN_EXTRA_VERSION_VARS NAMES version.h.extra PATHS ${CMAKE_CURRENT_LIST_DIR}/in-files NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + if(${PLUGIN_EXTRA_VERSION_VARS} STREQUAL "PLUGIN_EXTRA_VERSION_VARS-NOTFOUND") + message(STATUS "${CMLOC}PLUGIN_EXTRA_VERSION_VARS: Not Found") + set(EXTRA_VERSION_INFO "") + else() + message(STATUS "${CMLOC}PLUGIN_EXTRA_VERSION_VARS: Found") + configure_file(${PLUGIN_EXTRA_VERSION_VARS} ${BUILD_INCLUDE_PATH}/include/version_extra.h) + set(EXTRA_VERSION_INFO "#include \"version_extra.h\"") + endif() + find_file(PLUGIN_EXTRA_FORMBUILDER_HEADERS NAMES extra_formbuilder_headers.h.in PATHS ${CMAKE_CURRENT_LIST_DIR}/in-files NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + message(STATUS "${CMLOC}PLUGIN_EXTRA_FORMBUILDER_HEADERS: ${PLUGIN_EXTRA_FORMBUILDER_HEADERS}") + if(${PLUGIN_EXTRA_FORMBUILDER_HEADERS} STREQUAL "PLUGIN_EXTRA_FORMBUILDER_HEADERS-NOTFOUND") + message(STATUS "${CMLOC}PLUGIN_EXTRA_FORMBUILDER_HEADERS: Not found") + else() + message(STATUS "${CMLOC}PLUGIN_EXTRA_FORMBUILDER_HEADERS: Found") + configure_file(${PLUGIN_EXTRA_FORMBUILDER_HEADERS} ${BUILD_INCLUDE_PATH}/include/extra_formbuilder_headers.h) + endif() + configure_file(${CMAKE_CURRENT_LIST_DIR}/in-files/version.h.in ${BUILD_INCLUDE_PATH}/include/version.h) + configure_file(${CMAKE_CURRENT_LIST_DIR}/in-files/wxWTranslateCatalog.h.in ${BUILD_INCLUDE_PATH}/include/wxWTranslateCatalog.h) + include_directories(${BUILD_INCLUDE_PATH}/include) + if(MINGW) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE_SAVE}) + endif() +endif(NOT SKIP_VERSION_CONFIG) + +# configure xml file for circleci + +message(STATUS "${CMLOC}ENV BUILD_GTK3: $ENV{BUILD_GTK3}") +string(TOUPPER "$ENV{BUILD_GTK3}" BUILD_GTK3_TEMP) +set(ENV{BUILD_GTK3} ${BUILD_GTK3_TEMP}) +unset(BUILD_GTK3_TEMP) +string(TOUPPER "$ENV{BUILD_ENV}" BUILD_ENV_TEMP) +message(STATUS "${CMLOC}BUILD_ENV: $ENV{BUILD_ENV}, BUILD_ENV_TEMP ${BUILD_ENV_TEMP}, OCPN_TARGET: $ENV{OCPN_TARGET}") +message(STATUS "${CMLOC}Doing build_gtk3: $ENV{BUILD_GTK3}") +if("$ENV{BUILD_GTK3}" STREQUAL "TRUE" AND ( ("${BUILD_ENV_TEMP}" STREQUAL "UBUNTU" AND NOT "$ENV{OCPN_TARGET}" STREQUAL "jammy") OR "$ENV{OCPN_TARGET}" STREQUAL "buster-armhf")) + set(PKG_TARGET_GTK "gtk3") + message(STATUS "${CMLOC}Found gtk3") +else() + unset(PKG_TARGET_GTK) +endif() +message(STATUS "${CMLOC}PKG_TARGET_GTK: ${PKG_TARGET_GTK}") + +if(UNIX AND NOT APPLE) + # Handle gtk3 build variant + string(STRIP "${PKG_TARGET}" PKG_TARGET) + string(TOLOWER "${PKG_TARGET}" PKG_TARGET) + + # Generate architecturally uniques names for linux output packages + if(ARCH MATCHES "aarch64") + set(PKG_TARGET_ARCH "-aarch64") + elseif(ARCH MATCHES "arm64") + set(PKG_TARGET_ARCH "-arm64") + elseif(ARCH MATCHES "armhf") + set(PKG_TARGET_ARCH "-armhf") + elseif(ARCH MATCHES "i386") + set(PKG_TARGET_ARCH "-i386") + elseif(ARCH MATCHES "amd64") + set(PKG_TARGET_ARCH "-amd64") + else() + set(PKG_TARGET_ARCH "-x86_64") + endif() +else() + if(MINGW) + set(PKG_TARGET_ARCH "-x86_64") + else(MINGW) + set(PKG_TARGET_ARCH "") + endif(MINGW) +endif() + +message(STATUS "${CMLOC}ARCH: ${ARCH}") + +if("${PKG_BUILD_TARGET}" STREQUAL "") + set(PKG_BUILD_TARGET "${PKG_TARGET}") + set(PKG_TARGET_BUILD "-${PKG_BUILD_TARGET}") +endif() + +if(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID) + find_package(GTK2) + + if(GTK2_FOUND AND NOT "$ENV{BUILD_GTK3}" STREQUAL "TRUE") + set(wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --toolkit=gtk2) + include_directories(${GTK2_INCLUDE_DIRS}) + set(GTK_LIBRARIES ${GTK2_LIBRARIES}) + set(PKG_BUILT_WITH_GTK "gtk2") + message(STATUS "${CMLOC}Building against GTK2...") + else(GTK2_FOUND AND NOT "$ENV{BUILD_GTK3}" STREQUAL "TRUE") + find_package(GTK3) + if(GTK3_FOUND) + include_directories(${GTK3_INCLUDE_DIRS}) + set(GTK_LIBRARIES ${GTK3_LIBRARIES}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__WXGTK3__") + set(wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --toolkit=gtk3) + set(PKG_BUILT_WITH_GTK "gtk3") + message(STATUS "${CMLOC}Building against GTK3...") + else(GTK3_FOUND) + message(STATUS "${CMLOC} Unix: Neither FATAL_ERROR GTK2 nor GTK3") + set(PKG_BUILT_WITH_GTK "") + endif(GTK3_FOUND) + endif(GTK2_FOUND AND NOT "$ENV{BUILD_GTK3}" STREQUAL "TRUE") + set(EXTRA_LIBS ${EXTRA_LIBS} ${GTK_LIBRARIES}) +else() + set(PKG_BUILT_WITH_GTK "${PKG_TARGET_GTK}") +endif(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID) + +if(NOT "${PKG_TARGET_GTK}" STREQUAL "") + set(PKG_BUILD_GTK "-${PKG_TARGET_GTK}") + set(PKG_TARGET_GTK "-${PKG_TARGET_GTK}") +endif() + +message(STATUS "${CMLOC}PKG_NVR: ${PKG_NVR}, PKG_TARGET: ${PKG_TARGET}, ARCH: ${ARCH}, PKG_TARGET_WX_VER: ${PKG_TARGET_WX_VER}, PKG_BUILD_GTK: ${PKG_BUILD_GTK}, PKG_TARGET_VERSION: ${PKG_TARGET_VERSION}, OCPN_TARGET: $ENV{OCPN_TARGET}") +if(DEFINED ENV{OCPN_TARGET}) + message(STATUS "${CMLOC}OCPN_TARGET defined: $ENV{OCPN_TARGET}") + if(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW OR MSVC OR + (("$ENV{OCPN_TARGET}" STREQUAL "bookworm-armhf" OR "$ENV{OCPN_TARGET}" STREQUAL "bookworm-arm64") AND "$ENV{BUILD_ENV}" STREQUAL "debian") OR + (("$ENV{OCPN_TARGET}" STREQUAL "bullseye-armhf" OR "$ENV{OCPN_TARGET}" STREQUAL "bullseye-arm64") AND "$ENV{WX_VER}" STREQUAL "32" AND "$ENV{BUILD_ENV}" STREQUAL "debian" )) + message(STATUS "${CMLOC}Including $ENV{OCPN_TARGET} $ENV{BUILD_ENV}") + set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${ARCH}${PKG_TARGET_WX_VER}${PKG_BUILD_GTK}-${PKG_TARGET_VERSION}-$ENV{OCPN_TARGET}") + set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}${PKG_TARGET_WX_VER}${PKG_BUILD_GTK}-${PKG_TARGET_VERSION}-$ENV{OCPN_TARGET}") + else() + set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}") + set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}") + if(APPLE AND CMAKE_OSX_ARCHITECTURES) + set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${COMPOUND_ARCH_DASH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}") + endif() +endif() +else() + if(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW OR MSVC) + set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}") + set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}") + else(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW OR MSVC) + set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}") + set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}") + endif(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW OR MSVC) +endif(DEFINED ENV{OCPN_TARGET}) +if(OCPN_FLATPAK_CONFIG) + message(STATUS "${CMLOG}Checking for flatpak extensions") + find_file(PLUGIN_FLATPAK_ARGS NAMES flatpak_args.in PATHS cmake/in-files NO_DEFAULT_PATH ) + if(${PLUGIN_FLATPAK_ARGS} STREQUAL "PLUGIN_FLATPAK_ARGS-NOTFOUND") + message(STATUS "${CMLOC}PLUGIN_FLATPAK_ARGS: Not Found") + set(finish_args "") + else() + message(STATUS "${CMLOC}finish_args: Found") + message(STATUS "${CMLOC}PLUGIN_FLATPAK_ARGS: ${PLUGIN_FLATPAK_ARGS}") + file(READ ${PLUGIN_FLATPAK_ARGS} finish_args) + endif() + find_file(PLUGIN_FLATPAK_OPTIONS NAMES flatpak_options.in PATHS cmake/in-files NO_DEFAULT_PATH ) + if(${PLUGIN_FLATPAK_OPTIONS} STREQUAL "PLUGIN_FLATPAK_OPTIONS-NOTFOUND") + message(STATUS "${CMLOC}PLUGIN_FLATPAK_OPTIONS: Not Found") + set(build_options "") + else() + message(STATUS "${CMLOC}build_options: Found") + file(READ ${PLUGIN_FLATPAK_OPTIONS} build_options) + endif() + find_file(PLUGIN_FLATPAK_EXTRA_MODULES NAMES flatpak_extra_modules.in PATHS cmake/in-files NO_DEFAULT_PATH ) + if(${PLUGIN_FLATPAK_EXTRA_MODULES} STREQUAL "PLUGIN_FLATPAK_EXTRA_MODULES-NOTFOUND") + message(STATUS "${CMLOC}PLUGIN_FLATPAK_EXTRA_MODULES: Not Found") + set(flatpak_extra_modules "") + else() + message(STATUS "${CMLOC}flatpak_extra_modules: Found") + file(READ ${PLUGIN_FLATPAK_EXTRA_MODULES} flatpak_extra_modules) + endif() +endif() +message(STATUS "${CMLOC}PACKAGING_NAME: ${PACKAGING_NAME}") +message(STATUS "${CMLOC}PACKAGING_NAME_XML: ${PACKAGING_NAME_XML}") + +set(PKG_TARGET_FULL "${PKG_TARGET}${PKG_TARGET_GTK}${PKG_TARGET_WX_VER}${PKG_TARGET_ARCH}") +message(STATUS "${CMLOC}PKG_TARGET_FULL: ${PKG_TARGET_FULL}") +message(STATUS "${CMLOC}PKG_BUILD_TARGET: ${PKG_BUILD_TARGET}") +message(STATUS "${CMLOC}PKG_BUILD_GTK: ${PKG_TARGET_GTK}") +message(STATUS "${CMLOC}PKG_BUILT_WITH_GTK: ${PKG_BUILT_WITH_GTK}") +message(STATUS "${CMLOC}*.in files generated in ${CMAKE_CURRENT_BINARY_DIR}") +configure_file(${PROJECT_SOURCE_DIR}/cmake/in-files/plugin.xml.in ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGING_NAME_XML}.xml) +configure_file(${PROJECT_SOURCE_DIR}/cmake/in-files/pkg_version.sh.in ${CMAKE_CURRENT_BINARY_DIR}/pkg_version.sh) +configure_file(${PROJECT_SOURCE_DIR}/cmake/in-files/cloudsmith-upload.sh.in ${CMAKE_CURRENT_BINARY_DIR}/cloudsmith-upload.sh @ONLY) +configure_file(${PROJECT_SOURCE_DIR}/cmake/in-files/PluginCPackOptions.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PluginCPackOptions.cmake @ONLY) + +if(OCPN_FLATPAK_CONFIG) + #set(SDK_VER $ENV{SDK_VER}) + # Hack for temporary "beta" status of 20.08 runtime + # See new substitution variable in cmake/in-files/org.opencpn.OpenCPN.Plugin.yaml.in + message(STATUS "${CMLOC}FLATPAK_BRANCH: ${FLATPAK_BRANCH}") + set(RUNTIME_VERSION ${FLATPAK_BRANCH}) + + message(STATUS "${CMLOC}Checking OCPN_FLATPAK_CONFIG: ${OCPN_FLATPAK_CONFIG}, SDK_VER: ${SDK_VER}, WX_VER: ${WX_VER}") + configure_file(${PROJECT_SOURCE_DIR}/cmake/in-files/org.opencpn.OpenCPN.Plugin.yaml.in ${CMAKE_CURRENT_BINARY_DIR}/flatpak/org.opencpn.OpenCPN.Plugin.${PACKAGE}.yaml) + + message(STATUS "${CMLOC}Done OCPN_FLATPAK CONFIG") + message(STATUS "${CMLOC}Directory used: ${CMAKE_CURRENT_BINARY_DIR}/flatpak") + message(STATUS "${CMLOC}Git Branch: ${GIT_REPOSITORY_BRANCH}") + set(CMLOC ${SAVE_CMLOC}) + return() +endif(OCPN_FLATPAK_CONFIG) + +set(CMAKE_VERBOSE_MAKEFILE ON) + +include_directories(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src) + +set(CMAKE_SHARED_LINKER_FLAGS "") +set(CMAKE_EXE_LINKER_FLAGS "") + +# SET(PROFILING 1) +if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + add_definitions("-DDEBUG_BUILD") + set(CMAKE_INSTALL_DO_STRIP FALSE) + set(CPACK_DEBIAN_DEBUGINFO_PACKAGE YES) + message(STATUS "${CMLOC}DEBUG available") +endif(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + +if(NOT WIN32 AND NOT APPLE) + add_definitions("-Wall -Wno-unused -fexceptions -rdynamic -fvisibility=hidden") + add_definitions(" -fno-strict-aliasing") + message(STATUS "${CMLOC}Build type: ${CMAKE_BUILD_TYPE}") + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(" -O0 -g") + message(STATUS "${CMLOC}Optimisation: -O0 -g") + elseif(CMAKE_BUILD_TYPE STREQUAL "Release") + add_definitions(" -O2 -s") + message(STATUS "${CMLOC}Optimisation: -O2 -s") + elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + add_definitions(" -O2 -g") + message(STATUS "${CMLOC}Optimisation: -O2 -g") + else(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") + add_definitions(" -O2 -s") + message(STATUS "${CMLOC}Optimisation: -O2 -s") + endif(CMAKE_BUILD_TYPE STREQUAL "Debug") + + add_definitions(" -DPREFIX=\\\"${CMAKE_INSTALL_PREFIX}\\\"") + # profiling with gprof ADD_DEFINITIONS( -pg ) SET(CMAKE_EXE_LINKER_FLAGS -pg) profiling with gcov ADD_DEFINITIONS( "-fprofile-arcs -ftest-coverage" ) SET(EXTRA_LIBS ${EXTRA_LIBS} "gcov") +endif(NOT WIN32 AND NOT APPLE) + +if(MINGW) + add_definitions("-Wall -Wno-unused -Wno-cpp -fexceptions") + add_definitions(" -g -fno-strict-aliasing") + if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") + add_link_options(-Wl,--strip-all) + endif(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") +endif(MINGW) + +if(APPLE) + string(APPEND CMAKE_CXX_FLAGS " -Wall -Wno-unused -fexceptions -Wno-overloaded-virtual") + string(APPEND CMAKE_CXX_FLAGS " -g -fno-strict-aliasing") + string(APPEND CMAKE_CXX_FLAGS " -Wno-deprecated -Wno-deprecated-declarations -Wno-unknown-pragmas") + string(APPEND CMAKE_CXX_FLAGS " -D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_") + string(APPEND CMAKE_CXX_FLAGS " -DAPPLE") +endif(APPLE) + +# Add some definitions to satisfy MS +if(MSVC) + add_definitions(-D__MSVC__) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D HAVE_SNPRINTF) + message(STATUS "${CMLOC}Set SNPRINTF") +else(MSVC) + if(NOT APPLE) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic") + else(NOT APPLE) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl -undefined dynamic_lookup") + endif(NOT APPLE) +endif(MSVC) + +set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) +set(BUILD_SHARED_LIBS TRUE) + +# Allow multiprocess compile +if(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") +endif(MSVC) + +if(WIN32) + if(MSVC) + set(CMAKE_C_FLAGS_DEBUG "/MP /MDd /Ob0 /Od /D_DEBUG /Zi /RTC1") + set(CMAKE_C_FLAGS_MINSIZEREL "/MP /MD /O1 /Ob1 /D NDEBUG") + set(CMAKE_C_FLAGS_RELEASE "/MP /MD /O2 /Ob2 /D NDEBUG /Zi") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MP /MD /O2 /Ob1 /D NDEBUG /Zi") + set(CMAKE_CXX_FLAGS_DEBUG "/MP /MDd /Ob0 /Od /D_DEBUG /Zi /RTC1 /EHa") + set(CMAKE_CXX_FLAGS_MINSIZEREL "/MP /MD /O1 /Ob1 /D NDEBUG /EHa") + set(CMAKE_CXX_FLAGS_RELEASE "/MP /MD /O2 /Ob2 /D NDEBUG /Zi /EHa") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MP /MD /O2 /Ob1 /D NDEBUG /Zi /EHa") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG") + endif(MSVC) +endif(WIN32) + +set(wxWidgets_USE_LIBS + base + core + net + xml + html + adv + aui) + +# Search for opengles, short of running a program to test the speed of acceleration, I simply use gles on "native linux" arm systems +if(ARCH MATCHES "arm*" + AND (NOT QT_ANDROID) + AND USE_GL MATCHES "ON") + find_path(OPENGLESv1_INCLUDE_DIR GLES/gl.h) + if(OPENGLESv1_INCLUDE_DIR) + message(STATUS "${CMLOC}Found OpenGLESv1") + add_definitions(-DocpnUSE_GLES) + add_definitions(-DocpnUSE_GL) + + set(OPENGLES_FOUND "YES") + set(OPENGL_FOUND "YES") + + set(wxWidgets_USE_LIBS ${wxWidgets_USE_LIBS} gl) + + set(OPENGL_LIBRARIES "GL_static" "EGL" "X11" "drm") + endif() +endif() + +IF(DEFINED _wx_selected_config) + MESSAGE(STATUS "${CMLOC}_wx_select_config defined as $ENV{_wx_select_config}") + IF(_wx_selected_config MATCHES "androideabi-qt") + MESSAGE (STATUS "${CMLOC}Qt_Base: " ${Qt_Base}) + MESSAGE (STATUS "${CMLOC}wxQt_Base/Build: " ${wxQt_Base} "/" ${wxQt_Build}) + ADD_DEFINITIONS(-DocpnUSE_GLES) + ADD_DEFINITIONS(-DocpnUSE_GL) + ADD_DEFINITIONS(-DARMHF) + + SET(OPENGLES_FOUND "YES") + SET(OPENGL_FOUND "YES") + + ADD_DEFINITIONS(-DUSE_GLU_TESS) + SET(USE_GLES2 ON ) + MESSAGE (STATUS "${CMLOC}Using GLESv2 for Android") + ADD_DEFINITIONS(-DUSE_ANDROID_GLES2) + ADD_DEFINITIONS(-DUSE_GLSL) + + ENDIF(_wx_selected_config MATCHES "androideabi-qt") +ENDIF(DEFINED _wx_selected_config) + +# Building for QT_ANDROID involves a cross-building environment, So the include directories, flags, etc must be stated explicitly without trying to locate them on the host build system. +IF(QT_ANDROID) + MESSAGE(STATUS "${CMLOC}Processing QT_ANDROID") + ADD_DEFINITIONS(-D__WXQT__) + ADD_DEFINITIONS(-D__OCPN__ANDROID__) + ADD_DEFINITIONS(-DOCPN_USE_WRAPPER) + ADD_DEFINITIONS(-DANDROID) + + set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-soname,libgorp.so ") + + #set(CMAKE_POSITION_INDEPENDENT_CODE ON) + SET(CMAKE_CXX_FLAGS "-pthread -fPIC ") + + ## Compiler flags + add_compile_options("-Wno-inconsistent-missing-override" + "-Wno-potentially-evaluated-expression" + "-Wno-overloaded-virtual" + "-Wno-unused-command-line-argument" + "-Wno-unknown-pragmas" + ) + + message(STATUS "${CMLOC}Adding libgorp.o shared library") + set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-soname,libgorp.so ") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s") ## Strip binary + + SET(QT_LINUX "OFF") + SET(QT "ON") + SET(CMAKE_SKIP_BUILD_RPATH TRUE) + ADD_DEFINITIONS(-DQT_WIDGETS_LIB) + if("$ENV{OCPN_TARGET}" STREQUAL "android-arm64") + MESSAGE(STATUS "${CMLOC}Adding definition -DARM64") + ADD_DEFINITIONS(-DARM64) + else() + MESSAGE(STATUS "${CMLOC}Adding definition -DARMHF") + ADD_DEFINITIONS(-DARMHF) + endif() + +ENDIF(QT_ANDROID) + +if((NOT OPENGLES_FOUND) AND (NOT QT_ANDROID)) + + if(USE_GL MATCHES "ON") + message(STATUS "${CMLOC}Finding package OpenGL") + find_package(OpenGL) + else(USE_GL MATCHES "ON") + message(STATUS "${CMLOC}OpenGL disabled by option...") + endif(USE_GL MATCHES "ON") + + if(OPENGL_FOUND) + + set(wxWidgets_USE_LIBS ${wxWidgets_USE_LIBS} gl) + include_directories(${OPENGL_INCLUDE_DIR}) + + message(STATUS "${CMLOC}Found OpenGL...") + message(STATUS "${CMLOC} Lib: " ${OPENGL_LIBRARIES}) + message(STATUS "${CMLOC} Include: " ${OPENGL_INCLUDE_DIR}) + add_definitions(-DocpnUSE_GL) + + # We need to remove GLU from the OPENGL_LIBRARIES list + foreach(_currentLibFile ${OPENGL_LIBRARIES}) + set(UCNAME ${_currentLibFile}) + string(TOUPPER ${UCNAME} UCNAME) + if(NOT ${UCNAME} MATCHES "(.*)GLU(.*)") + set(REVISED_OPENGL_LIBRARIES ${_currentLibFile} ${REVISED_OPENGL_LIBRARIES}) + endif() + endforeach(_currentLibFile) + + set(OPENGL_LIBRARIES ${REVISED_OPENGL_LIBRARIES}) + message(STATUS "${CMLOC} Revised GL Lib: " ${OPENGL_LIBRARIES}) + + else() + message(STATUS "${CMLOC}OpenGL not found...") + endif() +endif() + +if(NOT QT_ANDROID) + # Find wxWidgets here, and the setting get inherited by all plugins. These options can be used to set the linux widgets build type + set(wxWidgets_USE_DEBUG OFF) + set(wxWidgets_USE_UNICODE ON) + set(wxWidgets_USE_UNIVERSAL OFF) + set(wxWidgets_USE_STATIC OFF) + + set(WXWIDGETS_FORCE_VERSION CACHE STRING "Force usage of a specific wxWidgets version.") + if(NOT "${WX_VER}" STREQUAL "") + string(LENGTH ${WX_VER} WX_VER_LEN) + string(SUBSTRING ${WX_VER} 0 1 MAJOR) + string(SUBSTRING ${WX_VER} 1 1 MINOR) + string(CONCAT WXWIDGETS_FORCE_VERSION ${MAJOR} "." ${MINOR}) + if(${WX_VER_LEN} EQUAL 3) + string(SUBSTRING ${WX_VER} 2 1 PATCH) + string(CONCAT WXWIDGETS_FORCE_VERSION ${WXWIDGETS_FORCE_VERSION} "." ${PATCH}) + endif() + endif() + message(STATUS "${CMLOC}wxWidgets_Version: ${WXWIDGETS_FORCE_VERSION}") + + if(WXWIDGETS_FORCE_VERSION) + set(wxWidgets_CONFIG_OPTIONS --version=${WXWIDGETS_FORCE_VERSION}) + endif() + + message(STATUS "${CMLOC}wxWidgets components: ${wxWidgets_USE_LIBS}") + find_package(wxWidgets REQUIRED COMPONENTS ${wxWidgets_USE_LIBS}) + + if(MSVC) + # Exclude wxexpat.lib, since we use our own version. Other things are excluded as well, but we don't need them + set(wxWidgets_EXCLUDE_COMMON_LIBRARIES TRUE) + endif(MSVC) + + if(WIN32 OR APPLE OR QT_ANDROID) + if(MSYS) + # this is to convert msys to windows paths, and handle the missing /usr + string(REGEX REPLACE "/usr/local" ";C:/MinGW/msys/1.0/local" wxWidgets_INCLUDE_DIRS ${wxWidgets_INCLUDE_DIRS}) + endif(MSYS) + endif(WIN32 OR APPLE OR QT_ANDROID) + + include(${wxWidgets_USE_FILE}) + + message(STATUS "${CMLOC}Found wxWidgets...") + message(STATUS "${CMLOC} wxWidgets Include: ${wxWidgets_INCLUDE_DIRS}") + message(STATUS "${CMLOC} wxWidgets Libraries: ${wxWidgets_LIBRARIES}") + + # We need to remove GLU from the wxWidgets_LIBRARIES list It only appears to get on the list for MSW... + foreach(_currentLibFile ${wxWidgets_LIBRARIES}) + set(UCNAME ${_currentLibFile}) + string(TOUPPER ${UCNAME} UCNAME) + if(NOT ${UCNAME} MATCHES "(.*)GLU(.*)") + set(REVISED_wxWidgets_LIBRARIES ${REVISED_wxWidgets_LIBRARIES} ${_currentLibFile}) + endif() + endforeach(_currentLibFile) + set(wxWidgets_LIBRARIES ${REVISED_wxWidgets_LIBRARIES}) + + message(STATUS "${CMLOC} Revised wxWidgets Libraries: ${wxWidgets_LIBRARIES}") +else(NOT QT_ANDROID) + IF(_wx_selected_config MATCHES "androideabi-qt-arm64") + MESSAGE(STATUS "${CMLOC}Processing androideabi-qt-arm64 includes") + + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/include") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/include/QtCore") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/include/QtWidgets") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/include/QtGui") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/include/QtOpenGL") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/include/QtTest") + + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/wxWidgets/libarm64/wx/include/arm-linux-androideabi-qt-unicode-static-3.1") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/wxWidgets/include") + + SET(wxWidgets_LIBRARIES + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/lib/libQt5Core.so + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/lib/libQt5OpenGL.so + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/lib/libQt5Widgets.so + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/lib/libQt5Gui.so + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/qt5/build_arm64_O3/qtbase/lib/libQt5AndroidExtras.so + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/opencpn/API-117/libarm64/libgorp.so + + -lc++_shared + -lz + libGLESv2.so + libEGL.so + ) + + ELSE(_wx_selected_config MATCHES "androideabi-qt-arm64") + MESSAGE(STATUS "${CMLOC}Processing androideabi-qt-armhf includes") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/include") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/include/QtCore") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/include/QtWidgets") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/include/QtGui") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/include/QtOpenGL") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/include/QtTest") + + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/wxWidgets/libarmhf/wx/include/arm-linux-androideabi-qt-unicode-static-3.1") + set(qt_android_include ${qt_android_include} "${OCPN_Android_Common}/wxWidgets/include") + + ADD_DEFINITIONS( -DOCPN_ARMHF ) + + SET(wxWidgets_LIBRARIES + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/lib/libQt5Core.so + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/lib/libQt5OpenGL.so + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/lib/libQt5Widgets.so + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/lib/libQt5Gui.so + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/qt5/build_arm32_19_O3/qtbase/lib/libQt5AndroidExtras.so + ${CMAKE_CURRENT_SOURCE_DIR}/${OCPN_Android_Common}/opencpn/API-117/libarmhf/libgorp.so + + -lc++_shared + -lz + libGLESv2.so + libEGL.so + ) + + ENDIF(_wx_selected_config MATCHES "androideabi-qt-arm64") + + # Needed for android builds + include_directories(BEFORE ${qt_android_include}) + +endif(NOT QT_ANDROID) + +find_package(Gettext REQUIRED) + +set(CMLOC ${SAVE_CMLOC}) diff --git a/cmake/PluginInstall.cmake b/cmake/PluginInstall.cmake index 3e320f25..a8259122 100644 --- a/cmake/PluginInstall.cmake +++ b/cmake/PluginInstall.cmake @@ -17,9 +17,9 @@ if(WIN32) if(MSVC) # TARGET_LINK_LIBRARIES(${PACKAGE_NAME} gdiplus.lib glu32.lib) target_link_libraries(${PACKAGE_NAME} ${OPENGL_LIBRARIES}) - add_subdirectory(libs/ocpn-api) - target_link_libraries(${PACKAGE_NAME} ocpn::api) - message(STATUS "${CMLOC}Added ocpn-api for MSVC") +# add_subdirectory(libs/ocpn-api) +# target_link_libraries(${PACKAGE_NAME} ocpn::api) +# message(STATUS "${CMLOC}Added ocpn-api for MSVC") endif(MSVC) if(MINGW) @@ -27,9 +27,9 @@ if(WIN32) add_definitions(" -DUNICODE") target_link_libraries(${PACKAGE_NAME} ${OPENGL_LIBRARIES}) set(CMAKE_SHARED_LINKER_FLAGS "-L../buildwin") - add_subdirectory(libs/ocpn-api) - target_link_libraries(${PACKAGE_NAME} ocpn::api) - message(STATUS "${CMLOC}Added ocpn-api for MINGW") +# add_subdirectory(libs/ocpn-api) +# target_link_libraries(${PACKAGE_NAME} ocpn::api) +# message(STATUS "${CMLOC}Added ocpn-api for MINGW") endif(MINGW) endif(WIN32) @@ -44,6 +44,16 @@ if(UNIX) endif(PROFILING) endif(UNIX) +if(UNIX AND NOT APPLE AND NOT QT_ANDROID) + find_package(BZip2 REQUIRED) + include_directories(${BZIP2_INCLUDE_DIR}) + find_package(ZLIB REQUIRED) + include_directories(${ZLIB_INCLUDE_DIR}) + target_link_libraries(${PACKAGE_NAME} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARY}) +endif(UNIX AND NOT APPLE AND NOT QT_ANDROID) + +set(PARENT opencpn) + if(APPLE) install( TARGETS ${PACKAGE_NAME} @@ -62,16 +72,6 @@ if(APPLE) endif(APPLE) -if(UNIX AND NOT APPLE AND NOT QT_ANDROID) - find_package(BZip2 REQUIRED) - include_directories(${BZIP2_INCLUDE_DIR}) - find_package(ZLIB REQUIRED) - include_directories(${ZLIB_INCLUDE_DIR}) - target_link_libraries(${PACKAGE_NAME} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARY}) -endif(UNIX AND NOT APPLE AND NOT QT_ANDROID) - -set(PARENT opencpn) - # Based on code from nohal if(NOT CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX ${TENTATIVE_PREFIX}) @@ -129,6 +129,8 @@ if(UNIX AND NOT APPLE) endif(UNIX AND NOT APPLE) if(APPLE) + message(STATUS "${CMLOC}Install Prefix: ${CMAKE_INSTALL_PREFIX}") + # For Apple build, we need to copy the "data" directory contents to the build directory, so that the packager can pick them up. if(NOT EXISTS "${PROJECT_BINARY_DIR}/data/") file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/data/") @@ -157,6 +159,13 @@ if(APPLE) endforeach(_currentDataFile) endif() + # On macos, fix paths which points to the build environment, make sure they + # refers to runtime locations + message(STATUS "Adjusting MacOS library paths") + install(CODE "execute_process( + COMMAND bash -c ${PROJECT_SOURCE_DIR}/cmake/fix-macos-libs.sh + )") + install( TARGETS ${PACKAGE_NAME} RUNTIME diff --git a/cmake/PluginPackage.cmake b/cmake/PluginPackage.cmake index d0477882..81697725 100644 --- a/cmake/PluginPackage.cmake +++ b/cmake/PluginPackage.cmake @@ -111,8 +111,11 @@ if(UNIX AND NOT APPLE) endif(UNIX AND NOT APPLE) + if(NOT STANDALONE MATCHES "BUNDLED") - if(APPLE) + # MacOS .pkg installer is deprecated in OCPN 5.6.2+ + #if(APPLE) + if(FALSE) message(STATUS "${CMLOC}*** Staging to build PlugIn OSX Package ***") # Copy a bunch of files so the Packages installer builder can find them relative to ${CMAKE_CURRENT_BINARY_DIR} This avoids absolute paths in the chartdldr_pi.pkgproj file @@ -137,9 +140,9 @@ if(NOT STANDALONE MATCHES "BUNDLED") COMMENT "create-pkg: Done." DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${VERBOSE_NAME}-Plugin_${PACKAGE_VERSION}_${OCPN_MIN_VERSION}.pkg) - set(CPACK_GENERATOR "TGZ") - endif(APPLE) + endif(FALSE) + set(CPACK_GENERATOR "TGZ") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE_NAME} PlugIn for OpenCPN") set(CPACK_PACKAGE_DESCRIPTION "${PACKAGE_NAME} PlugIn for OpenCPN") set(CPACK_PACKAGE_FILE_NAME "${PACKAGING_NAME_XML}") diff --git a/cmake/PluginSetup.cmake b/cmake/PluginSetup.cmake index 69a6005b..c62840e7 100644 --- a/cmake/PluginSetup.cmake +++ b/cmake/PluginSetup.cmake @@ -81,7 +81,8 @@ elseif(MINGW) elseif(MSVC) set(PKG_TARGET "msvc") message(STATUS "${CMLOC}WX_VER: $ENV{WX_VER}") - if( NOT "$ENV{WX_VER}" STREQUAL "" ) + if( NOT "$ENV{WX_VER}" STREQUAL "31" ) +## if( NOT "$ENV{WX_VER}" STREQUAL "" ) set(PKG_TARGET_WX_VER "-wx$ENV{WX_VER}") else() unset(PKG_TARGET_WX_VER) @@ -99,7 +100,8 @@ elseif(APPLE) if("$ENV{WX_VER}" STREQUAL "32") set(PKG_TARGET "darwin-wx$ENV{WX_VER}") else() - set(PKG_TARGET "${PKG_BUILD_TARGET}") +## set(PKG_TARGET "${PKG_BUILD_TARGET}") + set(PKG_TARGET "darwin-wx315") endif() execute_process(COMMAND "sw_vers" "-productVersion" OUTPUT_VARIABLE PKG_TARGET_VERSION) elseif(_wx_selected_config MATCHES "androideabi-qt-arm64") @@ -112,10 +114,13 @@ elseif(_wx_selected_config MATCHES "androideabi-qt-armhf") set(QT_ANDROID ON) elseif(UNIX) # Some linux dist: + execute_process(COMMAND "lsb_release" "-rs" OUTPUT_VARIABLE PKG_TARGET_VERSION) if("$ENV{BUILD_ENV}" STREQUAL "debian" OR "$ENV{BUILD_ENV}" STREQUAL "DEBIAN") set(PKG_TARGET "$ENV{BUILD_ENV}") - if( NOT "$ENV{WX_VER}" STREQUAL "" ) - set(PKG_TARGET_WX_VER "-wx$ENV{WX_VER}") + if("${PKG_TARGET_VERSION}" STRLESS "12") + if( NOT "$ENV{WX_VER}" STREQUAL "" ) + set(PKG_TARGET_WX_VER "-wx$ENV{WX_VER}") + endif() endif() message(STATUS "${CMLOC}PKG_TARGET_WX_VER: ${PKG_TARGET_WX_VER}, WX_VER: $ENV{WX_VER}") elseif(("$ENV{BUILD_ENV}" STREQUAL "ubuntu" OR "$ENV{BUILD_ENV}" STREQUAL "UBUNTU") AND @@ -128,7 +133,6 @@ elseif(UNIX) else() execute_process(COMMAND "lsb_release" "-is" OUTPUT_VARIABLE PKG_TARGET) endif() - execute_process(COMMAND "lsb_release" "-rs" OUTPUT_VARIABLE PKG_TARGET_VERSION) else() set(PKG_TARGET "unknown") set(PKG_TARGET_VERSION 1) @@ -251,7 +255,17 @@ else(NOT WIN32 AND NOT QT_ANDROID) endif(_wx_selected_config MATCHES "androideabi-qt-armhf") endif(NOT WIN32 AND NOT QT_ANDROID) + +if(APPLE AND CMAKE_OSX_ARCHITECTURES) + string(REPLACE ";" "-" _compound_arch "${CMAKE_OSX_ARCHITECTURES}") + set(COMPOUND_ARCH_DASH "${_compound_arch}") + set(ARCH "${CMAKE_OSX_ARCHITECTURES}") +else() + set(COMPOUND_ARCH_DASH "${ARCH}") +endif() + message(STATUS "${CMLOC}ARCH: ${ARCH}") +message(STATUS "${CMLOC}COMPOUND_ARCH_DASH: ${COMPOUND_ARCH_DASH}") if(NOT "${PKG_TARGET}" STREQUAL "") string(STRIP ${PKG_TARGET} PKG_TARGET) diff --git a/cmake/PluginSetup.cmake.bak b/cmake/PluginSetup.cmake.bak index f7984c42..99ded537 100644 --- a/cmake/PluginSetup.cmake.bak +++ b/cmake/PluginSetup.cmake.bak @@ -81,7 +81,8 @@ elseif(MINGW) elseif(MSVC) set(PKG_TARGET "msvc") message(STATUS "${CMLOC}WX_VER: $ENV{WX_VER}") - if( NOT "$ENV{WX_VER}" STREQUAL "" ) + if( NOT "$ENV{WX_VER}" STREQUAL "31" ) +## if( NOT "$ENV{WX_VER}" STREQUAL "" ) set(PKG_TARGET_WX_VER "-wx$ENV{WX_VER}") else() unset(PKG_TARGET_WX_VER) @@ -96,10 +97,10 @@ elseif(MSVC) endif() elseif(APPLE) set(PKG_BUILD_TARGET "darwin") - if("$ENV{WXVERSION}" STREQUAL "32") - set(PKG_TARGET "darwin-wx$ENV{WXVERSION}") + if("$ENV{WX_VER}" STREQUAL "32") + set(PKG_TARGET "darwin-wx$ENV{WX_VER}") else() - set(PKG_TARGET "${PKG_BUILD_TARGET}") + set(PKG_TARGET "darwin-wx315") endif() execute_process(COMMAND "sw_vers" "-productVersion" OUTPUT_VARIABLE PKG_TARGET_VERSION) elseif(_wx_selected_config MATCHES "androideabi-qt-arm64") @@ -112,8 +113,25 @@ elseif(_wx_selected_config MATCHES "androideabi-qt-armhf") set(QT_ANDROID ON) elseif(UNIX) # Some linux dist: - execute_process(COMMAND "lsb_release" "-is" OUTPUT_VARIABLE PKG_TARGET) execute_process(COMMAND "lsb_release" "-rs" OUTPUT_VARIABLE PKG_TARGET_VERSION) + if("$ENV{BUILD_ENV}" STREQUAL "debian" OR "$ENV{BUILD_ENV}" STREQUAL "DEBIAN") + set(PKG_TARGET "$ENV{BUILD_ENV}") + if("${PKG_TARGET_VERSION}" STRLESS "12") + if( NOT "$ENV{WX_VER}" STREQUAL "" ) + set(PKG_TARGET_WX_VER "-wx$ENV{WX_VER}") + endif() + endif() + message(STATUS "${CMLOC}PKG_TARGET_WX_VER: ${PKG_TARGET_WX_VER}, WX_VER: $ENV{WX_VER}") + elseif(("$ENV{BUILD_ENV}" STREQUAL "ubuntu" OR "$ENV{BUILD_ENV}" STREQUAL "UBUNTU") AND + (("$ENV{OCPN_TARGET}" STREQUAL "jammy" OR "$ENV{OCPN_TARGET}" STREQUAL "JAMMY"))) + set(PKG_TARGET "ubuntu") + if( NOT "$ENV{WX_VER}" STREQUAL "" ) + set(PKG_TARGET_WX_VER "-wx$ENV{WX_VER}") + endif() + message(STATUS "${CMLOC}PKG_TARGET_WX_VER: ${PKG_TARGET_WX_VER}, WX_VER: $ENV{WX_VER}") + else() + execute_process(COMMAND "lsb_release" "-is" OUTPUT_VARIABLE PKG_TARGET) + endif() else() set(PKG_TARGET "unknown") set(PKG_TARGET_VERSION 1) @@ -134,7 +152,7 @@ if(NOT WIN32 AND NOT QT_ANDROID) if(EXISTS /etc/debian_version) message(STATUS "${CMLOC}*** Debian detected ***") set(PACKAGE_FORMAT "DEB") - set(PACKAGE_DEPS "libc6, libwxgtk3.0-0, wx3.0-i18n, libglu1-mesa (>= 7.0.0), libgl1-mesa-glx (>= 7.0.0), zlib1g, bzip2, libportaudio2") + set(PACKAGE_DEPS "libc6, libwxgtk3.0-0, wx-i18n, libglu1-mesa (>= 7.0.0), libgl1-mesa-glx (>= 7.0.0), zlib1g, bzip2, libportaudio2") set(PACKAGE_RECS "xcalib,xdg-utils") set(LIB_INSTALL_DIR "lib") if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm*") @@ -236,12 +254,26 @@ else(NOT WIN32 AND NOT QT_ANDROID) endif(_wx_selected_config MATCHES "androideabi-qt-armhf") endif(NOT WIN32 AND NOT QT_ANDROID) + +if(APPLE AND CMAKE_OSX_ARCHITECTURES) + string(REPLACE ";" "-" _compound_arch "${CMAKE_OSX_ARCHITECTURES}") + set(COMPOUND_ARCH_DASH "${_compound_arch}") + set(ARCH "${CMAKE_OSX_ARCHITECTURES}") +else() + set(COMPOUND_ARCH_DASH "${ARCH}") +endif() + message(STATUS "${CMLOC}ARCH: ${ARCH}") +message(STATUS "${CMLOC}COMPOUND_ARCH_DASH: ${COMPOUND_ARCH_DASH}") -string(STRIP ${PKG_TARGET} PKG_TARGET) -string(TOLOWER ${PKG_TARGET} PKG_TARGET) -string(STRIP ${PKG_TARGET_VERSION} PKG_TARGET_VERSION) -string(TOLOWER ${PKG_TARGET_VERSION} PKG_TARGET_VERSION) +if(NOT "${PKG_TARGET}" STREQUAL "") + string(STRIP ${PKG_TARGET} PKG_TARGET) + string(TOLOWER ${PKG_TARGET} PKG_TARGET) +endif() +if(NOT "${PKG_TARGET_VERSION}" STREQUAL "") + string(STRIP ${PKG_TARGET_VERSION} PKG_TARGET_VERSION) + string(TOLOWER ${PKG_TARGET_VERSION} PKG_TARGET_VERSION) +endif() set(PKG_TARGET_NVR ${PKG_TARGET}-${PKG_TARGET_VERSION}) message(STATUS "${CMLOC}PKG_TARGET: ${PKG_TARGET}, PKG_TARGET_VERSION: ${PKG_TARGET_VERSION}") diff --git a/cmake/android-aarch64-toolchain.cmake b/cmake/android-aarch64-toolchain.cmake new file mode 100644 index 00000000..2ee7b34c --- /dev/null +++ b/cmake/android-aarch64-toolchain.cmake @@ -0,0 +1,23 @@ +# ~~~ +# Summary: Cmake toolchain file for android arm64 +# License: GPLv3+ +# Copyright (c) 2021 Alec Leamas +# ~~~ +# + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + + +set(CMAKE_SYSTEM_NAME Android) +set(CMAKE_SYSTEM_VERSION 21) +set(CMAKE_ANDROID_ARCH_ABI arm64-v8a) +if (DEFINED ENV{NDK_HOME}) + set(CMAKE_ANDROID_NDK $ENV{NDK_HOME}) +else () + set(CMAKE_ANDROID_NDK /opt/android/ndk) +endif () + +set(ARM_ARCH aarch64 CACHE STRING "Selected arm architecture" FORCE) diff --git a/cmake/android-armhf-toolchain.cmake b/cmake/android-armhf-toolchain.cmake new file mode 100644 index 00000000..dcec280a --- /dev/null +++ b/cmake/android-armhf-toolchain.cmake @@ -0,0 +1,20 @@ +# ~~~ +# Summary: Cmake toolchain file for 32-bit android armhf +# License: GPLv3+ +# Copyright (c) 2021 Alec Leamas +# ~~~ + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +set(CMAKE_SYSTEM_NAME Android) +set(CMAKE_SYSTEM_VERSION 21) +set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a) +if (DEFINED ENV{NDK_HOME}) + set(CMAKE_ANDROID_NDK $ENV{NDK_HOME}) +else () + set(CMAKE_ANDROID_NDK /opt/android/ndk) +endif () +set(ARM_ARCH armhf CACHE STRING "Selected arm architecture" FORCE) diff --git a/cmake/fix-macos-libs.sh b/cmake/fix-macos-libs.sh new file mode 100755 index 00000000..725ebb9d --- /dev/null +++ b/cmake/fix-macos-libs.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Adjust absolute paths to wxWidgets libraries to match their +# location ot the target MacOS system where they are installed +# as part of OpenCPN + +readonly RUNTIME_PATH="@executable_path/../Frameworks/" + +plugin=$(find . -maxdepth 1 -name '*.dylib') +for lib in $(otool -L "$plugin" | awk ' /wx/ {print $1}'); do + libdir=${lib%/*} + if [ "$libdir" = "$lib" ]; then + continue + elif [ "$libdir" != "$RUNTIME_PATH" ]; then + runtime_lib=$(echo $lib | sed "s|$libdir|$RUNTIME_PATH|") + install_name_tool -change "$lib" "$runtime_lib" "$plugin" + fi +done +echo "fix-macos-libs.sh: Revised library paths:" +otool -L "$plugin" | grep wx diff --git a/cmake/in-files/NSIS.template.in b/cmake/in-files/NSIS.template.in index e6611a75..c2de88c3 100644 --- a/cmake/in-files/NSIS.template.in +++ b/cmake/in-files/NSIS.template.in @@ -1,4628 +1,4628 @@ -/*----------------------------------------------------------------------------------------------------- -NSIS Installer script for OpenCPN (Windows) -NSIS version 2.46 -Written by Gunther Pilz (Netsurfer) netsurfer@opencpn.de -------------------------------------------------------------------------------------------------------- -CMake variables - CPACK_PACKAGE_NAME "OpenCPN" - CPACK_NSIS_PACKAGE_NAME_LC "opencpn" - CPACK_PACKAGE_VENDOR "opencpn.org" - CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR} - CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR} - CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH} - CPACK_PACKAGE_VERSION ${PACKAGE_VERSION} - CPACK_NSIS_INSTALLED_ICON_NAME "opencpn.exe" - CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/src/bitmaps\\\\opencpn.ico" - CPACK_NSIS_EXTRA_INSTALL_COMMANDS ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} - CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/data/license.txt" - CPACK_BUILDWIN_DIR "${PROJECT_SOURCE_DIR}/buildwin" - CPACK_NSIS_DIR "${PROJECT_SOURCE_DIR}/buildwin/NSIS_Unicode") - - #CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_CURRENT_BINARY_DIR};${PACKAGE_NAME};ALL;/" - #CPACK_PACKAGE_EXECUTABLES ${PACKAGE_NAME} "OpenCPN" - #CPACK_PACKAGE_INSTALL_DIRECTORY ${PACKAGE_NAME} "OpenCPN" - #CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenCPN ${PACKAGE_VERSION}" - #CPACK_NSIS_LINK_NAME "${CPACK_PACKAGE_NAME} ${PACKAGE_VERSION}" - #CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_NAME} Version ${PACKAGE_VERSION}" - #CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.opencpn.org" - #CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.opencpn.org" - #CPACK_NSIS_CONTACT "http:\\\\\\\\www.opencpn.org" - #CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_setup" - -----------------------------------------------------------------------------------------------------------*/ -;# Set compression - SetCompressor /FINAL lzma - -;-------------------------------- -;# You must define these values - !define OCPN_INSTALLER_VERSION "1.0.0" - /* - !define CPACK_NSIS_INSTALLED_ICON_NAME "opencpn.exe" - !define CPACK_NSIS_PACKAGE_NAME_LC "opencpn" - !define CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_NAME} ${PACKAGE_VERSION}" - !define CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/src/bitmaps/opencpn.ico" - !define CPACK_BUILDWIN_DIR "${PROJECT_SOURCE_DIR}/buildwin" - !define CPACK_NSIS_DIR "${PROJECT_SOURCE_DIR}/buildwin/NSIS_Unicode" - */ - !define /date YEAR "%Y" - !define OUTPUT_FILE_NAME "@CPACK_NSIS_PACKAGE_NAME_LC@_@CPACK_PACKAGE_VERSION@_setup.exe" - !define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@" - !define REG_ROOT_KEY "Software" - !define REG_KEY "Software\s63_pi" - !define REG_ROOT_KEY_UN "Software\Microsoft\Windows\CurrentVersion\Uninstall" - !define REG_KEY_UN "Software\Microsoft\Windows\CurrentVersion\Uninstall\s63_pi @CPACK_PACKAGE_VERSION@" - !define CSIDL_LOCAL_APPDATA "0x1C" - !define Explode "!insertmacro Explode" - !define unExplode "!insertmacro unExplode" - - -;-------------------------------- -;# Variables - Var INST_USER_SID - Var CONFIG_EXISTS - Var CONFIG_EMPTY - Var INI_EXISTS - Var CHARTDB_EXISTS - Var SENC_EXISTS - Var CM93_EXISTS - Var NAVOBJ_EXISTS - Var LOG_EXISTS - Var REG_LANG - Var Count_SecGrpResetConfig - Var SecGrpEndSetConfig_Text - Var RESET_CONFIG - Var STARTMENU_FOLDER - Var OLD_INSTALLS - Var Prev_Install_RegKey - Var MULTIPLE_INSTALLS - Var VERSION_EXISTS - Var VERSION_NEWER - Var VERSION_OLDER - Var CANCEL_INSTALLER - Var VERSION_DATE - Var LANG_NAME - Var Status_SecGrpSetConfig - Var MAJOR_D - Var MINOR_D - Var PATCH_D - Var PATCH_ND - Var LM_VERSION - Var LM_VERSION_INST - Var LM_VERSION_UNINST - Var latest_version - Var latest_pathexe - Var BU_X - Var BU_Y - Var UAT - Var OUAT - Var USERS_APPDATA - Var ADMIN_APPDATA - Var USERS_NAME - Var counter_tmp - Var CurrentDirVar - Var CurrentFileVar - Var CONTEXT - Var REG_CHARTDIRS - Var USERNAME - Var IS_ADMIN - Var Compare_Version_Result - Var Inst_Or_Uninst - Var Marquee_Handle - Var Banner_Text_Blink - Var error_tmp -# onSelChange - Var ConfigSetLang - Var ConfigSetChartDir - Var SetConfig -# Installer Pages - Var Skip_Page_CleanUp - Var Skip_Page_TypeInst - Var Skip_Page_SetConfig - Var Skip_Page_Directory - Var Skip_Page_Startmenu - Var Skip_Page_Confirm -# Page_TypeInst - Var Label_TypeInst_Reinstall - Var RB_Reinstall - Var Label_TypeInst_Upgrade - Var RB_Upgrade - Var Label_TypeInst_Downgrade - Var RB_Downgrade - Var Label_TypeInst_Parallel - Var GroupBox_TypeInst - Var RB_Parallel - Var TI_REINSTALL - Var TI_UPGRADE - Var TI_DOWNGRADE - Var TI_PARALLEL - Var GroupBox_Size - Var INSTALL_TYPE -# Page_SetConfig - Var Label_SetConfig - Var GroupBox_Language_SetConfig - Var CheckBox_Language_SetConfig - Var GroupBox_ChartDir_SetConfig - Var DirRequest_SetConfig - Var Button_Delete_SetConfig - Var Button_DeleteAll_SetConfig - Var Button_Add_SetConfig - Var ListBox_SetConfig -;# Page_SetConfig_Leave - Var CHART_DIR_TMP_FILE - Var CHART_DIR_EMPTY - Var CONFIG_SET_LANG - -# Uninstaller Pages - Var Skip_UnPage_Components -;-------------------------------- -;# Execution Level - RequestExecutionLevel highest - -;-------------------------------- -;# Includes - !addincludedir "@CPACK_NSIS_DIR@/Include" - !addplugindir "@CPACK_NSIS_DIR@/Plugins" - - !include MUI2.nsh - !include LogicLib.nsh - !include nsDialogs.nsh - !include Sections.nsh - !include StrFunc.nsh - !include WordFunc.nsh - !include TextFunc.nsh - !include FileFunc.nsh - !include WinVer.nsh - - !include UAC.nsh - - !define MUI_UI "@CPACK_NSIS_DIR@/UI/opencpn_ui.exe" - -;-------------------------------- -;# General - ;# Name and file - Name "@CPACK_NSIS_PACKAGE_NAME@" - OutFile "@CPACK_TOPLEVEL_DIRECTORY@/${OUTPUT_FILE_NAME}" - - ;# Default installation folder - InstallDir "$PROGRAMFILES\s63_pi" - - BrandingText /TRIMLEFT "s63_pi $(Installer) v${OCPN_INSTALLER_VERSION}" -;-------------------------------- -;# Interface Settings - !define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit - !define MUI_CUSTOMFUNCTION_UNGUIINIT un.myGuiInit - - !define MUI_ABORTWARNING - - ;# MUI Settings / Header - !define MUI_ICON "@CPACK_PACKAGE_ICON@" - !define MUI_HEADERIMAGE - !define MUI_HEADERIMAGE_LEFT - !define MUI_HEADERIMAGE_BITMAP "@CPACK_NSIS_DIR@\Bitmaps\header-install.bmp" - !define MUI_HEADERIMAGE_UNBITMAP "@CPACK_NSIS_DIR@\Bitmaps\header-uninstall.bmp" - - ;# MUI Settings / Wizard - !define MUI_WELCOMEFINISHPAGE_BITMAP "@CPACK_NSIS_DIR@\Bitmaps\wizard-install.bmp" - !define MUI_UNWELCOMEFINISHPAGE_BITMAP "@CPACK_NSIS_DIR@\Bitmaps\wizard-uninstall.bmp" - - ;# Set Multi-Language settings - ;# Language Selection Dialog Settings - ;# Show all languages, despite user's codepage - !define MUI_LANGDLL_ALLLANGUAGES -/* - ;# Remember the installer language - !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" - !define MUI_LANGDLL_REGISTRY_KEY "${REG_KEY_UN}" - !define MUI_LANGDLL_REGISTRY_VALUENAME "SetupLanguage" - !define MUI_LANGDLL_WINDOWTITLE "$(LangDialog_Title)" - !define MUI_LANGDLL_INFO "$(LangDialog_Text)" - */ -;-------------------------------- -;# Calls for making respective functions available - ${StrLoc} - -;-------------------------------- -;################################################################################################## -;# Macros # -;################################################################################################## - -!ifndef ___EnumHKU___ - !define ___EnumHKU___ - - !include LogicLib.nsh - !include WordFunc.nsh - - !define TOKEN_QUERY 0x0008 - !define TOKEN_ADJUST_PRIVILEGES 0x0020 - - !define SE_RESTORE_NAME SeRestorePrivilege - - !define SE_PRIVILEGE_ENABLED 0x00000002 - - !define HKEY_USERS 0x80000003 - - Var key - Var logged - Var EnumHKU_counter - Var SID - Var USERPROFILE - - !macro _EnumHKU_AdjustTokens - StrCpy $R1 0 - - System::Call "kernel32::GetCurrentProcess() i .R0" - System::Call "advapi32::OpenProcessToken(i R0, i ${TOKEN_QUERY}|${TOKEN_ADJUST_PRIVILEGES}, *i R1R1) i .R0" - - ${If} $R0 != 0 - System::Call "advapi32::LookupPrivilegeValue(t n, t '${SE_RESTORE_NAME}', *l .R2) i .R0" - - ${If} $R0 != 0 - System::Call "*(i 1, l R2, i ${SE_PRIVILEGE_ENABLED}) i .R0" - System::Call "advapi32::AdjustTokenPrivileges(i R1, i 0, i R0, i 0, i 0, i 0)" - System::Free $R0 - ${EndIf} - - System::Call "kernel32::CloseHandle(i R1)" - ${EndIf} - !macroend - - !macro _EnumHKU_InvokeCallback CALLBACK SUBKEY - Push $0 - Push $1 - Push $R0 - Push $R1 - Push $R2 - Push $R3 - Push $R4 - Push $R5 - Push $R6 - - Push "${SUBKEY}" - Call "${CALLBACK}" - - Pop $R6 - Pop $R5 - Pop $R4 - Pop $R3 - Pop $R2 - Pop $R1 - Pop $R0 - Pop $1 - Pop $0 - !macroend - - !macro _EnumHKU_Load FILE CALLBACK SUBKEY - GetFullPathName /SHORT $R2 ${FILE} - System::Call "advapi32::RegLoadKeyW(i ${HKEY_USERS}, t '${SUBKEY}', t R2) i .R3" - ${If} $R3 == 0 - !insertmacro _EnumHKU_InvokeCallback ${CALLBACK} "${SUBKEY}" - ;System::Call "advapi32::RegUnLoadKeyW(i ${HKEY_USERS}, t '${SUBKEY}')" - IntOp $EnumHKU_counter $EnumHKU_counter + 1 - ${EndIf} - !macroend - - !macro EnumHKU UN CALLBACK SUBKEY - Push $0 - Push $1 - StrCpy $EnumHKU_counter 0 - GetFunctionAddress $0 "${CALLBACK}" - StrCpy $1 "${SUBKEY}_$EnumHKU_counter" - StrCpy $key ${SUBKEY} - Call ${UN}_EnumHKU - Pop $1 - Pop $0 - !macroend - - !define EnumHKU '!insertmacro EnumHKU ""' - !define un.EnumHKU '!insertmacro EnumHKU "un."' - - !macro _EnumHKU UN - Function ${UN}_EnumHKU - Push $R0 - Push $R1 - Push $R2 - Push $R3 - Push $R4 - Push $R5 - Push $R6 - - # enumerate logged on users - StrCpy $R0 0 - ${Do} - EnumRegKey $R1 HKU "" $R0 - ${If} $R1 != "" - StrLen $R4 $R1 - ${If} $R4 > 8 - StrCpy $R6 0 - ${WordFind} "$R1" "_Classes" "E*" $R6 - IfErrors 0 cont - - ReadRegStr $R5 HKU "$R1\Volatile Environment" USERPROFILE - ExpandEnvStrings $R5 $R5 - StrCpy $USERPROFILE $R5 - StrCpy $logged "on" - !insertmacro _EnumHKU_InvokeCallback $0 $R1 - StrCpy $USERPROFILE "" - StrCpy $logged "" - ${EndIf} - cont: - IntOp $R0 $R0 + 1 - ${EndIf} - ${LoopUntil} $R1 == "" - - # enumerate logged off users - System::Call "kernel32::GetVersion() i .R0" - IntOp $R0 $R0 & 0x80000000 - ${If} $R0 == 0 - # nt - !insertmacro _EnumHKU_AdjustTokens - StrCpy $R0 0 - ${Do} - EnumRegKey $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $R0 - ${If} $R1 != "" - StrLen $R4 $R1 - ${If} $R4 > 8 - ClearErrors - ReadRegStr $R5 HKU "$R1\Volatile Environment" HOMEPATH - IfErrors 0 cont1 - ReadRegStr $R5 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$R1" ProfileImagePath - ExpandEnvStrings $R5 $R5 - StrCpy $USERPROFILE $R5 - StrCpy $logged "off" - !insertmacro _EnumHKU_Load "$R5\NTUSER.DAT" $0 $1 - StrCpy $1 "$key_$EnumHKU_counter" - StrCpy $USERPROFILE "" - StrCpy $logged "" - ${EndIf} - - cont1: - IntOp $R0 $R0 + 1 - ${EndIf} - ${LoopUntil} $R1 == "" - ${Else} - # 9x - ClearErrors - FindFirst $R1 $R2 "$WINDIR\Profiles\*.*" - ${Unless} ${Errors} - ${Do} - ${If} $R2 != "." - ${AndIf} $R2 != ".." - ${If} ${FileExists} "$WINDIR\Profiles\$R2\USER.DAT" - !insertmacro _EnumHKU_Load "$WINDIR\Profiles\$R2\USER.DAT" $0 $1 - ${EndIf} - ${EndIf} - ClearErrors - FindNext $R1 $R2 - ${LoopUntil} ${Errors} - FindClose $R1 - ${EndUnless} - ${Endif} - - Pop $R6 - Pop $R5 - Pop $R4 - Pop $R3 - Pop $R2 - Pop $R1 - Pop $R0 - FunctionEnd - !macroend - - !insertmacro _EnumHKU "" - !insertmacro _EnumHKU "un." -!endif - -!macro IndexOf Var Str Char - Push "${Char}" - Push "${Str}" - Call IndexOf - Pop "${Var}" -!macroend -!define IndexOf "!insertmacro IndexOf" - -!macro RIndexOf Var Str Char - Push "${Char}" - Push "${Str}" - Call RIndexOf - Pop "${Var}" -!macroend -!define RIndexOf "!insertmacro RIndexOf" - - -!macro Explode Length Separator String - Push `${Separator}` - Push `${String}` - Call Explode - Pop `${Length}` -!macroend - -!macro unExplode Length Separator String - Push `${Separator}` - Push `${String}` - Call un.Explode - Pop `${Length}` -!macroend - -!ifndef _RecFind_Included - !define _RecFind_Included - - Var _RecFindVar1 - Var _RecFindVar2 - - !macro _RecFindOpen Dir CurrentDirVar CurrentFileVar - !define _Local `${__LINE__}` - !define _Dir `${Dir}` - !define _CurrentDirVar `${CurrentDirVar}` - !define _CurrentFileVar `${CurrentFileVar}` - - !define _RecFindOpenSet - - StrCpy $_RecFindVar2 1 - Push `` - - `nextDir${_Local}:` - Pop `${_CurrentDirVar}` - IntOp $_RecFindVar2 $_RecFindVar2 - 1 - !macroend - !define RecFindOpen `!insertmacro _RecFindOpen` - - !macro _RecFindFirst - !ifndef _RecFindOpenSet - !error `Incorrect use of RecFind commands!` - !else - !define _RecFindFirstSet - !endif - - ClearErrors - FindFirst $_RecFindVar1 `${_CurrentFileVar}` `${_Dir}${_CurrentDirVar}\*.*` - IfErrors `Done${_Local}` - - `checkFile${_Local}:` - StrCmp ${_CurrentFileVar} . `nextFile${_Local}` - StrCmp ${_CurrentFileVar} .. `nextFile${_Local}` - - IfFileExists `${_Dir}${_CurrentDirVar}\${_CurrentFileVar}\*.*` 0 +4 - Push `${_CurrentDirVar}\${_CurrentFileVar}` - IntOp $_RecFindVar2 $_RecFindVar2 + 1 - Goto `nextFile${_Local}` - !macroend - !define RecFindFirst `!insertmacro _RecFindFirst` - - !macro _RecFindNext - !ifndef _RecFindOpenSet | _RecFindFirstSet - !error `Incorrect use of RecFind commands!` - !else - !define _RecFindNextSet - !endif - - `nextFile${_Local}:` - - ClearErrors - FindNext $_RecFindVar1 `${_CurrentFileVar}` - IfErrors 0 `checkFile${_Local}` - - StrCmp $_RecFindVar2 0 +3 - FindClose $_RecFindVar1 - Goto `nextDir${_Local}` - !macroend - !define RecFindNext `!insertmacro _RecFindNext` - - !macro _RecFindClose - !ifndef _RecFindOpenSet | _RecFindFirstSet | _RecFindNextSet - !error `Incorrect use of RecFind commands!` - !else - !undef _RecFindOpenSet - !undef _RecFindFirstSet - !undef _RecFindNextSet - !endif - - `Done${_Local}:` - FindClose $_RecFindVar1 - - StrCmp $_RecFindVar2 0 +4 - Pop $_RecFindVar1 - IntOp $_RecFindVar2 $_RecFindVar2 - 1 - Goto -3 - - !undef _CurrentFileVar - !undef _CurrentDirVar - !undef _Dir - !undef _Local - !macroend - !define RecFindClose `!insertmacro _RecFindClose` -!endif - -;-------------------------------------------------------------------------------------------------- -;################################################################################################## -;# FUNCTIONS # -;################################################################################################## - -; StrContains -; This function does a case sensitive searches for an occurrence of a substring in a string. -; It returns the substring if it is found. -; Otherwise it returns null(""). -; Written by kenglish_hi -; Adapted from StrReplace written by dandaman32 - - -Var STR_HAYSTACK -Var STR_NEEDLE -Var STR_CONTAINS_VAR_1 -Var STR_CONTAINS_VAR_2 -Var STR_CONTAINS_VAR_3 -Var STR_CONTAINS_VAR_4 -Var STR_RETURN_VAR - -Function StrContains - Exch $STR_NEEDLE - Exch 1 - Exch $STR_HAYSTACK - ; Uncomment to debug - ;MessageBox MB_OK 'STR_NEEDLE = $STR_NEEDLE STR_HAYSTACK = $STR_HAYSTACK ' - StrCpy $STR_RETURN_VAR "" - StrCpy $STR_CONTAINS_VAR_1 -1 - StrLen $STR_CONTAINS_VAR_2 $STR_NEEDLE - StrLen $STR_CONTAINS_VAR_4 $STR_HAYSTACK - loop: - IntOp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_1 + 1 - StrCpy $STR_CONTAINS_VAR_3 $STR_HAYSTACK $STR_CONTAINS_VAR_2 $STR_CONTAINS_VAR_1 - StrCmp $STR_CONTAINS_VAR_3 $STR_NEEDLE found - StrCmp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_4 done - Goto loop - found: - StrCpy $STR_RETURN_VAR $STR_NEEDLE - Goto done - done: - Pop $STR_NEEDLE ;Prevent "invalid opcode" errors and keep the - Exch $STR_RETURN_VAR -FunctionEnd - -!macro _StrContainsConstructor OUT NEEDLE HAYSTACK - Push `${HAYSTACK}` - Push `${NEEDLE}` - Call StrContains - Pop `${OUT}` -!macroend - -!define StrContains '!insertmacro "_StrContainsConstructor"' - - - - - - -;-------------------------------------------------------------------------------------------------- -;################################################################################################## -;# PAGES # -;################################################################################################## -;# Installer Pages # -;################################################################################################## -/* Var Skip_Page_CleanUp - Var Skip_Page_TypeInst - Var Skip_Page_SetConfig - Var Skip_Page_Directory - Var Skip_Page_Startmenu - Var Skip_Page_Confirm -*/ - ;# Welcome page - !define MUI_WELCOMEPAGE_TITLE_3LINES - !insertmacro MUI_PAGE_WELCOME - - ;# License page - !define MUI_PAGE_CUSTOMFUNCTION_LEAVE Page_License_Leave - ;!insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" - - !define MUI_LICENSEPAGE_BUTTON "$(^NextBtn)" - !define MUI_LICENSEPAGE_TEXT_BOTTOM $(License_Message) - - !insertmacro MUI_PAGE_LICENSE $(license) - -/* - ;# Clean up page - only shown if previous installation(s) <= 2.2.823 were found - checked in .onInit function -; Page custom Page_CleanUp Page_CleanUp_Leave -*/ - ;# Install type page - only shown if previous installation(s) > 2.2.823 were found - checked in .onInit function - Page custom Page_TypeInst Page_TypeInst_Leave - -/* - ;# Components page - !define MUI_COMPONENTSPAGE_SMALLDESC - !define MUI_PAGE_HEADER_TEXT $(CP_HEADER_TEXT) - !define MUI_PAGE_HEADER_SUBTEXT $(CP_HEADER_SUBTEXT) - !define MUI_COMPONENTSPAGE_TEXT_TOP $(CP_TOP) - !define MUI_COMPONENTSPAGE_TEXT_COMPLIST $(CP_COMPLIST) - !define MUI_COMPONENTSPAGE_TEXT_INSTTYPE "" ;#CHANGE $(CP_INSTTYPE) - ;!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE $(CP_DESCRIPTION_TITLE) ;# for this we can use the default text - ;!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO $(CP_DESCRIPTION_INFO) ;# for this we can use the default text - !define MUI_PAGE_CUSTOMFUNCTION_PRE Page_Components_Pre - !define MUI_PAGE_CUSTOMFUNCTION_SHOW Page_Components_Show - !define MUI_PAGE_CUSTOMFUNCTION_LEAVE Page_Components_Leave - !insertmacro MUI_PAGE_COMPONENTS -*/ - ;# Directory page - allows for changing/ selecting the install directory - !define MUI_DIRECTORYPAGE_VERIFYONLEAVE - !define MUI_PAGE_CUSTOMFUNCTION_PRE Page_Directory_Pre - !define MUI_PAGE_CUSTOMFUNCTION_LEAVE Page_Directory_Leave - !insertmacro MUI_PAGE_DIRECTORY - -/* - ;# Start Menu Folder page - allows for changing/ selecting the Start Menu Folder (if Shortcuts get installed is configured on the Components page) - !define MUI_STARTMENUPAGE_NODISABLE - !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX" - !define MUI_STARTMENUPAGE_REGISTRY_KEY "${REG_KEY_UN}" - !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "StartMenuFolder" - !define MUI_STARTMENUPAGE_DEFAULTFOLDER "OpenCPN" - !define MUI_PAGE_CUSTOMFUNCTION_PRE Page_Startmenu_Pre - !insertmacro MUI_PAGE_STARTMENU "Application" $STARTMENU_FOLDER - - ;# Set Config page - selecting chart director[y|ies] and setting the language in opencpn.ini - only available if opencpn.ini does not exist (or is being deleted) - Page custom Page_SetConfig Page_SetConfig_Leave -*/ - ;# Confirm page - shows all settings for the installation (is mainly needed to always have the 'Install' button on the right page, ie. if Start Menu page is skipped) - Page custom Page_Confirm - - ;# Install page - !define MUI_PAGE_CUSTOMFUNCTION_SHOW Page_Instfiles_Show - !insertmacro MUI_PAGE_INSTFILES - - ;# Finish page - - #!define MUI_FINISHPAGE_RUN opencpn.exe -# !define MUI_FINISHPAGE_RUN -# !define MUI_FINISHPAGE_RUN_FUNCTION ExecAppFile - - !define MUI_FINISHPAGE_SHOWREADME install.log - !define MUI_FINISHPAGE_SHOWREADME_TEXT $(Show_Readme_Text) - !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED - !define MUI_FINISHPAGE_LINK $(Finish_Link_Text) - !define MUI_FINISHPAGE_LINK_LOCATION $(Finish_Link_URL) - !define MUI_FINISHPAGE_LINK_COLOR 000080 - !define MUI_FINISHPAGE_NOREBOOTSUPPORT - !define MUI_FINISHPAGE_TITLE_3LINES - !insertmacro MUI_PAGE_FINISH - -;-------------------------------- -;################################################################################################## -;# Uninstaller Pages # -;################################################################################################## - ;# Welcome page - !define MUI_WELCOMEPAGE_TITLE_3LINES - !insertmacro MUI_UNPAGE_WELCOME - -/* - ;# Components page - !define MUI_PAGE_CUSTOMFUNCTION_PRE un.Page_Components_Pre - !insertmacro MUI_UNPAGE_COMPONENTS -*/ - ;# Confirm page - !insertmacro MUI_UNPAGE_CONFIRM - ;# Uninstall page - !insertmacro MUI_UNPAGE_INSTFILES - - ;# Finish page - !define MUI_FINISHPAGE_TITLE_3LINES - !insertmacro MUI_UNPAGE_FINISH - -;-------------------------------------------------------------------------------------------------- -;################################################################################################## -;# Languages # -;################################################################################################## -;# Languages - !insertmacro MUI_LANGUAGE "English" ;# first language is the default language - !insertmacro MUI_LANGUAGE "German" - !include /NONFATAL "Langstrings_GERMAN.nsh" - !insertmacro MUI_LANGUAGE "French" - !include /NONFATAL "Langstrings_FRENCH.nsh" - !insertmacro MUI_LANGUAGE "Czech" - !include /NONFATAL "Langstrings_CZECH.nsh" - !insertmacro MUI_LANGUAGE "Danish" - !include /NONFATAL "Langstrings_DANISH.nsh" - !insertmacro MUI_LANGUAGE "Spanish" - !include /NONFATAL "Langstrings_SPANISH.nsh" - !insertmacro MUI_LANGUAGE "Italian" - !include /NONFATAL "Langstrings_ITALIAN.nsh" - !insertmacro MUI_LANGUAGE "Dutch" - !include /NONFATAL "Langstrings_DUTCH.nsh" - !insertmacro MUI_LANGUAGE "Polish" - !include /NONFATAL "Langstrings_POLISH.nsh" - !insertmacro MUI_LANGUAGE "PortugueseBR" - !include /NONFATAL "Langstrings_PORTUGUESEBR.nsh" - !insertmacro MUI_LANGUAGE "Portuguese" - !include /NONFATAL "Langstrings_PORTUGUESE.nsh" - !insertmacro MUI_LANGUAGE "Russian" - !include /NONFATAL "Langstrings_RUSSIAN.nsh" - !insertmacro MUI_LANGUAGE "Swedish" - !include /NONFATAL "Langstrings_SWEDISH.nsh" - !insertmacro MUI_LANGUAGE "Finnish" - !include /NONFATAL "Langstrings_FINNISH.nsh" - !insertmacro MUI_LANGUAGE "Norwegian" - !include /NONFATAL "Langstrings_NORWEGIAN.nsh" - !insertmacro MUI_LANGUAGE "TradChinese" - !include /NONFATAL "Langstrings_CHINESETW.nsh" - !insertmacro MUI_LANGUAGE "Turkish" - !include /NONFATAL "Langstrings_TURKISH.nsh" - ;!insertmacro MUI_LANGUAGE "Hungarian" - ;!include /NONFATAL "Langstrings_HUNGARIAN.nsh" - -;-------------------------------- -;# Reserve Files - ;# If you are using solid compression, files that are required before - ;# the actual installation should be stored first in the data block, - ;# because this will make your installer start faster. - !insertmacro MUI_RESERVEFILE_LANGDLL - -;# Remember the installer language - !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" - !define MUI_LANGDLL_REGISTRY_KEY "${REG_KEY_UN}" - !define MUI_LANGDLL_REGISTRY_VALUENAME "SetupLanguage" - !define MUI_LANGDLL_WINDOWTITLE $(LangDialog_Title) - !define MUI_LANGDLL_INFO $(LangDialog_Text) - -;-------------------------------------------------------------------------------------------------- -;################################################################################################## -;# S E C T I O N S # -;################################################################################################## -;# Installer Sections # -;################################################################################################## -Section "-Topmost Section" SecTopmost ;# this needs to be always the first section to be executed! - SetShellVarContext all - SetOutPath $INSTDIR - - ${If} $INSTALL_TYPE == 1 - ${OrIf} $INSTALL_TYPE == 2 - ${OrIf} $INSTALL_TYPE == 3 - ReadRegStr $0 HKLM "$Prev_Install_RegKey" "UninstallString" - ${StrFilter} "$0" "" "" "$\"" $0 - ClearErrors - ExecWait '"$0" /S /type=1 _?=$INSTDIR' - IfErrors 0 +2 - DetailPrint "Error on uninstalling" - Sleep 100 - Delete $0 - ${EndIf} -SectionEnd - - -;# Install Section /hidden -Section "-Install Section" SecInstall - @CPACK_NSIS_FULL_INSTALL@ - - @CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ - - ;# Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall @CPACK_PACKAGE_VERSION@.exe" - - ;# Registry Entries - SetShellVarContext all ;# make sure that we write to HKLM - ;# HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN - WriteRegStr SHCTX "${REG_KEY_UN}" "DisplayName" "@CPACK_PACKAGE_NAME@ @CPACK_PACKAGE_VERSION@" - WriteRegStr SHCTX "${REG_KEY_UN}" "DisplayVersion" "@CPACK_PACKAGE_VERSION@" - WriteRegStr SHCTX "${REG_KEY_UN}" "CompareVersion" "$VERSION_DATE" - WriteRegStr SHCTX "${REG_KEY_UN}" "StartMenuPath" "$SMPROGRAMS\$STARTMENU_FOLDER" - WriteRegStr SHCTX "${REG_KEY_UN}" "InstallLocation" "$INSTDIR" - WriteRegStr SHCTX "${REG_KEY_UN}" "UninstallString" "$\"$INSTDIR\Uninstall @CPACK_PACKAGE_VERSION@.exe$\"" - WriteRegStr SHCTX "${REG_KEY_UN}" "QuietUninstallString" "$\"$INSTDIR\Uninstall @CPACK_PACKAGE_VERSION@.exe /S$\"" - WriteRegStr SHCTX "${REG_KEY_UN}" "ConfigLocation" "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" - WriteRegStr SHCTX "${REG_KEY_UN}" "DisplayIcon" "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@" - WriteRegStr SHCTX "${REG_KEY_UN}" "Publisher" "@CPACK_PACKAGE_VENDOR@" - WriteRegDWORD SHCTX "${REG_KEY_UN}" "VersionMajor" $MAJOR_D - WriteRegDWORD SHCTX "${REG_KEY_UN}" "VersionMinor" $MINOR_D - WriteRegDWORD SHCTX "${REG_KEY_UN}" "VersionPatch" $PATCH_D - WriteRegDWORD SHCTX "${REG_KEY_UN}" "NoModify" 1 - WriteRegDWORD SHCTX "${REG_KEY_UN}" "NoRepair" 1 - WriteRegStr SHCTX "${REG_KEY_UN}" "HelpLink" "http://opencpn.org/" - WriteRegStr SHCTX "${REG_KEY_UN}" "URLInfoAbout" "http://opencpn.org/" - WriteRegStr SHCTX "${REG_KEY_UN}" "Contact" "http://opencpn.org/" - WriteRegStr SHCTX "${REG_KEY_UN}" "InstallUser" "$USERS_NAME" - ${If} ${UAC_IsInnerInstance} - WriteRegStr SHCTX "${REG_KEY_UN}" "InstallAdminUser" "$USERNAME" - ${EndIf} - - ;# Create the config folder if it does not exist and set full access rights to it -; ${IfNot} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" -; CreateDirectory "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" -; Sleep 250 -; ${EndIf} -; AccessControlW::GrantOnFile "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" "(BU)" "GenericRead + GenericExecute + GenericWrite + Delete + FullAccess" - - ;# Save the log file - StrCpy $0 "$INSTDIR\install.log" - Push $0 - Call DumpLog -SectionEnd - -;-------------------------------- -;################################################################################################## -;# Uninstaller Sections # -;################################################################################################## - -Section "-un.Delete Config RegKey" UnSecDeleteConfigRegKey - DeleteRegKey HKLM "${REG_KEY}" -SectionEnd - -Section /o "-un.Backup Config to RegKey" UnSecBackupConfigToRegKey - SetShellVarContext all -/* - ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" - ClearErrors - StrCpy $0 "" - StrCpy $2 0 - loop: - IntOp $2 $2 + 1 - ReadINIStr $1 "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" "ChartDirectories" "ChartDir$2" - StrCmp $1 "" cont - ${WordReplace} "$1" "\\" "\" "+" $3 - ${unExplode} $4 "^" "$3" - Pop $5 - StrCmp $5 "" cont - StrCmp $0 "" 0 +2 - StrCpy $0 $5 - StrCpy $0 "$0;$5" - Goto loop - cont: - WriteRegStr HKLM "${REG_KEY}" "ChartDirs" "$0" - - ReadINIStr $0 "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" "Settings" "Locale" - StrCmp $0 "" +2 0 - WriteRegStr HKLM "${REG_KEY}" "InstallerLanguage" "$0" - ${EndIf} -*/ -SectionEnd - -Section "un.Delete Config Folder" UnSecDeleteConfigFolder - SetShellVarContext all -/* - ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" - RMDir /r "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" - ClearErrors - ${EndIf} -*/ -SectionEnd - -Section "-un.Uninstall" UnSecUninstall - -/* - ;# Delete all Shortcuts - Push $INSTDIR - Call un.Delete_Desktop_Shortcuts - Push $INSTDIR - Call un.Delete_Start_Menu_Shortcuts -*/ - ;# Delete subdirs and files in INSTDIR - ;# Remove the uninstaller itself - ReadRegStr $0 HKLM "${REG_KEY_UN}" "UninstallString" - ${StrFilter} "$0" "" "" "$\"" $0 - Delete $0 - ;# Remove the installation log file - Delete "$INSTDIR\install.log" - @CPACK_NSIS_DELETE_FILES@ - @CPACK_NSIS_DELETE_DIRECTORIES@ - - ;# Remove the installation directory INSTDIR if it is empty - ClearErrors - RMDir "$INSTDIR" - IfErrors 0 cont - IfSilent cont - MessageBox MB_OK|MB_ICONEXCLAMATION "$(Msg_Error_Remove_InstDir)" - - cont: - ;# Remove RegKey - DeleteRegKey HKLM "${REG_KEY_UN}" -SectionEnd - -;-------------------------------------------------------------------------------------------------- -;################################################################################################## -;# F U N C T I O N S # -;################################################################################################## -;# Installer Functions # -;################################################################################################## -;# .onInit Function -Function .onInit - ;# Check if Windows version is at least XP (not Win 98, Win 2000 or older) - ${IfNot} ${AtLeastWinXP} - MessageBox MB_OK|MB_ICONEXCLAMATION "$(Installer_Unsupported_Windows_Version)" - Abort - ${Else} - ${If} ${IsWinXP} - ${AndIf} ${AtMostServicePack} 2 - MessageBox MB_OK|MB_ICONEXCLAMATION "$(Installer_Unsupported_XP_SP_Version)" - Abort - ${EndIf} - ${EndIf} - - ;Prevent multiple instances of the installer - ${IfNot} ${UAC_IsInnerInstance} - System::Call 'kernel32::CreateMutexW(i 0, i 0, t "ocpn_inst_@CPACK_PACKAGE_VERSION@") i .r1 ?e' - Pop $R0 - StrCmp $R0 0 +3 - MessageBox MB_OK|MB_ICONEXCLAMATION "$(Installer_Running)" - Abort - ${EndIf} - - Call GetUserInfo - StrCpy $USERS_NAME $USERNAME - - ;# Macros to be inserted - ${If} $IS_ADMIN == 1 - !insertmacro MUI_LANGDLL_DISPLAY - ${EndIf} - - SetShellVarContext current - StrCpy $USERS_APPDATA $APPDATA - StrCpy $ADMIN_APPDATA $APPDATA - - ;# UAC check if user has Admin privileges and prompt for elevation if not - uac_tryagain: - !insertmacro UAC_RunElevated - StrCpy $Inst_Or_Uninst "$(Installer)" - ${Switch} $0 - ${Case} 0 - ${IfThen} $1 = 1 ${|} Quit ${|} ;# we are the outer process, the inner process has done its work, we are done - ${IfThen} $3 <> 0 ${|} ${Break} ${|} ;# we are admin, let the show go on - ${If} $1 = 3 ;# RunAs completed successfully, but with a non-admin user - MessageBox mb_IconExclamation|mb_TopMost|mb_SetForeground "$(Msg_UAC_Admin_Retry)" /SD IDNO IDOK uac_tryagain IDNO 0 - ${EndIf} - ;# fall-through and die - ${Case} 1223 - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_Admin_Abort)" - Quit - ${Case} 1062 - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_Logon_Abort)" - Quit - ${Default} - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_No_Elevation)" - Quit - ${EndSwitch} - -########## from here we can be sure to run with admin privileges ########## - - ;# Delete all temporary files created during the installation - Delete "$TEMP\opencpn_*.tmp" - - ;# Check for unloaded Registry hive from previous installation attempt e.g. when installer crashed - StrCpy $0 0 - !insertmacro _EnumHKU_AdjustTokens - ${Do} - EnumRegKey $1 HKU "" $0 - StrCmp $1 "" done - IntOp $0 $0 + 1 - ClearErrors - ${WordFind} "$1" "opencpn-inst-tmp-sid" "E*" $2 - IfErrors +2 0 - System::Call "advapi32::RegUnLoadKeyW(i ${HKEY_USERS}, t '$1') i .r3" - ${Loop} - done: - ${If} ${UAC_IsInnerInstance} - !insertmacro UAC_AsUser_GetGlobalVar $USERS_APPDATA - !insertmacro UAC_AsUser_GetGlobalVar $USERS_NAME - ${EndIf} - - ClearErrors - Var /GLOBAL INST_PARAMS - Var /GLOBAL FORCE_SCAN - ${GetParameters} $INST_PARAMS - ${GetOptions} "$INST_PARAMS" "/scan" $FORCE_SCAN - IfErrors +2 - - # Get the user's SID from the username - ReadRegStr $0 HKCU "Volatile Environment" "USERNAME" - System::Call /NOUNLOAD '*(&w${NSIS_MAX_STRLEN})i.R9' - System::Call /NOUNLOAD 'advapi32::LookupAccountNameW(,t "$0",i R9,*i ${NSIS_MAX_STRLEN},w .R8,*i ${NSIS_MAX_STRLEN},*i .r4)i.r5' - System::Call /NOUNLOAD 'advapi32::ConvertSidToStringSidW(i R9,*t .R8)i.r5' - StrCpy $INST_USER_SID $R8 - - Call VersionDate - - ;# check for previous installed versions conforming to this installer - Call Check_Prev_Installs - - ;# check for old installed versions prior to the ones that uses this installer - StrCpy $OLD_INSTALLS 0 - - Call Reg_Scan_Old_Versions_HKLM - - Call EnumProfileList - - Call Get_Users_Values - - ${If} $OLD_INSTALLS == 0 - StrCpy $Skip_Page_CleanUp 1 - ${EndIf} - - - ;# make sure that the DWORD values for the Registry only contain digits - ${StrFilter} "@CPACK_PACKAGE_VERSION_MAJOR@" "1" "" "" $MAJOR_D - ${StrFilter} "@CPACK_PACKAGE_VERSION_MINOR@" "1" "" "" $MINOR_D - ${StrFilter} "@CPACK_PACKAGE_VERSION_PATCH@" "1" "" "" $PATCH_D - - StrCpy $INSTDIR "$PROGRAMFILES\OpenCPN\plugins\s63_pi" - - ;Call GetAllUsers -FunctionEnd - -;-------------------------------- -;# myGuiInit Function -/* -Var CONFIG_EMPTY -Var INI_EXISTS -Var CHARTDB_EXISTS -Var SENC_EXISTS -Var CM93_EXISTS -Var NAVOBJ_EXISTS -Var LOG_EXISTS -Var REG_LANG -Var Count_SecGrpResetConfig -Var SecGrpEndSetConfig_Text -*/ -Function myGuiInit - ;Get chosen installer language - ${Switch} $LANGUAGE - ${Case} ${LANG_CZECH} - StrCpy $LANG_NAME "Čeština" - StrCpy $REG_LANG "cs_CZ" - ${Break} - ${Case} ${LANG_DANISH} - StrCpy $LANG_NAME "Dansk" - StrCpy $REG_LANG "da_DK" - ${Break} - ${Case} ${LANG_GERMAN} - StrCpy $LANG_NAME "Deutsch" - StrCpy $REG_LANG "de_DE" - ${Break} - ${Case} ${LANG_ENGLISH} - StrCpy $LANG_NAME "English" - StrCpy $REG_LANG "en_US" - ${Break} - ${Case} ${LANG_SPANISH} - StrCpy $LANG_NAME "Español" - StrCpy $REG_LANG "es_ES" - ${Break} - ${Case} ${LANG_FRENCH} - StrCpy $LANG_NAME "Français" - StrCpy $REG_LANG "fr_FR" - ${Break} - ${Case} ${LANG_ITALIAN} - StrCpy $LANG_NAME "Italiano" - StrCpy $REG_LANG "it_IT" - ${Break} - ${Case} ${LANG_DUTCH} - StrCpy $LANG_NAME "Nederlandse" - StrCpy $REG_LANG "nl_NL" - ${Break} - ${Case} ${LANG_POLISH} - StrCpy $LANG_NAME "Polski" - StrCpy $REG_LANG "pl_PL" - ${Break} - ${Case} ${LANG_PORTUGUESE} - StrCpy $LANG_NAME "Português" - StrCpy $REG_LANG "pt_PT" - ${Break} - ${Case} ${LANG_PORTUGUESEBR} - StrCpy $LANG_NAME "Português Brasileiro" - StrCpy $REG_LANG "pt_BR" - ${Break} - ${Case} ${LANG_SWEDISH} - StrCpy $LANG_NAME "Svenska" - StrCpy $REG_LANG "sv_SE" - ${Break} - ${Case} ${LANG_RUSSIAN} - StrCpy $LANG_NAME "Русский" - StrCpy $REG_LANG "ru_RU" - ${Break} - ${Case} ${LANG_NORWEGIAN} - StrCpy $LANG_NAME "Norsk" - StrCpy $REG_LANG "nb_NO" - ${Break} - ${Case} ${LANG_FINNISH} - StrCpy $LANG_NAME "Suomalainen" - StrCpy $REG_LANG "fi_FI" - ${Break} - ${Case} ${LANG_TRADCHINESE} - StrCpy $LANG_NAME "正體中文" - StrCpy $REG_LANG "zh_TW" - ${Break} - ${Case} ${LANG_Turkish} - StrCpy $LANG_NAME "Türkçe" - StrCpy $REG_LANG "tr_TR" - ${Break} - ${Default} - ${Break} - ${EndSwitch} - - ;# Set Sections Text - SectionSetText ${SecGrpShortcuts} $(SecGrpShortcuts_Text) - SectionSetText ${SecShortcutStartmenu} $(SecShortcutStartmenu_Text) - SectionSetText ${SecShortcutDesktop} $(SecShortcutDesktop_Text) - SectionSetText ${SecSetConfig} $(SecSetConfig_Text) - -/* - ;# Look for config dir ("%APPDATA%\opencpn) and the several config files - Call Check_Config_Exists - - ${If} $CONFIG_EXISTS != 1 - ${OrIf} $CONFIG_EMPTY == 1 - Call Hide_SecGrpResetConfig - IntOp $0 ${SF_SELECTED} | ${SF_BOLD} - SectionSetFlags ${SecSetConfig} $0 - StrCpy $SetConfig 1 - ${EndIf} -*/ - SetShellVarContext all ;# switch SetShellVarContext back to ALL -FunctionEnd - -/* -;-------------------------------- -;# onSelChange -;Var ConfigSetLang -;Var ConfigSetChartDir -;Var SetConfig -Function .onSelChange - ;# Check if all available Sections in SecGrpResetConfig are selected => set SecGrpResetConfig to selected instead of partially selected - Push $0 - Push $1 - Push $2 - Push $3 - Push $R0 - Push $R1 - StrCpy $0 ${SecGrpResetConfig} - StrCpy $1 0 - StrCpy $2 0 - ${Do} - IntOp $0 $0 + 1 - ${If} ${SectionIsSectionGroupEnd} $0 - Goto end - ${EndIf} - SectionGetText $0 $R0 - ${If} $R0 != "" - ${AndIf} ${SectionIsSelected} $0 - Goto found_selected - ${ElseIf} $R0 != "" - ${AndIfNot} ${SectionIsSelected} $0 - Goto found_unselected - ${EndIf} - ${Loop} - - found_selected: - StrCpy $0 ${SecGrpResetConfig} - ${Do} - IntOp $0 $0 + 1 - ${If} ${SectionIsSectionGroupEnd} $0 - Goto end - ${EndIf} - SectionGetText $0 $R0 - ${If} $R0 == "" - ${AndIfNot} ${SectionIsSelected} $0 - SectionSetFlags $0 ${SF_SELECTED} - ${EndIf} - ${Loop} - - found_unselected: - StrCpy $0 ${SecGrpResetConfig} - ${Do} - IntOp $0 $0 + 1 - ${If} ${SectionIsSectionGroupEnd} $0 - Goto end - ${EndIf} - SectionGetText $0 $R0 - ${If} $R0 == "" - ${AndIf} ${SectionIsSelected} $0 - !insertmacro ClearSectionFlag $0 ${SF_SELECTED} - ${EndIf} - ${Loop} - - end: - SectionGetText ${SecDeleteConfigFile} $R1 - ${If} $R1 != "" - ${IfNot} ${SectionIsReadOnly} ${SecSetConfig} - ${AndIfNot} ${SectionIsSelected} ${SecSetConfig} - ${AndIf} $SetConfig == 1 - StrCpy $SetConfig 0 - ${EndIf} - - ${IfNot} ${SectionIsSelected} ${SecDeleteConfigFile} - ${AndIf} ${SectionIsSelected} ${SecSetConfig} - !insertmacro ClearSectionFlag ${SecSetConfig} ${SF_SELECTED} - IntOp $0 ${SF_RO} | ${SF_BOLD} - SectionSetFlags ${SecSetConfig} $0 - ;SectionSetFlags ${SecSetConfig} ${SF_RO} - StrCpy $SetConfig 1 - ${ElseIfNot} ${SectionIsSelected} ${SecDeleteConfigFile} - ${AndIfNot} ${SectionIsSelected} ${SecSetConfig} - IntOp $0 ${SF_RO} | ${SF_BOLD} - SectionSetFlags ${SecSetConfig} $0 - ;SectionSetFlags ${SecSetConfig} ${SF_RO} - StrCpy $SetConfig 0 - ${ElseIf} ${SectionIsSelected} ${SecDeleteConfigFile} - ${AndIfNot} ${SectionIsSelected} ${SecSetConfig} - ${AndIf} $SetConfig == 1 - !insertmacro ClearSectionFlag ${SecSetConfig} ${SF_RO} - IntOp $0 ${SF_SELECTED} | ${SF_BOLD} - SectionSetFlags ${SecSetConfig} $0 - ;SectionSetFlags ${SecSetConfig} ${SF_SELECTED} - ${ElseIf} ${SectionIsSelected} ${SecDeleteConfigFile} - ${AndIf} $SetConfig == 0 - !insertmacro ClearSectionFlag ${SecSetConfig} ${SF_RO} - StrCpy $SetConfig 0 - ${EndIf} - ${EndIf} - - Pop $R1 - Pop $R0 - Pop $3 - Pop $2 - Pop $1 - Pop $0 -FunctionEnd - -*/ -Function .OnInstFailed - Call InstallerEnd -FunctionEnd - - -Function .OnInstSuccess - Call InstallerEnd -FunctionEnd - - -Function .onGUIEnd - Call InstallerEnd -FunctionEnd - - -Function InstallerEnd - ;# Delete all temporary files created during the installation - Delete "$TEMP\opencpn_*.tmp" - ${If} $EnumHKU_counter > 0 - ${ForEach} $1 $EnumHKU_counter 0 - 1 - System::Call "advapi32::RegUnLoadKeyW(i ${HKEY_USERS}, t '$key_$1')" - ${Next} - ${Endif} -FunctionEnd - -;-------------------------------- -;################################################################################################## -;# Installer Page Functions # -;################################################################################################## -;# Page_License_Leave - Function Page_License_Leave -/* - FindWindow $mui.ComponentsPage "#32770" "" $HWNDPARENT - System::Call "*(i 0, i 0, i 4, i 8) i .r1" - System::Call "User32::MapDialogRect(i $mui.ComponentsPage, i r1) i .r2" - System::Call "*$1(i .r2, i.r3, i.r4, i.r5)" - System::Free $1 - StrCpy $BU_X $4 - StrCpy $BU_Y $5 -*/ - FunctionEnd - -/* -;-------------------------------- -;# Page_CleanUp - Var Label_CleanUp - Var Label_FullScan_CleanUp - Var GroupBox_CleanUp - Var ListBox_CleanUp - Var Button_FullScan_CleanUp - Var Button_UnselectAll_CleanUp - Var Button_SelectAll_CleanUp - Var Button_Uninstall_Selected_CleanUp - Var Banner_Handle - Var MSG_Box_Uninstall_Shown - Function Page_CleanUp - ${If} $Skip_Page_CleanUp == 1 - Abort - ${EndIf} - - !ifndef PBS_MARQUEE - !define PBS_MARQUEE 0x08 - !endif - !ifndef PBM_SETMARQUEE - !define PBM_SETMARQUEE 0x040A - !endif - !ifndef GWL_STYLE - !define GWL_STYLE -16 - !endif - - ${IfNot} $MSG_Box_Uninstall_Shown == 1 - MessageBox MB_YESNO|MB_ICONQUESTION "$(Msg_Uninstall_Old_Versions)" IDYES cont IDNO skip - ${Else} - Goto cont - ${EndIf} - - skip: - Abort - - cont: - StrCpy $MSG_Box_Uninstall_Shown 1 - !insertmacro MUI_HEADER_TEXT "$(Page_CleanUp_Title)" "$(Page_CleanUp_Subtitle)" - - nsDialogs::Create /NOUNLOAD 1018 - Pop $0 - ${If} $0 == error - Abort - ${EndIf} - - ${NSD_CreateLabel} 0 0 200u 16u "$(LAB_FullScan_CleanUp)" - Pop $Label_FullScan_CleanUp - - ${NSD_CreateButton} 220u 0 70u 15u "$(BT_FullScan_CleanUp)" - Pop $Button_FullScan_CleanUp - GetFunctionAddress $0 Button_FullScan_CleanUp_Click - nsDialogs::OnClick /NOUNLOAD $Button_FullScan_CleanUp $0 - - ${NSD_CreateLabel} 0 22u 100% 24u "$(Label_CleanUp_Text)" - Pop $Label_CleanUp - - ${NSD_CreateGroupBox} 0 55u 100% 85u "$(Install_Location_Default)" - Pop $GroupBox_CleanUp - - !define __NSD_ListBoxMultiselect_CLASS LISTBOX - !define __NSD_ListBoxMultiselect_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${LBS_DISABLENOSCROLL}|${LBS_HASSTRINGS}|${LBS_NOINTEGRALHEIGHT}|${LBS_NOTIFY}|${LBS_MULTIPLESEL} - !define __NSD_ListBoxMultiselect_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE} - !insertmacro __NSD_DefineControl ListBoxMultiselect - ${NSD_CreateListboxMultiselect} 10u 70u 200u 65u "$(LB_CleanUp)" - Pop $ListBox_CleanUp - GetFunctionAddress $0 ListBox_CleanUp_Change - nsDialogs::OnChange /NOUNLOAD $ListBox_CleanUp $0 - - ${NSD_CreateButton} 220u 70u 70u 15u "$(BT_UnselectAll_CleanUp)" - Pop $Button_UnselectAll_CleanUp - GetFunctionAddress $0 Button_UnselectAll_CleanUp_Click - nsDialogs::OnClick /NOUNLOAD $Button_UnselectAll_CleanUp $0 - - ${NSD_CreateButton} 220u 100u 70u 15u "$(BT_SelectAll_CleanUp)" - Pop $Button_SelectAll_CleanUp - GetFunctionAddress $0 Button_SelectAll_CleanUp_Click - nsDialogs::OnClick /NOUNLOAD $Button_SelectAll_CleanUp $0 - - ${NSD_CreateButton} 220u 120u 70u 15u "$(BT_Uninstall_Selected_CleanUp)" - Pop $Button_Uninstall_Selected_CleanUp - GetFunctionAddress $0 Button_Uninstall_Selected_CleanUp_Click - nsDialogs::OnClick /NOUNLOAD $Button_Uninstall_Selected_CleanUp $0 - - - ;# First check if HDD scan was already done - ${If} ${FileExists} "$TEMP\opencpn_hdd_full_scan.tmp" - EnableWindow $Button_FullScan_CleanUp 0 - EnableWindow $Label_FullScan_CleanUp 0 - SendMessage $GroupBox_CleanUp ${WM_SETTEXT} 0 "STR:$(Install_Location_HDD_Scan)" - ClearErrors - FileOpen $R0 "$TEMP\opencpn_hdd_full_scan.tmp" r - IfErrors done1 - ${Do} - FileReadUTF16LE $R0 $R1 - ${If} $R1 == "" - Goto done1 - ${Else} - ${TrimNewLines} $R1 $R1 - SendMessage $ListBox_CleanUp ${LB_ADDSTRING} 0 "STR:$R1" - ${EndIf} - ${Loop} - done1: - FileClose $R0 - ;# if not get values from LM_VERSION and opencpn_old_installs.tmp file - ${Else} - ${IfNot} ${FileExists} "$TEMP\opencpn_hdd_quick_scan.tmp" - ;# Scan the default locations for program installations on a per-user and all-users basis - Banner::show /NOUNLOAD /set 76 "$(Search_old_installations)" - Banner::getWindow /NOUNLOAD - Pop $Banner_Handle - ShowWindow $Banner_Handle ${SW_HIDE} - ${NSD_AddExStyle} $Banner_Handle ${WS_EX_APPWINDOW} - ShowWindow $Banner_Handle ${SW_SHOW} - GetDlgItem $2 $Banner_Handle 1030 - SendMessage $2 ${WM_SETTEXT} 0 "STR:$(text_please_wait_1)" - - ; Get progress bar handle. - GetDlgItem $Marquee_Handle $Banner_Handle 1004 - - ; Set PBS_MARQUEE style for the progress bar control. - System::Call "user32::GetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}) i .r1" - System::Call "user32::SetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}, i $1|${PBS_MARQUEE})" - - ; Send PBM_SETMARQUEE message to start the marquee. - ; lParam is time in milliseconds between marquee animation updates. - SendMessage $Marquee_Handle ${PBM_SETMARQUEE} 1 50 - - System::Call "User32::SetWindowPos(i $Banner_Handle, i -1, i 0, i 0, i 0, i 0, i 83)" - - HideWindow - - Call Quick_Scan_Old_Versions - - ShowWindow $HWNDPARENT ${SW_SHOW} - BringToFront - SendMessage $Marquee_Handle ${PBM_SETMARQUEE} 0 0 - System::Call "user32::SetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}, i $1)" - Banner::destroy - ${EndIf} - - ClearErrors - FileOpen $R0 "$TEMP\opencpn_hdd_quick_scan.tmp" r - IfErrors done2 - ${Do} - FileReadUTF16LE $R0 $R1 - ${If} $R1 == "" - Goto done2 - ${Else} - ${TrimNewLines} $R1 $R1 - SendMessage $ListBox_CleanUp ${LB_ADDSTRING} 0 "STR:$R1" - ${EndIf} - ${Loop} - - done2: - FileClose $R0 - ${EndIf} - ;# Pre-select all listbox-items - ${NSD_LB_GetCount} $ListBox_CleanUp $1 - IntOp $1 $1 - 1 - SendMessage $ListBox_CleanUp ${LB_SELITEMRANGEEX} 0 $1 - Call ListBox_CleanUp_Change - - nsDialogs::Show - FunctionEnd -*/ - -/* - Function Button_FullScan_CleanUp_Click - SendMessage $ListBox_CleanUp ${LB_RESETCONTENT} 0 0 - - Banner::show /NOUNLOAD /set 76 "$(Scanning_HDD)" - Banner::getWindow /NOUNLOAD - Pop $Banner_Handle - ShowWindow $Banner_Handle ${SW_HIDE} - SendMessage $Banner_Handle ${WM_SETTEXT} 0 "STR:$(OCPN_Scanning_HDD)" - ${NSD_AddExStyle} $Banner_Handle ${WS_EX_APPWINDOW} - ShowWindow $Banner_Handle ${SW_SHOW} - GetDlgItem $2 $Banner_Handle 1030 - SendMessage $2 ${WM_SETTEXT} 0 "STR:$(text_please_wait_1)" - - ; Get progress bar handle. - GetDlgItem $Marquee_Handle $Banner_Handle 1004 - - ; Set PBS_MARQUEE style for the progress bar control. - System::Call "user32::GetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}) i .r1" - System::Call "user32::SetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}, i $1|${PBS_MARQUEE})" - - ; Send PBM_SETMARQUEE message to start the marquee. - ; lParam is time in milliseconds between marquee animation updates. - SendMessage $Marquee_Handle ${PBM_SETMARQUEE} 1 50 - - System::Call "User32::SetWindowPos(i $Banner_Handle, i -1, i 0, i 0, i 0, i 0, i 83)" - - HideWindow - - Call Full_Scan_Old_Versions - - ${If} ${FileExists} "$TEMP\opencpn_hdd_full_scan.tmp" - Delete "$TEMP\opencpn_hdd_quick_scan.tmp" - ${EndIf} - - ;# If install locations were found compare with Registry keys - ${If} $counter_tmp > 0 - ${If} $LM_VERSION_INST != "" - ClearErrors - FileOpen $R0 "$TEMP\opencpn_hdd_full_scan.tmp" r - IfErrors done1 - ${Do} - FileReadUTF16LE $R0 $R1 - ${If} $R1 == "" - Goto done1 - ${Else} - ${TrimNewLines} $R1 $R1 - StrCmp $R1 $R2 done1 - ${EndIf} - ${Loop} - ;# Path from Registry key wasn't found => delete RegKey - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1" - StrCpy $LM_VERSION_INST "" - - done1: - FileClose $R0 - ${EndIf} - - ${If} ${FileExists} "$TEMP\opencpn_old_installs.tmp" - ;# Clear the stack - ClearErrors - ${Do} - Pop $0 - IfErrors empty - ${Loop} - empty: - - ClearErrors - FileOpen $R0 "$TEMP\opencpn_old_installs.tmp" r - - IfErrors done3 - ${Do} - FileReadUTF16LE $R0 $R3 - FileReadUTF16LE $R0 $R2 - ${If} $R3 == "" - Goto done3 - ${Else} - ${TrimNewLines} $R3 $R3 - ${TrimNewLines} $R2 $R2 - FileReadUTF16LE $R0 $R1 - ${TrimNewLines} $R1 $R1 - ClearErrors - FileOpen $0 "$TEMP\opencpn_hdd_full_scan.tmp" r - IfErrors next - ${Do} - FileReadUTF16LE $0 $1 - ${If} $1 == "" - Goto next - ${Else} - ${TrimNewLines} $1 $1 - StrCmp $1 $R1 done2 - ${EndIf} - ${Loop} - ;# Path from Registry key wasn't found => delete RegKey - DeleteRegKey HKU $R3 - Goto next - - done2: - Push $R1 - Push $R2 - Push $R3 - next: - FileClose $0 - ${EndIf} - ${Loop} - done3: - FileClose $R0 - - ClearErrors - FileOpen $R0 "$TEMP\opencpn_old_installs.tmp" w - IfErrors done4 - ${Do} - Pop $R1 - IfErrors done4 - FileWriteUTF16LE $R0 $R1 - FileWriteUTF16LE $R0 "$\r$\n" - ${Loop} - done4: - FileClose $R0 - ${EndIf} - ${EndIf} - - EnableWindow $Button_FullScan_CleanUp 0 ;# Disable the Scan HDD button after scan was done - EnableWindow $Label_FullScan_CleanUp 0 ;# Disable the Scan HDD label after scan was done - SendMessage $GroupBox_CleanUp ${WM_SETTEXT} 0 "STR:$(Install_Location_HDD_Scan)" - - ShowWindow $HWNDPARENT ${SW_SHOW} - BringToFront - - ; Stop the marquee and set the old styles back for the progress bar control. - SendMessage $Marquee_Handle ${PBM_SETMARQUEE} 0 0 - System::Call "user32::SetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}, i $1)" - - Banner::destroy - FunctionEnd -*/ - - Function Button_UnselectAll_CleanUp_Click - SendMessage $ListBox_CleanUp ${LB_SETSEL} FALSE -1 - Call ListBox_CleanUp_Change - FunctionEnd - - Function Button_SelectAll_CleanUp_Click - ${NSD_LB_GetCount} $ListBox_CleanUp $1 - IntOp $1 $1 - 1 - ${If} $1 == 0 - IntOp $1 $1 + 1 - ${EndIf} - SendMessage $ListBox_CleanUp ${LB_SELITEMRANGEEX} 0 $1 - Call ListBox_CleanUp_Change - FunctionEnd - - Function ListBox_CleanUp_Change - SendMessage $ListBox_CleanUp ${LB_GETSELCOUNT} 0 0 $1 - ${NSD_LB_GetCount} $ListBox_CleanUp $2 - ${If} $2 > 0 - ${If} $1 == 0 - EnableWindow $Button_Uninstall_Selected_CleanUp 0 - EnableWindow $Button_UnselectAll_CleanUp 0 - EnableWindow $Button_SelectAll_CleanUp 1 - ${ElseIf} $1 > 0 - ${AndIf} $1 == $2 - EnableWindow $Button_Uninstall_Selected_CleanUp 1 - EnableWindow $Button_UnselectAll_CleanUp 1 - EnableWindow $Button_SelectAll_CleanUp 0 - ${Else} - EnableWindow $Button_Uninstall_Selected_CleanUp 1 - EnableWindow $Button_UnselectAll_CleanUp 1 - EnableWindow $Button_SelectAll_CleanUp 1 - ${EndIf} - ${Else} - EnableWindow $Button_Uninstall_Selected_CleanUp 0 - EnableWindow $Button_UnselectAll_CleanUp 0 - EnableWindow $Button_SelectAll_CleanUp 0 - ${EndIf} - FunctionEnd - -/* - Var Uninstall_Path_Tmp - Function Button_Uninstall_Selected_CleanUp_Click - EnableWindow $Button_Uninstall_Selected_CleanUp 0 - SendMessage $ListBox_CleanUp ${LB_GETSELCOUNT} 0 0 $1 - ${NSD_LB_GetCount} $ListBox_CleanUp $2 - ClearErrors - FileOpen $R0 "$TEMP\opencpn_uninstall.tmp" w - IfErrors done - IntOp $2 $2 - 1 - ${ForEach} $3 $2 0 - 1 - SendMessage $ListBox_CleanUp ${LB_GETSEL} $3 0 $4 - ${If} $4 > 0 - System::Call "User32::SendMessage(i $ListBox_CleanUp, i ${LB_GETTEXT}, i $3, t .r5)" - FileWriteUTF16LE $R0 "$5" - FileWriteUTF16LE $R0 "$\r$\n" - SendMessage $ListBox_CleanUp ${LB_DELETESTRING} $3 0 - ${EndIf} - ${Next} - done: - FileClose $R0 - - Call ListBox_CleanUp_Change - - StrCpy $R8 "" - StrCpy $R7 "" - StrCpy $R6 "" - StrCpy $R5 "" - ${If} ${FileExists} "$TEMP\opencpn_uninstall.tmp" - ${If} ${FileExists} "$TEMP\opencpn_hdd_full_scan.tmp" - StrCpy $R8 "opencpn_hdd_full_scan.tmp" - ${ElseIf} ${FileExists} "$TEMP\opencpn_hdd_quick_scan.tmp" - StrCpy $R8 "opencpn_hdd_quick_scan.tmp" - ${EndIf} - - ${If} ${FileExists} "$TEMP\opencpn_old_installs.tmp" - StrCpy $R7 1 - ${EndIf} - - ${If} ${FileExists} "$TEMP\opencpn_old_uninstall_regkeys.tmp" - StrCpy $R6 1 - ${EndIf} - - ${If} ${FileExists} "$TEMP\opencpn_appdata.tmp" - StrCpy $R5 1 - ${EndIf} - - ClearErrors - FileOpen $R4 "$TEMP\opencpn_uninstall.tmp" r - IfErrors end - loop: - ClearErrors - FileReadUTF16LE $R4 $0 - IfErrors end - StrCmp $0 "" loop - StrCmp $0 "$\r$\n" loop - - ${TrimNewLines} $0 $0 - StrCpy $Uninstall_Path_Tmp $0 - - ;# Delete installation directory - ClearErrors - Call Delete_Installation_Dir - IfErrors 0 +2 - MessageBox MB_OK|MB_ICONEXCLAMATION "Error RMDir: $0" ;#ON ERROR - - ;# If deleted installation was the one in the HKLM ...\OpenCPN_is1 subkey => delete RegKey - ${If} $LM_VERSION_INST != "" - StrCmp $0 $LM_VERSION_INST 0 cont - ClearErrors - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1" - IfErrors 0 +2 - MessageBox MB_OK|MB_ICONEXCLAMATION "Error DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1" ;#ON ERROR - StrCpy $LM_VERSION "" - StrCpy $LM_VERSION_INST "" - StrCpy $LM_VERSION_UNINST "" - ${EndIf} - - cont: - ;# Delete Start Menu shortcuts - Push $Uninstall_Path_Tmp - Call Delete_Start_Menu_Shortcuts - - ;# Delete Desktop shortcuts - Push $Uninstall_Path_Tmp - Call Delete_Desktop_Shortcuts - - ;# Delete RegKeys in HKU Software\opencpn.org\... - ${If} $R7 == 1 - Call Update_Old_Installs - ${EndIf} - - ;# Delete RegKeys in HKU Software\...\Uninstall\OpenCPN - ${If} $R6 == 1 - Call Update_Old_Uninstalls - ${EndIf} - - ;# Delete %APPDATA\opencpn folder - ${If} $R5 == 1 - Call Update_Appdata - ${EndIf} - - ${IfNot} $R8 == "" - Call Update_HDD_Scan - ${EndIf} - - Goto loop - end: - FileClose $R4 - Delete "$TEMP\opencpn_uninstall.tmp" - StrCpy $Uninstall_Path_Tmp "" - ${EndIf} - - ${NSD_LB_GetCount} $ListBox_CleanUp $2 - ${If} $2 == 0 ;# listbox is empty - all were uninstalled - StrCpy $Skip_Page_CleanUp 1 - GetDlgItem $0 $HWNDPARENT 1 - SendMessage $0 ${BM_CLICK} 0 0 - ${EndIf} - FunctionEnd -*/ - -/* - Function Update_HDD_Scan - Push $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $R0 - Push $R8 - ClearErrors - FileOpen $0 "$TEMP\$R8" r ;# open target file for reading - GetTempFileName $R0 ;# get new temp file name - FileOpen $1 $R0 w ;# open temp file for writing - IfErrors end - loop: - FileReadUTF16LE $0 $2 ;# read line from target file - IfErrors done ;# check if end of file reached - ${TrimNewLines} $2 $2 - StrCmp $2 "$Uninstall_Path_Tmp" +2 ;# compare line with search string with CR/LF - FileWriteUTF16LE $1 "$2$\r$\n" ;# write line to temp file - Goto loop - done: - FileClose $0 ;# close target file - FileClose $1 ;# close temp file - Delete "$TEMP\$R8" ;# delete target file - CopyFiles /SILENT $R0 "$TEMP\$R8" ;# copy temp file to target file - Delete $R0 ;# delete temp file - end: - Pop $R8 - Pop $R0 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 - FunctionEnd -*/ - -/* - Function Update_Old_Installs - Push $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $R0 - Push $R1 - ClearErrors - FileOpen $0 "$TEMP\opencpn_old_installs.tmp" r ;# open target file for reading - GetTempFileName $R0 ;# get new temp file name - FileOpen $1 $R0 w ;# open temp file for writing - IfErrors end - loop: - FileReadUTF16LE $0 $4 ;# read line from target file - FileReadUTF16LE $0 $3 ;# read line from target file - FileReadUTF16LE $0 $2 ;# read line from target file - IfErrors done ;# check if end of file reached - ${TrimNewLines} $2 $2 - StrCmp $2 "$Uninstall_Path_Tmp" +5 ;# compare line with search string with CR/LF - FileWriteUTF16LE $1 $4 ;# write line to temp file - FileWriteUTF16LE $1 $3 ;# write line to temp file - FileWriteUTF16LE $1 "$2$\r$\n" ;# write line to temp file - Goto loop - ${TrimNewLines} $4 $4 - DeleteRegKey HKU "$4" - ${WordFind} "$4" "\" "-2{*" $4 - DeleteRegKey /ifempty HKU "$4" - ClearErrors - Goto loop - done: - FileClose $0 ;# close target file - FileClose $1 ;# close temp file - Delete "$TEMP\opencpn_old_installs.tmp" ;# delete target file - CopyFiles /SILENT $R0 "$TEMP\opencpn_old_installs.tmp" ;# copy temp file to target file - Delete $R0 ;# delete temp file - end: - Pop $R1 - Pop $R0 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 - FunctionEnd -*/ - -/* - Function Update_Old_Uninstalls - Push $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $R0 - Push $R1 - ClearErrors - FileOpen $0 "$TEMP\opencpn_old_uninstall_regkeys.tmp" r ;# open target file for reading - GetTempFileName $R0 ;# get new temp file name - FileOpen $1 $R0 w ;# open temp file for writing - IfErrors end - loop: - FileReadUTF16LE $0 $4 ;# read line from target file - FileReadUTF16LE $0 $3 ;# read line from target file - FileReadUTF16LE $0 $2 ;# read line from target file - IfErrors done ;# check if end of file reached - ${TrimNewLines} $2 $2 - StrCmp $2 "$Uninstall_Path_Tmp" +5 ;# compare line with search string with CR/LF - FileWriteUTF16LE $1 $4 ;# write line to temp file - FileWriteUTF16LE $1 $3 ;# write line to temp file - FileWriteUTF16LE $1 "$2$\r$\n" ;# write line to temp file - Goto loop - ${TrimNewLines} $3 $3 - DeleteRegKey HKU "$3" - ClearErrors - Goto loop - done: - FileClose $0 ;# close target file - FileClose $1 ;# close temp file - Delete "$TEMP\opencpn_old_uninstall_regkeys.tmp" ;# delete target file - CopyFiles /SILENT $R0 "$TEMP\opencpn_old_uninstall_regkeys.tmp" ;# copy temp file to target file - Delete $R0 ;# delete temp file - end: - Pop $R1 - Pop $R0 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 - FunctionEnd -*/ - -/* - Function Update_Appdata - Push $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $R0 - Push $R1 - ClearErrors - FileOpen $0 "$TEMP\opencpn_appdata.tmp" r ;# open target file for reading - GetTempFileName $R0 ;# get new temp file name - FileOpen $1 $R0 w ;# open temp file for writing - IfErrors end - loop: - FileReadUTF16LE $0 $4 ;# read line from target file - FileReadUTF16LE $0 $3 ;# read line from target file - FileReadUTF16LE $0 $2 ;# read line from target file - IfErrors done ;# check if end of file reached - ${TrimNewLines} $2 $2 - StrCmp $2 "$Uninstall_Path_Tmp" +5 ;# compare line with search string with CR/LF - FileWriteUTF16LE $1 $4 ;# write line to temp file - FileWriteUTF16LE $1 $3 ;# write line to temp file - FileWriteUTF16LE $1 "$2$\r$\n" ;# write line to temp file - Goto loop - ${TrimNewLines} $3 $3 - RMDir /r "$3\opencpn" - ClearErrors - Goto loop - done: - FileClose $0 ;# close target file - FileClose $1 ;# close temp file - Delete "$TEMP\opencpn_appdata.tmp" ;# delete target file - CopyFiles /SILENT $R0 "$TEMP\opencpn_appdata.tmp" ;# copy temp file to target file - Delete $R0 ;# delete temp file - end: - Pop $R1 - Pop $R0 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 - FunctionEnd -*/ - -/* -;-------------------------------- -;# Page_CleanUp_Leave - Function Page_CleanUp_Leave - ${NSD_LB_GetCount} $ListBox_CleanUp $2 - ${If} $2 > 0 ;# listbox is not empty - not all old versions were uninstalled - MessageBox MB_YESNO|MB_ICONQUESTION "$(Msg_Not_All_Old_Uninstalled)" IDYES leaving - Abort - ${EndIf} - leaving: - SendMessage $ListBox_CleanUp ${LB_RESETCONTENT} 0 0 - FunctionEnd - -*/ - -;-------------------------------- -;# Page_TypeInst -/* Var Label_TypeInst_Reinstall - Var RB_Reinstall - Var Label_TypeInst_Upgrade - Var RB_Upgrade - Var Label_TypeInst_Downgrade - Var RB_Downgrade - Var Label_TypeInst_Parallel - Var GroupBox_TypeInst - Var RB_Parallel - Var TI_REINSTALL - Var TI_UPGRADE - Var TI_DOWNGRADE - Var TI_PARALLEL - Var GroupBox_Size - Var INSTALL_TYPE - */ - Function Page_TypeInst - ${If} $Skip_Page_TypeInst == 1 - Abort - ${EndIf} - ${If} $VERSION_EXISTS == 1 - !insertmacro MUI_HEADER_TEXT $(Page_TypeInst_Title_Exists) $(Page_TypeInst_Subtitle_Exists) - ${ElseIf} $MULTIPLE_INSTALLS == 1 - !insertmacro MUI_HEADER_TEXT $(Page_TypeInst_Title_1) $(Page_TypeInst_Subtitle_1) - ${ElseIf} $MULTIPLE_INSTALLS > 1 - !insertmacro MUI_HEADER_TEXT $(Page_TypeInst_Title) $(Page_TypeInst_Subtitle) - ${EndIf} - - nsDialogs::Create /NOUNLOAD 1018 - Pop $0 - - ${If} $0 == error - Abort - ${EndIf} - - ;Case 1: same version already installed => Option 1: Reinstall - ${If} $VERSION_EXISTS == 1 - ${NSD_CreateLabel} 0 0 100% 40u "$(Label_TypeInst_Reinstall_Text)" - Pop $Label_TypeInst_Reinstall - - ${NSD_CreateRadioButton} 10u 65u 100% 10u "$(RB_Reinstall_TypeInst_Text)" - Pop $RB_Reinstall - ${NSD_AddStyle} $RB_Reinstall ${WS_GROUP} - ${NSD_SetState} $RB_Reinstall ${BST_CHECKED} - - StrCpy $GroupBox_Size 1 - ;Case 2: one older previous installation => Option 1: Upgrade Option 2: Parallel Installation - ${ElseIf} $MULTIPLE_INSTALLS == 1 - ${AndIf} $VERSION_NEWER == 1 - ${NSD_CreateLabel} 0 0 100% 32u "$(Label_TypeInst_Upgrade_Text)" - Pop $Label_TypeInst_Upgrade - - ${NSD_CreateRadioButton} 10u 65u 100% 10u "$(RB_Upgrade_TypeInst_Text)" - Pop $RB_Upgrade - ${NSD_AddStyle} $RB_Upgrade ${WS_GROUP} - ${If} $TI_UPGRADE != "" - ${NSD_SetState} $RB_Upgrade $TI_UPGRADE - ${ElseIf} $TI_UPGRADE == "" - ${AndIf} $TI_PARALLEL == "" - ${NSD_SetState} $RB_Upgrade ${BST_CHECKED} - ${EndIf} -/* - ${NSD_CreateRadioButton} 10u 85u 100% 10u "$(RB_Parallel_TypeInst_Text)" - Pop $RB_Parallel - ${If} $TI_PARALLEL != "" - ${NSD_SetState} $RB_Parallel $TI_PARALLEL - ${EndIf} -*/ - StrCpy $GroupBox_Size 1 - ;Case 3: one newer previous installation => Option 1: Downgrade Option 2: Parallel Installation - ${ElseIf} $MULTIPLE_INSTALLS == 1 - ${AndIf} $VERSION_OLDER == 1 - ${NSD_CreateLabel} 0 0 100% 32u "$(Label_TypeInst_Downgrade_Text)" - Pop $Label_TypeInst_Downgrade - - ${NSD_CreateRadioButton} 10u 65u 100% 10u "$(RB_Downgrade_TypeInst_Text)" - Pop $RB_Downgrade - ${NSD_AddStyle} $RB_Downgrade ${WS_GROUP} - ${If} $TI_DOWNGRADE != "" - ${NSD_SetState} $RB_Upgrade $TI_DOWNGRADE - ${ElseIf} $TI_DOWNGRADE == "" - ${AndIf} $TI_PARALLEL == "" - ${NSD_SetState} $RB_Downgrade ${BST_CHECKED} - ${EndIf} -/* - ${NSD_CreateRadioButton} 10u 85u 100% 10u "$(RB_Parallel_TypeInst_Text)" - Pop $RB_Parallel - ${If} $TI_PARALLEL != "" - ${NSD_SetState} $RB_Parallel $TI_PARALLEL - ${EndIf} -*/ - StrCpy $GroupBox_Size 1 -/* - ;Case 4: more than one previous installation => Option 1: Parallel Installation - ${ElseIf} $MULTIPLE_INSTALLS > 1 - ${NSD_CreateLabel} 0 0 100% 32u "$(Label_TypeInst_Parallel_Text)" - Pop $Label_TypeInst_Parallel - - ${NSD_CreateRadioButton} 10u 65u 100% 10u "$(RB_Parallel_TypeInst_Text)" - Pop $RB_Parallel - ${NSD_AddStyle} $RB_Parallel ${WS_GROUP} - ${NSD_SetState} $RB_Parallel ${BST_CHECKED} - - StrCpy $GroupBox_Size 1 -*/ - ${EndIf} - - ${If} $GroupBox_Size == 1 - ${NSD_CreateGroupBox} 0 50u 100% 35u "Install Type" - Pop $GroupBox_TypeInst - ${ElseIf} $GroupBox_Size == 2 - ${NSD_CreateGroupBox} 0 50u 100% 55u "Install Type" - Pop $GroupBox_TypeInst - ${EndIf} - - nsDialogs::Show - FunctionEnd - -;-------------------------------- -;# Page_TypeInst_Leave - Function Page_TypeInst_Leave - ${If} $RB_Reinstall != "" - ${NSD_GetState} $RB_Reinstall $TI_REINSTALL - ${EndIf} - ${If} $RB_Upgrade != "" - ${NSD_GetState} $RB_Upgrade $TI_UPGRADE - ${EndIf} - ${If} $RB_Downgrade != "" - ${NSD_GetState} $RB_Downgrade $TI_DOWNGRADE - ${EndIf} - ${If} $RB_Parallel != "" - ${NSD_GetState} $RB_Parallel $TI_PARALLEL - ${EndIf} - - StrCpy $Skip_Page_Directory "" - ${If} $TI_REINSTALL == 1 - StrCpy $INSTALL_TYPE 1 - ${ElseIf} $TI_UPGRADE == 1 - StrCpy $INSTALL_TYPE 2 - ${ElseIf} $TI_DOWNGRADE == 1 - StrCpy $INSTALL_TYPE 3 - ${ElseIf} $TI_PARALLEL == 1 - StrCpy $INSTALL_TYPE 4 - ${EndIf} - - ${If} $INSTALL_TYPE == 1 - ${OrIf} $INSTALL_TYPE == 2 - ${OrIf} $INSTALL_TYPE == 3 - StrCpy $Skip_Page_Directory 1 - ReadRegStr $0 HKLM "$Prev_Install_RegKey" "InstallLocation" - StrCpy $INSTDIR $0 - ${EndIf} - - ; On Upgrade or Downgrade, tentatively trim any Package Version trailer from install location - ${If} $INSTALL_TYPE == 2 - ${OrIf} $INSTALL_TYPE == 3 - StrCpy $R1 0 - Push $INSTDIR - Push "OpenCPN\plugins\s63_pi" - Push ">" - Call StrLoc - Pop $0 - - StrCpy $R1 $INSTDIR $0 - StrCpy $R1 "$R1OpenCPN\plugins\s63_pi" - StrLen $R2 $INSTDIR - StrLen $R3 $R1 - -/* - ; If Previous install dir was a parallel, make the upgrade also parallel. - ${If} $R2 > $R3 - StrCpy $INSTDIR "$R1 @CPACK_PACKAGE_VERSION@" - ${Else} - StrCpy $INSTDIR $R1 - ${Endif} -*/ - ${Endif} - - ${If} $INSTALL_TYPE == 4 - StrCpy $INSTDIR "$PROGRAMFILES\OpenCPN\plugins\s63_pi @CPACK_PACKAGE_VERSION@" - ${EndIf} - FunctionEnd - -/* -;-------------------------------- -;# Page_Components_Pre - Function Page_Components_Pre - - FunctionEnd - -;-------------------------------- -;# Page_Components_Show - Function Page_Components_Show - ;# change controls size and position on the Components Page - Push $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $5 - Push $6 - Push $7 - - FindWindow $mui.ComponentsPage "#32770" "" $HWNDPARENT - - ;GetDlgItem $mui.ComponentsPage.Text $mui.ComponentsPage 1006 - GetDlgItem $mui.ComponentsPage.InstTypesText $mui.ComponentsPage 1021 - ShowWindow $mui.ComponentsPage.InstTypesText ${SW_HIDE} - - GetDlgItem $mui.ComponentsPage.ComponentsText $mui.ComponentsPage 1022 - GetDlgItem $mui.ComponentsPage.InstTypes $mui.ComponentsPage 1017 - ShowWindow $mui.ComponentsPage.InstTypes ${SW_HIDE} - - GetDlgItem $mui.ComponentsPage.Components $mui.ComponentsPage 1032 - GetDlgItem $mui.ComponentsPage.DescriptionTitle $mui.ComponentsPage 1042 - GetDlgItem $mui.ComponentsPage.DescriptionText $mui.ComponentsPage 1043 - GetDlgItem $mui.ComponentsPage.SpaceRequired $mui.ComponentsPage 1023 - ShowWindow $mui.ComponentsPage.SpaceRequired ${SW_HIDE} - - Push "198" - Push "40" - Push "100" - Push "100" - Call DU2Pix - System::Call "User32::SetWindowPos(i $mui.ComponentsPage.DescriptionTitle, i 0, i $1, i $2, i $3, i $4, i 64)" ;# 1042 - - Push "203" - Push "50" - Push "90" - Push "85" - Call DU2Pix - System::Call "User32::SetWindowPos(i $mui.ComponentsPage.DescriptionText, i 0, i $1, i $2, i $3, i $4, i 64)" ;# 1043 - - Push "0" - Push "25" - Push "300" - Push "15" - Call DU2Pix - System::Call "User32::SetWindowPos(i $mui.ComponentsPage.ComponentsText, i 0, i $1, i $2, i $3, i $4, i 64)" ;# 1022 - - Push "0" - Push "40" - Push "195" - Push "100" - Call DU2Pix - System::Call "User32::SetWindowPos(i $mui.ComponentsPage.Components, i 0, i $1, i $2, i $3, i $4, i 64)" ;# 1032 - - Pop $7 - Pop $6 - Pop $5 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 - FunctionEnd - -;-------------------------------- -;# Page_Components_Leave - Function Page_Components_Leave - ${IfNot} ${SectionIsSelected} ${SecSetConfig} - StrCpy $Skip_Page_SetConfig 1 - ${Else} - StrCpy $Skip_Page_SetConfig 0 - ${EndIf} - - ${IfNot} ${SectionIsSelected} ${SecShortcutStartmenu} - StrCpy $Skip_Page_Startmenu 1 - ${Else} - StrCpy $Skip_Page_Startmenu 0 - ${EndIf} - FunctionEnd -*/ -;-------------------------------- -;# Page_Directory_Pre - Function Page_Directory_Pre - ${If} $Skip_Page_Directory == 1 - Abort - ${EndIf} - FunctionEnd - -;-------------------------------- -;# Page_Directory_Leave - Function Page_Directory_Leave - GetInstDirError $R0 - ${If} $R0 > 0 ;# Invalid path entered - MessageBox MB_OK|MB_ICONSTOP "$(Msg_Path_Invalid)" - Abort - ${EndIf} - - ${If} $INSTALL_TYPE == 4 - ${AndIf} ${FileExists} "$INSTDIR\opencpn.exe" - MessageBox MB_OK|MB_ICONSTOP "$(Msg_Path_Installation_Exists)" - Abort - ${EndIf} - FunctionEnd - - - - - -/* -;-------------------------------- -;# Page_Startmenu_Pre - Function Page_Startmenu_Pre - ${If} $Skip_Page_Startmenu == 1 - Abort - ${EndIf} - - ${If} $INSTALL_TYPE == 1 - ${OrIf} $INSTALL_TYPE == 2 - ${OrIf} $INSTALL_TYPE == 3 - ReadRegStr $0 HKLM "$Prev_Install_RegKey" "StartMenuFolder" - StrCpy $STARTMENU_FOLDER $0 - ${EndIf} - FunctionEnd -*/ -;-------------------------------- -/*# Page_SetConfig - Var Label_SetConfig - Var GroupBox_Language_SetConfig - Var CheckBox_Language_SetConfig - Var GroupBox_ChartDir_SetConfig - Var DirRequest_SetConfig - Var Button_Delete_SetConfig - Var Button_DeleteAll_SetConfig - Var Button_Add_SetConfig - Var ListBox_SetConfig -*/ - -/* - Function Page_SetConfig - ${If} $Skip_Page_SetConfig == 1 - Abort - ${EndIf} - !insertmacro MUI_HEADER_TEXT $(Page_SetConfig_Title) $(Page_SetConfig_Subtitle) - nsDialogs::Create /NOUNLOAD 1018 - Pop $0 - ${If} $0 == error - Abort - ${EndIf} - - ${NSD_CreateLabel} 0 0 100% 16u "$(Label_SetConfig_Text)" - Pop $Label_SetConfig - - ${NSD_CreateGroupBox} 0 20u 100% 30u "$(GB_Language_SetConfig_Text)" - Pop $GroupBox_Language_SetConfig - - ${NSD_CreateCheckBox} 10u 35u 100% 10u "$(CB_Language_SetConfig_Text)" - Pop $CheckBox_Language_SetConfig - ;StrCmp $CONFIG_SET_LANG "" cont - ${If} $CONFIG_SET_LANG == "" - ${NSD_SetState} $CheckBox_Language_SetConfig ${BST_CHECKED} - Goto cont - ${EndIf} - - StrCmp $CONFIG_SET_LANG 0 0 +2 - ${NSD_SetState} $CheckBox_Language_SetConfig ${BST_UNCHECKED} - StrCmp $CONFIG_SET_LANG 1 0 +2 - ${NSD_SetState} $CheckBox_Language_SetConfig ${BST_CHECKED} - - cont: - ${NSD_CreateGroupBox} 0 55u 100% 85u "$(GB_ChartDir_SetConfig_Text)" - Pop $GroupBox_ChartDir_SetConfig - - ${NSD_CreateButton} 220u 70u 60u 15u "$(BT_Delete_SetConfig_Text)" - Pop $Button_Delete_SetConfig - GetFunctionAddress $0 Button_Delete_SetConfig_Click - nsDialogs::OnClick /NOUNLOAD $Button_Delete_SetConfig $0 - - ${NSD_CreateButton} 220u 88u 60u 15u "$(BT_DeleteAll_SetConfig_Text)" - Pop $Button_DeleteAll_SetConfig - GetFunctionAddress $0 Button_DeleteAll_SetConfig_Click - nsDialogs::OnClick /NOUNLOAD $Button_DeleteAll_SetConfig $0 - - ${NSD_CreateButton} 220u 115u 60u 15u "$(BT_Browse_SetConfig_Text)" - Pop $Button_Add_SetConfig - GetFunctionAddress $0 Button_Add_SetConfig_Click - nsDialogs::OnClick /NOUNLOAD $Button_Add_SetConfig $0 - - ${NSD_CreateListBox} 10u 70u 200u 60u $(LB_SetConfig) - Pop $ListBox_SetConfig - GetFunctionAddress $0 ListBox_SetConfig_Change - nsDialogs::OnChange /NOUNLOAD $ListBox_SetConfig $0 - ${IfNot} $CHART_DIR_EMPTY == 1 - SetShellVarContext all - ${If} ${FileExists} "$TEMP\opencpn_chart_dirs.tmp" - ClearErrors - FileOpen $R0 "$TEMP\opencpn_chart_dirs.tmp" r - IfErrors end - loop: - ClearErrors - FileReadUTF16LE $R0 $1 - IfErrors end - ${TrimNewLines} $1 $1 - SendMessage $ListBox_SetConfig ${LB_ADDSTRING} 0 "STR:$1" - Goto loop - end: - FileClose $R0 - ${ElseIf} $INI_EXISTS == 1 - StrCpy $R2 0 - loop2: - IntOp $R2 $R2 + 1 - ReadINIStr $R1 "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" "ChartDirectories" "ChartDir$R2" - StrCmp $R1 "" cont2 - ${WordReplace} "$R1" "\\" "\" "+" $R3 - ${Explode} $R4 "^" "$R3" - Pop $R5 - StrCmp $R5 "" cont2 - SendMessage $ListBox_SetConfig ${LB_ADDSTRING} 0 "STR:$R5" - Goto loop2 - ${Else} - ReadRegStr $0 HKLM "Software\OpenCPN" "ChartDirs" - StrCmp $0 "" cont2 - ${Explode} $3 ";" "$0" - ${For} $1 1 $3 - Pop $2 - ${TrimNewLines} $2 $2 - SendMessage $ListBox_SetConfig ${LB_ADDSTRING} 0 "STR:$2" - ${Next} - ${EndIf} - ${EndIf} - - cont2: - Call ListBox_SetConfig_Change - nsDialogs::Show - FunctionEnd - - Function Button_Delete_SetConfig_Click - SendMessage $ListBox_SetConfig ${LB_GETCURSEL} 0 0 $0 - SendMessage $ListBox_SetConfig ${LB_DELETESTRING} $0 0 - Call ListBox_SetConfig_Change - FunctionEnd - - Function Button_DeleteAll_SetConfig_Click - SendMessage $ListBox_SetConfig ${LB_RESETCONTENT} 0 0 - Call ListBox_SetConfig_Change - FunctionEnd - - Function Button_Add_SetConfig_Click - Var /GLOBAL Initial_Dir - StrCmp $Initial_Dir "" 0 +3 - SetShellVarContext all - StrCpy $Initial_Dir "$DOCUMENTS" - nsDialogs::SelectFolderDialog /NOUNLOAD "$(Select_Chart_Directory)" "$Initial_Dir" - Pop $0 - ${If} $0 == error - Abort - ${EndIf} - StrCpy $Initial_Dir $0 - ${NSD_LB_GetCount} $ListBox_SetConfig $2 - ${If} $2 > 0 - SendMessage $ListBox_SetConfig ${LB_FINDSTRINGEXACT} -1 "STR:$0" $6 - ${IfNot} $6 < 0 - Goto end - ${EndIf} - ${EndIf} - SendMessage $ListBox_SetConfig ${LB_ADDSTRING} 0 "STR:$0" - end: - Call ListBox_SetConfig_Change - FunctionEnd - - Function ListBox_SetConfig_Change - ${NSD_LB_GetCount} $ListBox_SetConfig $0 - ${If} $0 > 0 - StrCpy $CHART_DIR_EMPTY 0 - ${NSD_LB_GetSelection} $ListBox_SetConfig $1 - ${If} $1 != "" - EnableWindow $Button_Delete_SetConfig 1 - ${Else} - EnableWindow $Button_Delete_SetConfig 0 - ${EndIf} - EnableWindow $Button_DeleteAll_SetConfig 1 - ${Else} - EnableWindow $Button_Delete_SetConfig 0 - EnableWindow $Button_DeleteAll_SetConfig 0 - StrCpy $CHART_DIR_EMPTY 1 - ${EndIf} - FunctionEnd - -*/ -/* -;-------------------------------- -# Page_SetConfig_Leave -# Var CHART_DIR_TMP_FILE - - Function Page_SetConfig_Leave - ${NSD_LB_GetCount} $ListBox_SetConfig $0 - ${If} $0 > 0 - ClearErrors - FileOpen $R0 "$TEMP\opencpn_chart_dirs.tmp" w - IfErrors done - IntOp $0 $0 - 1 - ${For} $1 0 $0 - SendMessage $ListBox_SetConfig ${LB_SETCURSEL} $1 0 - System::Call "User32::SendMessage(i $ListBox_SetConfig, i ${LB_GETTEXT}, i $1, t .r2)" - FileWriteUTF16LE $R0 $2 - FileWriteUTF16LE $R0 "$\r$\n" - ${Next} - FileClose $R0 - StrCpy $CHART_DIR_TMP_FILE 1 - ${Else} - StrCpy $CHART_DIR_EMPTY 1 - ${EndIf} - - done: - ${NSD_GetState} $CheckBox_Language_SetConfig $0 - ${If} $0 == ${BST_CHECKED} - StrCpy $CONFIG_SET_LANG 1 - ${Else} - StrCpy $CONFIG_SET_LANG 0 - ${EndIf} - FunctionEnd -*/ -;-------------------------------- -;# Page_Confirm - Var Install_Options - Var TEXT_INSTALL_OPTIONS - Function Page_Confirm - !insertmacro MUI_HEADER_TEXT $(Page_Confirm_Title) $(Page_Confirm_Subtitle) - ;# gather all installation settings and prepare (string) variable '$Install_Options' to display - ;# add the installation type to '$Install_Options' - StrCpy $Install_Options "$(Installation_Type):$\r$\n" - ${If} $Skip_Page_TypeInst != 1 - ${Switch} $INSTALL_TYPE - ${Case} 1 - StrCpy $Install_Options "$Install_Options$\t$(Type_Reinstall)" - ${Break} - ${Case} 2 - StrCpy $Install_Options "$Install_Options$\t$(Type_Upgrade)" - ${Break} - ${Case} 3 - StrCpy $Install_Options "$Install_Options$\t$(Type_Downgrade)" - ${Break} - ${Case} 4 - StrCpy $Install_Options "$Install_Options$\t$(Type_Parallel_Installation)" - ${Break} - ${Default} - ${Break} - ${EndSwitch} - ${Else} - StrCpy $Install_Options "$Install_Options$\t$(Type_Fresh_Installation)" - ${EndIf} - - ;# add the installation directory to '$Install_Options' - StrCpy $Install_Options "$Install_Options$\r$\n$\r$\n$(Installation_Directory):$\r$\n$\t$INSTDIR" - -/* - ;# add the delete config settings to '$Install_Options' - ${If} $CONFIG_EXISTS == 1 - ${AndIf} $CONFIG_EMPTY != 1 - StrCpy $Install_Options "$Install_Options$\r$\n$\r$\n$(Installation_Delete_Config):" - SectionGetFlags ${SecGrpResetConfig} $0 - SectionGetFlags ${SecGrpResetConfig} $1 - IntOp $0 $0 & ${SF_SELECTED} - IntOp $1 $1 & ${SF_PSELECTED} - StrCmp $0 0 +3 0 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecGrpResetConfig_Text)" - Goto cont - - StrCmp $1 0 none_selected 0 - SectionGetFlags ${SecDeleteConfigFile} $0 - IntOp $0 $0 & ${SF_SELECTED} - StrCmp $0 0 +2 0 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteConfigFile_Text)" - SectionGetFlags ${SecDeleteChartDB} $0 - IntOp $0 $0 & ${SF_SELECTED} - StrCmp $0 0 +2 0 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteChartDB_Text)" - SectionGetFlags ${SecDeleteSENC} $0 - IntOp $0 $0 & ${SF_SELECTED} - StrCmp $0 0 +2 0 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteSENC_Text)" - SectionGetFlags ${SecDeleteCM93} $0 - IntOp $0 $0 & ${SF_SELECTED} - StrCmp $0 0 +2 0 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteCM93_Text)" - SectionGetFlags ${SecDeleteNavobjFile} $0 - IntOp $0 $0 & ${SF_SELECTED} - StrCmp $0 0 +2 0 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteNavobjFile_Text)" - SectionGetFlags ${SecDeleteLogFile} $0 - IntOp $0 $0 & ${SF_SELECTED} - StrCmp $0 0 +2 0 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteLogFile_Text)" - Goto cont - - none_selected: - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(text_none)" - - cont: - ${EndIf} -*/ - -/* - ;# add the shortcut settings to '$Install_Options' - StrCpy $Install_Options "$Install_Options$\r$\n$\r$\n$(Create_Shortcuts):" - SectionGetFlags ${SecShortcutStartmenu} $0 - IntOp $0 $0 & ${SF_SELECTED} - ${If} $0 != 0 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(Create_Shortcut_Start_Menu): $STARTMENU_FOLDER" - StrCpy $2 1 - ${Else} - StrCpy $2 0 - ${EndIf} - - SectionGetFlags ${SecShortcutDesktop} $0 - IntOp $0 $0 & ${SF_SELECTED} - ${If} $0 != 0 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(Create_Shortcut_Desktop): $DESKTOP" - ${Else} - StrCmp $2 0 0 +2 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(text_none)" - ${EndIf} -*/ - -/* - ;# add the pre-config settings to '$Install_Options' - ${IfNot} ${SectionIsReadOnly} ${SecSetConfig} - ${AndIf} ${SectionIsSelected} ${SecSetConfig} - StrCpy $Install_Options "$Install_Options$\r$\n$\r$\n$(SecSetConfig_Text):" - StrCmp $CONFIG_SET_LANG 1 0 +2 - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(CB_Language_SetConfig_Text)" - StrCmp $CHART_DIR_TMP_FILE 1 0 end - IfFileExists "$TEMP\opencpn_chart_dirs.tmp" 0 end - StrCpy $Install_Options "$Install_Options$\r$\n$\t$(GB_ChartDir_SetConfig_Text)" - ClearErrors - FileOpen $0 "$TEMP\opencpn_chart_dirs.tmp" r - IfErrors end - ${Do} - FileReadUTF16LE $0 $1 - IfErrors done - ${TrimNewLines} $1 $1 - StrCmp $1 "" +2 - StrCpy $Install_Options "$Install_Options$\r$\n$\t - $1" - ${Loop} - done: - FileClose $0 - end: - ${EndIf} - ;# end '$Install_Options' -*/ - nsDialogs::Create /NOUNLOAD 1018 - Pop $0 - ${If} $0 == error - Abort - ${EndIf} - - nsDialogs::CreateControl EDIT "${__NSD_Text_STYLE}|${WS_VSCROLL}|${WS_HSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN}|${ES_READONLY}" "${__NSD_Text_EXSTYLE}" 0 0 100% 100% "$Install_Options" - Pop $TEXT_INSTALL_OPTIONS - - nsDialogs::Show - FunctionEnd - -;# Page_Instfiles_Show - Function Page_Instfiles_Show - w7tbp::Start - FunctionEnd - -;-------------------------------- -;################################################################################################## -;# General Installer Functions # -;################################################################################################## -Function GetAllUsers - ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName" - System::Call 'netapi32::NetUserEnum(w "\\$0",i 0,i 2,*i .R0,i ${NSIS_MAX_STRLEN}, *i .R1,*i .R2,*i .r1)i .r2' - StrCpy $R8 $R0 - IntOp $R2 $R2 - 1 - ${ForEach} $9 0 $R2 + 1 - System::Call "*$R0(w.R9)" - MessageBox MB_OK "[$R9]" - IntOp $R0 $R0 + 4 - ${Next} - System::Call 'netapi32.dll::NetApiBufferFree(i R8)i .R1' -FunctionEnd - - -Function Hide_SecGrpResetConfig - Push $0 - !insertmacro ClearSectionFlag ${SecDeleteConfigFile} ${SF_SELECTED} - SectionSetText ${SecDeleteConfigFile} "" - !insertmacro ClearSectionFlag ${SecDeleteChartDB} ${SF_SELECTED} - SectionSetText ${SecDeleteChartDB} "" - !insertmacro ClearSectionFlag ${SecDeleteSENC} ${SF_SELECTED} - SectionSetText ${SecDeleteSENC} "" - !insertmacro ClearSectionFlag ${SecDeleteCM93} ${SF_SELECTED} - SectionSetText ${SecDeleteCM93} "" - !insertmacro ClearSectionFlag ${SecDeleteNavobjFile} ${SF_SELECTED} - SectionSetText ${SecDeleteNavobjFile} "" - !insertmacro ClearSectionFlag ${SecDeleteLogFile} ${SF_SELECTED} - SectionSetText ${SecDeleteLogFile} "" - !insertmacro ClearSectionFlag ${SecGrpResetConfig} ${SF_SECGRP} - !insertmacro ClearSectionFlag ${SecGrpResetConfig} ${SF_SELECTED} - SectionSetFlags ${SecGrpResetConfig} 0 - SectionSetText ${SecGrpResetConfig} "" - IntOp $0 ${SecDeleteLogFile} + 1 - !insertmacro ClearSectionFlag $0 ${SF_SECGRPEND} - SectionSetText $0 "" - Pop $0 -FunctionEnd - - -Function Check_Config_Exists - ;# Look for config dir ("%APPDATA%\opencpn) and the several config files - SetShellVarContext all - - ${IfNot} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" - ${If} ${FileExists} "$USERS_APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" - CreateDirectory "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" - Sleep 250 - AccessControlW::GrantOnFile "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" "(BU)" "GenericRead + GenericExecute + GenericWrite + Delete + FullAccess" - CopyFiles /SILENT "$USERS_APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" - ${ElseIf} ${FileExists} "$ADMIN_APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" - CreateDirectory "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" - Sleep 250 - AccessControlW::GrantOnFile "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" "(BU)" "GenericRead + GenericExecute + GenericWrite + Delete + FullAccess" - CopyFiles /SILENT "$ADMIN_APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" - ${EndIf} - - ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" - DeleteINISec "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" Directories - ${EndIf} - ${EndIf} - - ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" - StrCpy $CONFIG_EXISTS 1 - SectionSetText ${SecGrpResetConfig} $(SecGrpResetConfig_Text) - ${EndIf} - StrCpy $Count_SecGrpResetConfig 0 - ${If} $CONFIG_EXISTS == 1 - ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" - StrCpy $INI_EXISTS 1 - IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 - SectionSetText ${SecDeleteConfigFile} $(SecDeleteConfigFile_Text) - ${Else} - !insertmacro ClearSectionFlag ${SecDeleteConfigFile} ${SF_SELECTED} - SectionSetText ${SecDeleteConfigFile} "" - ${EndIf} - - ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\CHRTLIST.DAT" - StrCpy $CHARTDB_EXISTS 1 - IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 - SectionSetText ${SecDeleteChartDB} $(SecDeleteChartDB_Text) - ${Else} - !insertmacro ClearSectionFlag ${SecDeleteChartDB} ${SF_SELECTED} - SectionSetText ${SecDeleteChartDB} "" - ${EndIf} - - ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\SENC\*.*" - StrCpy $SENC_EXISTS 1 - IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 - SectionSetText ${SecDeleteSENC} $(SecDeleteSENC_Text) - ${Else} - !insertmacro ClearSectionFlag ${SecDeleteSENC} ${SF_SELECTED} - SectionSetText ${SecDeleteSENC} "" - ${EndIf} - - ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\cm93\*.*" - StrCpy $CM93_EXISTS 1 - IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 - SectionSetText ${SecDeleteCM93} $(SecDeleteCM93_Text) - ${Else} - !insertmacro ClearSectionFlag ${SecDeleteCM93} ${SF_SELECTED} - SectionSetText ${SecDeleteCM93} "" - ${EndIf} - - ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\navobj.xml" - StrCpy $NAVOBJ_EXISTS 1 - IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 - SectionSetText ${SecDeleteNavobjFile} $(SecDeleteNavobjFile_Text) - ${Else} - !insertmacro ClearSectionFlag ${SecDeleteNavobjFile} ${SF_SELECTED} - SectionSetText ${SecDeleteNavobjFile} "" - ${EndIf} - - ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.log" - StrCpy $LOG_EXISTS 1 - IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 - SectionSetText ${SecDeleteLogFile} $(SecDeleteLogFile_Text) - ${Else} - !insertmacro ClearSectionFlag ${SecDeleteLogFile} ${SF_SELECTED} - SectionSetText ${SecDeleteLogFile} "" - ${EndIf} - - ${If} $Count_SecGrpResetConfig == 0 - StrCpy $CONFIG_EMPTY 1 - ${EndIf} - - !insertmacro ClearSectionFlag ${SecSetConfig} ${SF_SELECTED} - IntOp $0 ${SF_RO} | ${SF_BOLD} - SectionSetFlags ${SecSetConfig} $0 - ;SectionSetFlags ${SecSetConfig} ${SF_RO} - StrCpy $SetConfig 0 - ${EndIf} -FunctionEnd - - -Function Reg_Scan_Old_Versions_HKLM - ;# Registry look-up - ;# Versions prior to 2.2.727 write RegKey "OpenCPN_is1" to "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" - ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1 "DisplayName" - ${If} $0 != "" - ${StrFilter} "$0" "31" "." " " $1 - StrCpy $LM_VERSION "$1" - ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1 "UninstallString" - ${StrFilter} "$0" "" "" "$\"" $2 - ${If} ${FileExists} "$2" - ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1 "QuietUninstallString" - ${StrFilter} "$0" "" "" "$\"" $3 - StrCpy $LM_VERSION_UNINST $3 - ReadRegStr $4 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1 "InstallLocation" - ${TrimNewLines} $4 $4 - ${If} ${FileExists} "$4opencpn.exe" - ${AndIf} ${FileExists} "$4unins*.exe" - ;# check if last character of $4 is a "\" and if so remove it - ${RIndexOf} $6 "$4" "\" - ${If} $6 == 1 - ${WordReplace} "$4" "\" "" "-1" $4 - ${EndIf} - - StrCpy $LM_VERSION_INST $4 - IntOp $OLD_INSTALLS $OLD_INSTALLS + 1 - ;StrCpy $VERSION_NEWER 1 - ${Else} - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1" - StrCpy $LM_VERSION "" - StrCpy $LM_VERSION_UNINST "" - ${EndIf} - ${EndIf} - ${EndIf} -FunctionEnd - - -Function EnumProfileList - ${EnumHKU} Callback_EnumProfileList opencpn-inst-tmp-sid -FunctionEnd - - -Function Callback_EnumProfileList - ;# Get the SID or tmpkey from the stack - Pop $SID - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_users_sid.tmp" - FileOpen $R0 "$TEMP\opencpn_users_sid.tmp" a - FileSeek $R0 0 END - ${Else} - FileOpen $R0 "$TEMP\opencpn_users_sid.tmp" w - ${EndIf} - - IfErrors done - FileWriteUTF16LE $R0 "$SID" - FileWriteUTF16LE $R0 "$\r$\n" - FileWriteUTF16LE $R0 "$USERPROFILE" - FileWriteUTF16LE $R0 "$\r$\n" - FileClose $R0 - done: -FunctionEnd - - -Function Get_Users_Values - Var /GLOBAL tmp_file_handle - StrCpy $SID "" - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_users_sid.tmp" - FileOpen $tmp_file_handle "$TEMP\opencpn_users_sid.tmp" r - IfErrors end - ${Do} - FileReadUTF16LE $tmp_file_handle $SID - FileReadUTF16LE $tmp_file_handle $USERPROFILE - StrCmp $SID "" done - ${TrimNewLines} $SID $SID - ${TrimNewLines} $USERPROFILE $USERPROFILE - ;# List of functions to call - Call Users_Appdata_Paths - Call Users_StartMenu_Paths - Call Users_Desktop_Paths - Call Users_Personal_Paths - Call Reg_Scan_Old_Versions_HKCU - ${Loop} - done: - FileClose $tmp_file_handle - StrCpy $SID "" - StrCpy $USERPROFILE "" - ${EndIf} - end: -FunctionEnd - - -Function Users_Appdata_Paths - ReadRegStr $1 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" AppData - ${WordReplace} "$1" "%USERPROFILE%" "$USERPROFILE" "+" $2 - ExpandEnvStrings $2 $2 - StrCmp $2 "" done - - StrCpy $5 "none" - ;# check if an OpenCPN config folder exists in the given path - ${If} ${FileExists} "$2\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" - ReadINIStr $3 "$2\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" Directories S57DataLocation - ${WordReplace} "$3" "\\" "\" "+" $4 - ${WordFind} "$4" "\" "-2{*" $5 - StrCmp $5 "" 0 +2 - StrCpy $5 "none" - ${EndIf} - - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_appdata.tmp" - FileOpen $R0 "$TEMP\opencpn_appdata.tmp" a - FileSeek $R0 0 END - ${Else} - FileOpen $R0 "$TEMP\opencpn_appdata.tmp" w - ${EndIf} - IfErrors done - FileWriteUTF16LE $R0 "$SID" - FileWriteUTF16LE $R0 "$\r$\n" - FileWriteUTF16LE $R0 "$2" - FileWriteUTF16LE $R0 "$\r$\n" - FileWriteUTF16LE $R0 "$5" - FileWriteUTF16LE $R0 "$\r$\n" - FileClose $R0 - done: -FunctionEnd - - -Function Users_Personal_Paths - ReadRegStr $1 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" Personal - ${WordReplace} "$1" "%USERPROFILE%" "$USERPROFILE" "+" $2 - ExpandEnvStrings $2 $2 - - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_personal.tmp" - FileOpen $R0 "$TEMP\opencpn_personal.tmp" a - IfErrors done - FileSeek $R0 0 END - ${Else} - FileOpen $R0 "$TEMP\opencpn_personal.tmp" w - IfErrors done - ${EndIf} - - FileWriteUTF16LE $R0 "$SID" - FileWriteUTF16LE $R0 "$\r$\n" - FileWriteUTF16LE $R0 "$2" - FileWriteUTF16LE $R0 "$\r$\n" - FileClose $R0 - done: -FunctionEnd - - -Function Users_StartMenu_Paths - ReadRegStr $1 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "Start Menu" - ${WordReplace} "$1" "%USERPROFILE%" "$USERPROFILE" "+" $2 - ExpandEnvStrings $2 $2 - - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_startmenu.tmp" - FileOpen $R0 "$TEMP\opencpn_startmenu.tmp" a - FileSeek $R0 0 END - ${Else} - FileOpen $R0 "$TEMP\opencpn_startmenu.tmp" w - ${EndIf} - IfErrors done - FileWriteUTF16LE $R0 "$SID" - FileWriteUTF16LE $R0 "$\r$\n" - FileWriteUTF16LE $R0 "$2" - FileWriteUTF16LE $R0 "$\r$\n" - FileClose $R0 - done: -FunctionEnd - - -Function Users_Desktop_Paths - ReadRegStr $1 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" Desktop - ${WordReplace} "$1" "%USERPROFILE%" "$USERPROFILE" "+" $2 - ExpandEnvStrings $2 $2 - - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_desktop.tmp" - FileOpen $R0 "$TEMP\opencpn_desktop.tmp" a - FileSeek $R0 0 END - ${Else} - FileOpen $R0 "$TEMP\opencpn_desktop.tmp" w - ${EndIf} - IfErrors done - FileWriteUTF16LE $R0 "$SID" - FileWriteUTF16LE $R0 "$\r$\n" - FileWriteUTF16LE $R0 "$2" - FileWriteUTF16LE $R0 "$\r$\n" - FileClose $R0 - done: -FunctionEnd - - -;Var latest_version -;Var latest_pathexe -Function Reg_Scan_Old_Versions_HKCU - ;# Versions from 2.2.727 up to 2.2.xxxx write RegKey "OpenCPN" to "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\" - ;# and also RegKey "OpenCPN " to "HKCU\Software\opencpn.org\" - ;# Find latest installed version => it's the one found in "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN" - - ReadRegStr $0 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN" "DisplayVersion" - ${If} $0 != "" - StrCpy $latest_version $0 - ReadRegStr $0 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN" "DisplayIcon" - StrCpy $latest_pathexe $0 - ReadRegStr $0 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN" "UninstallString" - ;StrCpy $CU_VERSION_UNINST $0 - ${WordFind} "$0" "\" "-2{*" $1 - ${If} ${FileExists} "$1\opencpn.exe" - ${AndIf} ${FileExists} "$1\unins*.exe" - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_old_uninstall_regkeys.tmp" - FileOpen $R0 "$TEMP\opencpn_old_uninstall_regkeys.tmp" a - FileSeek $R0 0 END - ${Else} - FileOpen $R0 "$TEMP\opencpn_old_uninstall_regkeys.tmp" w - ${EndIf} - - IfErrors done - FileWriteUTF16LE $R0 "$SID$\r$\n" - FileWriteUTF16LE $R0 "$SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN$\r$\n" - FileWriteUTF16LE $R0 "$1$\r$\n" - FileClose $R0 - ${Else} - DeleteRegKey HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN" - ${EndIf} - ${EndIf} - - done: - ClearErrors - ${Do} - Pop $0 - IfErrors empty - ${Loop} - empty: - StrCpy $0 0 - StrCpy $1 "" - ${Do} - EnumRegKey $1 HKU "$SID\Software\opencpn.org" $0 - StrCmp $1 "" done1 - IntOp $0 $0 + 1 - Push $1 - ${Loop} - done1: - ${If} $0 > 0 - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_old_installs.tmp" - FileOpen $R0 "$TEMP\opencpn_old_installs.tmp" a - FileSeek $R0 0 END - ${Else} - FileOpen $R0 "$TEMP\opencpn_old_installs.tmp" w - ${EndIf} - IfErrors done2 - ${Do} - Pop $R1 - IfErrors finished - ${StrFilter} "$R1" "31" "." " " $R2 ;# R2 = version - ;StrCpy $CU_VERSION $R2 - ReadRegStr $R3 HKU "$SID\Software\opencpn.org\$R1" "" ;# R3 = install path - ReadRegStr $R4 HKU "$SID\Software\opencpn.org\$R1" "Start Menu Folder" ;# R4 = Start Menu Folder - ReadRegStr $R5 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "Start Menu" ;# R5 = Start Menu Path - ${WordReplace} "$R5" "%USERPROFILE%" "$USERPROFILE" "+" $R5 - ExpandEnvStrings $R5 $R5 - ;StrCpy $CU_VERSION_INST "$R3\" - ${If} "$R3\opencpn.exe" == $latest_pathexe - ${AndIf} $R2 != $latest_version - DeleteRegKey HKU "$SID\Software\opencpn.org\$R1" - ${ElseIf} ${FileExists} "$R3\opencpn.exe" - ${AndIf} ${FileExists} "$R3\unins*.exe" - FileWriteUTF16LE $R0 "$SID\Software\opencpn.org\$R1" - FileWriteUTF16LE $R0 "$\r$\n" - FileWriteUTF16LE $R0 "$R5\$R4" - FileWriteUTF16LE $R0 "$\r$\n" - FileWriteUTF16LE $R0 "$R3" - FileWriteUTF16LE $R0 "$\r$\n" - IntOp $OLD_INSTALLS $OLD_INSTALLS + 1 - ;StrCpy $VERSION_NEWER 1 - ${Else} - DeleteRegKey HKU "$SID\Software\opencpn.org\$R1" - DeleteRegKey /ifempty HKU "$SID\Software\opencpn.org" - ${EndIf} - ${Loop} - finished: - FileClose $R0 - ${Else} - DeleteRegKey HKU "$SID\Software\opencpn.org" - ${EndIf} - - done2: - StrCpy $latest_version "" - StrCpy $latest_pathexe "" -FunctionEnd - - -Function Quick_Scan_Old_Versions - ;# Scan the given Drive for file "opencpn.exe" - ${If} ${FileExists} "$TEMP\opencpn_personal.tmp" - ClearErrors - FileOpen $R0 "$TEMP\opencpn_personal.tmp" r - IfErrors end - ${Do} - FileReadUTF16LE $R0 $R1 - FileReadUTF16LE $R0 $R2 - IfErrors done - StrCmp $R2 "" done - ${TrimNewLines} $R2 $R2 - ${Locate} "$R2" "/L=F /M=opencpn.exe" "Found_OpenCPN_Installation" - ${Loop} - done: - FileClose $R0 - ${EndIf} - - end: - ${Locate} "$PROGRAMFILES" "/L=F /M=opencpn.exe" "Found_OpenCPN_Installation" -FunctionEnd - - -Function Found_OpenCPN_Installation - Push $R0 - Push $R1 - ${If} ${FileExists} "$R8\unins*.exe" - ${If} ${FileExists} "$TEMP\opencpn_prev_installs.tmp" - ClearErrors - FileOpen $R1 "$TEMP\opencpn_prev_installs.tmp" r - IfErrors cont - ${Do} - FileReadUTF16LE $R1 $R2 - FileReadUTF16LE $R1 $R3 - StrCmp $R2 "" done - ${TrimNewLines} $R2 $R2 - ${TrimNewLines} $R3 $R3 - StrCmp $R3 $R8 found - ${LoopUntil} $R2 == "" - done: - FileClose $R1 - Goto cont - - found: - FileClose $R1 - Goto end - ${EndIf} - - cont: - IntOp $counter_tmp $counter_tmp + 1 - ClearErrors - ${IfNot} ${FileExists} "$TEMP\opencpn_hdd_quick_scan.tmp" - FileOpen $R0 "$TEMP\opencpn_hdd_quick_scan.tmp" w - IfErrors end - ${Else} - FileOpen $R0 "$TEMP\opencpn_hdd_quick_scan.tmp" a - IfErrors end - FileSeek $R0 0 END - ${EndIf} - - FileWriteUTF16LE $R0 "$R8" - FileWriteUTF16LE $R0 "$\r$\n" - FileClose $R0 - ${EndIf} - - end: - Pop $R1 - Pop $R0 - Push $0 -FunctionEnd - - -;Var counter_tmp -Function Full_Scan_Old_Versions - ;# Get all HDD Drive Letters on the system - StrCpy $counter_tmp 0 - ${GetDrives} "HDD" "Scan_Drive" -FunctionEnd - - -Function Scan_Drive - ;# Scan the given Drive for file "opencpn.exe" - /*;#DEBUG - scan only crtain drives - ${IfNot} $9 == "D:\" - ;${AndIfNot} $9 == "F:\" - Goto end - ${EndIf} - ;#DEBUG End */ - StrCpy $3 "$(Banner_Scan_Drive)" - GetDlgItem $2 $Banner_Handle 76 - SendMessage $2 ${WM_SETTEXT} 0 "STR:$3" - ${Locate} "$9" "/L=F /M=opencpn.exe" "Found_OCPN_Exe" - end: - Push $0 -FunctionEnd - - -Function Found_OCPN_Exe - Push $1 - ClearErrors - StrCpy $1 0 - StrCpy $2 0 - ${WordFind} "$R8" "\RECYCLER\" "E*" $1 - ${WordFind} "$R8" "\$$Recycle.Bin" "E*" $2 - IfErrors 0 cont1 - ${If} $1 == 1 - ${AndIf} $2 == 1 - Goto cont2 - ${EndIf} - - cont1: - ${If} $1 > 0 - ${OrIf} $2 > 0 - Goto end - ${EndIf} - - cont2: - ${If} ${FileExists} "$R8\unins*.exe" - ${If} ${FileExists} "$TEMP\opencpn_prev_installs.tmp" - ClearErrors - FileOpen $R1 "$TEMP\opencpn_prev_installs.tmp" r - IfErrors cont3 - ${Do} - FileReadUTF16LE $R1 $R2 - FileReadUTF16LE $R1 $R3 - StrCmp $R2 "" done - ${TrimNewLines} $R2 $R2 - ${TrimNewLines} $R3 $R3 - StrCmp $R3 $R8 found - ${LoopUntil} $R2 == "" - done: - FileClose $R1 - Goto cont3 - - found: - FileClose $R1 - Goto end - ${EndIf} - - cont3: - IntOp $counter_tmp $counter_tmp + 1 - GetDlgItem $2 $Banner_Handle 1030 - StrCmp $counter_tmp 1 0 +3 - StrCpy $R4 "$(Banner_Installation_Found_Singular)" - Goto +2 - StrCpy $R4 "$(Banner_Installation_Found_Plural)" - SendMessage $2 ${WM_SETTEXT} 0 "STR:$R4" - SendMessage $ListBox_CleanUp ${LB_ADDSTRING} 0 "STR:$R8" - ClearErrors - ${IfNot} ${FileExists} "$TEMP\opencpn_hdd_full_scan.tmp" - FileOpen $R0 "$TEMP\opencpn_hdd_full_scan.tmp" w - IfErrors end - ${Else} - FileOpen $R0 "$TEMP\opencpn_hdd_full_scan.tmp" a - IfErrors end - FileSeek $R0 0 END - ${EndIf} - - FileWriteUTF16LE $R0 "$R8" - FileWriteUTF16LE $R0 "$\r$\n" - FileClose $R0 - end: - ${EndIf} - Pop $1 - Push $0 -FunctionEnd - - -Function Delete_Installation_Dir - StrCmp $Uninstall_Path_Tmp "" end - ;# Check subdirs and remove them recursive ... - ${If} ${FileExists} "$Uninstall_Path_Tmp\doc\*.*" - RMDir /r "$Uninstall_Path_Tmp\doc" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\lang\*.*" - RMDir /r "$Uninstall_Path_Tmp\lang" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\Microsoft.VC80.CRT\*.*" - RMDir /r "$Uninstall_Path_Tmp\Microsoft.VC80.CRT" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\s57data\*.*" - RMDir /r "$Uninstall_Path_Tmp\s57data" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\sounds\*.*" - RMDir /r "$Uninstall_Path_Tmp\sounds" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\TCDATA\*.*" - RMDir /r "$Uninstall_Path_Tmp\TCDATA" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\gshhs\*.*" - RMDir /r "$Uninstall_Path_Tmp\gshhs" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\plugins\*.*" - RMDir /r "$Uninstall_Path_Tmp\plugins" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\share\*.*" - RMDir /r "$Uninstall_Path_Tmp\share" - ${EndIf} - - ;# Check files and delete them ... - ${If} ${FileExists} "$Uninstall_Path_Tmp\opencpn.exe" - Delete "$Uninstall_Path_Tmp\opencpn.exe" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\license.txt" - Delete "$Uninstall_Path_Tmp\license.txt" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\unins000.dat" - Delete "$Uninstall_Path_Tmp\unins000.dat" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\unins000.exe" - Delete "$Uninstall_Path_Tmp\unins000.exe" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\install.log" - Delete "$Uninstall_Path_Tmp\install.log" - ${EndIf} - - ${If} ${FileExists} "$Uninstall_Path_Tmp\install.log" - Delete "$Uninstall_Path_Tmp\install.log" - ${EndIf} - - Push $0 - Push $1 - Push $2 - Push $R9 - Push $R8 - Push $R7 - Push $R6 - ;# Find the Uninstall file - ${Locate} "$Uninstall_Path_Tmp" "/L=F /M=Uninstall*.exe /G=0" "Delete_Located_File_Single" - ;# Find the wx.. DLLs - ${Locate} "$Uninstall_Path_Tmp" "/L=F /M=wx*.dll /G=0" "Delete_Located_File_Multi" - ;# Dummy call of Locate as it does not properly close its handle and so the dir cannot be deleted though it might be empty - ${Locate} "C:\" "/L=DE /M=*.* /G=0" "Dummy_Function" - - ;# Remove the installation dir ($Uninstall_Path_Tmp) if empty - RMDir "$Uninstall_Path_Tmp" - ${If} ${FileExists} "$Uninstall_Path_Tmp\*.*" - Sleep 250 - RMDir "$Uninstall_Path_Tmp" - ${EndIf} - - Pop $R6 - Pop $R7 - Pop $R8 - Pop $R9 - Pop $2 - Pop $1 - Pop $0 - end: -FunctionEnd - ;# Helper-Functions for Delete_Installation_Dir - Function Delete_Located_File_Single - Delete "$R9" - StrCpy $0 StopLocate - Push $0 - FunctionEnd - - Function Delete_Located_File_Multi - Delete "$R9" - Push $0 - FunctionEnd - - Function Dummy_Function - StrCpy $0 StopLocate - Push $0 - FunctionEnd - ;# End Helper-Functions - - -Function ExecAppFile - !insertmacro UAC_AsUser_ExecShell 'open' '$INSTDIR\opencpn.exe' '' '$INSTDIR' '' - loop: - System::Call user32::GetForegroundWindow()i.r0 - Sleep 200 - IntCmpU $0 $hwndparent loop -FunctionEnd - - -Function DU2Pix - Pop $4 - Pop $3 - Pop $2 - Pop $1 - IntOp $1 $1 * $BU_X - IntOp $1 $1 / 4 - IntOp $2 $2 * $BU_Y - IntOp $2 $2 / 8 - IntOp $3 $3 * $BU_X - IntOp $3 $3 / 4 - IntOp $4 $4 * $BU_Y - IntOp $4 $4 / 8 -FunctionEnd - - -;!define LVM_GETITEMCOUNT 0x1004 ;# ANSI -;!define LVM_GETITEMTEXT 0x102D ;# ANSI -!define LVM_GETITEMCOUNT 0x1004 -!define LVM_GETITEMTEXT 0x1073 - -Function DumpLog - Exch $5 - Push $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $6 - - FindWindow $0 "#32770" "" $HWNDPARENT - GetDlgItem $0 $0 1016 - StrCmp $0 0 error - FileOpen $5 $5 "w" - FileWriteWord $5 0xfeff ; Write the BOM - StrCmp $5 0 error - SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6 - System::StrAlloc ${NSIS_MAX_STRLEN} - Pop $3 - StrCpy $2 0 - System::Call "*(i, i, i, i, i, i, i, i, i) i \ - (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1" - loop: StrCmp $2 $6 done - System::Call "User32::SendMessageW(i, i, i, i) i \ - ($0, ${LVM_GETITEMTEXT}, $2, r1)" - System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)" - FileWriteUTF16LE $5 "$4$\r$\n" - IntOp $2 $2 + 1 - Goto loop - done: - FileClose $5 - System::Free $1 - System::Free $3 - Goto exit - error: - MessageBox MB_OK error - exit: - Pop $6 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 - Exch $5 -FunctionEnd - - -Function Write_Reg_ChartDirs - ClearErrors - FileOpen $R0 "$TEMP\opencpn_chart_dirs.tmp" r - IfErrors end - loop: - FileReadUTF16LE $R0 $R1 - IfErrors done - ${TrimNewLines} $R1 $R1 - ${If} $REG_CHARTDIRS == "" - StrCpy $REG_CHARTDIRS "$R1" - ${Else} - StrCpy $REG_CHARTDIRS "$REG_CHARTDIRS;$R1" - ${EndIf} - Goto loop - done: - FileClose $R0 - WriteRegStr HKLM "Software\OpenCPN" "ChartDirs" $REG_CHARTDIRS - end: -FunctionEnd - - -Function IndexOf - Exch $R0 - Exch - Exch $R1 - Push $R2 - Push $R3 - - StrCpy $R3 $R0 - StrCpy $R0 -1 - IntOp $R0 $R0 + 1 - StrCpy $R2 $R3 1 $R0 - StrCmp $R2 "" +2 - StrCmp $R2 $R1 +2 -3 - - StrCpy $R0 -1 - - Pop $R3 - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - - -Function RIndexOf - Exch $R0 - Exch - Exch $R1 - Push $R2 - Push $R3 - - StrCpy $R3 $R0 - StrCpy $R0 0 - IntOp $R0 $R0 + 1 - StrCpy $R2 $R3 1 -$R0 - StrCmp $R2 "" +2 - StrCmp $R2 $R1 +2 -3 - - StrCpy $R0 -1 - - Pop $R3 - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - -;################################################################################################## -;# Uninstaller Functions # -;################################################################################################## -;# un.onInit Function -Function un.onInit - ;Prevent multiple instances of the uninstaller - ${IfNot} ${UAC_IsInnerInstance} - System::Call 'kernel32::CreateMutexW(i 0, i 0, t "ocpn_uninst_@CPACK_PACKAGE_VERSION@") i .r1 ?e' - Pop $R0 - StrCmp $R0 0 +3 - MessageBox MB_OK|MB_ICONEXCLAMATION "$(Uninstaller_Running)" - Abort - ${EndIf} - - Call un.GetUserInfo - StrCpy $USERS_NAME $USERNAME - - ;# Macros to be inserted - ${If} $IS_ADMIN == 1 - !insertmacro MUI_UNGETLANGUAGE - ${EndIf} - - StrCpy $USERS_APPDATA $APPDATA - - ;# UAC check if user has Admin privileges and prompt for elevation if not - uac_tryagain: - !insertmacro UAC_RunElevated - StrCpy $Inst_Or_Uninst "$(Uninstaller)" - ${Switch} $0 - ${Case} 0 - ${IfThen} $1 = 1 ${|} Quit ${|} ;# we are the outer process, the inner process has done its work, we are done - ${IfThen} $3 <> 0 ${|} ${Break} ${|} ;# we are admin, let the show go on - ${If} $1 = 3 ;# RunAs completed successfully, but with a non-admin user - MessageBox mb_IconExclamation|mb_TopMost|mb_SetForeground "$(Msg_UAC_Admin_Retry)" /SD IDNO IDOK uac_tryagain IDNO 0 - ${EndIf} - ;# fall-through and die - ${Case} 1223 - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_Admin_Abort)" - Quit - ${Case} 1062 - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_Logon_Abort)" - Quit - ${Default} - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_No_Elevation)" - Quit - ${EndSwitch} - -########## from here we can be sure to run with admin privileges ########## - - SectionSetText ${UnSecDeleteConfigFolder} $(UnSecDeleteConfigFolder_Text) - - ClearErrors - Var /GLOBAL UN_INST_PARAMS - Var /GLOBAL UN_INST_HELP - Var /GLOBAL UN_INST_TYPE - StrCpy $UN_INST_TYPE "" - ${GetParameters} $UN_INST_PARAMS - StrCmp $UN_INST_PARAMS "" no_params - - ${GetOptions} "$UN_INST_PARAMS" "/?" $UN_INST_HELP - IfErrors +3 - StrCpy $UN_INST_HELP "help" - Goto end - - ClearErrors - ${GetOptions} "$UN_INST_PARAMS" "/type" $UN_INST_TYPE - IfErrors no_type_param - ${Switch} $UN_INST_TYPE - ${Case} "=1" ;# 1 = Program Files only (Remove/ Delete: Program Files) - StrCpy $UN_INST_TYPE 1 - !insertmacro ClearSectionFlag ${UnSecDeleteConfigFolder} ${SF_SELECTED} - !insertmacro ClearSectionFlag ${UnSecDeleteConfigRegKey} ${SF_SELECTED} - ${Break} - ${Case} "=2" ;# 2 = Preserve Config folder (Remove/ Delete: Program Files + RegKey) - StrCpy $UN_INST_TYPE 2 - !insertmacro ClearSectionFlag ${UnSecDeleteConfigFolder} ${SF_SELECTED} - ${Break} - ${Case} "=3" ;# 3 = Preserve RegKey (Remove/ Delete: Program Files + Config folder) - StrCpy $UN_INST_TYPE 3 - !insertmacro ClearSectionFlag ${UnSecDeleteConfigRegKey} ${SF_SELECTED} - SectionSetFlags ${UnSecBackupConfigToRegKey} ${SF_SELECTED} - ${Break} - ${Case} "=4" ;# 4 = Delete Config folder (Remove/ Delete: Config folder) - StrCpy $UN_INST_TYPE 4 - !insertmacro ClearSectionFlag ${UnSecUninstall} ${SF_SELECTED} - !insertmacro ClearSectionFlag ${UnSecDeleteConfigRegKey} ${SF_SELECTED} - SectionSetFlags ${UnSecBackupConfigToRegKey} ${SF_SELECTED} - ${Break} - ${Case} "=5" ;# 5 = Delete RegKey (Remove/ Delete: RegKey) - StrCpy $UN_INST_TYPE 5 - !insertmacro ClearSectionFlag ${UnSecUninstall} ${SF_SELECTED} - !insertmacro ClearSectionFlag ${UnSecDeleteConfigFolder} ${SF_SELECTED} - ${Break} - ${Default} - StrCpy $9 $UN_INST_TYPE - StrCpy $UN_INST_TYPE "error_type" ;# unknown value given for the type parameter => MsgBox => Quit - ${Break} - ${EndSwitch} - - StrCmp $UN_INST_TYPE "error_type" 0 cont - MessageBox MB_OK|MB_ICONEXCLAMATION "$(Msg_Unknown_Type_Param)" - Quit - - no_type_param: - ;# If no parameter 'type' is given assume full uninstall - StrCpy $UN_INST_TYPE 0 ;# 0 = Full Uninstall (Remove/ Delete: Program Files + Config folder + RegKey) - Goto cont - - no_params: - ;# If no parameters are given assume full uninstall - StrCpy $UN_INST_TYPE 0 ;# 0 = Full Uninstall (Remove/ Delete: Program Files + Config folder + RegKey) - - cont: - ;# Delete all temporary files created during the installation - Delete "$TEMP\opencpn_*.tmp" - - Call un.VersionDate - - Call un.Check_Prev_Installs - - ;# If there are other installations of OCPN do not remove the config folder! - ${If} $UN_INST_TYPE == 0 - ${AndIf} $VERSION_EXISTS == 1 - ${AndIf} $MULTIPLE_INSTALLS > 1 - StrCpy $Skip_UnPage_Components 1 - !insertmacro ClearSectionFlag ${UnSecDeleteConfigFolder} ${SF_SELECTED} - ${EndIf} - - ReadRegStr $0 HKLM "${REG_KEY_UN}" "CompareVersion" - - end: -FunctionEnd - - -Function un.myGuiInit - ${If} $UN_INST_HELP == "help" - MessageBox MB_OK|MB_ICONINFORMATION "$(Msg_Uninstaller_Param_Help)" - Quit - ${EndIf} -FunctionEnd - -;-------------------------------- -;################################################################################################## -;# Uninstaller Page Functions # -;################################################################################################## -/* - ;# UnPage_Components_Pre - Function un.Page_Components_Pre - ${If} $Skip_UnPage_Components == 1 - Abort - ${EndIf} - FunctionEnd -*/ -;-------------------------------- -;################################################################################################## -;# General Uninstaller Functions # -;################################################################################################## - - - -;-------------------------------- -;################################################################################################## -;# Shared Functions # -;################################################################################################## -!macro GetUserInfo_Macro un - Function ${un}GetUserInfo - ClearErrors - UserInfo::GetName - ${If} ${Errors} - StrCpy $IS_ADMIN 1 - Return - ${EndIf} - Pop $USERNAME - - UserInfo::GetAccountType - Pop $R0 - StrCpy $UAT $R0 - ${If} ${IsNT} - ${AndIf} ${IsWinNT4} - ${If} $R0 == "Admin" - StrCpy $IS_ADMIN 1 - ${Else} - StrCpy $IS_ADMIN 0 - ${EndIf} - Goto end - ${EndIf} - - ${Switch} $R0 - ${Case} "Admin" - ${Case} "Power" - StrCpy $IS_ADMIN 1 - ${Break} - ${Default} - StrCpy $IS_ADMIN 0 - ${Break} - ${EndSwitch} - - UserInfo::GetOriginalAccountType - Pop $OUAT - - end: - FunctionEnd -!macroend -!insertmacro GetUserInfo_Macro "" -!insertmacro GetUserInfo_Macro "un." - - -!macro Check_Prev_Installs_Macro un - Function ${un}Check_Prev_Installs - StrCpy $R0 0 - StrCpy $R1 "" - StrCpy $R5 0 - StrCpy $VERSION_EXISTS 0 - SetShellVarContext all - ${Do} - EnumRegKey $R1 SHCTX "${REG_ROOT_KEY_UN}" $R0 - ${If} $R1 != "" - StrLen $R2 $R1 - ${WordFind} "$R1" " " "+1" $R3 - IntOp $R0 $R0 + 1 - ${If} $R3 == "s63_pi" - ${AndIf} $R2 > 7 - ReadRegStr $R4 SHCTX "${REG_ROOT_KEY_UN}\$R1" "CompareVersion" - ReadRegStr $R6 SHCTX "${REG_ROOT_KEY_UN}\$R1" "InstallLocation" - ${If} $R4 != "" - ${VersionCompare} $VERSION_DATE $R4 $Compare_Version_Result - ${Switch} $Compare_Version_Result - ${Case} 0 ;equal - StrCpy $VERSION_EXISTS 1 - ${Break} - ${Case} 1 ;version to install is newer - StrCpy $VERSION_NEWER 1 - ${Break} - ${Case} 2 ;version to install is older - StrCpy $VERSION_OLDER 1 - ${Break} - ${Default} - ${Break} - ${EndSwitch} - IntOp $R5 $R5 + 1 - StrCpy $Prev_Install_RegKey "${REG_ROOT_KEY_UN}\$R1" - ${EndIf} - StrCmp ${un} "" 0 uninst ;# only execute when it is the Installer function - ${If} $R6 != "" - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_prev_installs.tmp" - FileOpen $0 "$TEMP\opencpn_prev_installs.tmp" a - FileSeek $0 0 END - ${Else} - FileOpen $0 "$TEMP\opencpn_prev_installs.tmp" w - ${EndIf} - IfErrors done - FileWriteUTF16LE $0 "$R1$\r$\n" - FileWriteUTF16LE $0 "$R6$\r$\n" - FileClose $0 - done: - ${EndIf} - - ${If} $VERSION_EXISTS == 1 - ${Break} - ${EndIf} - - uninst: - ${EndIf} - ${Else} - Goto done2 - ${EndIf} - ${Loop} - done2: - ${If} $R5 > 0 - StrCpy $MULTIPLE_INSTALLS $R5 - ${Else} - StrCpy $MULTIPLE_INSTALLS 0 - ${EndIf} - ${If} $MULTIPLE_INSTALLS == 0 - StrCpy $Skip_Page_TypeInst 1 - ${Else} - StrCpy $Skip_Page_TypeInst 0 - ${EndIf} - FunctionEnd -!macroend -!insertmacro Check_Prev_Installs_Macro "" -!insertmacro Check_Prev_Installs_Macro "un." - - -/* VersionDate - normalizes the CPACK_PACKAGE_VERSION_PATCH to a comparable format 'yyyy.[02|19].mmdd.00' - 02 = Beta version - 19 = Stable release - IN: CPACK_PACKAGE_VERSION_PATCH - OUT: $VERSION_DATE -*/ -Var Patch_Version -Var Version_Digits_Only -Var Version_Unified -Var Patch_Date -!macro VersionDate_Macro un - Function ${un}VersionDate - StrCpy $Patch_Version "@CPACK_PACKAGE_VERSION_PATCH@" - ${If} $Patch_Version == "" - StrCpy $Patch_Version "0000" - ${EndIf} - StrLen $0 "$Patch_Version" - ${StrFilter} "$Patch_Version" "1" "" "" $Version_Digits_Only - StrLen $1 $Version_Digits_Only - ;# Patch version contains non-digit characters - ${If} $0 != $1 - ${StrFilter} "$Patch_Version" "-2" "" "" $PATCH_ND - ${If} $1 == 3 - StrCpy $Version_Unified "b${YEAR}0$Patch_Version" - ${ElseIf} $1 == 2 - StrCpy $Version_Unified "s${YEAR}00$Patch_Version" - ${ElseIf} $1 == 1 - StrCpy $Version_Unified "s${YEAR}000$Patch_Version" - ${Else} - StrCpy $Version_Unified "b${YEAR}$Patch_Version" - ${EndIf} - ${VersionConvert} $Version_Unified "" $Patch_Date - StrCpy $VERSION_DATE "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.$Patch_Date" - ;# Patch version contains only digits - ${Else} - ${If} $0 == 3 - StrCpy $Version_Unified "b${YEAR}0$Patch_Version" - ${ElseIf} $0 == 2 - StrCpy $Version_Unified "s${YEAR}00$Patch_Version" - ${ElseIf} $0 == 1 - StrCpy $Version_Unified "s${YEAR}000$Patch_Version" - ${Else} - StrCpy $Version_Unified "b${YEAR}$Patch_Version" - ${EndIf} - ${VersionConvert} $Version_Unified "" $Patch_Date - StrCpy $VERSION_DATE "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.$Patch_Date.00" - ${EndIf} - FunctionEnd -!macroend -!insertmacro VersionDate_Macro "" -!insertmacro VersionDate_Macro "un." - - -!macro Delete_Start_Menu_Shortcuts_Macro un - Function ${un}Delete_Start_Menu_Shortcuts - Pop $9 - Push $R0 - Push $R1 - Push $R2 - Push $R3 - Push $R4 - ${TrimNewLines} $9 $9 - SetShellVarContext all - ${RecFindOpen} "$STARTMENU" $CurrentDirVar $CurrentFileVar - ${RecFindFirst} - ClearErrors - ${WordFind} "$CurrentFileVar" ".lnk" "E*" $8 - IfErrors next - IntCmp $8 1 0 next 0 - ShellLink::GetShortCutWorkingDirectory "$STARTMENU$CurrentDirVar\$CurrentFileVar" - Pop $0 - StrCmp "$0" "" +2 - StrCmp "$0" "$9" 0 next - ShellLink::GetShortCutTarget "$STARTMENU$CurrentDirVar\$CurrentFileVar" - Pop $1 - ${WordFind2X} "$1" "\" ".exe" "-1" $7 - ClearErrors - ${WordFind} "$7" "uninstall" "E*" $6 - IfErrors 0 +2 - StrCpy $6 0 - ;#NON-DEBUG - ${If} $7 == "opencpn" - ${OrIf} $7 == "Uninstall" - ${OrIf} $7 == "unins000" - ${OrIf} $6 == 1 - Delete "$STARTMENU$CurrentDirVar\$CurrentFileVar" - StrCmp $CurrentDirVar "" next - ClearErrors - RMDir "$STARTMENU$CurrentDirVar" - Sleep 250 - IfErrors 0 check_parent - ${If} ${FileExists} "$STARTMENU$CurrentDirVar\*.*" - ClearErrors - RMDir "$STARTMENU$CurrentDirVar" - Sleep 250 - IfErrors next check_parent - ${EndIf} - - Goto next - - check_parent: - StrCpy $R3 "$STARTMENU$CurrentDirVar" - Push $R3 - Call ${un}Parent_Dirs_Check - ${EndIf} - - next: - ${RecFindNext} - ${RecFindClose} - - ${If} ${FileExists} "$TEMP\opencpn_startmenu.tmp" - FileOpen $R0 "$TEMP\opencpn_startmenu.tmp" r - IfErrors end - ${Do} - FileReadUTF16LE $R0 $R1 - FileReadUTF16LE $R0 $R2 - ${TrimNewLines} $R1 $R1 - ${TrimNewLines} $R2 $R2 - StrCmp $R2 "" 0 +2 - ${Break} - ${RecFindOpen} "$R2" $CurrentDirVar $CurrentFileVar - ${RecFindFirst} - ClearErrors - ${WordFind} "$CurrentFileVar" ".lnk" "E*" $8 - IfErrors next1 - IntCmp $8 1 0 next1 0 - ShellLink::GetShortCutWorkingDirectory "$R2$CurrentDirVar\$CurrentFileVar" - Pop $0 - StrCmp "$0" "$9" 0 next1 - ShellLink::GetShortCutTarget "$R2$CurrentDirVar\$CurrentFileVar" - Pop $1 - ${WordFind2X} "$1" "\" ".exe" "-1" $7 - ;#NON-DEBUG - ${If} $7 == "opencpn" - ${OrIf} $7 == "Uninstall" - ${OrIf} $7 == "unins000" - Delete "$R2$CurrentDirVar\$CurrentFileVar" - StrCmp $CurrentDirVar "" next1 - ClearErrors - RMDir "$R2$CurrentDirVar" - Sleep 250 - IfErrors 0 check_parent1 - ${If} ${FileExists} "$R2$CurrentDirVar\*.*" - ClearErrors - RMDir "$R2$CurrentDirVar" - Sleep 250 - IfErrors next1 check_parent1 - ${EndIf} - - Goto next1 - - check_parent1: - StrCpy $R3 "$STARTMENU$CurrentDirVar" - Push $R3 - Call ${un}Parent_Dirs_Check - ${EndIf} - - next1: - ${RecFindNext} - ${RecFindClose} - ${LoopUntil} $R2 == "" - FileClose $R0 - ${EndIf} - - end: - Call ${un}Delete_Empty_Parents - - Pop $R4 - Pop $R3 - Pop $R2 - Pop $R1 - Pop $R0 - FunctionEnd -!macroend -!insertmacro Delete_Start_Menu_Shortcuts_Macro "" -!insertmacro Delete_Start_Menu_Shortcuts_Macro "un." - - -!macro Delete_Desktop_Shortcuts_Macro un - Function ${un}Delete_Desktop_Shortcuts - Pop $9 - Push $R0 - Push $R1 - Push $R2 - Push $R3 - ${TrimNewLines} $9 $9 - SetShellVarContext all - ${RecFindOpen} "$DESKTOP" $CurrentDirVar $CurrentFileVar - ${RecFindFirst} - ClearErrors - ${WordFind} "$CurrentFileVar" ".lnk" "E*" $8 - IfErrors next - IntCmp $8 1 0 next 0 - ShellLink::GetShortCutWorkingDirectory "$DESKTOP$CurrentDirVar\$CurrentFileVar" - Pop $0 - StrCmp "$0" "" +2 - StrCmp "$0" "$9" 0 next - ShellLink::GetShortCutTarget "$DESKTOP$CurrentDirVar\$CurrentFileVar" - Pop $1 - ${WordFind2X} "$1" "\" ".exe" "-1" $7 - ClearErrors - ${WordFind} "$7" "uninstall" "E*" $6 - IfErrors 0 +2 - StrCpy $6 0 - ;#NON-DEBUG - ${If} $7 == "opencpn" - ${OrIf} $7 == "Uninstall" - ${OrIf} $7 == "unins000" - ${OrIf} $6 == 1 - Delete "$DESKTOP$CurrentDirVar\$CurrentFileVar" - StrCmp $CurrentDirVar "" next - RMDir "$DESKTOP$CurrentDirVar" - Sleep 250 - IfErrors 0 check_parent - ${If} ${FileExists} "$DESKTOP$CurrentDirVar\*.*" - ClearErrors - RMDir "$DESKTOP$CurrentDirVar" - Sleep 250 - IfErrors next check_parent - ${EndIf} - - Goto next - - check_parent: - StrCpy $R3 "$DESKTOP$CurrentDirVar" - Push $R3 - Call ${un}Parent_Dirs_Check - ${EndIf} - - next: - ${RecFindNext} - ${RecFindClose} - - ${If} ${FileExists} "$TEMP\opencpn_desktop.tmp" - FileOpen $R0 "$TEMP\opencpn_desktop.tmp" r - IfErrors end - ${Do} - FileReadUTF16LE $R0 $R1 - FileReadUTF16LE $R0 $R2 - ${TrimNewLines} $R1 $R1 - ${TrimNewLines} $R2 $R2 - StrCmp $R2 "" 0 +2 - ${Break} - ${RecFindOpen} "$R2" $CurrentDirVar $CurrentFileVar - ${RecFindFirst} - ClearErrors - ${WordFind} "$CurrentFileVar" ".lnk" "E*" $8 - IfErrors next1 - IntCmp $8 1 0 next1 0 - ShellLink::GetShortCutWorkingDirectory "$R2$CurrentDirVar\$CurrentFileVar" - Pop $0 - StrCmp "$0" "$9" 0 next1 - ShellLink::GetShortCutTarget "$R2$CurrentDirVar\$CurrentFileVar" - Pop $1 - ${WordFind2X} "$1" "\" ".exe" "-1" $7 - ;#NON-DEBUG - ${If} $7 == "opencpn" - ${OrIf} $7 == "Uninstall" - ${OrIf} $7 == "unins000" - Delete "$R2$CurrentDirVar\$CurrentFileVar" - StrCmp $CurrentDirVar "" next1 - RMDir "$R2$CurrentDirVar" - Sleep 250 - IfErrors 0 check_parent1 - ${If} ${FileExists} "$R2$CurrentDirVar\*.*" - ClearErrors - RMDir "$R2$CurrentDirVar" - Sleep 250 - IfErrors next1 check_parent1 - ${EndIf} - - Goto next1 - - check_parent1: - StrCpy $R3 "$STARTMENU$CurrentDirVar" - Push $R3 - Call ${un}Parent_Dirs_Check - ${EndIf} - - next1: - ${RecFindNext} - ${RecFindClose} - ${LoopUntil} $R2 == "" - FileClose $R0 - ${EndIf} - - end: - Call ${un}Delete_Empty_Parents - - Pop $R3 - Pop $R2 - Pop $R1 - Pop $R0 - FunctionEnd -!macroend -!insertmacro Delete_Desktop_Shortcuts_Macro "" -!insertmacro Delete_Desktop_Shortcuts_Macro "un." - - -!macro Parent_Dirs_Check_Macro un - Function ${un}Parent_Dirs_Check - Pop $R3 - Push $R4 - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_check_parent.tmp" - FileOpen $R4 "$TEMP\opencpn_check_parent.tmp" a - IfErrors end - ${Else} - FileOpen $R4 "$TEMP\opencpn_check_parent.tmp" w - IfErrors end - ${EndIf} - - ${WordFind} "$R3" "\" "E-2{*" $R3 - IfErrors close - FileWriteUTF16LE $R4 "$R3$\r$\n" - - close: - FileClose $R4 - - end: - Pop $R4 - FunctionEnd -!macroend -!insertmacro Parent_Dirs_Check_Macro "" -!insertmacro Parent_Dirs_Check_Macro "un." - - -!macro Delete_Empty_Parents_Macro un - Function ${un}Delete_Empty_Parents - Push $R3 - Push $R4 - Push $R5 - ClearErrors - ${If} ${FileExists} "$TEMP\opencpn_check_parent.tmp" - FileOpen $R4 "$TEMP\opencpn_check_parent.tmp" r - IfErrors end - ${Do} - FileReadUTF16LE $R4 $R3 - IfErrors close - ${TrimNewLines} "$R3" $R3 - ${DirState} $R3 $R5 - StrCmp $R5 0 0 next - ClearErrors - RMDir "$R3" - Sleep 250 - IfErrors next - - loop: - ${WordFind} "$R3" "\" "E-2{*" $R3 - IfErrors next - StrCpy $error_tmp 0 - Push $R3 - Call ${un}Delete_Empty_Dir - StrCmp $error_tmp 1 loop - next: - ${Loop} - close: - FileClose $R4 - Delete "$TEMP\opencpn_check_parent.tmp" - ${EndIf} - end: - Pop $R5 - Pop $R4 - Pop $R3 - FunctionEnd -!macroend -!insertmacro Delete_Empty_Parents_Macro "" -!insertmacro Delete_Empty_Parents_Macro "un." - - -!macro Delete_Empty_Dir_Macro un - Function ${un}Delete_Empty_Dir - Push $R3 - Exch - Pop $R3 - Push $R4 - ${DirState} $R3 $R4 - StrCmp $R4 0 0 end - RMDir "$R3" - Sleep 100 - StrCpy $error_tmp 1 - - end: - Pop $R4 - Pop $R3 - FunctionEnd -!macroend -!insertmacro Delete_Empty_Dir_Macro "" -!insertmacro Delete_Empty_Dir_Macro "un." - - -; Initialize variables -Var explString -Var explSeparator -Var explStrLen -Var explSepLen -Var explOffset -Var explTmp -Var explTmp2 -Var explTmp3 -Var explArrCount -!macro Explodes_Macro un - Function ${un}Explode - /*; Initialize variables - Var /GLOBAL explString - Var /GLOBAL explSeparator - Var /GLOBAL explStrLen - Var /GLOBAL explSepLen - Var /GLOBAL explOffset - Var /GLOBAL explTmp - Var /GLOBAL explTmp2 - Var /GLOBAL explTmp3 - Var /GLOBAL explArrCount - */ - ; Get input from user - Pop $explString - Pop $explSeparator - - ; Calculates initial values - StrLen $explStrLen $explString - StrLen $explSepLen $explSeparator - StrCpy $explArrCount 1 - - ${If} $explStrLen <= 1 ; If we got a single character - ${OrIf} $explSepLen > $explStrLen ; or separator is larger than the string, - Push $explString ; then we return initial string with no change - Push 1 ; and set array's length to 1 - Return - ${EndIf} - - ; Set offset to the last symbol of the string - StrCpy $explOffset $explStrLen - IntOp $explOffset $explOffset - 1 - - ; Clear temp string to exclude the possibility of appearance of occasional data - StrCpy $explTmp "" - StrCpy $explTmp2 "" - StrCpy $explTmp3 "" - - ; Loop until the offset becomes negative - ${Do} - ; If offset becomes negative, it is time to leave the function - ${IfThen} $explOffset == -1 ${|} ${ExitDo} ${|} - - ; Remove everything before and after the searched part ("TempStr") - StrCpy $explTmp $explString $explSepLen $explOffset - - ${If} $explTmp == $explSeparator - ; Calculating offset to start copy from - IntOp $explTmp2 $explOffset + $explSepLen ; Offset equals to the current offset plus length of separator - StrCpy $explTmp3 $explString "" $explTmp2 - - Push $explTmp3 ; Throwing array item to the stack - IntOp $explArrCount $explArrCount + 1 ; Increasing array's counter - - StrCpy $explString $explString $explOffset 0 ; Cutting all characters beginning with the separator entry - StrLen $explStrLen $explString - ${EndIf} - - ${If} $explOffset = 0 ; If the beginning of the line met and there is no separator, - ; copying the rest of the string - ${If} $explSeparator == "" ; Fix for the empty separator - IntOp $explArrCount $explArrCount - 1 - ${Else} - Push $explString - ${EndIf} - ${EndIf} - - IntOp $explOffset $explOffset - 1 - ${Loop} - - Push $explArrCount - FunctionEnd -!macroend -!insertmacro Explodes_Macro "" -!insertmacro Explodes_Macro "un." - - -!macro isEmptyDir_Macro un - Function ${un}isEmptyDir - # Stack -> # Stack: - Exch $0 # Stack: $0 - Push $1 # Stack: $1, $0 - FindFirst $0 $1 "$0\*.*" - StrCmp $1 "." 0 _notempty - FindNext $0 $1 - StrCmp $1 ".." 0 _notempty - ClearErrors - FindNext $0 $1 - IfErrors 0 _notempty - FindClose $0 - Pop $1 # Stack: $0 - StrCpy $0 1 - Exch $0 # Stack: 1 (true) - Goto _end - _notempty: - FindClose $0 - Pop $1 # Stack: $0 - StrCpy $0 0 - Exch $0 # Stack: 0 (false) - _end: - FunctionEnd -!macroend -!insertmacro isEmptyDir_Macro "" -!insertmacro isEmptyDir_Macro "un." -;-------------------------------------------------------------------------------------------------- -;################################################################################################## -;# D E S C R I P T I O N S # -;################################################################################################## -;# Installer Descriptions # -;################################################################################################## - -;# License page - LicenseLangString license ${LANG_ENGLISH} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_GERMAN} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_FRENCH} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_CZECH} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_DANISH} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_SPANISH} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_ITALIAN} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_DUTCH} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_POLISH} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_PORTUGUESE} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_PORTUGUESEBR} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_RUSSIAN} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_SWEDISH} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_FINNISH} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_NORWEGIAN} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_TRADCHINESE} "@CPACK_RESOURCE_FILE_LICENSE@" - LicenseLangString license ${LANG_TURKISH} "@CPACK_RESOURCE_FILE_LICENSE@" - ;LicenseLangString license ${LANG_HUNGARIAN} "@CPACK_RESOURCE_FILE_LICENSE@" - -!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SecGrpResetConfig} $(SecGrpResetConfig_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteConfigFile} $(SecDeleteConfigFile_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteChartDB} $(SecDeleteChartDB_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteSENC} $(SecDeleteSENC_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteCM93} $(SecDeleteCM93_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteNavobjFile} $(SecDeleteNavobjFile_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteLogFile} $(SecDeleteLogFile_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${SecGrpShortcuts} $(SecGrpShortcuts_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcutStartmenu} $(SecShortcutStartmenu_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcutDesktop} $(SecShortcutDesktop_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${SecSetConfig} $(SecSetConfig_Desc) -!insertmacro MUI_FUNCTION_DESCRIPTION_END - -;-------------------------------- -;################################################################################################## -;# Uninstaller Descriptions # -;################################################################################################## -!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${UnSecDeleteConfigFolder} $(UnSecDeleteConfigFolder_Desc) -!insertmacro MUI_UNFUNCTION_DESCRIPTION_END - - -;-------------------------------------------------------------------------------------------------- -;################################################################################################## -;# Language Strings # -;################################################################################################## -;#DO NOT EDIT THE NEXT LINE!!! It is needed for the online generating of the translation files! -;#Language Strings Start as of: 2010-10-10 -;#IMPORTANT: Do not end a multi-line with $\" - - LangString Installer ${LANG_ENGLISH} "installer" - - LangString Uninstaller ${LANG_ENGLISH} "uninstaller" - - ;Installer running on unsupported version of Windows - LangString Installer_Unsupported_Windows_Version ${LANG_ENGLISH} "Your Windows version is not supported (it's too old)!$\r$\nYou need at least Windows XP SP3." - - ;Installer running on Windows XP without SP3 - LangString Installer_Unsupported_XP_SP_Version ${LANG_ENGLISH} "Your Windows XP Service Pack version is not supported (it's too old)!$\r$\nYou need at least Windows XP SP3." - - ;Installer already running - LangString Installer_Running ${LANG_ENGLISH} "The installer is already running." - - ;Uninstaller already running - LangString Uninstaller_Running ${LANG_ENGLISH} "The uninstaller is already running." - - ;Language Dialog - LangString LangDialog_Title ${LANG_ENGLISH} "@CPACK_PACKAGE_NAME@ @CPACK_PACKAGE_VERSION@ Installation" - - LangString LangDialog_Text ${LANG_ENGLISH} "Please select a language:" - - ;License dialog - LangString License_Message ${LANG_ENGLISH} "OpenCPN is software libre. You are encouraged and legally \ - entitled to copy, reinstall, modify, and redistribute this program \ - for yourself and your friends under the terms of the GPL. $\r$\nSmooth sailing!" - - ;Clean up page - LangString text_please_wait_1 ${LANG_ENGLISH} "... please wait!" - - LangString Scanning_HDD ${LANG_ENGLISH} "Scanning HDD ..." - - LangString OCPN_Scanning_HDD ${LANG_ENGLISH} "OpenCPN: Scan HDD ..., please wait!" - - LangString Search_old_installations ${LANG_ENGLISH} "Searching for old installations" - - LangString Install_Location_Default ${LANG_ENGLISH} "Install Locations by default paths (may not find all)" - - LangString Install_Location_HDD_Scan ${LANG_ENGLISH} "Install Location by full HDD scan (most reliable)" - - LangString Label_CleanUp_Text ${LANG_ENGLISH} "Click on a list-item to select/ unselect it or Select ALL (recommended) and then Uninstall selected." - - LangString BT_Uninstall_Selected_CleanUp ${LANG_ENGLISH} "Uninstall Selected" - - LangString BT_SelectAll_CleanUp ${LANG_ENGLISH} "Select ALL" - - LangString BT_UnselectAll_CleanUp ${LANG_ENGLISH} "Unselect ALL" - - LangString LB_CleanUp ${LANG_ENGLISH} "Listbox Text" - - LangString BT_FullScan_CleanUp ${LANG_ENGLISH} "Scan HDD ..." - - LangString LAB_FullScan_CleanUp ${LANG_ENGLISH} "Scan the HDD for the most reliable detection.$\r$\nATTENTION: may last several minutes!" - - LangString Page_CleanUp_Title ${LANG_ENGLISH} "Uninstall older Version" - - LangString Page_CleanUp_Subtitle ${LANG_ENGLISH} "Incompatible version detected" - - ;Components Page - ;Header - LangString CP_HEADER_TEXT ${LANG_ENGLISH} "Installation Settings" - - ;Subheader - LangString CP_HEADER_SUBTEXT ${LANG_ENGLISH} "Choose the settings for the installation" - - ;Top - LangString CP_TOP ${LANG_ENGLISH} "Check or uncheck the options for the installation.$\r$\nClick 'Next' to continue." - - ;Installation type - LangString CP_INSTTYPE ${LANG_ENGLISH} "Installation type:" - - ;Components list - LangString CP_COMPLIST ${LANG_ENGLISH} "Adjust the settings individually:" - - - ;Directory page - - - ;Set Config page - LangString Page_SetConfig_Title ${LANG_ENGLISH} "Default configuration settings" - - LangString Page_SetConfig_Subtitle ${LANG_ENGLISH} "Preconfigure settings for OpenCPN" - - LangString Select_Chart_Directory ${LANG_ENGLISH} "Please select a chart directory to add to OpenCPN" - - LangString BT_Browse_SetConfig_Text ${LANG_ENGLISH} "Browse..." - - LangString BT_DeleteAll_SetConfig_Text ${LANG_ENGLISH} "Delete ALL" - - LangString BT_Delete_SetConfig_Text ${LANG_ENGLISH} "Delete" - - LangString GB_ChartDir_SetConfig_Text ${LANG_ENGLISH} "Add Chart Directory" - - LangString CB_Language_SetConfig_Text ${LANG_ENGLISH} "Set OpenCPN program language to $LANG_NAME" - - LangString GB_Language_SetConfig_Text ${LANG_ENGLISH} "Set OpenCPN program language" - - LangString Label_SetConfig_Text ${LANG_ENGLISH} "Configure preconfig settings for the OpenCPN program.$\r$\nThese settings are saved in the file opencpn.ini." - - ;Confirm page - LangString Page_Confirm_Title ${LANG_ENGLISH} "Ready to Install" - - LangString Page_Confirm_Subtitle ${LANG_ENGLISH} "Check the installation options" - - LangString Installation_Type ${LANG_ENGLISH} "Setup type" - - LangString Installation_Directory ${LANG_ENGLISH} "Destination location" - - LangString Create_Shortcuts ${LANG_ENGLISH} "Create shortcuts" - - LangString Type_Reinstall ${LANG_ENGLISH} "Reinstallation" - - LangString Type_Upgrade ${LANG_ENGLISH} "Upgrade" - - LangString Type_Downgrade ${LANG_ENGLISH} "Downgrade" - - LangString Type_Parallel_Installation ${LANG_ENGLISH} "Parallel installation" - - LangString Type_Fresh_Installation ${LANG_ENGLISH} "New installation" - - LangString Shortcuts ${LANG_ENGLISH} "Shortcuts" - - LangString Create_Shortcut_Start_Menu ${LANG_ENGLISH} "in the Start Menu folder" - - LangString Create_Shortcut_Desktop ${LANG_ENGLISH} "on the Desktop" - - LangString not_selected ${LANG_ENGLISH} "not selected" - - LangString text_none ${LANG_ENGLISH} "none" - - ;Installer Sections - ;Reset config - LangString SecGrpResetConfig_Text ${LANG_ENGLISH} "Reset ALL OpenCPN configuration files" - - ;Delete Config file (opencpn.ini) - LangString SecDeleteConfigFile_Text ${LANG_ENGLISH} "Delete config file (opencpn.ini)" - - ;Delete Chart DB (CHRTLIST.DAT) - LangString SecDeleteChartDB_Text ${LANG_ENGLISH} "Delete Chart Database file (CHRTLIST.DAT)" - - ;Delete SENC directory - LangString SecDeleteSENC_Text ${LANG_ENGLISH} "Delete SENC directory" - - ;Delete CM93 directory - LangString SecDeleteCM93_Text ${LANG_ENGLISH} "Delete CM93 Directory" - - ;Delete Log file (opencpn.log) - LangString SecDeleteLogFile_Text ${LANG_ENGLISH} "Delete Log file (opencpn.log)" - - ;Delete navobj.xml - LangString SecDeleteNavobjFile_Text ${LANG_ENGLISH} "Delete Navobject file (navobj.xml)" - - ;Set config - LangString SecSetConfig_Text ${LANG_ENGLISH} "OpenCPN Configuration Settings" - - ;Set language - LangString SecSetConfigLang_Text ${LANG_ENGLISH} "Set language to $LANG_NAME" - - ;Set chart dir(s) - LangString SecSetConfigChartDir_Text ${LANG_ENGLISH} "Select Chart Directories" - - ;Uninstaller Sections - ;Reset config - LangString UnSecDeleteConfigFolder_Text ${LANG_ENGLISH} "Delete Config folder" - - ;Installer Descriptions - LangString SecGrpResetConfig_Desc ${LANG_ENGLISH} "Deletes ALL files and subdirectories in the configuration folder." - - LangString SecDeleteConfigFile_Desc ${LANG_ENGLISH} "Deletes the configuration file. This file helds also Routes and Waypoints." - - LangString SecDeleteChartDB_Desc ${LANG_ENGLISH} "Deletes the Chart DB file." - - LangString SecDeleteSENC_Desc ${LANG_ENGLISH} "Deletes the SENC subfolder which helds the Bitmaps and S57 chart cache files." - - LangString SecDeleteCM93_Desc ${LANG_ENGLISH} "Deletes the cm93 subfolder which helds the cached cm93 chart outlines." - - LangString SecDeleteNavobjFile_Desc ${LANG_ENGLISH} "Deletes the file 'navobj.xml' in the config folder. This file contains the Tracks." - - LangString SecDeleteLogFile_Desc ${LANG_ENGLISH} "Deletes the OpenCPN log file 'opencpn.log'." - - LangString SecGrpShortcuts_Desc ${LANG_ENGLISH} "Creates shortcuts in both, the Start Menu and on the Desktop." - - LangString SecShortcutStartmenu_Desc ${LANG_ENGLISH} "Creates shortcuts for OpenCPN and the Uninstaller in the Start Menu - configurable on the next page." - - LangString SecShortcutDesktop_Desc ${LANG_ENGLISH} "Creates a shortcut for OpenCPN on the Desktop." - - LangString SecSetConfig_Desc ${LANG_ENGLISH} "Preconfigure the language setting and the chart dir(s) for s63_pi. When selected a separate page is shown for configuration." - - ;Uninstaller Descriptions - LangString UnSecDeleteConfigFolder_Desc ${LANG_ENGLISH} "Deletes the config folder and all its files and subdirectories." - - ;Un-install Link - LangString Uninstall_Link ${LANG_ENGLISH} "Uninstall @CPACK_PACKAGE_NAME@ @CPACK_PACKAGE_VERSION@" - - ;Multiple Install > 1 - ;Title - LangString Page_TypeInst_Title ${LANG_ENGLISH} "Previous Installations" - - ;Subtitle - LangString Page_TypeInst_Subtitle ${LANG_ENGLISH} "$MULTIPLE_INSTALLS installations of s63_pi found.$\r$\nChoose how you want to install s63_pi." - - ;Multiple Install = 1 - ;Title - LangString Page_TypeInst_Title_1 ${LANG_ENGLISH} "Already Installed" - - ;Subtitle - LangString Page_TypeInst_Subtitle_1 ${LANG_ENGLISH} "Found installed version of s63_pi.$\r$\n" - - ;Version exists - ;Title - LangString Page_TypeInst_Title_Exists ${LANG_ENGLISH} "Version Already Installed" - - ;Subtitle - LangString Page_TypeInst_Subtitle_Exists ${LANG_ENGLISH} "s63_pi @CPACK_PACKAGE_VERSION@ is already installed.$\r$\nChoose how you want to install s63_pi." - - ;Label - LangString Label_TypeInst_Reinstall_Text ${LANG_ENGLISH} "s63_pi @CPACK_PACKAGE_VERSION@ is already installed on your system. You can reinstall the version now using the previous settings. If you wish to install the program with different settings, cancel installation and un-install the existing version first. Click Next to continue." - - ;Radio button 'Reinstall' - LangString RB_Reinstall_TypeInst_Text ${LANG_ENGLISH} "Reinstall using previous settings" - - ;Version newer - ;Label - LangString Label_TypeInst_Upgrade_Text ${LANG_ENGLISH} "An older version of s63_pi is installed on your system. Click Next to continue upgrade." - - ;Radio button 'Upgrade' - LangString RB_Upgrade_TypeInst_Text ${LANG_ENGLISH} "Upgrade s63_pi using previous settings (recommended)" - - ;Version older - ;Label - LangString Label_TypeInst_Downgrade_Text ${LANG_ENGLISH} "A newer version of s63_pi is installed on your system. It is not recommended to downgrade to an older version. Select the installation type you want to perform and click Next to continue." - - ;Radio button 'Downgrade' - LangString RB_Downgrade_TypeInst_Text ${LANG_ENGLISH} "Downgrade s63_pi using previous settings (recommended)" - - ;Multiple versions - ;Label - LangString Label_TypeInst_Parallel_Text ${LANG_ENGLISH} "Setup has detected several installed versions of s63_pi on your system. It is recommended to have only one version of s63_pi installed at a time. Select the operation you want to perform and click Next to continue." - - ;Radio button 'Parallel Installation' - LangString RB_Parallel_TypeInst_Text ${LANG_ENGLISH} "Parallel Installation (advanced users)" - - ;Empty string - needed for Components page - LangString EmptyString ${LANG_ENGLISH} "" - - ;Finish page - LangString Show_Readme_Text ${LANG_ENGLISH} "Show Install Log file" - - LangString Finish_Link_Text ${LANG_ENGLISH} "OpenCPN website (Internet connection required)" - - LangString Finish_Link_URL ${LANG_ENGLISH} "http://opencpn.info/?ref=installer&user=$USERS_NAME&lang=$REG_LANG&version=@CPACK_PACKAGE_VERSION@" - - ;Message Boxes - LangString Msg_UAC_Admin_Retry ${LANG_ENGLISH} "This $Inst_Or_Uninst requires admin access!$\r$\nPlease log on as an Administrator and try again." - - LangString Msg_UAC_Admin_Abort ${LANG_ENGLISH} "This $Inst_Or_Uninst requires admin privileges, aborting!" - - LangString Msg_UAC_Logon_Abort ${LANG_ENGLISH} "Logon service not running, aborting!" - - LangString Msg_UAC_No_Elevation ${LANG_ENGLISH} "Unable to elevate , error $0" - - LangString Msg_Error_Remove_InstDir ${LANG_ENGLISH} "The installation directory$\r$\n'$INSTDIR'$\r$\ncould not be removed because it is not empty." - - LangString Msg_Path_Invalid ${LANG_ENGLISH} "The entered path is invalid!$\r$\n$\r$\nPlease check your input." - - LangString Msg_Path_Installation_Exists ${LANG_ENGLISH} "There already exists an installation of s63_pi in the given path.$\r$\nIf you wish to use this path, first uninstall the version. Or select another path for this installation." - - LangString Msg_Uninstall_Old_Versions ${LANG_ENGLISH} "Setup has detected at least one older version of s63_pi which is not compatible with the new version control.$\r$\n\ - It is recommended to first uninstall all of these installations (this does not affect your Config files) and clean-up the Registry.$\r$\n\ - If you click Yes on the next page a listbox with all installation locations will be shown and you will have the possibility to select the installations you wish to uninstall.$\r$\n\ - If you are unsure about possible other previous installations than those shown in the listbox, you can also perform a scan of the entire \ - Harddisk (ATTENTION: This may take several minutes) to find all install locations (recommended).$\r$\n$\r$\n\ - Do you want to uninstall the old version(s)?" - - LangString Msg_Not_All_Old_Uninstalled ${LANG_ENGLISH} "You have not uninstalled all previous installations.$\r$\n$\r$\nDo you want to continue anyway?" - - LangString Msg_Uninstaller_Param_Help ${LANG_ENGLISH} "Uninstaller Help$\r$\n$\r$\nUse the command line or a shortcut to run the uninstaller:$\r$\n$INSTDIR\Uninstall @CPACK_PACKAGE_VERSION@.exe [/?] | [/S], [/type=X]$\r$\n$\r$\nParameters:$\r$\n/?$\tshows this help message box$\r$\n/S$\truns the uninstaller in silent mode$\r$\n$\twill do a full uninstall if called without any type parameter$\r$\n/type=X$\tX must be a digit between 1 and 5$\r$\n$\t1 = Removes only the program files$\r$\n$\t2 = Removes only the program files + preconfig RegKey$\r$\n$\t3 = Removes the program files + config folder$\r$\n$\tpreserves the preconfig RegKey$\r$\n$\t4 = Deletes only the config folder$\r$\n$\t5 = Deletes only the preconfig RegKey$\r$\n$\r$\nEntering any other number or value will quit the uninstaller with a message box without removing or deleting anything." - - LangString Msg_Unknown_Type_Param ${LANG_ENGLISH} "The entered value '$9' for the type parameter is not valid!$\r$\nUse $INSTDIR\Uninstall @CPACK_PACKAGE_VERSION@.exe /?$\r$\nto see a list of valid values." - - ;added on 2010-10-16 - LangString SecGrpShortcuts_Text ${LANG_ENGLISH} "Create Shortcuts" - - LangString SecShortcutStartmenu_Text ${LANG_ENGLISH} "Add Shortcuts to the Start Menu" - - LangString SecShortcutDesktop_Text ${LANG_ENGLISH} "Create Shortcut on the Desktop" - - LangString Installation_Delete_Config ${LANG_ENGLISH} "Delete (existing) Config Subdirectories/ Files" - - ;added on 2010-10-17 - LangString Banner_Scan_Drive ${LANG_ENGLISH} "Scanning Drive $9" - - LangString Banner_Installation_Found_Singular ${LANG_ENGLISH} "Found $counter_tmp installation" - - LangString Banner_Installation_Found_Plural ${LANG_ENGLISH} "Found $counter_tmp installations" - - ;added on 2010-10-21 - LangString Uninstall_Folder_Name ${LANG_ENGLISH} "Uninstall" - - ;added on 2011-06-13 - LangString ^NameDA ${LANG_ENGLISH} "@CPACK_PACKAGE_NAME@ Version @CPACK_PACKAGE_VERSION@" - LangString Installer ${LANG_ENGLISH} "Installer" - -;#EOF +/*----------------------------------------------------------------------------------------------------- +NSIS Installer script for OpenCPN (Windows) +NSIS version 2.46 +Written by Gunther Pilz (Netsurfer) netsurfer@opencpn.de +------------------------------------------------------------------------------------------------------- +CMake variables + CPACK_PACKAGE_NAME "OpenCPN" + CPACK_NSIS_PACKAGE_NAME_LC "opencpn" + CPACK_PACKAGE_VENDOR "opencpn.org" + CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR} + CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR} + CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH} + CPACK_PACKAGE_VERSION ${PACKAGE_VERSION} + CPACK_NSIS_INSTALLED_ICON_NAME "opencpn.exe" + CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/src/bitmaps\\\\opencpn.ico" + CPACK_NSIS_EXTRA_INSTALL_COMMANDS ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} + CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/data/license.txt" + CPACK_BUILDWIN_DIR "${PROJECT_SOURCE_DIR}/buildwin" + CPACK_NSIS_DIR "${PROJECT_SOURCE_DIR}/buildwin/NSIS_Unicode") + + #CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_CURRENT_BINARY_DIR};${PACKAGE_NAME};ALL;/" + #CPACK_PACKAGE_EXECUTABLES ${PACKAGE_NAME} "OpenCPN" + #CPACK_PACKAGE_INSTALL_DIRECTORY ${PACKAGE_NAME} "OpenCPN" + #CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenCPN ${PACKAGE_VERSION}" + #CPACK_NSIS_LINK_NAME "${CPACK_PACKAGE_NAME} ${PACKAGE_VERSION}" + #CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_NAME} Version ${PACKAGE_VERSION}" + #CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.opencpn.org" + #CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.opencpn.org" + #CPACK_NSIS_CONTACT "http:\\\\\\\\www.opencpn.org" + #CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_setup" + +----------------------------------------------------------------------------------------------------------*/ +;# Set compression + SetCompressor /FINAL lzma + +;-------------------------------- +;# You must define these values + !define OCPN_INSTALLER_VERSION "1.0.0" + /* + !define CPACK_NSIS_INSTALLED_ICON_NAME "opencpn.exe" + !define CPACK_NSIS_PACKAGE_NAME_LC "opencpn" + !define CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_NAME} ${PACKAGE_VERSION}" + !define CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/src/bitmaps/opencpn.ico" + !define CPACK_BUILDWIN_DIR "${PROJECT_SOURCE_DIR}/buildwin" + !define CPACK_NSIS_DIR "${PROJECT_SOURCE_DIR}/buildwin/NSIS_Unicode" + */ + !define /date YEAR "%Y" + !define OUTPUT_FILE_NAME "@CPACK_NSIS_PACKAGE_NAME_LC@_@CPACK_PACKAGE_VERSION@_setup.exe" + !define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@" + !define REG_ROOT_KEY "Software" + !define REG_KEY "Software\s63_pi" + !define REG_ROOT_KEY_UN "Software\Microsoft\Windows\CurrentVersion\Uninstall" + !define REG_KEY_UN "Software\Microsoft\Windows\CurrentVersion\Uninstall\s63_pi @CPACK_PACKAGE_VERSION@" + !define CSIDL_LOCAL_APPDATA "0x1C" + !define Explode "!insertmacro Explode" + !define unExplode "!insertmacro unExplode" + + +;-------------------------------- +;# Variables + Var INST_USER_SID + Var CONFIG_EXISTS + Var CONFIG_EMPTY + Var INI_EXISTS + Var CHARTDB_EXISTS + Var SENC_EXISTS + Var CM93_EXISTS + Var NAVOBJ_EXISTS + Var LOG_EXISTS + Var REG_LANG + Var Count_SecGrpResetConfig + Var SecGrpEndSetConfig_Text + Var RESET_CONFIG + Var STARTMENU_FOLDER + Var OLD_INSTALLS + Var Prev_Install_RegKey + Var MULTIPLE_INSTALLS + Var VERSION_EXISTS + Var VERSION_NEWER + Var VERSION_OLDER + Var CANCEL_INSTALLER + Var VERSION_DATE + Var LANG_NAME + Var Status_SecGrpSetConfig + Var MAJOR_D + Var MINOR_D + Var PATCH_D + Var PATCH_ND + Var LM_VERSION + Var LM_VERSION_INST + Var LM_VERSION_UNINST + Var latest_version + Var latest_pathexe + Var BU_X + Var BU_Y + Var UAT + Var OUAT + Var USERS_APPDATA + Var ADMIN_APPDATA + Var USERS_NAME + Var counter_tmp + Var CurrentDirVar + Var CurrentFileVar + Var CONTEXT + Var REG_CHARTDIRS + Var USERNAME + Var IS_ADMIN + Var Compare_Version_Result + Var Inst_Or_Uninst + Var Marquee_Handle + Var Banner_Text_Blink + Var error_tmp +# onSelChange + Var ConfigSetLang + Var ConfigSetChartDir + Var SetConfig +# Installer Pages + Var Skip_Page_CleanUp + Var Skip_Page_TypeInst + Var Skip_Page_SetConfig + Var Skip_Page_Directory + Var Skip_Page_Startmenu + Var Skip_Page_Confirm +# Page_TypeInst + Var Label_TypeInst_Reinstall + Var RB_Reinstall + Var Label_TypeInst_Upgrade + Var RB_Upgrade + Var Label_TypeInst_Downgrade + Var RB_Downgrade + Var Label_TypeInst_Parallel + Var GroupBox_TypeInst + Var RB_Parallel + Var TI_REINSTALL + Var TI_UPGRADE + Var TI_DOWNGRADE + Var TI_PARALLEL + Var GroupBox_Size + Var INSTALL_TYPE +# Page_SetConfig + Var Label_SetConfig + Var GroupBox_Language_SetConfig + Var CheckBox_Language_SetConfig + Var GroupBox_ChartDir_SetConfig + Var DirRequest_SetConfig + Var Button_Delete_SetConfig + Var Button_DeleteAll_SetConfig + Var Button_Add_SetConfig + Var ListBox_SetConfig +;# Page_SetConfig_Leave + Var CHART_DIR_TMP_FILE + Var CHART_DIR_EMPTY + Var CONFIG_SET_LANG + +# Uninstaller Pages + Var Skip_UnPage_Components +;-------------------------------- +;# Execution Level + RequestExecutionLevel highest + +;-------------------------------- +;# Includes + !addincludedir "@CPACK_NSIS_DIR@/Include" + !addplugindir "@CPACK_NSIS_DIR@/Plugins" + + !include MUI2.nsh + !include LogicLib.nsh + !include nsDialogs.nsh + !include Sections.nsh + !include StrFunc.nsh + !include WordFunc.nsh + !include TextFunc.nsh + !include FileFunc.nsh + !include WinVer.nsh + + !include UAC.nsh + + !define MUI_UI "@CPACK_NSIS_DIR@/UI/opencpn_ui.exe" + +;-------------------------------- +;# General + ;# Name and file + Name "@CPACK_NSIS_PACKAGE_NAME@" + OutFile "@CPACK_TOPLEVEL_DIRECTORY@/${OUTPUT_FILE_NAME}" + + ;# Default installation folder + InstallDir "$PROGRAMFILES\s63_pi" + + BrandingText /TRIMLEFT "s63_pi $(Installer) v${OCPN_INSTALLER_VERSION}" +;-------------------------------- +;# Interface Settings + !define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit + !define MUI_CUSTOMFUNCTION_UNGUIINIT un.myGuiInit + + !define MUI_ABORTWARNING + + ;# MUI Settings / Header + !define MUI_ICON "@CPACK_PACKAGE_ICON@" + !define MUI_HEADERIMAGE + !define MUI_HEADERIMAGE_LEFT + !define MUI_HEADERIMAGE_BITMAP "@CPACK_NSIS_DIR@\Bitmaps\header-install.bmp" + !define MUI_HEADERIMAGE_UNBITMAP "@CPACK_NSIS_DIR@\Bitmaps\header-uninstall.bmp" + + ;# MUI Settings / Wizard + !define MUI_WELCOMEFINISHPAGE_BITMAP "@CPACK_NSIS_DIR@\Bitmaps\wizard-install.bmp" + !define MUI_UNWELCOMEFINISHPAGE_BITMAP "@CPACK_NSIS_DIR@\Bitmaps\wizard-uninstall.bmp" + + ;# Set Multi-Language settings + ;# Language Selection Dialog Settings + ;# Show all languages, despite user's codepage + !define MUI_LANGDLL_ALLLANGUAGES +/* + ;# Remember the installer language + !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" + !define MUI_LANGDLL_REGISTRY_KEY "${REG_KEY_UN}" + !define MUI_LANGDLL_REGISTRY_VALUENAME "SetupLanguage" + !define MUI_LANGDLL_WINDOWTITLE "$(LangDialog_Title)" + !define MUI_LANGDLL_INFO "$(LangDialog_Text)" + */ +;-------------------------------- +;# Calls for making respective functions available + ${StrLoc} + +;-------------------------------- +;################################################################################################## +;# Macros # +;################################################################################################## + +!ifndef ___EnumHKU___ + !define ___EnumHKU___ + + !include LogicLib.nsh + !include WordFunc.nsh + + !define TOKEN_QUERY 0x0008 + !define TOKEN_ADJUST_PRIVILEGES 0x0020 + + !define SE_RESTORE_NAME SeRestorePrivilege + + !define SE_PRIVILEGE_ENABLED 0x00000002 + + !define HKEY_USERS 0x80000003 + + Var key + Var logged + Var EnumHKU_counter + Var SID + Var USERPROFILE + + !macro _EnumHKU_AdjustTokens + StrCpy $R1 0 + + System::Call "kernel32::GetCurrentProcess() i .R0" + System::Call "advapi32::OpenProcessToken(i R0, i ${TOKEN_QUERY}|${TOKEN_ADJUST_PRIVILEGES}, *i R1R1) i .R0" + + ${If} $R0 != 0 + System::Call "advapi32::LookupPrivilegeValue(t n, t '${SE_RESTORE_NAME}', *l .R2) i .R0" + + ${If} $R0 != 0 + System::Call "*(i 1, l R2, i ${SE_PRIVILEGE_ENABLED}) i .R0" + System::Call "advapi32::AdjustTokenPrivileges(i R1, i 0, i R0, i 0, i 0, i 0)" + System::Free $R0 + ${EndIf} + + System::Call "kernel32::CloseHandle(i R1)" + ${EndIf} + !macroend + + !macro _EnumHKU_InvokeCallback CALLBACK SUBKEY + Push $0 + Push $1 + Push $R0 + Push $R1 + Push $R2 + Push $R3 + Push $R4 + Push $R5 + Push $R6 + + Push "${SUBKEY}" + Call "${CALLBACK}" + + Pop $R6 + Pop $R5 + Pop $R4 + Pop $R3 + Pop $R2 + Pop $R1 + Pop $R0 + Pop $1 + Pop $0 + !macroend + + !macro _EnumHKU_Load FILE CALLBACK SUBKEY + GetFullPathName /SHORT $R2 ${FILE} + System::Call "advapi32::RegLoadKeyW(i ${HKEY_USERS}, t '${SUBKEY}', t R2) i .R3" + ${If} $R3 == 0 + !insertmacro _EnumHKU_InvokeCallback ${CALLBACK} "${SUBKEY}" + ;System::Call "advapi32::RegUnLoadKeyW(i ${HKEY_USERS}, t '${SUBKEY}')" + IntOp $EnumHKU_counter $EnumHKU_counter + 1 + ${EndIf} + !macroend + + !macro EnumHKU UN CALLBACK SUBKEY + Push $0 + Push $1 + StrCpy $EnumHKU_counter 0 + GetFunctionAddress $0 "${CALLBACK}" + StrCpy $1 "${SUBKEY}_$EnumHKU_counter" + StrCpy $key ${SUBKEY} + Call ${UN}_EnumHKU + Pop $1 + Pop $0 + !macroend + + !define EnumHKU '!insertmacro EnumHKU ""' + !define un.EnumHKU '!insertmacro EnumHKU "un."' + + !macro _EnumHKU UN + Function ${UN}_EnumHKU + Push $R0 + Push $R1 + Push $R2 + Push $R3 + Push $R4 + Push $R5 + Push $R6 + + # enumerate logged on users + StrCpy $R0 0 + ${Do} + EnumRegKey $R1 HKU "" $R0 + ${If} $R1 != "" + StrLen $R4 $R1 + ${If} $R4 > 8 + StrCpy $R6 0 + ${WordFind} "$R1" "_Classes" "E*" $R6 + IfErrors 0 cont + + ReadRegStr $R5 HKU "$R1\Volatile Environment" USERPROFILE + ExpandEnvStrings $R5 $R5 + StrCpy $USERPROFILE $R5 + StrCpy $logged "on" + !insertmacro _EnumHKU_InvokeCallback $0 $R1 + StrCpy $USERPROFILE "" + StrCpy $logged "" + ${EndIf} + cont: + IntOp $R0 $R0 + 1 + ${EndIf} + ${LoopUntil} $R1 == "" + + # enumerate logged off users + System::Call "kernel32::GetVersion() i .R0" + IntOp $R0 $R0 & 0x80000000 + ${If} $R0 == 0 + # nt + !insertmacro _EnumHKU_AdjustTokens + StrCpy $R0 0 + ${Do} + EnumRegKey $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $R0 + ${If} $R1 != "" + StrLen $R4 $R1 + ${If} $R4 > 8 + ClearErrors + ReadRegStr $R5 HKU "$R1\Volatile Environment" HOMEPATH + IfErrors 0 cont1 + ReadRegStr $R5 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$R1" ProfileImagePath + ExpandEnvStrings $R5 $R5 + StrCpy $USERPROFILE $R5 + StrCpy $logged "off" + !insertmacro _EnumHKU_Load "$R5\NTUSER.DAT" $0 $1 + StrCpy $1 "$key_$EnumHKU_counter" + StrCpy $USERPROFILE "" + StrCpy $logged "" + ${EndIf} + + cont1: + IntOp $R0 $R0 + 1 + ${EndIf} + ${LoopUntil} $R1 == "" + ${Else} + # 9x + ClearErrors + FindFirst $R1 $R2 "$WINDIR\Profiles\*.*" + ${Unless} ${Errors} + ${Do} + ${If} $R2 != "." + ${AndIf} $R2 != ".." + ${If} ${FileExists} "$WINDIR\Profiles\$R2\USER.DAT" + !insertmacro _EnumHKU_Load "$WINDIR\Profiles\$R2\USER.DAT" $0 $1 + ${EndIf} + ${EndIf} + ClearErrors + FindNext $R1 $R2 + ${LoopUntil} ${Errors} + FindClose $R1 + ${EndUnless} + ${Endif} + + Pop $R6 + Pop $R5 + Pop $R4 + Pop $R3 + Pop $R2 + Pop $R1 + Pop $R0 + FunctionEnd + !macroend + + !insertmacro _EnumHKU "" + !insertmacro _EnumHKU "un." +!endif + +!macro IndexOf Var Str Char + Push "${Char}" + Push "${Str}" + Call IndexOf + Pop "${Var}" +!macroend +!define IndexOf "!insertmacro IndexOf" + +!macro RIndexOf Var Str Char + Push "${Char}" + Push "${Str}" + Call RIndexOf + Pop "${Var}" +!macroend +!define RIndexOf "!insertmacro RIndexOf" + + +!macro Explode Length Separator String + Push `${Separator}` + Push `${String}` + Call Explode + Pop `${Length}` +!macroend + +!macro unExplode Length Separator String + Push `${Separator}` + Push `${String}` + Call un.Explode + Pop `${Length}` +!macroend + +!ifndef _RecFind_Included + !define _RecFind_Included + + Var _RecFindVar1 + Var _RecFindVar2 + + !macro _RecFindOpen Dir CurrentDirVar CurrentFileVar + !define _Local `${__LINE__}` + !define _Dir `${Dir}` + !define _CurrentDirVar `${CurrentDirVar}` + !define _CurrentFileVar `${CurrentFileVar}` + + !define _RecFindOpenSet + + StrCpy $_RecFindVar2 1 + Push `` + + `nextDir${_Local}:` + Pop `${_CurrentDirVar}` + IntOp $_RecFindVar2 $_RecFindVar2 - 1 + !macroend + !define RecFindOpen `!insertmacro _RecFindOpen` + + !macro _RecFindFirst + !ifndef _RecFindOpenSet + !error `Incorrect use of RecFind commands!` + !else + !define _RecFindFirstSet + !endif + + ClearErrors + FindFirst $_RecFindVar1 `${_CurrentFileVar}` `${_Dir}${_CurrentDirVar}\*.*` + IfErrors `Done${_Local}` + + `checkFile${_Local}:` + StrCmp ${_CurrentFileVar} . `nextFile${_Local}` + StrCmp ${_CurrentFileVar} .. `nextFile${_Local}` + + IfFileExists `${_Dir}${_CurrentDirVar}\${_CurrentFileVar}\*.*` 0 +4 + Push `${_CurrentDirVar}\${_CurrentFileVar}` + IntOp $_RecFindVar2 $_RecFindVar2 + 1 + Goto `nextFile${_Local}` + !macroend + !define RecFindFirst `!insertmacro _RecFindFirst` + + !macro _RecFindNext + !ifndef _RecFindOpenSet | _RecFindFirstSet + !error `Incorrect use of RecFind commands!` + !else + !define _RecFindNextSet + !endif + + `nextFile${_Local}:` + + ClearErrors + FindNext $_RecFindVar1 `${_CurrentFileVar}` + IfErrors 0 `checkFile${_Local}` + + StrCmp $_RecFindVar2 0 +3 + FindClose $_RecFindVar1 + Goto `nextDir${_Local}` + !macroend + !define RecFindNext `!insertmacro _RecFindNext` + + !macro _RecFindClose + !ifndef _RecFindOpenSet | _RecFindFirstSet | _RecFindNextSet + !error `Incorrect use of RecFind commands!` + !else + !undef _RecFindOpenSet + !undef _RecFindFirstSet + !undef _RecFindNextSet + !endif + + `Done${_Local}:` + FindClose $_RecFindVar1 + + StrCmp $_RecFindVar2 0 +4 + Pop $_RecFindVar1 + IntOp $_RecFindVar2 $_RecFindVar2 - 1 + Goto -3 + + !undef _CurrentFileVar + !undef _CurrentDirVar + !undef _Dir + !undef _Local + !macroend + !define RecFindClose `!insertmacro _RecFindClose` +!endif + +;-------------------------------------------------------------------------------------------------- +;################################################################################################## +;# FUNCTIONS # +;################################################################################################## + +; StrContains +; This function does a case sensitive searches for an occurrence of a substring in a string. +; It returns the substring if it is found. +; Otherwise it returns null(""). +; Written by kenglish_hi +; Adapted from StrReplace written by dandaman32 + + +Var STR_HAYSTACK +Var STR_NEEDLE +Var STR_CONTAINS_VAR_1 +Var STR_CONTAINS_VAR_2 +Var STR_CONTAINS_VAR_3 +Var STR_CONTAINS_VAR_4 +Var STR_RETURN_VAR + +Function StrContains + Exch $STR_NEEDLE + Exch 1 + Exch $STR_HAYSTACK + ; Uncomment to debug + ;MessageBox MB_OK 'STR_NEEDLE = $STR_NEEDLE STR_HAYSTACK = $STR_HAYSTACK ' + StrCpy $STR_RETURN_VAR "" + StrCpy $STR_CONTAINS_VAR_1 -1 + StrLen $STR_CONTAINS_VAR_2 $STR_NEEDLE + StrLen $STR_CONTAINS_VAR_4 $STR_HAYSTACK + loop: + IntOp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_1 + 1 + StrCpy $STR_CONTAINS_VAR_3 $STR_HAYSTACK $STR_CONTAINS_VAR_2 $STR_CONTAINS_VAR_1 + StrCmp $STR_CONTAINS_VAR_3 $STR_NEEDLE found + StrCmp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_4 done + Goto loop + found: + StrCpy $STR_RETURN_VAR $STR_NEEDLE + Goto done + done: + Pop $STR_NEEDLE ;Prevent "invalid opcode" errors and keep the + Exch $STR_RETURN_VAR +FunctionEnd + +!macro _StrContainsConstructor OUT NEEDLE HAYSTACK + Push `${HAYSTACK}` + Push `${NEEDLE}` + Call StrContains + Pop `${OUT}` +!macroend + +!define StrContains '!insertmacro "_StrContainsConstructor"' + + + + + + +;-------------------------------------------------------------------------------------------------- +;################################################################################################## +;# PAGES # +;################################################################################################## +;# Installer Pages # +;################################################################################################## +/* Var Skip_Page_CleanUp + Var Skip_Page_TypeInst + Var Skip_Page_SetConfig + Var Skip_Page_Directory + Var Skip_Page_Startmenu + Var Skip_Page_Confirm +*/ + ;# Welcome page + !define MUI_WELCOMEPAGE_TITLE_3LINES + !insertmacro MUI_PAGE_WELCOME + + ;# License page + !define MUI_PAGE_CUSTOMFUNCTION_LEAVE Page_License_Leave + ;!insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" + + !define MUI_LICENSEPAGE_BUTTON "$(^NextBtn)" + !define MUI_LICENSEPAGE_TEXT_BOTTOM $(License_Message) + + !insertmacro MUI_PAGE_LICENSE $(license) + +/* + ;# Clean up page - only shown if previous installation(s) <= 2.2.823 were found - checked in .onInit function +; Page custom Page_CleanUp Page_CleanUp_Leave +*/ + ;# Install type page - only shown if previous installation(s) > 2.2.823 were found - checked in .onInit function + Page custom Page_TypeInst Page_TypeInst_Leave + +/* + ;# Components page + !define MUI_COMPONENTSPAGE_SMALLDESC + !define MUI_PAGE_HEADER_TEXT $(CP_HEADER_TEXT) + !define MUI_PAGE_HEADER_SUBTEXT $(CP_HEADER_SUBTEXT) + !define MUI_COMPONENTSPAGE_TEXT_TOP $(CP_TOP) + !define MUI_COMPONENTSPAGE_TEXT_COMPLIST $(CP_COMPLIST) + !define MUI_COMPONENTSPAGE_TEXT_INSTTYPE "" ;#CHANGE $(CP_INSTTYPE) + ;!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE $(CP_DESCRIPTION_TITLE) ;# for this we can use the default text + ;!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO $(CP_DESCRIPTION_INFO) ;# for this we can use the default text + !define MUI_PAGE_CUSTOMFUNCTION_PRE Page_Components_Pre + !define MUI_PAGE_CUSTOMFUNCTION_SHOW Page_Components_Show + !define MUI_PAGE_CUSTOMFUNCTION_LEAVE Page_Components_Leave + !insertmacro MUI_PAGE_COMPONENTS +*/ + ;# Directory page - allows for changing/ selecting the install directory + !define MUI_DIRECTORYPAGE_VERIFYONLEAVE + !define MUI_PAGE_CUSTOMFUNCTION_PRE Page_Directory_Pre + !define MUI_PAGE_CUSTOMFUNCTION_LEAVE Page_Directory_Leave + !insertmacro MUI_PAGE_DIRECTORY + +/* + ;# Start Menu Folder page - allows for changing/ selecting the Start Menu Folder (if Shortcuts get installed is configured on the Components page) + !define MUI_STARTMENUPAGE_NODISABLE + !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX" + !define MUI_STARTMENUPAGE_REGISTRY_KEY "${REG_KEY_UN}" + !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "StartMenuFolder" + !define MUI_STARTMENUPAGE_DEFAULTFOLDER "OpenCPN" + !define MUI_PAGE_CUSTOMFUNCTION_PRE Page_Startmenu_Pre + !insertmacro MUI_PAGE_STARTMENU "Application" $STARTMENU_FOLDER + + ;# Set Config page - selecting chart director[y|ies] and setting the language in opencpn.ini - only available if opencpn.ini does not exist (or is being deleted) + Page custom Page_SetConfig Page_SetConfig_Leave +*/ + ;# Confirm page - shows all settings for the installation (is mainly needed to always have the 'Install' button on the right page, ie. if Start Menu page is skipped) + Page custom Page_Confirm + + ;# Install page + !define MUI_PAGE_CUSTOMFUNCTION_SHOW Page_Instfiles_Show + !insertmacro MUI_PAGE_INSTFILES + + ;# Finish page + + #!define MUI_FINISHPAGE_RUN opencpn.exe +# !define MUI_FINISHPAGE_RUN +# !define MUI_FINISHPAGE_RUN_FUNCTION ExecAppFile + + !define MUI_FINISHPAGE_SHOWREADME install.log + !define MUI_FINISHPAGE_SHOWREADME_TEXT $(Show_Readme_Text) + !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED + !define MUI_FINISHPAGE_LINK $(Finish_Link_Text) + !define MUI_FINISHPAGE_LINK_LOCATION $(Finish_Link_URL) + !define MUI_FINISHPAGE_LINK_COLOR 000080 + !define MUI_FINISHPAGE_NOREBOOTSUPPORT + !define MUI_FINISHPAGE_TITLE_3LINES + !insertmacro MUI_PAGE_FINISH + +;-------------------------------- +;################################################################################################## +;# Uninstaller Pages # +;################################################################################################## + ;# Welcome page + !define MUI_WELCOMEPAGE_TITLE_3LINES + !insertmacro MUI_UNPAGE_WELCOME + +/* + ;# Components page + !define MUI_PAGE_CUSTOMFUNCTION_PRE un.Page_Components_Pre + !insertmacro MUI_UNPAGE_COMPONENTS +*/ + ;# Confirm page + !insertmacro MUI_UNPAGE_CONFIRM + ;# Uninstall page + !insertmacro MUI_UNPAGE_INSTFILES + + ;# Finish page + !define MUI_FINISHPAGE_TITLE_3LINES + !insertmacro MUI_UNPAGE_FINISH + +;-------------------------------------------------------------------------------------------------- +;################################################################################################## +;# Languages # +;################################################################################################## +;# Languages + !insertmacro MUI_LANGUAGE "English" ;# first language is the default language + !insertmacro MUI_LANGUAGE "German" + !include /NONFATAL "Langstrings_GERMAN.nsh" + !insertmacro MUI_LANGUAGE "French" + !include /NONFATAL "Langstrings_FRENCH.nsh" + !insertmacro MUI_LANGUAGE "Czech" + !include /NONFATAL "Langstrings_CZECH.nsh" + !insertmacro MUI_LANGUAGE "Danish" + !include /NONFATAL "Langstrings_DANISH.nsh" + !insertmacro MUI_LANGUAGE "Spanish" + !include /NONFATAL "Langstrings_SPANISH.nsh" + !insertmacro MUI_LANGUAGE "Italian" + !include /NONFATAL "Langstrings_ITALIAN.nsh" + !insertmacro MUI_LANGUAGE "Dutch" + !include /NONFATAL "Langstrings_DUTCH.nsh" + !insertmacro MUI_LANGUAGE "Polish" + !include /NONFATAL "Langstrings_POLISH.nsh" + !insertmacro MUI_LANGUAGE "PortugueseBR" + !include /NONFATAL "Langstrings_PORTUGUESEBR.nsh" + !insertmacro MUI_LANGUAGE "Portuguese" + !include /NONFATAL "Langstrings_PORTUGUESE.nsh" + !insertmacro MUI_LANGUAGE "Russian" + !include /NONFATAL "Langstrings_RUSSIAN.nsh" + !insertmacro MUI_LANGUAGE "Swedish" + !include /NONFATAL "Langstrings_SWEDISH.nsh" + !insertmacro MUI_LANGUAGE "Finnish" + !include /NONFATAL "Langstrings_FINNISH.nsh" + !insertmacro MUI_LANGUAGE "Norwegian" + !include /NONFATAL "Langstrings_NORWEGIAN.nsh" + !insertmacro MUI_LANGUAGE "TradChinese" + !include /NONFATAL "Langstrings_CHINESETW.nsh" + !insertmacro MUI_LANGUAGE "Turkish" + !include /NONFATAL "Langstrings_TURKISH.nsh" + ;!insertmacro MUI_LANGUAGE "Hungarian" + ;!include /NONFATAL "Langstrings_HUNGARIAN.nsh" + +;-------------------------------- +;# Reserve Files + ;# If you are using solid compression, files that are required before + ;# the actual installation should be stored first in the data block, + ;# because this will make your installer start faster. + !insertmacro MUI_RESERVEFILE_LANGDLL + +;# Remember the installer language + !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" + !define MUI_LANGDLL_REGISTRY_KEY "${REG_KEY_UN}" + !define MUI_LANGDLL_REGISTRY_VALUENAME "SetupLanguage" + !define MUI_LANGDLL_WINDOWTITLE $(LangDialog_Title) + !define MUI_LANGDLL_INFO $(LangDialog_Text) + +;-------------------------------------------------------------------------------------------------- +;################################################################################################## +;# S E C T I O N S # +;################################################################################################## +;# Installer Sections # +;################################################################################################## +Section "-Topmost Section" SecTopmost ;# this needs to be always the first section to be executed! + SetShellVarContext all + SetOutPath $INSTDIR + + ${If} $INSTALL_TYPE == 1 + ${OrIf} $INSTALL_TYPE == 2 + ${OrIf} $INSTALL_TYPE == 3 + ReadRegStr $0 HKLM "$Prev_Install_RegKey" "UninstallString" + ${StrFilter} "$0" "" "" "$\"" $0 + ClearErrors + ExecWait '"$0" /S /type=1 _?=$INSTDIR' + IfErrors 0 +2 + DetailPrint "Error on uninstalling" + Sleep 100 + Delete $0 + ${EndIf} +SectionEnd + + +;# Install Section /hidden +Section "-Install Section" SecInstall + @CPACK_NSIS_FULL_INSTALL@ + + @CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ + + ;# Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall @CPACK_PACKAGE_VERSION@.exe" + + ;# Registry Entries + SetShellVarContext all ;# make sure that we write to HKLM + ;# HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN + WriteRegStr SHCTX "${REG_KEY_UN}" "DisplayName" "@CPACK_PACKAGE_NAME@ @CPACK_PACKAGE_VERSION@" + WriteRegStr SHCTX "${REG_KEY_UN}" "DisplayVersion" "@CPACK_PACKAGE_VERSION@" + WriteRegStr SHCTX "${REG_KEY_UN}" "CompareVersion" "$VERSION_DATE" + WriteRegStr SHCTX "${REG_KEY_UN}" "StartMenuPath" "$SMPROGRAMS\$STARTMENU_FOLDER" + WriteRegStr SHCTX "${REG_KEY_UN}" "InstallLocation" "$INSTDIR" + WriteRegStr SHCTX "${REG_KEY_UN}" "UninstallString" "$\"$INSTDIR\Uninstall @CPACK_PACKAGE_VERSION@.exe$\"" + WriteRegStr SHCTX "${REG_KEY_UN}" "QuietUninstallString" "$\"$INSTDIR\Uninstall @CPACK_PACKAGE_VERSION@.exe /S$\"" + WriteRegStr SHCTX "${REG_KEY_UN}" "ConfigLocation" "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" + WriteRegStr SHCTX "${REG_KEY_UN}" "DisplayIcon" "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@" + WriteRegStr SHCTX "${REG_KEY_UN}" "Publisher" "@CPACK_PACKAGE_VENDOR@" + WriteRegDWORD SHCTX "${REG_KEY_UN}" "VersionMajor" $MAJOR_D + WriteRegDWORD SHCTX "${REG_KEY_UN}" "VersionMinor" $MINOR_D + WriteRegDWORD SHCTX "${REG_KEY_UN}" "VersionPatch" $PATCH_D + WriteRegDWORD SHCTX "${REG_KEY_UN}" "NoModify" 1 + WriteRegDWORD SHCTX "${REG_KEY_UN}" "NoRepair" 1 + WriteRegStr SHCTX "${REG_KEY_UN}" "HelpLink" "http://opencpn.org/" + WriteRegStr SHCTX "${REG_KEY_UN}" "URLInfoAbout" "http://opencpn.org/" + WriteRegStr SHCTX "${REG_KEY_UN}" "Contact" "http://opencpn.org/" + WriteRegStr SHCTX "${REG_KEY_UN}" "InstallUser" "$USERS_NAME" + ${If} ${UAC_IsInnerInstance} + WriteRegStr SHCTX "${REG_KEY_UN}" "InstallAdminUser" "$USERNAME" + ${EndIf} + + ;# Create the config folder if it does not exist and set full access rights to it +; ${IfNot} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" +; CreateDirectory "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" +; Sleep 250 +; ${EndIf} +; AccessControlW::GrantOnFile "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" "(BU)" "GenericRead + GenericExecute + GenericWrite + Delete + FullAccess" + + ;# Save the log file + StrCpy $0 "$INSTDIR\install.log" + Push $0 + Call DumpLog +SectionEnd + +;-------------------------------- +;################################################################################################## +;# Uninstaller Sections # +;################################################################################################## + +Section "-un.Delete Config RegKey" UnSecDeleteConfigRegKey + DeleteRegKey HKLM "${REG_KEY}" +SectionEnd + +Section /o "-un.Backup Config to RegKey" UnSecBackupConfigToRegKey + SetShellVarContext all +/* + ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" + ClearErrors + StrCpy $0 "" + StrCpy $2 0 + loop: + IntOp $2 $2 + 1 + ReadINIStr $1 "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" "ChartDirectories" "ChartDir$2" + StrCmp $1 "" cont + ${WordReplace} "$1" "\\" "\" "+" $3 + ${unExplode} $4 "^" "$3" + Pop $5 + StrCmp $5 "" cont + StrCmp $0 "" 0 +2 + StrCpy $0 $5 + StrCpy $0 "$0;$5" + Goto loop + cont: + WriteRegStr HKLM "${REG_KEY}" "ChartDirs" "$0" + + ReadINIStr $0 "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" "Settings" "Locale" + StrCmp $0 "" +2 0 + WriteRegStr HKLM "${REG_KEY}" "InstallerLanguage" "$0" + ${EndIf} +*/ +SectionEnd + +Section "un.Delete Config Folder" UnSecDeleteConfigFolder + SetShellVarContext all +/* + ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" + RMDir /r "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" + ClearErrors + ${EndIf} +*/ +SectionEnd + +Section "-un.Uninstall" UnSecUninstall + +/* + ;# Delete all Shortcuts + Push $INSTDIR + Call un.Delete_Desktop_Shortcuts + Push $INSTDIR + Call un.Delete_Start_Menu_Shortcuts +*/ + ;# Delete subdirs and files in INSTDIR + ;# Remove the uninstaller itself + ReadRegStr $0 HKLM "${REG_KEY_UN}" "UninstallString" + ${StrFilter} "$0" "" "" "$\"" $0 + Delete $0 + ;# Remove the installation log file + Delete "$INSTDIR\install.log" + @CPACK_NSIS_DELETE_FILES@ + @CPACK_NSIS_DELETE_DIRECTORIES@ + + ;# Remove the installation directory INSTDIR if it is empty + ClearErrors + RMDir "$INSTDIR" + IfErrors 0 cont + IfSilent cont + MessageBox MB_OK|MB_ICONEXCLAMATION "$(Msg_Error_Remove_InstDir)" + + cont: + ;# Remove RegKey + DeleteRegKey HKLM "${REG_KEY_UN}" +SectionEnd + +;-------------------------------------------------------------------------------------------------- +;################################################################################################## +;# F U N C T I O N S # +;################################################################################################## +;# Installer Functions # +;################################################################################################## +;# .onInit Function +Function .onInit + ;# Check if Windows version is at least XP (not Win 98, Win 2000 or older) + ${IfNot} ${AtLeastWinXP} + MessageBox MB_OK|MB_ICONEXCLAMATION "$(Installer_Unsupported_Windows_Version)" + Abort + ${Else} + ${If} ${IsWinXP} + ${AndIf} ${AtMostServicePack} 2 + MessageBox MB_OK|MB_ICONEXCLAMATION "$(Installer_Unsupported_XP_SP_Version)" + Abort + ${EndIf} + ${EndIf} + + ;Prevent multiple instances of the installer + ${IfNot} ${UAC_IsInnerInstance} + System::Call 'kernel32::CreateMutexW(i 0, i 0, t "ocpn_inst_@CPACK_PACKAGE_VERSION@") i .r1 ?e' + Pop $R0 + StrCmp $R0 0 +3 + MessageBox MB_OK|MB_ICONEXCLAMATION "$(Installer_Running)" + Abort + ${EndIf} + + Call GetUserInfo + StrCpy $USERS_NAME $USERNAME + + ;# Macros to be inserted + ${If} $IS_ADMIN == 1 + !insertmacro MUI_LANGDLL_DISPLAY + ${EndIf} + + SetShellVarContext current + StrCpy $USERS_APPDATA $APPDATA + StrCpy $ADMIN_APPDATA $APPDATA + + ;# UAC check if user has Admin privileges and prompt for elevation if not + uac_tryagain: + !insertmacro UAC_RunElevated + StrCpy $Inst_Or_Uninst "$(Installer)" + ${Switch} $0 + ${Case} 0 + ${IfThen} $1 = 1 ${|} Quit ${|} ;# we are the outer process, the inner process has done its work, we are done + ${IfThen} $3 <> 0 ${|} ${Break} ${|} ;# we are admin, let the show go on + ${If} $1 = 3 ;# RunAs completed successfully, but with a non-admin user + MessageBox mb_IconExclamation|mb_TopMost|mb_SetForeground "$(Msg_UAC_Admin_Retry)" /SD IDNO IDOK uac_tryagain IDNO 0 + ${EndIf} + ;# fall-through and die + ${Case} 1223 + MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_Admin_Abort)" + Quit + ${Case} 1062 + MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_Logon_Abort)" + Quit + ${Default} + MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_No_Elevation)" + Quit + ${EndSwitch} + +########## from here we can be sure to run with admin privileges ########## + + ;# Delete all temporary files created during the installation + Delete "$TEMP\opencpn_*.tmp" + + ;# Check for unloaded Registry hive from previous installation attempt e.g. when installer crashed + StrCpy $0 0 + !insertmacro _EnumHKU_AdjustTokens + ${Do} + EnumRegKey $1 HKU "" $0 + StrCmp $1 "" done + IntOp $0 $0 + 1 + ClearErrors + ${WordFind} "$1" "opencpn-inst-tmp-sid" "E*" $2 + IfErrors +2 0 + System::Call "advapi32::RegUnLoadKeyW(i ${HKEY_USERS}, t '$1') i .r3" + ${Loop} + done: + ${If} ${UAC_IsInnerInstance} + !insertmacro UAC_AsUser_GetGlobalVar $USERS_APPDATA + !insertmacro UAC_AsUser_GetGlobalVar $USERS_NAME + ${EndIf} + + ClearErrors + Var /GLOBAL INST_PARAMS + Var /GLOBAL FORCE_SCAN + ${GetParameters} $INST_PARAMS + ${GetOptions} "$INST_PARAMS" "/scan" $FORCE_SCAN + IfErrors +2 + + # Get the user's SID from the username + ReadRegStr $0 HKCU "Volatile Environment" "USERNAME" + System::Call /NOUNLOAD '*(&w${NSIS_MAX_STRLEN})i.R9' + System::Call /NOUNLOAD 'advapi32::LookupAccountNameW(,t "$0",i R9,*i ${NSIS_MAX_STRLEN},w .R8,*i ${NSIS_MAX_STRLEN},*i .r4)i.r5' + System::Call /NOUNLOAD 'advapi32::ConvertSidToStringSidW(i R9,*t .R8)i.r5' + StrCpy $INST_USER_SID $R8 + + Call VersionDate + + ;# check for previous installed versions conforming to this installer + Call Check_Prev_Installs + + ;# check for old installed versions prior to the ones that uses this installer + StrCpy $OLD_INSTALLS 0 + + Call Reg_Scan_Old_Versions_HKLM + + Call EnumProfileList + + Call Get_Users_Values + + ${If} $OLD_INSTALLS == 0 + StrCpy $Skip_Page_CleanUp 1 + ${EndIf} + + + ;# make sure that the DWORD values for the Registry only contain digits + ${StrFilter} "@CPACK_PACKAGE_VERSION_MAJOR@" "1" "" "" $MAJOR_D + ${StrFilter} "@CPACK_PACKAGE_VERSION_MINOR@" "1" "" "" $MINOR_D + ${StrFilter} "@CPACK_PACKAGE_VERSION_PATCH@" "1" "" "" $PATCH_D + + StrCpy $INSTDIR "$PROGRAMFILES\OpenCPN\plugins\s63_pi" + + ;Call GetAllUsers +FunctionEnd + +;-------------------------------- +;# myGuiInit Function +/* +Var CONFIG_EMPTY +Var INI_EXISTS +Var CHARTDB_EXISTS +Var SENC_EXISTS +Var CM93_EXISTS +Var NAVOBJ_EXISTS +Var LOG_EXISTS +Var REG_LANG +Var Count_SecGrpResetConfig +Var SecGrpEndSetConfig_Text +*/ +Function myGuiInit + ;Get chosen installer language + ${Switch} $LANGUAGE + ${Case} ${LANG_CZECH} + StrCpy $LANG_NAME "Čeština" + StrCpy $REG_LANG "cs_CZ" + ${Break} + ${Case} ${LANG_DANISH} + StrCpy $LANG_NAME "Dansk" + StrCpy $REG_LANG "da_DK" + ${Break} + ${Case} ${LANG_GERMAN} + StrCpy $LANG_NAME "Deutsch" + StrCpy $REG_LANG "de_DE" + ${Break} + ${Case} ${LANG_ENGLISH} + StrCpy $LANG_NAME "English" + StrCpy $REG_LANG "en_US" + ${Break} + ${Case} ${LANG_SPANISH} + StrCpy $LANG_NAME "Español" + StrCpy $REG_LANG "es_ES" + ${Break} + ${Case} ${LANG_FRENCH} + StrCpy $LANG_NAME "Français" + StrCpy $REG_LANG "fr_FR" + ${Break} + ${Case} ${LANG_ITALIAN} + StrCpy $LANG_NAME "Italiano" + StrCpy $REG_LANG "it_IT" + ${Break} + ${Case} ${LANG_DUTCH} + StrCpy $LANG_NAME "Nederlandse" + StrCpy $REG_LANG "nl_NL" + ${Break} + ${Case} ${LANG_POLISH} + StrCpy $LANG_NAME "Polski" + StrCpy $REG_LANG "pl_PL" + ${Break} + ${Case} ${LANG_PORTUGUESE} + StrCpy $LANG_NAME "Português" + StrCpy $REG_LANG "pt_PT" + ${Break} + ${Case} ${LANG_PORTUGUESEBR} + StrCpy $LANG_NAME "Português Brasileiro" + StrCpy $REG_LANG "pt_BR" + ${Break} + ${Case} ${LANG_SWEDISH} + StrCpy $LANG_NAME "Svenska" + StrCpy $REG_LANG "sv_SE" + ${Break} + ${Case} ${LANG_RUSSIAN} + StrCpy $LANG_NAME "Русский" + StrCpy $REG_LANG "ru_RU" + ${Break} + ${Case} ${LANG_NORWEGIAN} + StrCpy $LANG_NAME "Norsk" + StrCpy $REG_LANG "nb_NO" + ${Break} + ${Case} ${LANG_FINNISH} + StrCpy $LANG_NAME "Suomalainen" + StrCpy $REG_LANG "fi_FI" + ${Break} + ${Case} ${LANG_TRADCHINESE} + StrCpy $LANG_NAME "正體中文" + StrCpy $REG_LANG "zh_TW" + ${Break} + ${Case} ${LANG_Turkish} + StrCpy $LANG_NAME "Türkçe" + StrCpy $REG_LANG "tr_TR" + ${Break} + ${Default} + ${Break} + ${EndSwitch} + + ;# Set Sections Text + SectionSetText ${SecGrpShortcuts} $(SecGrpShortcuts_Text) + SectionSetText ${SecShortcutStartmenu} $(SecShortcutStartmenu_Text) + SectionSetText ${SecShortcutDesktop} $(SecShortcutDesktop_Text) + SectionSetText ${SecSetConfig} $(SecSetConfig_Text) + +/* + ;# Look for config dir ("%APPDATA%\opencpn) and the several config files + Call Check_Config_Exists + + ${If} $CONFIG_EXISTS != 1 + ${OrIf} $CONFIG_EMPTY == 1 + Call Hide_SecGrpResetConfig + IntOp $0 ${SF_SELECTED} | ${SF_BOLD} + SectionSetFlags ${SecSetConfig} $0 + StrCpy $SetConfig 1 + ${EndIf} +*/ + SetShellVarContext all ;# switch SetShellVarContext back to ALL +FunctionEnd + +/* +;-------------------------------- +;# onSelChange +;Var ConfigSetLang +;Var ConfigSetChartDir +;Var SetConfig +Function .onSelChange + ;# Check if all available Sections in SecGrpResetConfig are selected => set SecGrpResetConfig to selected instead of partially selected + Push $0 + Push $1 + Push $2 + Push $3 + Push $R0 + Push $R1 + StrCpy $0 ${SecGrpResetConfig} + StrCpy $1 0 + StrCpy $2 0 + ${Do} + IntOp $0 $0 + 1 + ${If} ${SectionIsSectionGroupEnd} $0 + Goto end + ${EndIf} + SectionGetText $0 $R0 + ${If} $R0 != "" + ${AndIf} ${SectionIsSelected} $0 + Goto found_selected + ${ElseIf} $R0 != "" + ${AndIfNot} ${SectionIsSelected} $0 + Goto found_unselected + ${EndIf} + ${Loop} + + found_selected: + StrCpy $0 ${SecGrpResetConfig} + ${Do} + IntOp $0 $0 + 1 + ${If} ${SectionIsSectionGroupEnd} $0 + Goto end + ${EndIf} + SectionGetText $0 $R0 + ${If} $R0 == "" + ${AndIfNot} ${SectionIsSelected} $0 + SectionSetFlags $0 ${SF_SELECTED} + ${EndIf} + ${Loop} + + found_unselected: + StrCpy $0 ${SecGrpResetConfig} + ${Do} + IntOp $0 $0 + 1 + ${If} ${SectionIsSectionGroupEnd} $0 + Goto end + ${EndIf} + SectionGetText $0 $R0 + ${If} $R0 == "" + ${AndIf} ${SectionIsSelected} $0 + !insertmacro ClearSectionFlag $0 ${SF_SELECTED} + ${EndIf} + ${Loop} + + end: + SectionGetText ${SecDeleteConfigFile} $R1 + ${If} $R1 != "" + ${IfNot} ${SectionIsReadOnly} ${SecSetConfig} + ${AndIfNot} ${SectionIsSelected} ${SecSetConfig} + ${AndIf} $SetConfig == 1 + StrCpy $SetConfig 0 + ${EndIf} + + ${IfNot} ${SectionIsSelected} ${SecDeleteConfigFile} + ${AndIf} ${SectionIsSelected} ${SecSetConfig} + !insertmacro ClearSectionFlag ${SecSetConfig} ${SF_SELECTED} + IntOp $0 ${SF_RO} | ${SF_BOLD} + SectionSetFlags ${SecSetConfig} $0 + ;SectionSetFlags ${SecSetConfig} ${SF_RO} + StrCpy $SetConfig 1 + ${ElseIfNot} ${SectionIsSelected} ${SecDeleteConfigFile} + ${AndIfNot} ${SectionIsSelected} ${SecSetConfig} + IntOp $0 ${SF_RO} | ${SF_BOLD} + SectionSetFlags ${SecSetConfig} $0 + ;SectionSetFlags ${SecSetConfig} ${SF_RO} + StrCpy $SetConfig 0 + ${ElseIf} ${SectionIsSelected} ${SecDeleteConfigFile} + ${AndIfNot} ${SectionIsSelected} ${SecSetConfig} + ${AndIf} $SetConfig == 1 + !insertmacro ClearSectionFlag ${SecSetConfig} ${SF_RO} + IntOp $0 ${SF_SELECTED} | ${SF_BOLD} + SectionSetFlags ${SecSetConfig} $0 + ;SectionSetFlags ${SecSetConfig} ${SF_SELECTED} + ${ElseIf} ${SectionIsSelected} ${SecDeleteConfigFile} + ${AndIf} $SetConfig == 0 + !insertmacro ClearSectionFlag ${SecSetConfig} ${SF_RO} + StrCpy $SetConfig 0 + ${EndIf} + ${EndIf} + + Pop $R1 + Pop $R0 + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd + +*/ +Function .OnInstFailed + Call InstallerEnd +FunctionEnd + + +Function .OnInstSuccess + Call InstallerEnd +FunctionEnd + + +Function .onGUIEnd + Call InstallerEnd +FunctionEnd + + +Function InstallerEnd + ;# Delete all temporary files created during the installation + Delete "$TEMP\opencpn_*.tmp" + ${If} $EnumHKU_counter > 0 + ${ForEach} $1 $EnumHKU_counter 0 - 1 + System::Call "advapi32::RegUnLoadKeyW(i ${HKEY_USERS}, t '$key_$1')" + ${Next} + ${Endif} +FunctionEnd + +;-------------------------------- +;################################################################################################## +;# Installer Page Functions # +;################################################################################################## +;# Page_License_Leave + Function Page_License_Leave +/* + FindWindow $mui.ComponentsPage "#32770" "" $HWNDPARENT + System::Call "*(i 0, i 0, i 4, i 8) i .r1" + System::Call "User32::MapDialogRect(i $mui.ComponentsPage, i r1) i .r2" + System::Call "*$1(i .r2, i.r3, i.r4, i.r5)" + System::Free $1 + StrCpy $BU_X $4 + StrCpy $BU_Y $5 +*/ + FunctionEnd + +/* +;-------------------------------- +;# Page_CleanUp + Var Label_CleanUp + Var Label_FullScan_CleanUp + Var GroupBox_CleanUp + Var ListBox_CleanUp + Var Button_FullScan_CleanUp + Var Button_UnselectAll_CleanUp + Var Button_SelectAll_CleanUp + Var Button_Uninstall_Selected_CleanUp + Var Banner_Handle + Var MSG_Box_Uninstall_Shown + Function Page_CleanUp + ${If} $Skip_Page_CleanUp == 1 + Abort + ${EndIf} + + !ifndef PBS_MARQUEE + !define PBS_MARQUEE 0x08 + !endif + !ifndef PBM_SETMARQUEE + !define PBM_SETMARQUEE 0x040A + !endif + !ifndef GWL_STYLE + !define GWL_STYLE -16 + !endif + + ${IfNot} $MSG_Box_Uninstall_Shown == 1 + MessageBox MB_YESNO|MB_ICONQUESTION "$(Msg_Uninstall_Old_Versions)" IDYES cont IDNO skip + ${Else} + Goto cont + ${EndIf} + + skip: + Abort + + cont: + StrCpy $MSG_Box_Uninstall_Shown 1 + !insertmacro MUI_HEADER_TEXT "$(Page_CleanUp_Title)" "$(Page_CleanUp_Subtitle)" + + nsDialogs::Create /NOUNLOAD 1018 + Pop $0 + ${If} $0 == error + Abort + ${EndIf} + + ${NSD_CreateLabel} 0 0 200u 16u "$(LAB_FullScan_CleanUp)" + Pop $Label_FullScan_CleanUp + + ${NSD_CreateButton} 220u 0 70u 15u "$(BT_FullScan_CleanUp)" + Pop $Button_FullScan_CleanUp + GetFunctionAddress $0 Button_FullScan_CleanUp_Click + nsDialogs::OnClick /NOUNLOAD $Button_FullScan_CleanUp $0 + + ${NSD_CreateLabel} 0 22u 100% 24u "$(Label_CleanUp_Text)" + Pop $Label_CleanUp + + ${NSD_CreateGroupBox} 0 55u 100% 85u "$(Install_Location_Default)" + Pop $GroupBox_CleanUp + + !define __NSD_ListBoxMultiselect_CLASS LISTBOX + !define __NSD_ListBoxMultiselect_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${LBS_DISABLENOSCROLL}|${LBS_HASSTRINGS}|${LBS_NOINTEGRALHEIGHT}|${LBS_NOTIFY}|${LBS_MULTIPLESEL} + !define __NSD_ListBoxMultiselect_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE} + !insertmacro __NSD_DefineControl ListBoxMultiselect + ${NSD_CreateListboxMultiselect} 10u 70u 200u 65u "$(LB_CleanUp)" + Pop $ListBox_CleanUp + GetFunctionAddress $0 ListBox_CleanUp_Change + nsDialogs::OnChange /NOUNLOAD $ListBox_CleanUp $0 + + ${NSD_CreateButton} 220u 70u 70u 15u "$(BT_UnselectAll_CleanUp)" + Pop $Button_UnselectAll_CleanUp + GetFunctionAddress $0 Button_UnselectAll_CleanUp_Click + nsDialogs::OnClick /NOUNLOAD $Button_UnselectAll_CleanUp $0 + + ${NSD_CreateButton} 220u 100u 70u 15u "$(BT_SelectAll_CleanUp)" + Pop $Button_SelectAll_CleanUp + GetFunctionAddress $0 Button_SelectAll_CleanUp_Click + nsDialogs::OnClick /NOUNLOAD $Button_SelectAll_CleanUp $0 + + ${NSD_CreateButton} 220u 120u 70u 15u "$(BT_Uninstall_Selected_CleanUp)" + Pop $Button_Uninstall_Selected_CleanUp + GetFunctionAddress $0 Button_Uninstall_Selected_CleanUp_Click + nsDialogs::OnClick /NOUNLOAD $Button_Uninstall_Selected_CleanUp $0 + + + ;# First check if HDD scan was already done + ${If} ${FileExists} "$TEMP\opencpn_hdd_full_scan.tmp" + EnableWindow $Button_FullScan_CleanUp 0 + EnableWindow $Label_FullScan_CleanUp 0 + SendMessage $GroupBox_CleanUp ${WM_SETTEXT} 0 "STR:$(Install_Location_HDD_Scan)" + ClearErrors + FileOpen $R0 "$TEMP\opencpn_hdd_full_scan.tmp" r + IfErrors done1 + ${Do} + FileReadUTF16LE $R0 $R1 + ${If} $R1 == "" + Goto done1 + ${Else} + ${TrimNewLines} $R1 $R1 + SendMessage $ListBox_CleanUp ${LB_ADDSTRING} 0 "STR:$R1" + ${EndIf} + ${Loop} + done1: + FileClose $R0 + ;# if not get values from LM_VERSION and opencpn_old_installs.tmp file + ${Else} + ${IfNot} ${FileExists} "$TEMP\opencpn_hdd_quick_scan.tmp" + ;# Scan the default locations for program installations on a per-user and all-users basis + Banner::show /NOUNLOAD /set 76 "$(Search_old_installations)" + Banner::getWindow /NOUNLOAD + Pop $Banner_Handle + ShowWindow $Banner_Handle ${SW_HIDE} + ${NSD_AddExStyle} $Banner_Handle ${WS_EX_APPWINDOW} + ShowWindow $Banner_Handle ${SW_SHOW} + GetDlgItem $2 $Banner_Handle 1030 + SendMessage $2 ${WM_SETTEXT} 0 "STR:$(text_please_wait_1)" + + ; Get progress bar handle. + GetDlgItem $Marquee_Handle $Banner_Handle 1004 + + ; Set PBS_MARQUEE style for the progress bar control. + System::Call "user32::GetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}) i .r1" + System::Call "user32::SetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}, i $1|${PBS_MARQUEE})" + + ; Send PBM_SETMARQUEE message to start the marquee. + ; lParam is time in milliseconds between marquee animation updates. + SendMessage $Marquee_Handle ${PBM_SETMARQUEE} 1 50 + + System::Call "User32::SetWindowPos(i $Banner_Handle, i -1, i 0, i 0, i 0, i 0, i 83)" + + HideWindow + + Call Quick_Scan_Old_Versions + + ShowWindow $HWNDPARENT ${SW_SHOW} + BringToFront + SendMessage $Marquee_Handle ${PBM_SETMARQUEE} 0 0 + System::Call "user32::SetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}, i $1)" + Banner::destroy + ${EndIf} + + ClearErrors + FileOpen $R0 "$TEMP\opencpn_hdd_quick_scan.tmp" r + IfErrors done2 + ${Do} + FileReadUTF16LE $R0 $R1 + ${If} $R1 == "" + Goto done2 + ${Else} + ${TrimNewLines} $R1 $R1 + SendMessage $ListBox_CleanUp ${LB_ADDSTRING} 0 "STR:$R1" + ${EndIf} + ${Loop} + + done2: + FileClose $R0 + ${EndIf} + ;# Pre-select all listbox-items + ${NSD_LB_GetCount} $ListBox_CleanUp $1 + IntOp $1 $1 - 1 + SendMessage $ListBox_CleanUp ${LB_SELITEMRANGEEX} 0 $1 + Call ListBox_CleanUp_Change + + nsDialogs::Show + FunctionEnd +*/ + +/* + Function Button_FullScan_CleanUp_Click + SendMessage $ListBox_CleanUp ${LB_RESETCONTENT} 0 0 + + Banner::show /NOUNLOAD /set 76 "$(Scanning_HDD)" + Banner::getWindow /NOUNLOAD + Pop $Banner_Handle + ShowWindow $Banner_Handle ${SW_HIDE} + SendMessage $Banner_Handle ${WM_SETTEXT} 0 "STR:$(OCPN_Scanning_HDD)" + ${NSD_AddExStyle} $Banner_Handle ${WS_EX_APPWINDOW} + ShowWindow $Banner_Handle ${SW_SHOW} + GetDlgItem $2 $Banner_Handle 1030 + SendMessage $2 ${WM_SETTEXT} 0 "STR:$(text_please_wait_1)" + + ; Get progress bar handle. + GetDlgItem $Marquee_Handle $Banner_Handle 1004 + + ; Set PBS_MARQUEE style for the progress bar control. + System::Call "user32::GetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}) i .r1" + System::Call "user32::SetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}, i $1|${PBS_MARQUEE})" + + ; Send PBM_SETMARQUEE message to start the marquee. + ; lParam is time in milliseconds between marquee animation updates. + SendMessage $Marquee_Handle ${PBM_SETMARQUEE} 1 50 + + System::Call "User32::SetWindowPos(i $Banner_Handle, i -1, i 0, i 0, i 0, i 0, i 83)" + + HideWindow + + Call Full_Scan_Old_Versions + + ${If} ${FileExists} "$TEMP\opencpn_hdd_full_scan.tmp" + Delete "$TEMP\opencpn_hdd_quick_scan.tmp" + ${EndIf} + + ;# If install locations were found compare with Registry keys + ${If} $counter_tmp > 0 + ${If} $LM_VERSION_INST != "" + ClearErrors + FileOpen $R0 "$TEMP\opencpn_hdd_full_scan.tmp" r + IfErrors done1 + ${Do} + FileReadUTF16LE $R0 $R1 + ${If} $R1 == "" + Goto done1 + ${Else} + ${TrimNewLines} $R1 $R1 + StrCmp $R1 $R2 done1 + ${EndIf} + ${Loop} + ;# Path from Registry key wasn't found => delete RegKey + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1" + StrCpy $LM_VERSION_INST "" + + done1: + FileClose $R0 + ${EndIf} + + ${If} ${FileExists} "$TEMP\opencpn_old_installs.tmp" + ;# Clear the stack + ClearErrors + ${Do} + Pop $0 + IfErrors empty + ${Loop} + empty: + + ClearErrors + FileOpen $R0 "$TEMP\opencpn_old_installs.tmp" r + + IfErrors done3 + ${Do} + FileReadUTF16LE $R0 $R3 + FileReadUTF16LE $R0 $R2 + ${If} $R3 == "" + Goto done3 + ${Else} + ${TrimNewLines} $R3 $R3 + ${TrimNewLines} $R2 $R2 + FileReadUTF16LE $R0 $R1 + ${TrimNewLines} $R1 $R1 + ClearErrors + FileOpen $0 "$TEMP\opencpn_hdd_full_scan.tmp" r + IfErrors next + ${Do} + FileReadUTF16LE $0 $1 + ${If} $1 == "" + Goto next + ${Else} + ${TrimNewLines} $1 $1 + StrCmp $1 $R1 done2 + ${EndIf} + ${Loop} + ;# Path from Registry key wasn't found => delete RegKey + DeleteRegKey HKU $R3 + Goto next + + done2: + Push $R1 + Push $R2 + Push $R3 + next: + FileClose $0 + ${EndIf} + ${Loop} + done3: + FileClose $R0 + + ClearErrors + FileOpen $R0 "$TEMP\opencpn_old_installs.tmp" w + IfErrors done4 + ${Do} + Pop $R1 + IfErrors done4 + FileWriteUTF16LE $R0 $R1 + FileWriteUTF16LE $R0 "$\r$\n" + ${Loop} + done4: + FileClose $R0 + ${EndIf} + ${EndIf} + + EnableWindow $Button_FullScan_CleanUp 0 ;# Disable the Scan HDD button after scan was done + EnableWindow $Label_FullScan_CleanUp 0 ;# Disable the Scan HDD label after scan was done + SendMessage $GroupBox_CleanUp ${WM_SETTEXT} 0 "STR:$(Install_Location_HDD_Scan)" + + ShowWindow $HWNDPARENT ${SW_SHOW} + BringToFront + + ; Stop the marquee and set the old styles back for the progress bar control. + SendMessage $Marquee_Handle ${PBM_SETMARQUEE} 0 0 + System::Call "user32::SetWindowLong(i $Marquee_Handle, i ${GWL_STYLE}, i $1)" + + Banner::destroy + FunctionEnd +*/ + + Function Button_UnselectAll_CleanUp_Click + SendMessage $ListBox_CleanUp ${LB_SETSEL} FALSE -1 + Call ListBox_CleanUp_Change + FunctionEnd + + Function Button_SelectAll_CleanUp_Click + ${NSD_LB_GetCount} $ListBox_CleanUp $1 + IntOp $1 $1 - 1 + ${If} $1 == 0 + IntOp $1 $1 + 1 + ${EndIf} + SendMessage $ListBox_CleanUp ${LB_SELITEMRANGEEX} 0 $1 + Call ListBox_CleanUp_Change + FunctionEnd + + Function ListBox_CleanUp_Change + SendMessage $ListBox_CleanUp ${LB_GETSELCOUNT} 0 0 $1 + ${NSD_LB_GetCount} $ListBox_CleanUp $2 + ${If} $2 > 0 + ${If} $1 == 0 + EnableWindow $Button_Uninstall_Selected_CleanUp 0 + EnableWindow $Button_UnselectAll_CleanUp 0 + EnableWindow $Button_SelectAll_CleanUp 1 + ${ElseIf} $1 > 0 + ${AndIf} $1 == $2 + EnableWindow $Button_Uninstall_Selected_CleanUp 1 + EnableWindow $Button_UnselectAll_CleanUp 1 + EnableWindow $Button_SelectAll_CleanUp 0 + ${Else} + EnableWindow $Button_Uninstall_Selected_CleanUp 1 + EnableWindow $Button_UnselectAll_CleanUp 1 + EnableWindow $Button_SelectAll_CleanUp 1 + ${EndIf} + ${Else} + EnableWindow $Button_Uninstall_Selected_CleanUp 0 + EnableWindow $Button_UnselectAll_CleanUp 0 + EnableWindow $Button_SelectAll_CleanUp 0 + ${EndIf} + FunctionEnd + +/* + Var Uninstall_Path_Tmp + Function Button_Uninstall_Selected_CleanUp_Click + EnableWindow $Button_Uninstall_Selected_CleanUp 0 + SendMessage $ListBox_CleanUp ${LB_GETSELCOUNT} 0 0 $1 + ${NSD_LB_GetCount} $ListBox_CleanUp $2 + ClearErrors + FileOpen $R0 "$TEMP\opencpn_uninstall.tmp" w + IfErrors done + IntOp $2 $2 - 1 + ${ForEach} $3 $2 0 - 1 + SendMessage $ListBox_CleanUp ${LB_GETSEL} $3 0 $4 + ${If} $4 > 0 + System::Call "User32::SendMessage(i $ListBox_CleanUp, i ${LB_GETTEXT}, i $3, t .r5)" + FileWriteUTF16LE $R0 "$5" + FileWriteUTF16LE $R0 "$\r$\n" + SendMessage $ListBox_CleanUp ${LB_DELETESTRING} $3 0 + ${EndIf} + ${Next} + done: + FileClose $R0 + + Call ListBox_CleanUp_Change + + StrCpy $R8 "" + StrCpy $R7 "" + StrCpy $R6 "" + StrCpy $R5 "" + ${If} ${FileExists} "$TEMP\opencpn_uninstall.tmp" + ${If} ${FileExists} "$TEMP\opencpn_hdd_full_scan.tmp" + StrCpy $R8 "opencpn_hdd_full_scan.tmp" + ${ElseIf} ${FileExists} "$TEMP\opencpn_hdd_quick_scan.tmp" + StrCpy $R8 "opencpn_hdd_quick_scan.tmp" + ${EndIf} + + ${If} ${FileExists} "$TEMP\opencpn_old_installs.tmp" + StrCpy $R7 1 + ${EndIf} + + ${If} ${FileExists} "$TEMP\opencpn_old_uninstall_regkeys.tmp" + StrCpy $R6 1 + ${EndIf} + + ${If} ${FileExists} "$TEMP\opencpn_appdata.tmp" + StrCpy $R5 1 + ${EndIf} + + ClearErrors + FileOpen $R4 "$TEMP\opencpn_uninstall.tmp" r + IfErrors end + loop: + ClearErrors + FileReadUTF16LE $R4 $0 + IfErrors end + StrCmp $0 "" loop + StrCmp $0 "$\r$\n" loop + + ${TrimNewLines} $0 $0 + StrCpy $Uninstall_Path_Tmp $0 + + ;# Delete installation directory + ClearErrors + Call Delete_Installation_Dir + IfErrors 0 +2 + MessageBox MB_OK|MB_ICONEXCLAMATION "Error RMDir: $0" ;#ON ERROR + + ;# If deleted installation was the one in the HKLM ...\OpenCPN_is1 subkey => delete RegKey + ${If} $LM_VERSION_INST != "" + StrCmp $0 $LM_VERSION_INST 0 cont + ClearErrors + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1" + IfErrors 0 +2 + MessageBox MB_OK|MB_ICONEXCLAMATION "Error DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1" ;#ON ERROR + StrCpy $LM_VERSION "" + StrCpy $LM_VERSION_INST "" + StrCpy $LM_VERSION_UNINST "" + ${EndIf} + + cont: + ;# Delete Start Menu shortcuts + Push $Uninstall_Path_Tmp + Call Delete_Start_Menu_Shortcuts + + ;# Delete Desktop shortcuts + Push $Uninstall_Path_Tmp + Call Delete_Desktop_Shortcuts + + ;# Delete RegKeys in HKU Software\opencpn.org\... + ${If} $R7 == 1 + Call Update_Old_Installs + ${EndIf} + + ;# Delete RegKeys in HKU Software\...\Uninstall\OpenCPN + ${If} $R6 == 1 + Call Update_Old_Uninstalls + ${EndIf} + + ;# Delete %APPDATA\opencpn folder + ${If} $R5 == 1 + Call Update_Appdata + ${EndIf} + + ${IfNot} $R8 == "" + Call Update_HDD_Scan + ${EndIf} + + Goto loop + end: + FileClose $R4 + Delete "$TEMP\opencpn_uninstall.tmp" + StrCpy $Uninstall_Path_Tmp "" + ${EndIf} + + ${NSD_LB_GetCount} $ListBox_CleanUp $2 + ${If} $2 == 0 ;# listbox is empty - all were uninstalled + StrCpy $Skip_Page_CleanUp 1 + GetDlgItem $0 $HWNDPARENT 1 + SendMessage $0 ${BM_CLICK} 0 0 + ${EndIf} + FunctionEnd +*/ + +/* + Function Update_HDD_Scan + Push $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $R0 + Push $R8 + ClearErrors + FileOpen $0 "$TEMP\$R8" r ;# open target file for reading + GetTempFileName $R0 ;# get new temp file name + FileOpen $1 $R0 w ;# open temp file for writing + IfErrors end + loop: + FileReadUTF16LE $0 $2 ;# read line from target file + IfErrors done ;# check if end of file reached + ${TrimNewLines} $2 $2 + StrCmp $2 "$Uninstall_Path_Tmp" +2 ;# compare line with search string with CR/LF + FileWriteUTF16LE $1 "$2$\r$\n" ;# write line to temp file + Goto loop + done: + FileClose $0 ;# close target file + FileClose $1 ;# close temp file + Delete "$TEMP\$R8" ;# delete target file + CopyFiles /SILENT $R0 "$TEMP\$R8" ;# copy temp file to target file + Delete $R0 ;# delete temp file + end: + Pop $R8 + Pop $R0 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 + FunctionEnd +*/ + +/* + Function Update_Old_Installs + Push $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $R0 + Push $R1 + ClearErrors + FileOpen $0 "$TEMP\opencpn_old_installs.tmp" r ;# open target file for reading + GetTempFileName $R0 ;# get new temp file name + FileOpen $1 $R0 w ;# open temp file for writing + IfErrors end + loop: + FileReadUTF16LE $0 $4 ;# read line from target file + FileReadUTF16LE $0 $3 ;# read line from target file + FileReadUTF16LE $0 $2 ;# read line from target file + IfErrors done ;# check if end of file reached + ${TrimNewLines} $2 $2 + StrCmp $2 "$Uninstall_Path_Tmp" +5 ;# compare line with search string with CR/LF + FileWriteUTF16LE $1 $4 ;# write line to temp file + FileWriteUTF16LE $1 $3 ;# write line to temp file + FileWriteUTF16LE $1 "$2$\r$\n" ;# write line to temp file + Goto loop + ${TrimNewLines} $4 $4 + DeleteRegKey HKU "$4" + ${WordFind} "$4" "\" "-2{*" $4 + DeleteRegKey /ifempty HKU "$4" + ClearErrors + Goto loop + done: + FileClose $0 ;# close target file + FileClose $1 ;# close temp file + Delete "$TEMP\opencpn_old_installs.tmp" ;# delete target file + CopyFiles /SILENT $R0 "$TEMP\opencpn_old_installs.tmp" ;# copy temp file to target file + Delete $R0 ;# delete temp file + end: + Pop $R1 + Pop $R0 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 + FunctionEnd +*/ + +/* + Function Update_Old_Uninstalls + Push $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $R0 + Push $R1 + ClearErrors + FileOpen $0 "$TEMP\opencpn_old_uninstall_regkeys.tmp" r ;# open target file for reading + GetTempFileName $R0 ;# get new temp file name + FileOpen $1 $R0 w ;# open temp file for writing + IfErrors end + loop: + FileReadUTF16LE $0 $4 ;# read line from target file + FileReadUTF16LE $0 $3 ;# read line from target file + FileReadUTF16LE $0 $2 ;# read line from target file + IfErrors done ;# check if end of file reached + ${TrimNewLines} $2 $2 + StrCmp $2 "$Uninstall_Path_Tmp" +5 ;# compare line with search string with CR/LF + FileWriteUTF16LE $1 $4 ;# write line to temp file + FileWriteUTF16LE $1 $3 ;# write line to temp file + FileWriteUTF16LE $1 "$2$\r$\n" ;# write line to temp file + Goto loop + ${TrimNewLines} $3 $3 + DeleteRegKey HKU "$3" + ClearErrors + Goto loop + done: + FileClose $0 ;# close target file + FileClose $1 ;# close temp file + Delete "$TEMP\opencpn_old_uninstall_regkeys.tmp" ;# delete target file + CopyFiles /SILENT $R0 "$TEMP\opencpn_old_uninstall_regkeys.tmp" ;# copy temp file to target file + Delete $R0 ;# delete temp file + end: + Pop $R1 + Pop $R0 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 + FunctionEnd +*/ + +/* + Function Update_Appdata + Push $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $R0 + Push $R1 + ClearErrors + FileOpen $0 "$TEMP\opencpn_appdata.tmp" r ;# open target file for reading + GetTempFileName $R0 ;# get new temp file name + FileOpen $1 $R0 w ;# open temp file for writing + IfErrors end + loop: + FileReadUTF16LE $0 $4 ;# read line from target file + FileReadUTF16LE $0 $3 ;# read line from target file + FileReadUTF16LE $0 $2 ;# read line from target file + IfErrors done ;# check if end of file reached + ${TrimNewLines} $2 $2 + StrCmp $2 "$Uninstall_Path_Tmp" +5 ;# compare line with search string with CR/LF + FileWriteUTF16LE $1 $4 ;# write line to temp file + FileWriteUTF16LE $1 $3 ;# write line to temp file + FileWriteUTF16LE $1 "$2$\r$\n" ;# write line to temp file + Goto loop + ${TrimNewLines} $3 $3 + RMDir /r "$3\opencpn" + ClearErrors + Goto loop + done: + FileClose $0 ;# close target file + FileClose $1 ;# close temp file + Delete "$TEMP\opencpn_appdata.tmp" ;# delete target file + CopyFiles /SILENT $R0 "$TEMP\opencpn_appdata.tmp" ;# copy temp file to target file + Delete $R0 ;# delete temp file + end: + Pop $R1 + Pop $R0 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 + FunctionEnd +*/ + +/* +;-------------------------------- +;# Page_CleanUp_Leave + Function Page_CleanUp_Leave + ${NSD_LB_GetCount} $ListBox_CleanUp $2 + ${If} $2 > 0 ;# listbox is not empty - not all old versions were uninstalled + MessageBox MB_YESNO|MB_ICONQUESTION "$(Msg_Not_All_Old_Uninstalled)" IDYES leaving + Abort + ${EndIf} + leaving: + SendMessage $ListBox_CleanUp ${LB_RESETCONTENT} 0 0 + FunctionEnd + +*/ + +;-------------------------------- +;# Page_TypeInst +/* Var Label_TypeInst_Reinstall + Var RB_Reinstall + Var Label_TypeInst_Upgrade + Var RB_Upgrade + Var Label_TypeInst_Downgrade + Var RB_Downgrade + Var Label_TypeInst_Parallel + Var GroupBox_TypeInst + Var RB_Parallel + Var TI_REINSTALL + Var TI_UPGRADE + Var TI_DOWNGRADE + Var TI_PARALLEL + Var GroupBox_Size + Var INSTALL_TYPE + */ + Function Page_TypeInst + ${If} $Skip_Page_TypeInst == 1 + Abort + ${EndIf} + ${If} $VERSION_EXISTS == 1 + !insertmacro MUI_HEADER_TEXT $(Page_TypeInst_Title_Exists) $(Page_TypeInst_Subtitle_Exists) + ${ElseIf} $MULTIPLE_INSTALLS == 1 + !insertmacro MUI_HEADER_TEXT $(Page_TypeInst_Title_1) $(Page_TypeInst_Subtitle_1) + ${ElseIf} $MULTIPLE_INSTALLS > 1 + !insertmacro MUI_HEADER_TEXT $(Page_TypeInst_Title) $(Page_TypeInst_Subtitle) + ${EndIf} + + nsDialogs::Create /NOUNLOAD 1018 + Pop $0 + + ${If} $0 == error + Abort + ${EndIf} + + ;Case 1: same version already installed => Option 1: Reinstall + ${If} $VERSION_EXISTS == 1 + ${NSD_CreateLabel} 0 0 100% 40u "$(Label_TypeInst_Reinstall_Text)" + Pop $Label_TypeInst_Reinstall + + ${NSD_CreateRadioButton} 10u 65u 100% 10u "$(RB_Reinstall_TypeInst_Text)" + Pop $RB_Reinstall + ${NSD_AddStyle} $RB_Reinstall ${WS_GROUP} + ${NSD_SetState} $RB_Reinstall ${BST_CHECKED} + + StrCpy $GroupBox_Size 1 + ;Case 2: one older previous installation => Option 1: Upgrade Option 2: Parallel Installation + ${ElseIf} $MULTIPLE_INSTALLS == 1 + ${AndIf} $VERSION_NEWER == 1 + ${NSD_CreateLabel} 0 0 100% 32u "$(Label_TypeInst_Upgrade_Text)" + Pop $Label_TypeInst_Upgrade + + ${NSD_CreateRadioButton} 10u 65u 100% 10u "$(RB_Upgrade_TypeInst_Text)" + Pop $RB_Upgrade + ${NSD_AddStyle} $RB_Upgrade ${WS_GROUP} + ${If} $TI_UPGRADE != "" + ${NSD_SetState} $RB_Upgrade $TI_UPGRADE + ${ElseIf} $TI_UPGRADE == "" + ${AndIf} $TI_PARALLEL == "" + ${NSD_SetState} $RB_Upgrade ${BST_CHECKED} + ${EndIf} +/* + ${NSD_CreateRadioButton} 10u 85u 100% 10u "$(RB_Parallel_TypeInst_Text)" + Pop $RB_Parallel + ${If} $TI_PARALLEL != "" + ${NSD_SetState} $RB_Parallel $TI_PARALLEL + ${EndIf} +*/ + StrCpy $GroupBox_Size 1 + ;Case 3: one newer previous installation => Option 1: Downgrade Option 2: Parallel Installation + ${ElseIf} $MULTIPLE_INSTALLS == 1 + ${AndIf} $VERSION_OLDER == 1 + ${NSD_CreateLabel} 0 0 100% 32u "$(Label_TypeInst_Downgrade_Text)" + Pop $Label_TypeInst_Downgrade + + ${NSD_CreateRadioButton} 10u 65u 100% 10u "$(RB_Downgrade_TypeInst_Text)" + Pop $RB_Downgrade + ${NSD_AddStyle} $RB_Downgrade ${WS_GROUP} + ${If} $TI_DOWNGRADE != "" + ${NSD_SetState} $RB_Upgrade $TI_DOWNGRADE + ${ElseIf} $TI_DOWNGRADE == "" + ${AndIf} $TI_PARALLEL == "" + ${NSD_SetState} $RB_Downgrade ${BST_CHECKED} + ${EndIf} +/* + ${NSD_CreateRadioButton} 10u 85u 100% 10u "$(RB_Parallel_TypeInst_Text)" + Pop $RB_Parallel + ${If} $TI_PARALLEL != "" + ${NSD_SetState} $RB_Parallel $TI_PARALLEL + ${EndIf} +*/ + StrCpy $GroupBox_Size 1 +/* + ;Case 4: more than one previous installation => Option 1: Parallel Installation + ${ElseIf} $MULTIPLE_INSTALLS > 1 + ${NSD_CreateLabel} 0 0 100% 32u "$(Label_TypeInst_Parallel_Text)" + Pop $Label_TypeInst_Parallel + + ${NSD_CreateRadioButton} 10u 65u 100% 10u "$(RB_Parallel_TypeInst_Text)" + Pop $RB_Parallel + ${NSD_AddStyle} $RB_Parallel ${WS_GROUP} + ${NSD_SetState} $RB_Parallel ${BST_CHECKED} + + StrCpy $GroupBox_Size 1 +*/ + ${EndIf} + + ${If} $GroupBox_Size == 1 + ${NSD_CreateGroupBox} 0 50u 100% 35u "Install Type" + Pop $GroupBox_TypeInst + ${ElseIf} $GroupBox_Size == 2 + ${NSD_CreateGroupBox} 0 50u 100% 55u "Install Type" + Pop $GroupBox_TypeInst + ${EndIf} + + nsDialogs::Show + FunctionEnd + +;-------------------------------- +;# Page_TypeInst_Leave + Function Page_TypeInst_Leave + ${If} $RB_Reinstall != "" + ${NSD_GetState} $RB_Reinstall $TI_REINSTALL + ${EndIf} + ${If} $RB_Upgrade != "" + ${NSD_GetState} $RB_Upgrade $TI_UPGRADE + ${EndIf} + ${If} $RB_Downgrade != "" + ${NSD_GetState} $RB_Downgrade $TI_DOWNGRADE + ${EndIf} + ${If} $RB_Parallel != "" + ${NSD_GetState} $RB_Parallel $TI_PARALLEL + ${EndIf} + + StrCpy $Skip_Page_Directory "" + ${If} $TI_REINSTALL == 1 + StrCpy $INSTALL_TYPE 1 + ${ElseIf} $TI_UPGRADE == 1 + StrCpy $INSTALL_TYPE 2 + ${ElseIf} $TI_DOWNGRADE == 1 + StrCpy $INSTALL_TYPE 3 + ${ElseIf} $TI_PARALLEL == 1 + StrCpy $INSTALL_TYPE 4 + ${EndIf} + + ${If} $INSTALL_TYPE == 1 + ${OrIf} $INSTALL_TYPE == 2 + ${OrIf} $INSTALL_TYPE == 3 + StrCpy $Skip_Page_Directory 1 + ReadRegStr $0 HKLM "$Prev_Install_RegKey" "InstallLocation" + StrCpy $INSTDIR $0 + ${EndIf} + + ; On Upgrade or Downgrade, tentatively trim any Package Version trailer from install location + ${If} $INSTALL_TYPE == 2 + ${OrIf} $INSTALL_TYPE == 3 + StrCpy $R1 0 + Push $INSTDIR + Push "OpenCPN\plugins\s63_pi" + Push ">" + Call StrLoc + Pop $0 + + StrCpy $R1 $INSTDIR $0 + StrCpy $R1 "$R1OpenCPN\plugins\s63_pi" + StrLen $R2 $INSTDIR + StrLen $R3 $R1 + +/* + ; If Previous install dir was a parallel, make the upgrade also parallel. + ${If} $R2 > $R3 + StrCpy $INSTDIR "$R1 @CPACK_PACKAGE_VERSION@" + ${Else} + StrCpy $INSTDIR $R1 + ${Endif} +*/ + ${Endif} + + ${If} $INSTALL_TYPE == 4 + StrCpy $INSTDIR "$PROGRAMFILES\OpenCPN\plugins\s63_pi @CPACK_PACKAGE_VERSION@" + ${EndIf} + FunctionEnd + +/* +;-------------------------------- +;# Page_Components_Pre + Function Page_Components_Pre + + FunctionEnd + +;-------------------------------- +;# Page_Components_Show + Function Page_Components_Show + ;# change controls size and position on the Components Page + Push $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + Push $7 + + FindWindow $mui.ComponentsPage "#32770" "" $HWNDPARENT + + ;GetDlgItem $mui.ComponentsPage.Text $mui.ComponentsPage 1006 + GetDlgItem $mui.ComponentsPage.InstTypesText $mui.ComponentsPage 1021 + ShowWindow $mui.ComponentsPage.InstTypesText ${SW_HIDE} + + GetDlgItem $mui.ComponentsPage.ComponentsText $mui.ComponentsPage 1022 + GetDlgItem $mui.ComponentsPage.InstTypes $mui.ComponentsPage 1017 + ShowWindow $mui.ComponentsPage.InstTypes ${SW_HIDE} + + GetDlgItem $mui.ComponentsPage.Components $mui.ComponentsPage 1032 + GetDlgItem $mui.ComponentsPage.DescriptionTitle $mui.ComponentsPage 1042 + GetDlgItem $mui.ComponentsPage.DescriptionText $mui.ComponentsPage 1043 + GetDlgItem $mui.ComponentsPage.SpaceRequired $mui.ComponentsPage 1023 + ShowWindow $mui.ComponentsPage.SpaceRequired ${SW_HIDE} + + Push "198" + Push "40" + Push "100" + Push "100" + Call DU2Pix + System::Call "User32::SetWindowPos(i $mui.ComponentsPage.DescriptionTitle, i 0, i $1, i $2, i $3, i $4, i 64)" ;# 1042 + + Push "203" + Push "50" + Push "90" + Push "85" + Call DU2Pix + System::Call "User32::SetWindowPos(i $mui.ComponentsPage.DescriptionText, i 0, i $1, i $2, i $3, i $4, i 64)" ;# 1043 + + Push "0" + Push "25" + Push "300" + Push "15" + Call DU2Pix + System::Call "User32::SetWindowPos(i $mui.ComponentsPage.ComponentsText, i 0, i $1, i $2, i $3, i $4, i 64)" ;# 1022 + + Push "0" + Push "40" + Push "195" + Push "100" + Call DU2Pix + System::Call "User32::SetWindowPos(i $mui.ComponentsPage.Components, i 0, i $1, i $2, i $3, i $4, i 64)" ;# 1032 + + Pop $7 + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 + FunctionEnd + +;-------------------------------- +;# Page_Components_Leave + Function Page_Components_Leave + ${IfNot} ${SectionIsSelected} ${SecSetConfig} + StrCpy $Skip_Page_SetConfig 1 + ${Else} + StrCpy $Skip_Page_SetConfig 0 + ${EndIf} + + ${IfNot} ${SectionIsSelected} ${SecShortcutStartmenu} + StrCpy $Skip_Page_Startmenu 1 + ${Else} + StrCpy $Skip_Page_Startmenu 0 + ${EndIf} + FunctionEnd +*/ +;-------------------------------- +;# Page_Directory_Pre + Function Page_Directory_Pre + ${If} $Skip_Page_Directory == 1 + Abort + ${EndIf} + FunctionEnd + +;-------------------------------- +;# Page_Directory_Leave + Function Page_Directory_Leave + GetInstDirError $R0 + ${If} $R0 > 0 ;# Invalid path entered + MessageBox MB_OK|MB_ICONSTOP "$(Msg_Path_Invalid)" + Abort + ${EndIf} + + ${If} $INSTALL_TYPE == 4 + ${AndIf} ${FileExists} "$INSTDIR\opencpn.exe" + MessageBox MB_OK|MB_ICONSTOP "$(Msg_Path_Installation_Exists)" + Abort + ${EndIf} + FunctionEnd + + + + + +/* +;-------------------------------- +;# Page_Startmenu_Pre + Function Page_Startmenu_Pre + ${If} $Skip_Page_Startmenu == 1 + Abort + ${EndIf} + + ${If} $INSTALL_TYPE == 1 + ${OrIf} $INSTALL_TYPE == 2 + ${OrIf} $INSTALL_TYPE == 3 + ReadRegStr $0 HKLM "$Prev_Install_RegKey" "StartMenuFolder" + StrCpy $STARTMENU_FOLDER $0 + ${EndIf} + FunctionEnd +*/ +;-------------------------------- +/*# Page_SetConfig + Var Label_SetConfig + Var GroupBox_Language_SetConfig + Var CheckBox_Language_SetConfig + Var GroupBox_ChartDir_SetConfig + Var DirRequest_SetConfig + Var Button_Delete_SetConfig + Var Button_DeleteAll_SetConfig + Var Button_Add_SetConfig + Var ListBox_SetConfig +*/ + +/* + Function Page_SetConfig + ${If} $Skip_Page_SetConfig == 1 + Abort + ${EndIf} + !insertmacro MUI_HEADER_TEXT $(Page_SetConfig_Title) $(Page_SetConfig_Subtitle) + nsDialogs::Create /NOUNLOAD 1018 + Pop $0 + ${If} $0 == error + Abort + ${EndIf} + + ${NSD_CreateLabel} 0 0 100% 16u "$(Label_SetConfig_Text)" + Pop $Label_SetConfig + + ${NSD_CreateGroupBox} 0 20u 100% 30u "$(GB_Language_SetConfig_Text)" + Pop $GroupBox_Language_SetConfig + + ${NSD_CreateCheckBox} 10u 35u 100% 10u "$(CB_Language_SetConfig_Text)" + Pop $CheckBox_Language_SetConfig + ;StrCmp $CONFIG_SET_LANG "" cont + ${If} $CONFIG_SET_LANG == "" + ${NSD_SetState} $CheckBox_Language_SetConfig ${BST_CHECKED} + Goto cont + ${EndIf} + + StrCmp $CONFIG_SET_LANG 0 0 +2 + ${NSD_SetState} $CheckBox_Language_SetConfig ${BST_UNCHECKED} + StrCmp $CONFIG_SET_LANG 1 0 +2 + ${NSD_SetState} $CheckBox_Language_SetConfig ${BST_CHECKED} + + cont: + ${NSD_CreateGroupBox} 0 55u 100% 85u "$(GB_ChartDir_SetConfig_Text)" + Pop $GroupBox_ChartDir_SetConfig + + ${NSD_CreateButton} 220u 70u 60u 15u "$(BT_Delete_SetConfig_Text)" + Pop $Button_Delete_SetConfig + GetFunctionAddress $0 Button_Delete_SetConfig_Click + nsDialogs::OnClick /NOUNLOAD $Button_Delete_SetConfig $0 + + ${NSD_CreateButton} 220u 88u 60u 15u "$(BT_DeleteAll_SetConfig_Text)" + Pop $Button_DeleteAll_SetConfig + GetFunctionAddress $0 Button_DeleteAll_SetConfig_Click + nsDialogs::OnClick /NOUNLOAD $Button_DeleteAll_SetConfig $0 + + ${NSD_CreateButton} 220u 115u 60u 15u "$(BT_Browse_SetConfig_Text)" + Pop $Button_Add_SetConfig + GetFunctionAddress $0 Button_Add_SetConfig_Click + nsDialogs::OnClick /NOUNLOAD $Button_Add_SetConfig $0 + + ${NSD_CreateListBox} 10u 70u 200u 60u $(LB_SetConfig) + Pop $ListBox_SetConfig + GetFunctionAddress $0 ListBox_SetConfig_Change + nsDialogs::OnChange /NOUNLOAD $ListBox_SetConfig $0 + ${IfNot} $CHART_DIR_EMPTY == 1 + SetShellVarContext all + ${If} ${FileExists} "$TEMP\opencpn_chart_dirs.tmp" + ClearErrors + FileOpen $R0 "$TEMP\opencpn_chart_dirs.tmp" r + IfErrors end + loop: + ClearErrors + FileReadUTF16LE $R0 $1 + IfErrors end + ${TrimNewLines} $1 $1 + SendMessage $ListBox_SetConfig ${LB_ADDSTRING} 0 "STR:$1" + Goto loop + end: + FileClose $R0 + ${ElseIf} $INI_EXISTS == 1 + StrCpy $R2 0 + loop2: + IntOp $R2 $R2 + 1 + ReadINIStr $R1 "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" "ChartDirectories" "ChartDir$R2" + StrCmp $R1 "" cont2 + ${WordReplace} "$R1" "\\" "\" "+" $R3 + ${Explode} $R4 "^" "$R3" + Pop $R5 + StrCmp $R5 "" cont2 + SendMessage $ListBox_SetConfig ${LB_ADDSTRING} 0 "STR:$R5" + Goto loop2 + ${Else} + ReadRegStr $0 HKLM "Software\OpenCPN" "ChartDirs" + StrCmp $0 "" cont2 + ${Explode} $3 ";" "$0" + ${For} $1 1 $3 + Pop $2 + ${TrimNewLines} $2 $2 + SendMessage $ListBox_SetConfig ${LB_ADDSTRING} 0 "STR:$2" + ${Next} + ${EndIf} + ${EndIf} + + cont2: + Call ListBox_SetConfig_Change + nsDialogs::Show + FunctionEnd + + Function Button_Delete_SetConfig_Click + SendMessage $ListBox_SetConfig ${LB_GETCURSEL} 0 0 $0 + SendMessage $ListBox_SetConfig ${LB_DELETESTRING} $0 0 + Call ListBox_SetConfig_Change + FunctionEnd + + Function Button_DeleteAll_SetConfig_Click + SendMessage $ListBox_SetConfig ${LB_RESETCONTENT} 0 0 + Call ListBox_SetConfig_Change + FunctionEnd + + Function Button_Add_SetConfig_Click + Var /GLOBAL Initial_Dir + StrCmp $Initial_Dir "" 0 +3 + SetShellVarContext all + StrCpy $Initial_Dir "$DOCUMENTS" + nsDialogs::SelectFolderDialog /NOUNLOAD "$(Select_Chart_Directory)" "$Initial_Dir" + Pop $0 + ${If} $0 == error + Abort + ${EndIf} + StrCpy $Initial_Dir $0 + ${NSD_LB_GetCount} $ListBox_SetConfig $2 + ${If} $2 > 0 + SendMessage $ListBox_SetConfig ${LB_FINDSTRINGEXACT} -1 "STR:$0" $6 + ${IfNot} $6 < 0 + Goto end + ${EndIf} + ${EndIf} + SendMessage $ListBox_SetConfig ${LB_ADDSTRING} 0 "STR:$0" + end: + Call ListBox_SetConfig_Change + FunctionEnd + + Function ListBox_SetConfig_Change + ${NSD_LB_GetCount} $ListBox_SetConfig $0 + ${If} $0 > 0 + StrCpy $CHART_DIR_EMPTY 0 + ${NSD_LB_GetSelection} $ListBox_SetConfig $1 + ${If} $1 != "" + EnableWindow $Button_Delete_SetConfig 1 + ${Else} + EnableWindow $Button_Delete_SetConfig 0 + ${EndIf} + EnableWindow $Button_DeleteAll_SetConfig 1 + ${Else} + EnableWindow $Button_Delete_SetConfig 0 + EnableWindow $Button_DeleteAll_SetConfig 0 + StrCpy $CHART_DIR_EMPTY 1 + ${EndIf} + FunctionEnd + +*/ +/* +;-------------------------------- +# Page_SetConfig_Leave +# Var CHART_DIR_TMP_FILE + + Function Page_SetConfig_Leave + ${NSD_LB_GetCount} $ListBox_SetConfig $0 + ${If} $0 > 0 + ClearErrors + FileOpen $R0 "$TEMP\opencpn_chart_dirs.tmp" w + IfErrors done + IntOp $0 $0 - 1 + ${For} $1 0 $0 + SendMessage $ListBox_SetConfig ${LB_SETCURSEL} $1 0 + System::Call "User32::SendMessage(i $ListBox_SetConfig, i ${LB_GETTEXT}, i $1, t .r2)" + FileWriteUTF16LE $R0 $2 + FileWriteUTF16LE $R0 "$\r$\n" + ${Next} + FileClose $R0 + StrCpy $CHART_DIR_TMP_FILE 1 + ${Else} + StrCpy $CHART_DIR_EMPTY 1 + ${EndIf} + + done: + ${NSD_GetState} $CheckBox_Language_SetConfig $0 + ${If} $0 == ${BST_CHECKED} + StrCpy $CONFIG_SET_LANG 1 + ${Else} + StrCpy $CONFIG_SET_LANG 0 + ${EndIf} + FunctionEnd +*/ +;-------------------------------- +;# Page_Confirm + Var Install_Options + Var TEXT_INSTALL_OPTIONS + Function Page_Confirm + !insertmacro MUI_HEADER_TEXT $(Page_Confirm_Title) $(Page_Confirm_Subtitle) + ;# gather all installation settings and prepare (string) variable '$Install_Options' to display + ;# add the installation type to '$Install_Options' + StrCpy $Install_Options "$(Installation_Type):$\r$\n" + ${If} $Skip_Page_TypeInst != 1 + ${Switch} $INSTALL_TYPE + ${Case} 1 + StrCpy $Install_Options "$Install_Options$\t$(Type_Reinstall)" + ${Break} + ${Case} 2 + StrCpy $Install_Options "$Install_Options$\t$(Type_Upgrade)" + ${Break} + ${Case} 3 + StrCpy $Install_Options "$Install_Options$\t$(Type_Downgrade)" + ${Break} + ${Case} 4 + StrCpy $Install_Options "$Install_Options$\t$(Type_Parallel_Installation)" + ${Break} + ${Default} + ${Break} + ${EndSwitch} + ${Else} + StrCpy $Install_Options "$Install_Options$\t$(Type_Fresh_Installation)" + ${EndIf} + + ;# add the installation directory to '$Install_Options' + StrCpy $Install_Options "$Install_Options$\r$\n$\r$\n$(Installation_Directory):$\r$\n$\t$INSTDIR" + +/* + ;# add the delete config settings to '$Install_Options' + ${If} $CONFIG_EXISTS == 1 + ${AndIf} $CONFIG_EMPTY != 1 + StrCpy $Install_Options "$Install_Options$\r$\n$\r$\n$(Installation_Delete_Config):" + SectionGetFlags ${SecGrpResetConfig} $0 + SectionGetFlags ${SecGrpResetConfig} $1 + IntOp $0 $0 & ${SF_SELECTED} + IntOp $1 $1 & ${SF_PSELECTED} + StrCmp $0 0 +3 0 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecGrpResetConfig_Text)" + Goto cont + + StrCmp $1 0 none_selected 0 + SectionGetFlags ${SecDeleteConfigFile} $0 + IntOp $0 $0 & ${SF_SELECTED} + StrCmp $0 0 +2 0 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteConfigFile_Text)" + SectionGetFlags ${SecDeleteChartDB} $0 + IntOp $0 $0 & ${SF_SELECTED} + StrCmp $0 0 +2 0 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteChartDB_Text)" + SectionGetFlags ${SecDeleteSENC} $0 + IntOp $0 $0 & ${SF_SELECTED} + StrCmp $0 0 +2 0 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteSENC_Text)" + SectionGetFlags ${SecDeleteCM93} $0 + IntOp $0 $0 & ${SF_SELECTED} + StrCmp $0 0 +2 0 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteCM93_Text)" + SectionGetFlags ${SecDeleteNavobjFile} $0 + IntOp $0 $0 & ${SF_SELECTED} + StrCmp $0 0 +2 0 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteNavobjFile_Text)" + SectionGetFlags ${SecDeleteLogFile} $0 + IntOp $0 $0 & ${SF_SELECTED} + StrCmp $0 0 +2 0 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(SecDeleteLogFile_Text)" + Goto cont + + none_selected: + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(text_none)" + + cont: + ${EndIf} +*/ + +/* + ;# add the shortcut settings to '$Install_Options' + StrCpy $Install_Options "$Install_Options$\r$\n$\r$\n$(Create_Shortcuts):" + SectionGetFlags ${SecShortcutStartmenu} $0 + IntOp $0 $0 & ${SF_SELECTED} + ${If} $0 != 0 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(Create_Shortcut_Start_Menu): $STARTMENU_FOLDER" + StrCpy $2 1 + ${Else} + StrCpy $2 0 + ${EndIf} + + SectionGetFlags ${SecShortcutDesktop} $0 + IntOp $0 $0 & ${SF_SELECTED} + ${If} $0 != 0 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(Create_Shortcut_Desktop): $DESKTOP" + ${Else} + StrCmp $2 0 0 +2 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(text_none)" + ${EndIf} +*/ + +/* + ;# add the pre-config settings to '$Install_Options' + ${IfNot} ${SectionIsReadOnly} ${SecSetConfig} + ${AndIf} ${SectionIsSelected} ${SecSetConfig} + StrCpy $Install_Options "$Install_Options$\r$\n$\r$\n$(SecSetConfig_Text):" + StrCmp $CONFIG_SET_LANG 1 0 +2 + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(CB_Language_SetConfig_Text)" + StrCmp $CHART_DIR_TMP_FILE 1 0 end + IfFileExists "$TEMP\opencpn_chart_dirs.tmp" 0 end + StrCpy $Install_Options "$Install_Options$\r$\n$\t$(GB_ChartDir_SetConfig_Text)" + ClearErrors + FileOpen $0 "$TEMP\opencpn_chart_dirs.tmp" r + IfErrors end + ${Do} + FileReadUTF16LE $0 $1 + IfErrors done + ${TrimNewLines} $1 $1 + StrCmp $1 "" +2 + StrCpy $Install_Options "$Install_Options$\r$\n$\t - $1" + ${Loop} + done: + FileClose $0 + end: + ${EndIf} + ;# end '$Install_Options' +*/ + nsDialogs::Create /NOUNLOAD 1018 + Pop $0 + ${If} $0 == error + Abort + ${EndIf} + + nsDialogs::CreateControl EDIT "${__NSD_Text_STYLE}|${WS_VSCROLL}|${WS_HSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN}|${ES_READONLY}" "${__NSD_Text_EXSTYLE}" 0 0 100% 100% "$Install_Options" + Pop $TEXT_INSTALL_OPTIONS + + nsDialogs::Show + FunctionEnd + +;# Page_Instfiles_Show + Function Page_Instfiles_Show + w7tbp::Start + FunctionEnd + +;-------------------------------- +;################################################################################################## +;# General Installer Functions # +;################################################################################################## +Function GetAllUsers + ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName" + System::Call 'netapi32::NetUserEnum(w "\\$0",i 0,i 2,*i .R0,i ${NSIS_MAX_STRLEN}, *i .R1,*i .R2,*i .r1)i .r2' + StrCpy $R8 $R0 + IntOp $R2 $R2 - 1 + ${ForEach} $9 0 $R2 + 1 + System::Call "*$R0(w.R9)" + MessageBox MB_OK "[$R9]" + IntOp $R0 $R0 + 4 + ${Next} + System::Call 'netapi32.dll::NetApiBufferFree(i R8)i .R1' +FunctionEnd + + +Function Hide_SecGrpResetConfig + Push $0 + !insertmacro ClearSectionFlag ${SecDeleteConfigFile} ${SF_SELECTED} + SectionSetText ${SecDeleteConfigFile} "" + !insertmacro ClearSectionFlag ${SecDeleteChartDB} ${SF_SELECTED} + SectionSetText ${SecDeleteChartDB} "" + !insertmacro ClearSectionFlag ${SecDeleteSENC} ${SF_SELECTED} + SectionSetText ${SecDeleteSENC} "" + !insertmacro ClearSectionFlag ${SecDeleteCM93} ${SF_SELECTED} + SectionSetText ${SecDeleteCM93} "" + !insertmacro ClearSectionFlag ${SecDeleteNavobjFile} ${SF_SELECTED} + SectionSetText ${SecDeleteNavobjFile} "" + !insertmacro ClearSectionFlag ${SecDeleteLogFile} ${SF_SELECTED} + SectionSetText ${SecDeleteLogFile} "" + !insertmacro ClearSectionFlag ${SecGrpResetConfig} ${SF_SECGRP} + !insertmacro ClearSectionFlag ${SecGrpResetConfig} ${SF_SELECTED} + SectionSetFlags ${SecGrpResetConfig} 0 + SectionSetText ${SecGrpResetConfig} "" + IntOp $0 ${SecDeleteLogFile} + 1 + !insertmacro ClearSectionFlag $0 ${SF_SECGRPEND} + SectionSetText $0 "" + Pop $0 +FunctionEnd + + +Function Check_Config_Exists + ;# Look for config dir ("%APPDATA%\opencpn) and the several config files + SetShellVarContext all + + ${IfNot} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" + ${If} ${FileExists} "$USERS_APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" + CreateDirectory "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" + Sleep 250 + AccessControlW::GrantOnFile "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" "(BU)" "GenericRead + GenericExecute + GenericWrite + Delete + FullAccess" + CopyFiles /SILENT "$USERS_APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" + ${ElseIf} ${FileExists} "$ADMIN_APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" + CreateDirectory "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" + Sleep 250 + AccessControlW::GrantOnFile "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" "(BU)" "GenericRead + GenericExecute + GenericWrite + Delete + FullAccess" + CopyFiles /SILENT "$ADMIN_APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@" + ${EndIf} + + ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" + DeleteINISec "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" Directories + ${EndIf} + ${EndIf} + + ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\*.*" + StrCpy $CONFIG_EXISTS 1 + SectionSetText ${SecGrpResetConfig} $(SecGrpResetConfig_Text) + ${EndIf} + StrCpy $Count_SecGrpResetConfig 0 + ${If} $CONFIG_EXISTS == 1 + ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" + StrCpy $INI_EXISTS 1 + IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 + SectionSetText ${SecDeleteConfigFile} $(SecDeleteConfigFile_Text) + ${Else} + !insertmacro ClearSectionFlag ${SecDeleteConfigFile} ${SF_SELECTED} + SectionSetText ${SecDeleteConfigFile} "" + ${EndIf} + + ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\CHRTLIST.DAT" + StrCpy $CHARTDB_EXISTS 1 + IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 + SectionSetText ${SecDeleteChartDB} $(SecDeleteChartDB_Text) + ${Else} + !insertmacro ClearSectionFlag ${SecDeleteChartDB} ${SF_SELECTED} + SectionSetText ${SecDeleteChartDB} "" + ${EndIf} + + ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\SENC\*.*" + StrCpy $SENC_EXISTS 1 + IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 + SectionSetText ${SecDeleteSENC} $(SecDeleteSENC_Text) + ${Else} + !insertmacro ClearSectionFlag ${SecDeleteSENC} ${SF_SELECTED} + SectionSetText ${SecDeleteSENC} "" + ${EndIf} + + ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\cm93\*.*" + StrCpy $CM93_EXISTS 1 + IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 + SectionSetText ${SecDeleteCM93} $(SecDeleteCM93_Text) + ${Else} + !insertmacro ClearSectionFlag ${SecDeleteCM93} ${SF_SELECTED} + SectionSetText ${SecDeleteCM93} "" + ${EndIf} + + ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\navobj.xml" + StrCpy $NAVOBJ_EXISTS 1 + IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 + SectionSetText ${SecDeleteNavobjFile} $(SecDeleteNavobjFile_Text) + ${Else} + !insertmacro ClearSectionFlag ${SecDeleteNavobjFile} ${SF_SELECTED} + SectionSetText ${SecDeleteNavobjFile} "" + ${EndIf} + + ${If} ${FileExists} "$APPDATA\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.log" + StrCpy $LOG_EXISTS 1 + IntOp $Count_SecGrpResetConfig $Count_SecGrpResetConfig + 1 + SectionSetText ${SecDeleteLogFile} $(SecDeleteLogFile_Text) + ${Else} + !insertmacro ClearSectionFlag ${SecDeleteLogFile} ${SF_SELECTED} + SectionSetText ${SecDeleteLogFile} "" + ${EndIf} + + ${If} $Count_SecGrpResetConfig == 0 + StrCpy $CONFIG_EMPTY 1 + ${EndIf} + + !insertmacro ClearSectionFlag ${SecSetConfig} ${SF_SELECTED} + IntOp $0 ${SF_RO} | ${SF_BOLD} + SectionSetFlags ${SecSetConfig} $0 + ;SectionSetFlags ${SecSetConfig} ${SF_RO} + StrCpy $SetConfig 0 + ${EndIf} +FunctionEnd + + +Function Reg_Scan_Old_Versions_HKLM + ;# Registry look-up + ;# Versions prior to 2.2.727 write RegKey "OpenCPN_is1" to "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" + ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1 "DisplayName" + ${If} $0 != "" + ${StrFilter} "$0" "31" "." " " $1 + StrCpy $LM_VERSION "$1" + ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1 "UninstallString" + ${StrFilter} "$0" "" "" "$\"" $2 + ${If} ${FileExists} "$2" + ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1 "QuietUninstallString" + ${StrFilter} "$0" "" "" "$\"" $3 + StrCpy $LM_VERSION_UNINST $3 + ReadRegStr $4 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1 "InstallLocation" + ${TrimNewLines} $4 $4 + ${If} ${FileExists} "$4opencpn.exe" + ${AndIf} ${FileExists} "$4unins*.exe" + ;# check if last character of $4 is a "\" and if so remove it + ${RIndexOf} $6 "$4" "\" + ${If} $6 == 1 + ${WordReplace} "$4" "\" "" "-1" $4 + ${EndIf} + + StrCpy $LM_VERSION_INST $4 + IntOp $OLD_INSTALLS $OLD_INSTALLS + 1 + ;StrCpy $VERSION_NEWER 1 + ${Else} + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN_is1" + StrCpy $LM_VERSION "" + StrCpy $LM_VERSION_UNINST "" + ${EndIf} + ${EndIf} + ${EndIf} +FunctionEnd + + +Function EnumProfileList + ${EnumHKU} Callback_EnumProfileList opencpn-inst-tmp-sid +FunctionEnd + + +Function Callback_EnumProfileList + ;# Get the SID or tmpkey from the stack + Pop $SID + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_users_sid.tmp" + FileOpen $R0 "$TEMP\opencpn_users_sid.tmp" a + FileSeek $R0 0 END + ${Else} + FileOpen $R0 "$TEMP\opencpn_users_sid.tmp" w + ${EndIf} + + IfErrors done + FileWriteUTF16LE $R0 "$SID" + FileWriteUTF16LE $R0 "$\r$\n" + FileWriteUTF16LE $R0 "$USERPROFILE" + FileWriteUTF16LE $R0 "$\r$\n" + FileClose $R0 + done: +FunctionEnd + + +Function Get_Users_Values + Var /GLOBAL tmp_file_handle + StrCpy $SID "" + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_users_sid.tmp" + FileOpen $tmp_file_handle "$TEMP\opencpn_users_sid.tmp" r + IfErrors end + ${Do} + FileReadUTF16LE $tmp_file_handle $SID + FileReadUTF16LE $tmp_file_handle $USERPROFILE + StrCmp $SID "" done + ${TrimNewLines} $SID $SID + ${TrimNewLines} $USERPROFILE $USERPROFILE + ;# List of functions to call + Call Users_Appdata_Paths + Call Users_StartMenu_Paths + Call Users_Desktop_Paths + Call Users_Personal_Paths + Call Reg_Scan_Old_Versions_HKCU + ${Loop} + done: + FileClose $tmp_file_handle + StrCpy $SID "" + StrCpy $USERPROFILE "" + ${EndIf} + end: +FunctionEnd + + +Function Users_Appdata_Paths + ReadRegStr $1 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" AppData + ${WordReplace} "$1" "%USERPROFILE%" "$USERPROFILE" "+" $2 + ExpandEnvStrings $2 $2 + StrCmp $2 "" done + + StrCpy $5 "none" + ;# check if an OpenCPN config folder exists in the given path + ${If} ${FileExists} "$2\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" + ReadINIStr $3 "$2\@CPACK_NSIS_PACKAGE_NAME_LC@\opencpn.ini" Directories S57DataLocation + ${WordReplace} "$3" "\\" "\" "+" $4 + ${WordFind} "$4" "\" "-2{*" $5 + StrCmp $5 "" 0 +2 + StrCpy $5 "none" + ${EndIf} + + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_appdata.tmp" + FileOpen $R0 "$TEMP\opencpn_appdata.tmp" a + FileSeek $R0 0 END + ${Else} + FileOpen $R0 "$TEMP\opencpn_appdata.tmp" w + ${EndIf} + IfErrors done + FileWriteUTF16LE $R0 "$SID" + FileWriteUTF16LE $R0 "$\r$\n" + FileWriteUTF16LE $R0 "$2" + FileWriteUTF16LE $R0 "$\r$\n" + FileWriteUTF16LE $R0 "$5" + FileWriteUTF16LE $R0 "$\r$\n" + FileClose $R0 + done: +FunctionEnd + + +Function Users_Personal_Paths + ReadRegStr $1 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" Personal + ${WordReplace} "$1" "%USERPROFILE%" "$USERPROFILE" "+" $2 + ExpandEnvStrings $2 $2 + + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_personal.tmp" + FileOpen $R0 "$TEMP\opencpn_personal.tmp" a + IfErrors done + FileSeek $R0 0 END + ${Else} + FileOpen $R0 "$TEMP\opencpn_personal.tmp" w + IfErrors done + ${EndIf} + + FileWriteUTF16LE $R0 "$SID" + FileWriteUTF16LE $R0 "$\r$\n" + FileWriteUTF16LE $R0 "$2" + FileWriteUTF16LE $R0 "$\r$\n" + FileClose $R0 + done: +FunctionEnd + + +Function Users_StartMenu_Paths + ReadRegStr $1 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "Start Menu" + ${WordReplace} "$1" "%USERPROFILE%" "$USERPROFILE" "+" $2 + ExpandEnvStrings $2 $2 + + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_startmenu.tmp" + FileOpen $R0 "$TEMP\opencpn_startmenu.tmp" a + FileSeek $R0 0 END + ${Else} + FileOpen $R0 "$TEMP\opencpn_startmenu.tmp" w + ${EndIf} + IfErrors done + FileWriteUTF16LE $R0 "$SID" + FileWriteUTF16LE $R0 "$\r$\n" + FileWriteUTF16LE $R0 "$2" + FileWriteUTF16LE $R0 "$\r$\n" + FileClose $R0 + done: +FunctionEnd + + +Function Users_Desktop_Paths + ReadRegStr $1 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" Desktop + ${WordReplace} "$1" "%USERPROFILE%" "$USERPROFILE" "+" $2 + ExpandEnvStrings $2 $2 + + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_desktop.tmp" + FileOpen $R0 "$TEMP\opencpn_desktop.tmp" a + FileSeek $R0 0 END + ${Else} + FileOpen $R0 "$TEMP\opencpn_desktop.tmp" w + ${EndIf} + IfErrors done + FileWriteUTF16LE $R0 "$SID" + FileWriteUTF16LE $R0 "$\r$\n" + FileWriteUTF16LE $R0 "$2" + FileWriteUTF16LE $R0 "$\r$\n" + FileClose $R0 + done: +FunctionEnd + + +;Var latest_version +;Var latest_pathexe +Function Reg_Scan_Old_Versions_HKCU + ;# Versions from 2.2.727 up to 2.2.xxxx write RegKey "OpenCPN" to "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\" + ;# and also RegKey "OpenCPN " to "HKCU\Software\opencpn.org\" + ;# Find latest installed version => it's the one found in "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN" + + ReadRegStr $0 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN" "DisplayVersion" + ${If} $0 != "" + StrCpy $latest_version $0 + ReadRegStr $0 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN" "DisplayIcon" + StrCpy $latest_pathexe $0 + ReadRegStr $0 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN" "UninstallString" + ;StrCpy $CU_VERSION_UNINST $0 + ${WordFind} "$0" "\" "-2{*" $1 + ${If} ${FileExists} "$1\opencpn.exe" + ${AndIf} ${FileExists} "$1\unins*.exe" + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_old_uninstall_regkeys.tmp" + FileOpen $R0 "$TEMP\opencpn_old_uninstall_regkeys.tmp" a + FileSeek $R0 0 END + ${Else} + FileOpen $R0 "$TEMP\opencpn_old_uninstall_regkeys.tmp" w + ${EndIf} + + IfErrors done + FileWriteUTF16LE $R0 "$SID$\r$\n" + FileWriteUTF16LE $R0 "$SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN$\r$\n" + FileWriteUTF16LE $R0 "$1$\r$\n" + FileClose $R0 + ${Else} + DeleteRegKey HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenCPN" + ${EndIf} + ${EndIf} + + done: + ClearErrors + ${Do} + Pop $0 + IfErrors empty + ${Loop} + empty: + StrCpy $0 0 + StrCpy $1 "" + ${Do} + EnumRegKey $1 HKU "$SID\Software\opencpn.org" $0 + StrCmp $1 "" done1 + IntOp $0 $0 + 1 + Push $1 + ${Loop} + done1: + ${If} $0 > 0 + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_old_installs.tmp" + FileOpen $R0 "$TEMP\opencpn_old_installs.tmp" a + FileSeek $R0 0 END + ${Else} + FileOpen $R0 "$TEMP\opencpn_old_installs.tmp" w + ${EndIf} + IfErrors done2 + ${Do} + Pop $R1 + IfErrors finished + ${StrFilter} "$R1" "31" "." " " $R2 ;# R2 = version + ;StrCpy $CU_VERSION $R2 + ReadRegStr $R3 HKU "$SID\Software\opencpn.org\$R1" "" ;# R3 = install path + ReadRegStr $R4 HKU "$SID\Software\opencpn.org\$R1" "Start Menu Folder" ;# R4 = Start Menu Folder + ReadRegStr $R5 HKU "$SID\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "Start Menu" ;# R5 = Start Menu Path + ${WordReplace} "$R5" "%USERPROFILE%" "$USERPROFILE" "+" $R5 + ExpandEnvStrings $R5 $R5 + ;StrCpy $CU_VERSION_INST "$R3\" + ${If} "$R3\opencpn.exe" == $latest_pathexe + ${AndIf} $R2 != $latest_version + DeleteRegKey HKU "$SID\Software\opencpn.org\$R1" + ${ElseIf} ${FileExists} "$R3\opencpn.exe" + ${AndIf} ${FileExists} "$R3\unins*.exe" + FileWriteUTF16LE $R0 "$SID\Software\opencpn.org\$R1" + FileWriteUTF16LE $R0 "$\r$\n" + FileWriteUTF16LE $R0 "$R5\$R4" + FileWriteUTF16LE $R0 "$\r$\n" + FileWriteUTF16LE $R0 "$R3" + FileWriteUTF16LE $R0 "$\r$\n" + IntOp $OLD_INSTALLS $OLD_INSTALLS + 1 + ;StrCpy $VERSION_NEWER 1 + ${Else} + DeleteRegKey HKU "$SID\Software\opencpn.org\$R1" + DeleteRegKey /ifempty HKU "$SID\Software\opencpn.org" + ${EndIf} + ${Loop} + finished: + FileClose $R0 + ${Else} + DeleteRegKey HKU "$SID\Software\opencpn.org" + ${EndIf} + + done2: + StrCpy $latest_version "" + StrCpy $latest_pathexe "" +FunctionEnd + + +Function Quick_Scan_Old_Versions + ;# Scan the given Drive for file "opencpn.exe" + ${If} ${FileExists} "$TEMP\opencpn_personal.tmp" + ClearErrors + FileOpen $R0 "$TEMP\opencpn_personal.tmp" r + IfErrors end + ${Do} + FileReadUTF16LE $R0 $R1 + FileReadUTF16LE $R0 $R2 + IfErrors done + StrCmp $R2 "" done + ${TrimNewLines} $R2 $R2 + ${Locate} "$R2" "/L=F /M=opencpn.exe" "Found_OpenCPN_Installation" + ${Loop} + done: + FileClose $R0 + ${EndIf} + + end: + ${Locate} "$PROGRAMFILES" "/L=F /M=opencpn.exe" "Found_OpenCPN_Installation" +FunctionEnd + + +Function Found_OpenCPN_Installation + Push $R0 + Push $R1 + ${If} ${FileExists} "$R8\unins*.exe" + ${If} ${FileExists} "$TEMP\opencpn_prev_installs.tmp" + ClearErrors + FileOpen $R1 "$TEMP\opencpn_prev_installs.tmp" r + IfErrors cont + ${Do} + FileReadUTF16LE $R1 $R2 + FileReadUTF16LE $R1 $R3 + StrCmp $R2 "" done + ${TrimNewLines} $R2 $R2 + ${TrimNewLines} $R3 $R3 + StrCmp $R3 $R8 found + ${LoopUntil} $R2 == "" + done: + FileClose $R1 + Goto cont + + found: + FileClose $R1 + Goto end + ${EndIf} + + cont: + IntOp $counter_tmp $counter_tmp + 1 + ClearErrors + ${IfNot} ${FileExists} "$TEMP\opencpn_hdd_quick_scan.tmp" + FileOpen $R0 "$TEMP\opencpn_hdd_quick_scan.tmp" w + IfErrors end + ${Else} + FileOpen $R0 "$TEMP\opencpn_hdd_quick_scan.tmp" a + IfErrors end + FileSeek $R0 0 END + ${EndIf} + + FileWriteUTF16LE $R0 "$R8" + FileWriteUTF16LE $R0 "$\r$\n" + FileClose $R0 + ${EndIf} + + end: + Pop $R1 + Pop $R0 + Push $0 +FunctionEnd + + +;Var counter_tmp +Function Full_Scan_Old_Versions + ;# Get all HDD Drive Letters on the system + StrCpy $counter_tmp 0 + ${GetDrives} "HDD" "Scan_Drive" +FunctionEnd + + +Function Scan_Drive + ;# Scan the given Drive for file "opencpn.exe" + /*;#DEBUG - scan only crtain drives + ${IfNot} $9 == "D:\" + ;${AndIfNot} $9 == "F:\" + Goto end + ${EndIf} + ;#DEBUG End */ + StrCpy $3 "$(Banner_Scan_Drive)" + GetDlgItem $2 $Banner_Handle 76 + SendMessage $2 ${WM_SETTEXT} 0 "STR:$3" + ${Locate} "$9" "/L=F /M=opencpn.exe" "Found_OCPN_Exe" + end: + Push $0 +FunctionEnd + + +Function Found_OCPN_Exe + Push $1 + ClearErrors + StrCpy $1 0 + StrCpy $2 0 + ${WordFind} "$R8" "\RECYCLER\" "E*" $1 + ${WordFind} "$R8" "\$$Recycle.Bin" "E*" $2 + IfErrors 0 cont1 + ${If} $1 == 1 + ${AndIf} $2 == 1 + Goto cont2 + ${EndIf} + + cont1: + ${If} $1 > 0 + ${OrIf} $2 > 0 + Goto end + ${EndIf} + + cont2: + ${If} ${FileExists} "$R8\unins*.exe" + ${If} ${FileExists} "$TEMP\opencpn_prev_installs.tmp" + ClearErrors + FileOpen $R1 "$TEMP\opencpn_prev_installs.tmp" r + IfErrors cont3 + ${Do} + FileReadUTF16LE $R1 $R2 + FileReadUTF16LE $R1 $R3 + StrCmp $R2 "" done + ${TrimNewLines} $R2 $R2 + ${TrimNewLines} $R3 $R3 + StrCmp $R3 $R8 found + ${LoopUntil} $R2 == "" + done: + FileClose $R1 + Goto cont3 + + found: + FileClose $R1 + Goto end + ${EndIf} + + cont3: + IntOp $counter_tmp $counter_tmp + 1 + GetDlgItem $2 $Banner_Handle 1030 + StrCmp $counter_tmp 1 0 +3 + StrCpy $R4 "$(Banner_Installation_Found_Singular)" + Goto +2 + StrCpy $R4 "$(Banner_Installation_Found_Plural)" + SendMessage $2 ${WM_SETTEXT} 0 "STR:$R4" + SendMessage $ListBox_CleanUp ${LB_ADDSTRING} 0 "STR:$R8" + ClearErrors + ${IfNot} ${FileExists} "$TEMP\opencpn_hdd_full_scan.tmp" + FileOpen $R0 "$TEMP\opencpn_hdd_full_scan.tmp" w + IfErrors end + ${Else} + FileOpen $R0 "$TEMP\opencpn_hdd_full_scan.tmp" a + IfErrors end + FileSeek $R0 0 END + ${EndIf} + + FileWriteUTF16LE $R0 "$R8" + FileWriteUTF16LE $R0 "$\r$\n" + FileClose $R0 + end: + ${EndIf} + Pop $1 + Push $0 +FunctionEnd + + +Function Delete_Installation_Dir + StrCmp $Uninstall_Path_Tmp "" end + ;# Check subdirs and remove them recursive ... + ${If} ${FileExists} "$Uninstall_Path_Tmp\doc\*.*" + RMDir /r "$Uninstall_Path_Tmp\doc" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\lang\*.*" + RMDir /r "$Uninstall_Path_Tmp\lang" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\Microsoft.VC80.CRT\*.*" + RMDir /r "$Uninstall_Path_Tmp\Microsoft.VC80.CRT" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\s57data\*.*" + RMDir /r "$Uninstall_Path_Tmp\s57data" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\sounds\*.*" + RMDir /r "$Uninstall_Path_Tmp\sounds" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\TCDATA\*.*" + RMDir /r "$Uninstall_Path_Tmp\TCDATA" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\gshhs\*.*" + RMDir /r "$Uninstall_Path_Tmp\gshhs" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\plugins\*.*" + RMDir /r "$Uninstall_Path_Tmp\plugins" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\share\*.*" + RMDir /r "$Uninstall_Path_Tmp\share" + ${EndIf} + + ;# Check files and delete them ... + ${If} ${FileExists} "$Uninstall_Path_Tmp\opencpn.exe" + Delete "$Uninstall_Path_Tmp\opencpn.exe" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\license.txt" + Delete "$Uninstall_Path_Tmp\license.txt" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\unins000.dat" + Delete "$Uninstall_Path_Tmp\unins000.dat" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\unins000.exe" + Delete "$Uninstall_Path_Tmp\unins000.exe" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\install.log" + Delete "$Uninstall_Path_Tmp\install.log" + ${EndIf} + + ${If} ${FileExists} "$Uninstall_Path_Tmp\install.log" + Delete "$Uninstall_Path_Tmp\install.log" + ${EndIf} + + Push $0 + Push $1 + Push $2 + Push $R9 + Push $R8 + Push $R7 + Push $R6 + ;# Find the Uninstall file + ${Locate} "$Uninstall_Path_Tmp" "/L=F /M=Uninstall*.exe /G=0" "Delete_Located_File_Single" + ;# Find the wx.. DLLs + ${Locate} "$Uninstall_Path_Tmp" "/L=F /M=wx*.dll /G=0" "Delete_Located_File_Multi" + ;# Dummy call of Locate as it does not properly close its handle and so the dir cannot be deleted though it might be empty + ${Locate} "C:\" "/L=DE /M=*.* /G=0" "Dummy_Function" + + ;# Remove the installation dir ($Uninstall_Path_Tmp) if empty + RMDir "$Uninstall_Path_Tmp" + ${If} ${FileExists} "$Uninstall_Path_Tmp\*.*" + Sleep 250 + RMDir "$Uninstall_Path_Tmp" + ${EndIf} + + Pop $R6 + Pop $R7 + Pop $R8 + Pop $R9 + Pop $2 + Pop $1 + Pop $0 + end: +FunctionEnd + ;# Helper-Functions for Delete_Installation_Dir + Function Delete_Located_File_Single + Delete "$R9" + StrCpy $0 StopLocate + Push $0 + FunctionEnd + + Function Delete_Located_File_Multi + Delete "$R9" + Push $0 + FunctionEnd + + Function Dummy_Function + StrCpy $0 StopLocate + Push $0 + FunctionEnd + ;# End Helper-Functions + + +Function ExecAppFile + !insertmacro UAC_AsUser_ExecShell 'open' '$INSTDIR\opencpn.exe' '' '$INSTDIR' '' + loop: + System::Call user32::GetForegroundWindow()i.r0 + Sleep 200 + IntCmpU $0 $hwndparent loop +FunctionEnd + + +Function DU2Pix + Pop $4 + Pop $3 + Pop $2 + Pop $1 + IntOp $1 $1 * $BU_X + IntOp $1 $1 / 4 + IntOp $2 $2 * $BU_Y + IntOp $2 $2 / 8 + IntOp $3 $3 * $BU_X + IntOp $3 $3 / 4 + IntOp $4 $4 * $BU_Y + IntOp $4 $4 / 8 +FunctionEnd + + +;!define LVM_GETITEMCOUNT 0x1004 ;# ANSI +;!define LVM_GETITEMTEXT 0x102D ;# ANSI +!define LVM_GETITEMCOUNT 0x1004 +!define LVM_GETITEMTEXT 0x1073 + +Function DumpLog + Exch $5 + Push $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $6 + + FindWindow $0 "#32770" "" $HWNDPARENT + GetDlgItem $0 $0 1016 + StrCmp $0 0 error + FileOpen $5 $5 "w" + FileWriteWord $5 0xfeff ; Write the BOM + StrCmp $5 0 error + SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6 + System::StrAlloc ${NSIS_MAX_STRLEN} + Pop $3 + StrCpy $2 0 + System::Call "*(i, i, i, i, i, i, i, i, i) i \ + (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1" + loop: StrCmp $2 $6 done + System::Call "User32::SendMessageW(i, i, i, i) i \ + ($0, ${LVM_GETITEMTEXT}, $2, r1)" + System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)" + FileWriteUTF16LE $5 "$4$\r$\n" + IntOp $2 $2 + 1 + Goto loop + done: + FileClose $5 + System::Free $1 + System::Free $3 + Goto exit + error: + MessageBox MB_OK error + exit: + Pop $6 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 + Exch $5 +FunctionEnd + + +Function Write_Reg_ChartDirs + ClearErrors + FileOpen $R0 "$TEMP\opencpn_chart_dirs.tmp" r + IfErrors end + loop: + FileReadUTF16LE $R0 $R1 + IfErrors done + ${TrimNewLines} $R1 $R1 + ${If} $REG_CHARTDIRS == "" + StrCpy $REG_CHARTDIRS "$R1" + ${Else} + StrCpy $REG_CHARTDIRS "$REG_CHARTDIRS;$R1" + ${EndIf} + Goto loop + done: + FileClose $R0 + WriteRegStr HKLM "Software\OpenCPN" "ChartDirs" $REG_CHARTDIRS + end: +FunctionEnd + + +Function IndexOf + Exch $R0 + Exch + Exch $R1 + Push $R2 + Push $R3 + + StrCpy $R3 $R0 + StrCpy $R0 -1 + IntOp $R0 $R0 + 1 + StrCpy $R2 $R3 1 $R0 + StrCmp $R2 "" +2 + StrCmp $R2 $R1 +2 -3 + + StrCpy $R0 -1 + + Pop $R3 + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + + +Function RIndexOf + Exch $R0 + Exch + Exch $R1 + Push $R2 + Push $R3 + + StrCpy $R3 $R0 + StrCpy $R0 0 + IntOp $R0 $R0 + 1 + StrCpy $R2 $R3 1 -$R0 + StrCmp $R2 "" +2 + StrCmp $R2 $R1 +2 -3 + + StrCpy $R0 -1 + + Pop $R3 + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + +;################################################################################################## +;# Uninstaller Functions # +;################################################################################################## +;# un.onInit Function +Function un.onInit + ;Prevent multiple instances of the uninstaller + ${IfNot} ${UAC_IsInnerInstance} + System::Call 'kernel32::CreateMutexW(i 0, i 0, t "ocpn_uninst_@CPACK_PACKAGE_VERSION@") i .r1 ?e' + Pop $R0 + StrCmp $R0 0 +3 + MessageBox MB_OK|MB_ICONEXCLAMATION "$(Uninstaller_Running)" + Abort + ${EndIf} + + Call un.GetUserInfo + StrCpy $USERS_NAME $USERNAME + + ;# Macros to be inserted + ${If} $IS_ADMIN == 1 + !insertmacro MUI_UNGETLANGUAGE + ${EndIf} + + StrCpy $USERS_APPDATA $APPDATA + + ;# UAC check if user has Admin privileges and prompt for elevation if not + uac_tryagain: + !insertmacro UAC_RunElevated + StrCpy $Inst_Or_Uninst "$(Uninstaller)" + ${Switch} $0 + ${Case} 0 + ${IfThen} $1 = 1 ${|} Quit ${|} ;# we are the outer process, the inner process has done its work, we are done + ${IfThen} $3 <> 0 ${|} ${Break} ${|} ;# we are admin, let the show go on + ${If} $1 = 3 ;# RunAs completed successfully, but with a non-admin user + MessageBox mb_IconExclamation|mb_TopMost|mb_SetForeground "$(Msg_UAC_Admin_Retry)" /SD IDNO IDOK uac_tryagain IDNO 0 + ${EndIf} + ;# fall-through and die + ${Case} 1223 + MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_Admin_Abort)" + Quit + ${Case} 1062 + MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_Logon_Abort)" + Quit + ${Default} + MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(Msg_UAC_No_Elevation)" + Quit + ${EndSwitch} + +########## from here we can be sure to run with admin privileges ########## + + SectionSetText ${UnSecDeleteConfigFolder} $(UnSecDeleteConfigFolder_Text) + + ClearErrors + Var /GLOBAL UN_INST_PARAMS + Var /GLOBAL UN_INST_HELP + Var /GLOBAL UN_INST_TYPE + StrCpy $UN_INST_TYPE "" + ${GetParameters} $UN_INST_PARAMS + StrCmp $UN_INST_PARAMS "" no_params + + ${GetOptions} "$UN_INST_PARAMS" "/?" $UN_INST_HELP + IfErrors +3 + StrCpy $UN_INST_HELP "help" + Goto end + + ClearErrors + ${GetOptions} "$UN_INST_PARAMS" "/type" $UN_INST_TYPE + IfErrors no_type_param + ${Switch} $UN_INST_TYPE + ${Case} "=1" ;# 1 = Program Files only (Remove/ Delete: Program Files) + StrCpy $UN_INST_TYPE 1 + !insertmacro ClearSectionFlag ${UnSecDeleteConfigFolder} ${SF_SELECTED} + !insertmacro ClearSectionFlag ${UnSecDeleteConfigRegKey} ${SF_SELECTED} + ${Break} + ${Case} "=2" ;# 2 = Preserve Config folder (Remove/ Delete: Program Files + RegKey) + StrCpy $UN_INST_TYPE 2 + !insertmacro ClearSectionFlag ${UnSecDeleteConfigFolder} ${SF_SELECTED} + ${Break} + ${Case} "=3" ;# 3 = Preserve RegKey (Remove/ Delete: Program Files + Config folder) + StrCpy $UN_INST_TYPE 3 + !insertmacro ClearSectionFlag ${UnSecDeleteConfigRegKey} ${SF_SELECTED} + SectionSetFlags ${UnSecBackupConfigToRegKey} ${SF_SELECTED} + ${Break} + ${Case} "=4" ;# 4 = Delete Config folder (Remove/ Delete: Config folder) + StrCpy $UN_INST_TYPE 4 + !insertmacro ClearSectionFlag ${UnSecUninstall} ${SF_SELECTED} + !insertmacro ClearSectionFlag ${UnSecDeleteConfigRegKey} ${SF_SELECTED} + SectionSetFlags ${UnSecBackupConfigToRegKey} ${SF_SELECTED} + ${Break} + ${Case} "=5" ;# 5 = Delete RegKey (Remove/ Delete: RegKey) + StrCpy $UN_INST_TYPE 5 + !insertmacro ClearSectionFlag ${UnSecUninstall} ${SF_SELECTED} + !insertmacro ClearSectionFlag ${UnSecDeleteConfigFolder} ${SF_SELECTED} + ${Break} + ${Default} + StrCpy $9 $UN_INST_TYPE + StrCpy $UN_INST_TYPE "error_type" ;# unknown value given for the type parameter => MsgBox => Quit + ${Break} + ${EndSwitch} + + StrCmp $UN_INST_TYPE "error_type" 0 cont + MessageBox MB_OK|MB_ICONEXCLAMATION "$(Msg_Unknown_Type_Param)" + Quit + + no_type_param: + ;# If no parameter 'type' is given assume full uninstall + StrCpy $UN_INST_TYPE 0 ;# 0 = Full Uninstall (Remove/ Delete: Program Files + Config folder + RegKey) + Goto cont + + no_params: + ;# If no parameters are given assume full uninstall + StrCpy $UN_INST_TYPE 0 ;# 0 = Full Uninstall (Remove/ Delete: Program Files + Config folder + RegKey) + + cont: + ;# Delete all temporary files created during the installation + Delete "$TEMP\opencpn_*.tmp" + + Call un.VersionDate + + Call un.Check_Prev_Installs + + ;# If there are other installations of OCPN do not remove the config folder! + ${If} $UN_INST_TYPE == 0 + ${AndIf} $VERSION_EXISTS == 1 + ${AndIf} $MULTIPLE_INSTALLS > 1 + StrCpy $Skip_UnPage_Components 1 + !insertmacro ClearSectionFlag ${UnSecDeleteConfigFolder} ${SF_SELECTED} + ${EndIf} + + ReadRegStr $0 HKLM "${REG_KEY_UN}" "CompareVersion" + + end: +FunctionEnd + + +Function un.myGuiInit + ${If} $UN_INST_HELP == "help" + MessageBox MB_OK|MB_ICONINFORMATION "$(Msg_Uninstaller_Param_Help)" + Quit + ${EndIf} +FunctionEnd + +;-------------------------------- +;################################################################################################## +;# Uninstaller Page Functions # +;################################################################################################## +/* + ;# UnPage_Components_Pre + Function un.Page_Components_Pre + ${If} $Skip_UnPage_Components == 1 + Abort + ${EndIf} + FunctionEnd +*/ +;-------------------------------- +;################################################################################################## +;# General Uninstaller Functions # +;################################################################################################## + + + +;-------------------------------- +;################################################################################################## +;# Shared Functions # +;################################################################################################## +!macro GetUserInfo_Macro un + Function ${un}GetUserInfo + ClearErrors + UserInfo::GetName + ${If} ${Errors} + StrCpy $IS_ADMIN 1 + Return + ${EndIf} + Pop $USERNAME + + UserInfo::GetAccountType + Pop $R0 + StrCpy $UAT $R0 + ${If} ${IsNT} + ${AndIf} ${IsWinNT4} + ${If} $R0 == "Admin" + StrCpy $IS_ADMIN 1 + ${Else} + StrCpy $IS_ADMIN 0 + ${EndIf} + Goto end + ${EndIf} + + ${Switch} $R0 + ${Case} "Admin" + ${Case} "Power" + StrCpy $IS_ADMIN 1 + ${Break} + ${Default} + StrCpy $IS_ADMIN 0 + ${Break} + ${EndSwitch} + + UserInfo::GetOriginalAccountType + Pop $OUAT + + end: + FunctionEnd +!macroend +!insertmacro GetUserInfo_Macro "" +!insertmacro GetUserInfo_Macro "un." + + +!macro Check_Prev_Installs_Macro un + Function ${un}Check_Prev_Installs + StrCpy $R0 0 + StrCpy $R1 "" + StrCpy $R5 0 + StrCpy $VERSION_EXISTS 0 + SetShellVarContext all + ${Do} + EnumRegKey $R1 SHCTX "${REG_ROOT_KEY_UN}" $R0 + ${If} $R1 != "" + StrLen $R2 $R1 + ${WordFind} "$R1" " " "+1" $R3 + IntOp $R0 $R0 + 1 + ${If} $R3 == "s63_pi" + ${AndIf} $R2 > 7 + ReadRegStr $R4 SHCTX "${REG_ROOT_KEY_UN}\$R1" "CompareVersion" + ReadRegStr $R6 SHCTX "${REG_ROOT_KEY_UN}\$R1" "InstallLocation" + ${If} $R4 != "" + ${VersionCompare} $VERSION_DATE $R4 $Compare_Version_Result + ${Switch} $Compare_Version_Result + ${Case} 0 ;equal + StrCpy $VERSION_EXISTS 1 + ${Break} + ${Case} 1 ;version to install is newer + StrCpy $VERSION_NEWER 1 + ${Break} + ${Case} 2 ;version to install is older + StrCpy $VERSION_OLDER 1 + ${Break} + ${Default} + ${Break} + ${EndSwitch} + IntOp $R5 $R5 + 1 + StrCpy $Prev_Install_RegKey "${REG_ROOT_KEY_UN}\$R1" + ${EndIf} + StrCmp ${un} "" 0 uninst ;# only execute when it is the Installer function + ${If} $R6 != "" + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_prev_installs.tmp" + FileOpen $0 "$TEMP\opencpn_prev_installs.tmp" a + FileSeek $0 0 END + ${Else} + FileOpen $0 "$TEMP\opencpn_prev_installs.tmp" w + ${EndIf} + IfErrors done + FileWriteUTF16LE $0 "$R1$\r$\n" + FileWriteUTF16LE $0 "$R6$\r$\n" + FileClose $0 + done: + ${EndIf} + + ${If} $VERSION_EXISTS == 1 + ${Break} + ${EndIf} + + uninst: + ${EndIf} + ${Else} + Goto done2 + ${EndIf} + ${Loop} + done2: + ${If} $R5 > 0 + StrCpy $MULTIPLE_INSTALLS $R5 + ${Else} + StrCpy $MULTIPLE_INSTALLS 0 + ${EndIf} + ${If} $MULTIPLE_INSTALLS == 0 + StrCpy $Skip_Page_TypeInst 1 + ${Else} + StrCpy $Skip_Page_TypeInst 0 + ${EndIf} + FunctionEnd +!macroend +!insertmacro Check_Prev_Installs_Macro "" +!insertmacro Check_Prev_Installs_Macro "un." + + +/* VersionDate + normalizes the CPACK_PACKAGE_VERSION_PATCH to a comparable format 'yyyy.[02|19].mmdd.00' + 02 = Beta version + 19 = Stable release + IN: CPACK_PACKAGE_VERSION_PATCH + OUT: $VERSION_DATE +*/ +Var Patch_Version +Var Version_Digits_Only +Var Version_Unified +Var Patch_Date +!macro VersionDate_Macro un + Function ${un}VersionDate + StrCpy $Patch_Version "@CPACK_PACKAGE_VERSION_PATCH@" + ${If} $Patch_Version == "" + StrCpy $Patch_Version "0000" + ${EndIf} + StrLen $0 "$Patch_Version" + ${StrFilter} "$Patch_Version" "1" "" "" $Version_Digits_Only + StrLen $1 $Version_Digits_Only + ;# Patch version contains non-digit characters + ${If} $0 != $1 + ${StrFilter} "$Patch_Version" "-2" "" "" $PATCH_ND + ${If} $1 == 3 + StrCpy $Version_Unified "b${YEAR}0$Patch_Version" + ${ElseIf} $1 == 2 + StrCpy $Version_Unified "s${YEAR}00$Patch_Version" + ${ElseIf} $1 == 1 + StrCpy $Version_Unified "s${YEAR}000$Patch_Version" + ${Else} + StrCpy $Version_Unified "b${YEAR}$Patch_Version" + ${EndIf} + ${VersionConvert} $Version_Unified "" $Patch_Date + StrCpy $VERSION_DATE "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.$Patch_Date" + ;# Patch version contains only digits + ${Else} + ${If} $0 == 3 + StrCpy $Version_Unified "b${YEAR}0$Patch_Version" + ${ElseIf} $0 == 2 + StrCpy $Version_Unified "s${YEAR}00$Patch_Version" + ${ElseIf} $0 == 1 + StrCpy $Version_Unified "s${YEAR}000$Patch_Version" + ${Else} + StrCpy $Version_Unified "b${YEAR}$Patch_Version" + ${EndIf} + ${VersionConvert} $Version_Unified "" $Patch_Date + StrCpy $VERSION_DATE "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.$Patch_Date.00" + ${EndIf} + FunctionEnd +!macroend +!insertmacro VersionDate_Macro "" +!insertmacro VersionDate_Macro "un." + + +!macro Delete_Start_Menu_Shortcuts_Macro un + Function ${un}Delete_Start_Menu_Shortcuts + Pop $9 + Push $R0 + Push $R1 + Push $R2 + Push $R3 + Push $R4 + ${TrimNewLines} $9 $9 + SetShellVarContext all + ${RecFindOpen} "$STARTMENU" $CurrentDirVar $CurrentFileVar + ${RecFindFirst} + ClearErrors + ${WordFind} "$CurrentFileVar" ".lnk" "E*" $8 + IfErrors next + IntCmp $8 1 0 next 0 + ShellLink::GetShortCutWorkingDirectory "$STARTMENU$CurrentDirVar\$CurrentFileVar" + Pop $0 + StrCmp "$0" "" +2 + StrCmp "$0" "$9" 0 next + ShellLink::GetShortCutTarget "$STARTMENU$CurrentDirVar\$CurrentFileVar" + Pop $1 + ${WordFind2X} "$1" "\" ".exe" "-1" $7 + ClearErrors + ${WordFind} "$7" "uninstall" "E*" $6 + IfErrors 0 +2 + StrCpy $6 0 + ;#NON-DEBUG + ${If} $7 == "opencpn" + ${OrIf} $7 == "Uninstall" + ${OrIf} $7 == "unins000" + ${OrIf} $6 == 1 + Delete "$STARTMENU$CurrentDirVar\$CurrentFileVar" + StrCmp $CurrentDirVar "" next + ClearErrors + RMDir "$STARTMENU$CurrentDirVar" + Sleep 250 + IfErrors 0 check_parent + ${If} ${FileExists} "$STARTMENU$CurrentDirVar\*.*" + ClearErrors + RMDir "$STARTMENU$CurrentDirVar" + Sleep 250 + IfErrors next check_parent + ${EndIf} + + Goto next + + check_parent: + StrCpy $R3 "$STARTMENU$CurrentDirVar" + Push $R3 + Call ${un}Parent_Dirs_Check + ${EndIf} + + next: + ${RecFindNext} + ${RecFindClose} + + ${If} ${FileExists} "$TEMP\opencpn_startmenu.tmp" + FileOpen $R0 "$TEMP\opencpn_startmenu.tmp" r + IfErrors end + ${Do} + FileReadUTF16LE $R0 $R1 + FileReadUTF16LE $R0 $R2 + ${TrimNewLines} $R1 $R1 + ${TrimNewLines} $R2 $R2 + StrCmp $R2 "" 0 +2 + ${Break} + ${RecFindOpen} "$R2" $CurrentDirVar $CurrentFileVar + ${RecFindFirst} + ClearErrors + ${WordFind} "$CurrentFileVar" ".lnk" "E*" $8 + IfErrors next1 + IntCmp $8 1 0 next1 0 + ShellLink::GetShortCutWorkingDirectory "$R2$CurrentDirVar\$CurrentFileVar" + Pop $0 + StrCmp "$0" "$9" 0 next1 + ShellLink::GetShortCutTarget "$R2$CurrentDirVar\$CurrentFileVar" + Pop $1 + ${WordFind2X} "$1" "\" ".exe" "-1" $7 + ;#NON-DEBUG + ${If} $7 == "opencpn" + ${OrIf} $7 == "Uninstall" + ${OrIf} $7 == "unins000" + Delete "$R2$CurrentDirVar\$CurrentFileVar" + StrCmp $CurrentDirVar "" next1 + ClearErrors + RMDir "$R2$CurrentDirVar" + Sleep 250 + IfErrors 0 check_parent1 + ${If} ${FileExists} "$R2$CurrentDirVar\*.*" + ClearErrors + RMDir "$R2$CurrentDirVar" + Sleep 250 + IfErrors next1 check_parent1 + ${EndIf} + + Goto next1 + + check_parent1: + StrCpy $R3 "$STARTMENU$CurrentDirVar" + Push $R3 + Call ${un}Parent_Dirs_Check + ${EndIf} + + next1: + ${RecFindNext} + ${RecFindClose} + ${LoopUntil} $R2 == "" + FileClose $R0 + ${EndIf} + + end: + Call ${un}Delete_Empty_Parents + + Pop $R4 + Pop $R3 + Pop $R2 + Pop $R1 + Pop $R0 + FunctionEnd +!macroend +!insertmacro Delete_Start_Menu_Shortcuts_Macro "" +!insertmacro Delete_Start_Menu_Shortcuts_Macro "un." + + +!macro Delete_Desktop_Shortcuts_Macro un + Function ${un}Delete_Desktop_Shortcuts + Pop $9 + Push $R0 + Push $R1 + Push $R2 + Push $R3 + ${TrimNewLines} $9 $9 + SetShellVarContext all + ${RecFindOpen} "$DESKTOP" $CurrentDirVar $CurrentFileVar + ${RecFindFirst} + ClearErrors + ${WordFind} "$CurrentFileVar" ".lnk" "E*" $8 + IfErrors next + IntCmp $8 1 0 next 0 + ShellLink::GetShortCutWorkingDirectory "$DESKTOP$CurrentDirVar\$CurrentFileVar" + Pop $0 + StrCmp "$0" "" +2 + StrCmp "$0" "$9" 0 next + ShellLink::GetShortCutTarget "$DESKTOP$CurrentDirVar\$CurrentFileVar" + Pop $1 + ${WordFind2X} "$1" "\" ".exe" "-1" $7 + ClearErrors + ${WordFind} "$7" "uninstall" "E*" $6 + IfErrors 0 +2 + StrCpy $6 0 + ;#NON-DEBUG + ${If} $7 == "opencpn" + ${OrIf} $7 == "Uninstall" + ${OrIf} $7 == "unins000" + ${OrIf} $6 == 1 + Delete "$DESKTOP$CurrentDirVar\$CurrentFileVar" + StrCmp $CurrentDirVar "" next + RMDir "$DESKTOP$CurrentDirVar" + Sleep 250 + IfErrors 0 check_parent + ${If} ${FileExists} "$DESKTOP$CurrentDirVar\*.*" + ClearErrors + RMDir "$DESKTOP$CurrentDirVar" + Sleep 250 + IfErrors next check_parent + ${EndIf} + + Goto next + + check_parent: + StrCpy $R3 "$DESKTOP$CurrentDirVar" + Push $R3 + Call ${un}Parent_Dirs_Check + ${EndIf} + + next: + ${RecFindNext} + ${RecFindClose} + + ${If} ${FileExists} "$TEMP\opencpn_desktop.tmp" + FileOpen $R0 "$TEMP\opencpn_desktop.tmp" r + IfErrors end + ${Do} + FileReadUTF16LE $R0 $R1 + FileReadUTF16LE $R0 $R2 + ${TrimNewLines} $R1 $R1 + ${TrimNewLines} $R2 $R2 + StrCmp $R2 "" 0 +2 + ${Break} + ${RecFindOpen} "$R2" $CurrentDirVar $CurrentFileVar + ${RecFindFirst} + ClearErrors + ${WordFind} "$CurrentFileVar" ".lnk" "E*" $8 + IfErrors next1 + IntCmp $8 1 0 next1 0 + ShellLink::GetShortCutWorkingDirectory "$R2$CurrentDirVar\$CurrentFileVar" + Pop $0 + StrCmp "$0" "$9" 0 next1 + ShellLink::GetShortCutTarget "$R2$CurrentDirVar\$CurrentFileVar" + Pop $1 + ${WordFind2X} "$1" "\" ".exe" "-1" $7 + ;#NON-DEBUG + ${If} $7 == "opencpn" + ${OrIf} $7 == "Uninstall" + ${OrIf} $7 == "unins000" + Delete "$R2$CurrentDirVar\$CurrentFileVar" + StrCmp $CurrentDirVar "" next1 + RMDir "$R2$CurrentDirVar" + Sleep 250 + IfErrors 0 check_parent1 + ${If} ${FileExists} "$R2$CurrentDirVar\*.*" + ClearErrors + RMDir "$R2$CurrentDirVar" + Sleep 250 + IfErrors next1 check_parent1 + ${EndIf} + + Goto next1 + + check_parent1: + StrCpy $R3 "$STARTMENU$CurrentDirVar" + Push $R3 + Call ${un}Parent_Dirs_Check + ${EndIf} + + next1: + ${RecFindNext} + ${RecFindClose} + ${LoopUntil} $R2 == "" + FileClose $R0 + ${EndIf} + + end: + Call ${un}Delete_Empty_Parents + + Pop $R3 + Pop $R2 + Pop $R1 + Pop $R0 + FunctionEnd +!macroend +!insertmacro Delete_Desktop_Shortcuts_Macro "" +!insertmacro Delete_Desktop_Shortcuts_Macro "un." + + +!macro Parent_Dirs_Check_Macro un + Function ${un}Parent_Dirs_Check + Pop $R3 + Push $R4 + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_check_parent.tmp" + FileOpen $R4 "$TEMP\opencpn_check_parent.tmp" a + IfErrors end + ${Else} + FileOpen $R4 "$TEMP\opencpn_check_parent.tmp" w + IfErrors end + ${EndIf} + + ${WordFind} "$R3" "\" "E-2{*" $R3 + IfErrors close + FileWriteUTF16LE $R4 "$R3$\r$\n" + + close: + FileClose $R4 + + end: + Pop $R4 + FunctionEnd +!macroend +!insertmacro Parent_Dirs_Check_Macro "" +!insertmacro Parent_Dirs_Check_Macro "un." + + +!macro Delete_Empty_Parents_Macro un + Function ${un}Delete_Empty_Parents + Push $R3 + Push $R4 + Push $R5 + ClearErrors + ${If} ${FileExists} "$TEMP\opencpn_check_parent.tmp" + FileOpen $R4 "$TEMP\opencpn_check_parent.tmp" r + IfErrors end + ${Do} + FileReadUTF16LE $R4 $R3 + IfErrors close + ${TrimNewLines} "$R3" $R3 + ${DirState} $R3 $R5 + StrCmp $R5 0 0 next + ClearErrors + RMDir "$R3" + Sleep 250 + IfErrors next + + loop: + ${WordFind} "$R3" "\" "E-2{*" $R3 + IfErrors next + StrCpy $error_tmp 0 + Push $R3 + Call ${un}Delete_Empty_Dir + StrCmp $error_tmp 1 loop + next: + ${Loop} + close: + FileClose $R4 + Delete "$TEMP\opencpn_check_parent.tmp" + ${EndIf} + end: + Pop $R5 + Pop $R4 + Pop $R3 + FunctionEnd +!macroend +!insertmacro Delete_Empty_Parents_Macro "" +!insertmacro Delete_Empty_Parents_Macro "un." + + +!macro Delete_Empty_Dir_Macro un + Function ${un}Delete_Empty_Dir + Push $R3 + Exch + Pop $R3 + Push $R4 + ${DirState} $R3 $R4 + StrCmp $R4 0 0 end + RMDir "$R3" + Sleep 100 + StrCpy $error_tmp 1 + + end: + Pop $R4 + Pop $R3 + FunctionEnd +!macroend +!insertmacro Delete_Empty_Dir_Macro "" +!insertmacro Delete_Empty_Dir_Macro "un." + + +; Initialize variables +Var explString +Var explSeparator +Var explStrLen +Var explSepLen +Var explOffset +Var explTmp +Var explTmp2 +Var explTmp3 +Var explArrCount +!macro Explodes_Macro un + Function ${un}Explode + /*; Initialize variables + Var /GLOBAL explString + Var /GLOBAL explSeparator + Var /GLOBAL explStrLen + Var /GLOBAL explSepLen + Var /GLOBAL explOffset + Var /GLOBAL explTmp + Var /GLOBAL explTmp2 + Var /GLOBAL explTmp3 + Var /GLOBAL explArrCount + */ + ; Get input from user + Pop $explString + Pop $explSeparator + + ; Calculates initial values + StrLen $explStrLen $explString + StrLen $explSepLen $explSeparator + StrCpy $explArrCount 1 + + ${If} $explStrLen <= 1 ; If we got a single character + ${OrIf} $explSepLen > $explStrLen ; or separator is larger than the string, + Push $explString ; then we return initial string with no change + Push 1 ; and set array's length to 1 + Return + ${EndIf} + + ; Set offset to the last symbol of the string + StrCpy $explOffset $explStrLen + IntOp $explOffset $explOffset - 1 + + ; Clear temp string to exclude the possibility of appearance of occasional data + StrCpy $explTmp "" + StrCpy $explTmp2 "" + StrCpy $explTmp3 "" + + ; Loop until the offset becomes negative + ${Do} + ; If offset becomes negative, it is time to leave the function + ${IfThen} $explOffset == -1 ${|} ${ExitDo} ${|} + + ; Remove everything before and after the searched part ("TempStr") + StrCpy $explTmp $explString $explSepLen $explOffset + + ${If} $explTmp == $explSeparator + ; Calculating offset to start copy from + IntOp $explTmp2 $explOffset + $explSepLen ; Offset equals to the current offset plus length of separator + StrCpy $explTmp3 $explString "" $explTmp2 + + Push $explTmp3 ; Throwing array item to the stack + IntOp $explArrCount $explArrCount + 1 ; Increasing array's counter + + StrCpy $explString $explString $explOffset 0 ; Cutting all characters beginning with the separator entry + StrLen $explStrLen $explString + ${EndIf} + + ${If} $explOffset = 0 ; If the beginning of the line met and there is no separator, + ; copying the rest of the string + ${If} $explSeparator == "" ; Fix for the empty separator + IntOp $explArrCount $explArrCount - 1 + ${Else} + Push $explString + ${EndIf} + ${EndIf} + + IntOp $explOffset $explOffset - 1 + ${Loop} + + Push $explArrCount + FunctionEnd +!macroend +!insertmacro Explodes_Macro "" +!insertmacro Explodes_Macro "un." + + +!macro isEmptyDir_Macro un + Function ${un}isEmptyDir + # Stack -> # Stack: + Exch $0 # Stack: $0 + Push $1 # Stack: $1, $0 + FindFirst $0 $1 "$0\*.*" + StrCmp $1 "." 0 _notempty + FindNext $0 $1 + StrCmp $1 ".." 0 _notempty + ClearErrors + FindNext $0 $1 + IfErrors 0 _notempty + FindClose $0 + Pop $1 # Stack: $0 + StrCpy $0 1 + Exch $0 # Stack: 1 (true) + Goto _end + _notempty: + FindClose $0 + Pop $1 # Stack: $0 + StrCpy $0 0 + Exch $0 # Stack: 0 (false) + _end: + FunctionEnd +!macroend +!insertmacro isEmptyDir_Macro "" +!insertmacro isEmptyDir_Macro "un." +;-------------------------------------------------------------------------------------------------- +;################################################################################################## +;# D E S C R I P T I O N S # +;################################################################################################## +;# Installer Descriptions # +;################################################################################################## + +;# License page + LicenseLangString license ${LANG_ENGLISH} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_GERMAN} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_FRENCH} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_CZECH} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_DANISH} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_SPANISH} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_ITALIAN} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_DUTCH} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_POLISH} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_PORTUGUESE} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_PORTUGUESEBR} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_RUSSIAN} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_SWEDISH} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_FINNISH} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_NORWEGIAN} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_TRADCHINESE} "@CPACK_RESOURCE_FILE_LICENSE@" + LicenseLangString license ${LANG_TURKISH} "@CPACK_RESOURCE_FILE_LICENSE@" + ;LicenseLangString license ${LANG_HUNGARIAN} "@CPACK_RESOURCE_FILE_LICENSE@" + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecGrpResetConfig} $(SecGrpResetConfig_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteConfigFile} $(SecDeleteConfigFile_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteChartDB} $(SecDeleteChartDB_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteSENC} $(SecDeleteSENC_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteCM93} $(SecDeleteCM93_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteNavobjFile} $(SecDeleteNavobjFile_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${SecDeleteLogFile} $(SecDeleteLogFile_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${SecGrpShortcuts} $(SecGrpShortcuts_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcutStartmenu} $(SecShortcutStartmenu_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcutDesktop} $(SecShortcutDesktop_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${SecSetConfig} $(SecSetConfig_Desc) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + +;-------------------------------- +;################################################################################################## +;# Uninstaller Descriptions # +;################################################################################################## +!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${UnSecDeleteConfigFolder} $(UnSecDeleteConfigFolder_Desc) +!insertmacro MUI_UNFUNCTION_DESCRIPTION_END + + +;-------------------------------------------------------------------------------------------------- +;################################################################################################## +;# Language Strings # +;################################################################################################## +;#DO NOT EDIT THE NEXT LINE!!! It is needed for the online generating of the translation files! +;#Language Strings Start as of: 2010-10-10 +;#IMPORTANT: Do not end a multi-line with $\" + + LangString Installer ${LANG_ENGLISH} "installer" + + LangString Uninstaller ${LANG_ENGLISH} "uninstaller" + + ;Installer running on unsupported version of Windows + LangString Installer_Unsupported_Windows_Version ${LANG_ENGLISH} "Your Windows version is not supported (it's too old)!$\r$\nYou need at least Windows XP SP3." + + ;Installer running on Windows XP without SP3 + LangString Installer_Unsupported_XP_SP_Version ${LANG_ENGLISH} "Your Windows XP Service Pack version is not supported (it's too old)!$\r$\nYou need at least Windows XP SP3." + + ;Installer already running + LangString Installer_Running ${LANG_ENGLISH} "The installer is already running." + + ;Uninstaller already running + LangString Uninstaller_Running ${LANG_ENGLISH} "The uninstaller is already running." + + ;Language Dialog + LangString LangDialog_Title ${LANG_ENGLISH} "@CPACK_PACKAGE_NAME@ @CPACK_PACKAGE_VERSION@ Installation" + + LangString LangDialog_Text ${LANG_ENGLISH} "Please select a language:" + + ;License dialog + LangString License_Message ${LANG_ENGLISH} "OpenCPN is software libre. You are encouraged and legally \ + entitled to copy, reinstall, modify, and redistribute this program \ + for yourself and your friends under the terms of the GPL. $\r$\nSmooth sailing!" + + ;Clean up page + LangString text_please_wait_1 ${LANG_ENGLISH} "... please wait!" + + LangString Scanning_HDD ${LANG_ENGLISH} "Scanning HDD ..." + + LangString OCPN_Scanning_HDD ${LANG_ENGLISH} "OpenCPN: Scan HDD ..., please wait!" + + LangString Search_old_installations ${LANG_ENGLISH} "Searching for old installations" + + LangString Install_Location_Default ${LANG_ENGLISH} "Install Locations by default paths (may not find all)" + + LangString Install_Location_HDD_Scan ${LANG_ENGLISH} "Install Location by full HDD scan (most reliable)" + + LangString Label_CleanUp_Text ${LANG_ENGLISH} "Click on a list-item to select/ unselect it or Select ALL (recommended) and then Uninstall selected." + + LangString BT_Uninstall_Selected_CleanUp ${LANG_ENGLISH} "Uninstall Selected" + + LangString BT_SelectAll_CleanUp ${LANG_ENGLISH} "Select ALL" + + LangString BT_UnselectAll_CleanUp ${LANG_ENGLISH} "Unselect ALL" + + LangString LB_CleanUp ${LANG_ENGLISH} "Listbox Text" + + LangString BT_FullScan_CleanUp ${LANG_ENGLISH} "Scan HDD ..." + + LangString LAB_FullScan_CleanUp ${LANG_ENGLISH} "Scan the HDD for the most reliable detection.$\r$\nATTENTION: may last several minutes!" + + LangString Page_CleanUp_Title ${LANG_ENGLISH} "Uninstall older Version" + + LangString Page_CleanUp_Subtitle ${LANG_ENGLISH} "Incompatible version detected" + + ;Components Page + ;Header + LangString CP_HEADER_TEXT ${LANG_ENGLISH} "Installation Settings" + + ;Subheader + LangString CP_HEADER_SUBTEXT ${LANG_ENGLISH} "Choose the settings for the installation" + + ;Top + LangString CP_TOP ${LANG_ENGLISH} "Check or uncheck the options for the installation.$\r$\nClick 'Next' to continue." + + ;Installation type + LangString CP_INSTTYPE ${LANG_ENGLISH} "Installation type:" + + ;Components list + LangString CP_COMPLIST ${LANG_ENGLISH} "Adjust the settings individually:" + + + ;Directory page + + + ;Set Config page + LangString Page_SetConfig_Title ${LANG_ENGLISH} "Default configuration settings" + + LangString Page_SetConfig_Subtitle ${LANG_ENGLISH} "Preconfigure settings for OpenCPN" + + LangString Select_Chart_Directory ${LANG_ENGLISH} "Please select a chart directory to add to OpenCPN" + + LangString BT_Browse_SetConfig_Text ${LANG_ENGLISH} "Browse..." + + LangString BT_DeleteAll_SetConfig_Text ${LANG_ENGLISH} "Delete ALL" + + LangString BT_Delete_SetConfig_Text ${LANG_ENGLISH} "Delete" + + LangString GB_ChartDir_SetConfig_Text ${LANG_ENGLISH} "Add Chart Directory" + + LangString CB_Language_SetConfig_Text ${LANG_ENGLISH} "Set OpenCPN program language to $LANG_NAME" + + LangString GB_Language_SetConfig_Text ${LANG_ENGLISH} "Set OpenCPN program language" + + LangString Label_SetConfig_Text ${LANG_ENGLISH} "Configure preconfig settings for the OpenCPN program.$\r$\nThese settings are saved in the file opencpn.ini." + + ;Confirm page + LangString Page_Confirm_Title ${LANG_ENGLISH} "Ready to Install" + + LangString Page_Confirm_Subtitle ${LANG_ENGLISH} "Check the installation options" + + LangString Installation_Type ${LANG_ENGLISH} "Setup type" + + LangString Installation_Directory ${LANG_ENGLISH} "Destination location" + + LangString Create_Shortcuts ${LANG_ENGLISH} "Create shortcuts" + + LangString Type_Reinstall ${LANG_ENGLISH} "Reinstallation" + + LangString Type_Upgrade ${LANG_ENGLISH} "Upgrade" + + LangString Type_Downgrade ${LANG_ENGLISH} "Downgrade" + + LangString Type_Parallel_Installation ${LANG_ENGLISH} "Parallel installation" + + LangString Type_Fresh_Installation ${LANG_ENGLISH} "New installation" + + LangString Shortcuts ${LANG_ENGLISH} "Shortcuts" + + LangString Create_Shortcut_Start_Menu ${LANG_ENGLISH} "in the Start Menu folder" + + LangString Create_Shortcut_Desktop ${LANG_ENGLISH} "on the Desktop" + + LangString not_selected ${LANG_ENGLISH} "not selected" + + LangString text_none ${LANG_ENGLISH} "none" + + ;Installer Sections + ;Reset config + LangString SecGrpResetConfig_Text ${LANG_ENGLISH} "Reset ALL OpenCPN configuration files" + + ;Delete Config file (opencpn.ini) + LangString SecDeleteConfigFile_Text ${LANG_ENGLISH} "Delete config file (opencpn.ini)" + + ;Delete Chart DB (CHRTLIST.DAT) + LangString SecDeleteChartDB_Text ${LANG_ENGLISH} "Delete Chart Database file (CHRTLIST.DAT)" + + ;Delete SENC directory + LangString SecDeleteSENC_Text ${LANG_ENGLISH} "Delete SENC directory" + + ;Delete CM93 directory + LangString SecDeleteCM93_Text ${LANG_ENGLISH} "Delete CM93 Directory" + + ;Delete Log file (opencpn.log) + LangString SecDeleteLogFile_Text ${LANG_ENGLISH} "Delete Log file (opencpn.log)" + + ;Delete navobj.xml + LangString SecDeleteNavobjFile_Text ${LANG_ENGLISH} "Delete Navobject file (navobj.xml)" + + ;Set config + LangString SecSetConfig_Text ${LANG_ENGLISH} "OpenCPN Configuration Settings" + + ;Set language + LangString SecSetConfigLang_Text ${LANG_ENGLISH} "Set language to $LANG_NAME" + + ;Set chart dir(s) + LangString SecSetConfigChartDir_Text ${LANG_ENGLISH} "Select Chart Directories" + + ;Uninstaller Sections + ;Reset config + LangString UnSecDeleteConfigFolder_Text ${LANG_ENGLISH} "Delete Config folder" + + ;Installer Descriptions + LangString SecGrpResetConfig_Desc ${LANG_ENGLISH} "Deletes ALL files and subdirectories in the configuration folder." + + LangString SecDeleteConfigFile_Desc ${LANG_ENGLISH} "Deletes the configuration file. This file helds also Routes and Waypoints." + + LangString SecDeleteChartDB_Desc ${LANG_ENGLISH} "Deletes the Chart DB file." + + LangString SecDeleteSENC_Desc ${LANG_ENGLISH} "Deletes the SENC subfolder which helds the Bitmaps and S57 chart cache files." + + LangString SecDeleteCM93_Desc ${LANG_ENGLISH} "Deletes the cm93 subfolder which helds the cached cm93 chart outlines." + + LangString SecDeleteNavobjFile_Desc ${LANG_ENGLISH} "Deletes the file 'navobj.xml' in the config folder. This file contains the Tracks." + + LangString SecDeleteLogFile_Desc ${LANG_ENGLISH} "Deletes the OpenCPN log file 'opencpn.log'." + + LangString SecGrpShortcuts_Desc ${LANG_ENGLISH} "Creates shortcuts in both, the Start Menu and on the Desktop." + + LangString SecShortcutStartmenu_Desc ${LANG_ENGLISH} "Creates shortcuts for OpenCPN and the Uninstaller in the Start Menu - configurable on the next page." + + LangString SecShortcutDesktop_Desc ${LANG_ENGLISH} "Creates a shortcut for OpenCPN on the Desktop." + + LangString SecSetConfig_Desc ${LANG_ENGLISH} "Preconfigure the language setting and the chart dir(s) for s63_pi. When selected a separate page is shown for configuration." + + ;Uninstaller Descriptions + LangString UnSecDeleteConfigFolder_Desc ${LANG_ENGLISH} "Deletes the config folder and all its files and subdirectories." + + ;Un-install Link + LangString Uninstall_Link ${LANG_ENGLISH} "Uninstall @CPACK_PACKAGE_NAME@ @CPACK_PACKAGE_VERSION@" + + ;Multiple Install > 1 + ;Title + LangString Page_TypeInst_Title ${LANG_ENGLISH} "Previous Installations" + + ;Subtitle + LangString Page_TypeInst_Subtitle ${LANG_ENGLISH} "$MULTIPLE_INSTALLS installations of s63_pi found.$\r$\nChoose how you want to install s63_pi." + + ;Multiple Install = 1 + ;Title + LangString Page_TypeInst_Title_1 ${LANG_ENGLISH} "Already Installed" + + ;Subtitle + LangString Page_TypeInst_Subtitle_1 ${LANG_ENGLISH} "Found installed version of s63_pi.$\r$\n" + + ;Version exists + ;Title + LangString Page_TypeInst_Title_Exists ${LANG_ENGLISH} "Version Already Installed" + + ;Subtitle + LangString Page_TypeInst_Subtitle_Exists ${LANG_ENGLISH} "s63_pi @CPACK_PACKAGE_VERSION@ is already installed.$\r$\nChoose how you want to install s63_pi." + + ;Label + LangString Label_TypeInst_Reinstall_Text ${LANG_ENGLISH} "s63_pi @CPACK_PACKAGE_VERSION@ is already installed on your system. You can reinstall the version now using the previous settings. If you wish to install the program with different settings, cancel installation and un-install the existing version first. Click Next to continue." + + ;Radio button 'Reinstall' + LangString RB_Reinstall_TypeInst_Text ${LANG_ENGLISH} "Reinstall using previous settings" + + ;Version newer + ;Label + LangString Label_TypeInst_Upgrade_Text ${LANG_ENGLISH} "An older version of s63_pi is installed on your system. Click Next to continue upgrade." + + ;Radio button 'Upgrade' + LangString RB_Upgrade_TypeInst_Text ${LANG_ENGLISH} "Upgrade s63_pi using previous settings (recommended)" + + ;Version older + ;Label + LangString Label_TypeInst_Downgrade_Text ${LANG_ENGLISH} "A newer version of s63_pi is installed on your system. It is not recommended to downgrade to an older version. Select the installation type you want to perform and click Next to continue." + + ;Radio button 'Downgrade' + LangString RB_Downgrade_TypeInst_Text ${LANG_ENGLISH} "Downgrade s63_pi using previous settings (recommended)" + + ;Multiple versions + ;Label + LangString Label_TypeInst_Parallel_Text ${LANG_ENGLISH} "Setup has detected several installed versions of s63_pi on your system. It is recommended to have only one version of s63_pi installed at a time. Select the operation you want to perform and click Next to continue." + + ;Radio button 'Parallel Installation' + LangString RB_Parallel_TypeInst_Text ${LANG_ENGLISH} "Parallel Installation (advanced users)" + + ;Empty string - needed for Components page + LangString EmptyString ${LANG_ENGLISH} "" + + ;Finish page + LangString Show_Readme_Text ${LANG_ENGLISH} "Show Install Log file" + + LangString Finish_Link_Text ${LANG_ENGLISH} "OpenCPN website (Internet connection required)" + + LangString Finish_Link_URL ${LANG_ENGLISH} "http://opencpn.info/?ref=installer&user=$USERS_NAME&lang=$REG_LANG&version=@CPACK_PACKAGE_VERSION@" + + ;Message Boxes + LangString Msg_UAC_Admin_Retry ${LANG_ENGLISH} "This $Inst_Or_Uninst requires admin access!$\r$\nPlease log on as an Administrator and try again." + + LangString Msg_UAC_Admin_Abort ${LANG_ENGLISH} "This $Inst_Or_Uninst requires admin privileges, aborting!" + + LangString Msg_UAC_Logon_Abort ${LANG_ENGLISH} "Logon service not running, aborting!" + + LangString Msg_UAC_No_Elevation ${LANG_ENGLISH} "Unable to elevate , error $0" + + LangString Msg_Error_Remove_InstDir ${LANG_ENGLISH} "The installation directory$\r$\n'$INSTDIR'$\r$\ncould not be removed because it is not empty." + + LangString Msg_Path_Invalid ${LANG_ENGLISH} "The entered path is invalid!$\r$\n$\r$\nPlease check your input." + + LangString Msg_Path_Installation_Exists ${LANG_ENGLISH} "There already exists an installation of s63_pi in the given path.$\r$\nIf you wish to use this path, first uninstall the version. Or select another path for this installation." + + LangString Msg_Uninstall_Old_Versions ${LANG_ENGLISH} "Setup has detected at least one older version of s63_pi which is not compatible with the new version control.$\r$\n\ + It is recommended to first uninstall all of these installations (this does not affect your Config files) and clean-up the Registry.$\r$\n\ + If you click Yes on the next page a listbox with all installation locations will be shown and you will have the possibility to select the installations you wish to uninstall.$\r$\n\ + If you are unsure about possible other previous installations than those shown in the listbox, you can also perform a scan of the entire \ + Harddisk (ATTENTION: This may take several minutes) to find all install locations (recommended).$\r$\n$\r$\n\ + Do you want to uninstall the old version(s)?" + + LangString Msg_Not_All_Old_Uninstalled ${LANG_ENGLISH} "You have not uninstalled all previous installations.$\r$\n$\r$\nDo you want to continue anyway?" + + LangString Msg_Uninstaller_Param_Help ${LANG_ENGLISH} "Uninstaller Help$\r$\n$\r$\nUse the command line or a shortcut to run the uninstaller:$\r$\n$INSTDIR\Uninstall @CPACK_PACKAGE_VERSION@.exe [/?] | [/S], [/type=X]$\r$\n$\r$\nParameters:$\r$\n/?$\tshows this help message box$\r$\n/S$\truns the uninstaller in silent mode$\r$\n$\twill do a full uninstall if called without any type parameter$\r$\n/type=X$\tX must be a digit between 1 and 5$\r$\n$\t1 = Removes only the program files$\r$\n$\t2 = Removes only the program files + preconfig RegKey$\r$\n$\t3 = Removes the program files + config folder$\r$\n$\tpreserves the preconfig RegKey$\r$\n$\t4 = Deletes only the config folder$\r$\n$\t5 = Deletes only the preconfig RegKey$\r$\n$\r$\nEntering any other number or value will quit the uninstaller with a message box without removing or deleting anything." + + LangString Msg_Unknown_Type_Param ${LANG_ENGLISH} "The entered value '$9' for the type parameter is not valid!$\r$\nUse $INSTDIR\Uninstall @CPACK_PACKAGE_VERSION@.exe /?$\r$\nto see a list of valid values." + + ;added on 2010-10-16 + LangString SecGrpShortcuts_Text ${LANG_ENGLISH} "Create Shortcuts" + + LangString SecShortcutStartmenu_Text ${LANG_ENGLISH} "Add Shortcuts to the Start Menu" + + LangString SecShortcutDesktop_Text ${LANG_ENGLISH} "Create Shortcut on the Desktop" + + LangString Installation_Delete_Config ${LANG_ENGLISH} "Delete (existing) Config Subdirectories/ Files" + + ;added on 2010-10-17 + LangString Banner_Scan_Drive ${LANG_ENGLISH} "Scanning Drive $9" + + LangString Banner_Installation_Found_Singular ${LANG_ENGLISH} "Found $counter_tmp installation" + + LangString Banner_Installation_Found_Plural ${LANG_ENGLISH} "Found $counter_tmp installations" + + ;added on 2010-10-21 + LangString Uninstall_Folder_Name ${LANG_ENGLISH} "Uninstall" + + ;added on 2011-06-13 + LangString ^NameDA ${LANG_ENGLISH} "@CPACK_PACKAGE_NAME@ Version @CPACK_PACKAGE_VERSION@" + LangString Installer ${LANG_ENGLISH} "Installer" + +;#EOF diff --git a/cmake/in-files/cloudsmith-upload.sh.in b/cmake/in-files/cloudsmith-upload.sh.in index 10e2d986..800d8730 100644 --- a/cmake/in-files/cloudsmith-upload.sh.in +++ b/cmake/in-files/cloudsmith-upload.sh.in @@ -122,9 +122,9 @@ echo $tarball_basename source $BUILD_DIR/pkg_version.sh if [ -n "${OCPN_TARGET}" ]; then - tarball_name=@PACKAGE_NAME@-@PACKAGE_VERSION@-${PKG_TARGET}-@ARCH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-${PKG_TARGET_VERSION}-${OCPN_TARGET}-tarball + tarball_name=@PACKAGE_NAME@-@PACKAGE_VERSION@-${PKG_TARGET}-@COMPOUND_ARCH_DASH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-${PKG_TARGET_VERSION}-${OCPN_TARGET}-tarball else - tarball_name=@PACKAGE_NAME@-@PACKAGE_VERSION@-${PKG_TARGET}-@ARCH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-${PKG_TARGET_VERSION}-tarball + tarball_name=@PACKAGE_NAME@-@PACKAGE_VERSION@-${PKG_TARGET}-@COMPOUND_ARCH_DASH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-${PKG_TARGET_VERSION}-tarball fi if [ "$(ls $BUILD_DIR/*.${PKG_EXT})" ]; then @@ -175,7 +175,7 @@ fi echo $VERSION echo $REPO -if [ "$APPVEYOR" ] || [ LOCAL_BUILD=true ]; then +if [ "$APPVEYOR" ] || [ $LOCAL_BUILD=true ]; then echo 'substituting xml file variables for windows build' while read line; do line=${line//--pkg_repo--/$REPO} @@ -201,7 +201,7 @@ rm -f metadata.xml tarball_tar=$(ls *.tar) xml_here=$(ls *.xml) cp -f $xml_here metadata.xml -if [ "$TRAVIS" ] || [ "$CIRCLECI" ]; then +if [ "$TRAVIS" ] || [ "$CIRCLECI" ] || [ ! -z ${LOCAL_DEPLOY+x} ]; then mkdir build_tar cp $tarball_tar build_tar/. cd build_tar @@ -235,9 +235,9 @@ if [ ! -z ${LOCAL_DEPLOY+x} ]; then if [ -d "/home/circleci/circleci-output" ]; then sudo cp build/*.gz ~/circleci-output if have_any ./build/*.deb; then - sudo cp build/*.deb ~/circleci-output + sudo cp ./build/*.deb ~/circleci-output elif have_any ./build/*.exe; then - sudo cp build/*.exe ~/circleci-output + sudo cp ./build/*.exe ~/circleci-output fi else echo "Directory ~/circleci-output not found" @@ -246,7 +246,7 @@ elif [ $LOCAL_BUILD = false ]; then # Only upload if the owner did the pull request. Non-owners probably don't have security to upload to the cloudsmith repository if [ "$CIRCLE_PROJECT_USERNAME" = "$CIRCLE_USERNAME" ]; then cloudsmith push raw --republish --no-wait-for-sync \ - --name @PACKAGE_NAME@-@PACKAGE_VERSION@-@PKG_TARGET@-@ARCH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-@PKG_TARGET_VERSION@-${OCPN_TARGET}-metadata \ + --name @PACKAGE_NAME@-@PACKAGE_VERSION@-@PKG_TARGET@-@COMPOUND_ARCH_DASH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-@PKG_TARGET_VERSION@-${OCPN_TARGET}-metadata \ --version ${VERSION} \ --summary "@PACKAGE@ opencpn plugin metadata for automatic installation" \ $REPO $xml @@ -259,7 +259,7 @@ elif [ $LOCAL_BUILD = false ]; then if [ "${PKG_EXT}" != "gz" ] && [ "$pkg" != "" ]; then cloudsmith push raw --republish --no-wait-for-sync \ - --name opencpn-package-@PACKAGE@-@PACKAGE_VERSION@-@PKG_TARGET@-@ARCH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-@PKG_TARGET_VERSION@-${OCPN_TARGET}.${PKG_EXT} \ + --name opencpn-package-@PACKAGE@-@PACKAGE_VERSION@-@PKG_TARGET@-@COMPOUND_ARCH_DASH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-@PKG_TARGET_VERSION@-${OCPN_TARGET}.${PKG_EXT} \ --version ${VERSION} \ --summary "@PACKAGE@ .${PKG_EXT} installation package" \ $REPO $pkg diff --git a/cmake/in-files/version.h.in b/cmake/in-files/version.h.in index dfdcae6e..83256454 100644 --- a/cmake/in-files/version.h.in +++ b/cmake/in-files/version.h.in @@ -1,16 +1,16 @@ -#define PLUGIN_NAME ${PROJECT_NAME} -#define PLUGIN_CATALOG_NAME wxS("opencpn-${PACKAGE_NAME}") -#define PLUGIN_VERSION_MAJOR ${VERSION_MAJOR} -#define PLUGIN_VERSION_MINOR ${VERSION_MINOR} -#define PLUGIN_VERSION_PATCH ${VERSION_PATCH} -#define PLUGIN_VERSION_TWEAK ${VERSION_TWEAK} -#define PLUGIN_VERSION_DATE "${VERSION_DATE}" -#define PLUGIN_COMMON_NAME "${COMMON_NAME}" -#define PLUGIN_SHORT_DESCRIPTION "${SHORT_DESCRIPTION}" -#define PLUGIN_LONG_DESCRIPTION "${LONG_DESCRIPTION}" -#define PLUGIN_PACKAGE_NAME "${PACKAGE_NAME}" -// API version of OCPN to use -#define OCPN_API_VERSION_MAJOR ${OCPN_API_VERSION_MAJOR} -#define OCPN_API_VERSION_MINOR ${OCPN_API_VERSION_MINOR} -// Include extra version settings if required -${EXTRA_VERSION_INFO} +#define PLUGIN_NAME ${PROJECT_NAME} +#define PLUGIN_CATALOG_NAME wxS("opencpn-${PACKAGE_NAME}") +#define PLUGIN_VERSION_MAJOR ${VERSION_MAJOR} +#define PLUGIN_VERSION_MINOR ${VERSION_MINOR} +#define PLUGIN_VERSION_PATCH ${VERSION_PATCH} +#define PLUGIN_VERSION_TWEAK ${VERSION_TWEAK} +#define PLUGIN_VERSION_DATE "${VERSION_DATE}" +#define PLUGIN_COMMON_NAME "${COMMON_NAME}" +#define PLUGIN_SHORT_DESCRIPTION "${SHORT_DESCRIPTION}" +#define PLUGIN_LONG_DESCRIPTION "${LONG_DESCRIPTION}" +#define PLUGIN_PACKAGE_NAME "${PACKAGE_NAME}" +// API version of OCPN to use +#define OCPN_API_VERSION_MAJOR ${OCPN_API_VERSION_MAJOR} +#define OCPN_API_VERSION_MINOR ${OCPN_API_VERSION_MINOR} +// Include extra version settings if required +${EXTRA_VERSION_INFO} diff --git a/extinclude/GLES2/gl2.h b/extinclude/GLES2/gl2.h deleted file mode 100644 index 55e4b76c..00000000 --- a/extinclude/GLES2/gl2.h +++ /dev/null @@ -1,656 +0,0 @@ -#ifndef __gles2_gl2_h_ -#define __gles2_gl2_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright 2013-2020 The Khronos Group Inc. -** SPDX-License-Identifier: MIT -** -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** https://github.com/KhronosGroup/OpenGL-Registry -*/ - -#include - -#ifndef GL_APIENTRYP -#define GL_APIENTRYP GL_APIENTRY* -#endif - -#ifndef GL_GLES_PROTOTYPES -#define GL_GLES_PROTOTYPES 1 -#endif - -/* Generated on date 20210306 */ - -/* Generated C header for: - * API: gles2 - * Profile: common - * Versions considered: 2\.[0-9] - * Versions emitted: .* - * Default extensions included: None - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef GL_ES_VERSION_2_0 -#define GL_ES_VERSION_2_0 1 -#include -typedef khronos_int8_t GLbyte; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; -typedef khronos_int16_t GLshort; -typedef khronos_uint16_t GLushort; -typedef void GLvoid; -typedef struct __GLsync *GLsync; -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; -typedef unsigned int GLenum; -typedef unsigned int GLuint; -typedef char GLchar; -typedef khronos_float_t GLfloat; -typedef khronos_ssize_t GLsizeiptr; -typedef khronos_intptr_t GLintptr; -typedef unsigned int GLbitfield; -typedef int GLint; -typedef unsigned char GLboolean; -typedef int GLsizei; -typedef khronos_uint8_t GLubyte; -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_FALSE 0 -#define GL_TRUE 1 -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_FUNC_ADD 0x8006 -#define GL_BLEND_EQUATION 0x8009 -#define GL_BLEND_EQUATION_RGB 0x8009 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_STREAM_DRAW 0x88E0 -#define GL_STATIC_DRAW 0x88E4 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_CULL_FACE 0x0B44 -#define GL_BLEND 0x0BE2 -#define GL_DITHER 0x0BD0 -#define GL_STENCIL_TEST 0x0B90 -#define GL_DEPTH_TEST 0x0B71 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_OUT_OF_MEMORY 0x0505 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_LINE_WIDTH 0x0B21 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_VIEWPORT 0x0BA2 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_ALPHA_BITS 0x0D55 -#define GL_DEPTH_BITS 0x0D56 -#define GL_STENCIL_BITS 0x0D57 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_FIXED 0x140C -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_SHADER_TYPE 0x8B4F -#define GL_DELETE_STATUS 0x8B80 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_INVERT 0x150A -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_TEXTURE 0x1702 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_REPEAT 0x2901 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_COMPILE_STATUS 0x8B81 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGB565 0x8D62 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_NONE 0 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture); -typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask); -typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); -typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s); -typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures); -typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func); -typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); -typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap); -typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices); -typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap); -typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void); -typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); -typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures); -typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void); -typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data); -typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); -typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode); -typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap); -typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture); -typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width); -typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units); -typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); -typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); -typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); -typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass); -typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height); -#if GL_GLES_PROTOTYPES -GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); -GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); -GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); -GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); -GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); -GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode); -GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); -GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); -GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); -GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d); -GL_APICALL void GL_APIENTRY glClearStencil (GLint s); -GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); -GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); -GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); -GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); -GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); -GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); -GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); -GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); -GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); -GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); -GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); -GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); -GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f); -GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glDisable (GLenum cap); -GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); -GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); -GL_APICALL void GL_APIENTRY glEnable (GLenum cap); -GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glFinish (void); -GL_APICALL void GL_APIENTRY glFlush (void); -GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); -GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); -GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); -GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); -GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); -GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); -GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); -GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data); -GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); -GL_APICALL GLenum GL_APIENTRY glGetError (void); -GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data); -GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data); -GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name); -GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); -GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); -GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); -GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); -GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); -GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); -GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); -GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); -GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); -GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); -GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); -GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); -GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); -GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); -GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); -GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); -GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); -GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); -GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); -GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0); -GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0); -GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); -GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); -GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); -GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); -GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); -GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); -#endif -#endif /* GL_ES_VERSION_2_0 */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/extinclude/GLES2/gl2ext.h b/extinclude/GLES2/gl2ext.h deleted file mode 100644 index 477349b4..00000000 --- a/extinclude/GLES2/gl2ext.h +++ /dev/null @@ -1,3955 +0,0 @@ -#ifndef __gles2_gl2ext_h_ -#define __gles2_gl2ext_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright 2013-2020 The Khronos Group Inc. -** SPDX-License-Identifier: MIT -** -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** https://github.com/KhronosGroup/OpenGL-Registry -*/ - -#ifndef GL_APIENTRYP -#define GL_APIENTRYP GL_APIENTRY* -#endif - -/* Generated on date 20210512 */ - -/* Generated C header for: - * API: gles2 - * Profile: common - * Versions considered: 2\.[0-9] - * Versions emitted: _nomatch_^ - * Default extensions included: gles2 - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef GL_KHR_blend_equation_advanced -#define GL_KHR_blend_equation_advanced 1 -#define GL_MULTIPLY_KHR 0x9294 -#define GL_SCREEN_KHR 0x9295 -#define GL_OVERLAY_KHR 0x9296 -#define GL_DARKEN_KHR 0x9297 -#define GL_LIGHTEN_KHR 0x9298 -#define GL_COLORDODGE_KHR 0x9299 -#define GL_COLORBURN_KHR 0x929A -#define GL_HARDLIGHT_KHR 0x929B -#define GL_SOFTLIGHT_KHR 0x929C -#define GL_DIFFERENCE_KHR 0x929E -#define GL_EXCLUSION_KHR 0x92A0 -#define GL_HSL_HUE_KHR 0x92AD -#define GL_HSL_SATURATION_KHR 0x92AE -#define GL_HSL_COLOR_KHR 0x92AF -#define GL_HSL_LUMINOSITY_KHR 0x92B0 -typedef void (GL_APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void); -#endif -#endif /* GL_KHR_blend_equation_advanced */ - -#ifndef GL_KHR_blend_equation_advanced_coherent -#define GL_KHR_blend_equation_advanced_coherent 1 -#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 -#endif /* GL_KHR_blend_equation_advanced_coherent */ - -#ifndef GL_KHR_context_flush_control -#define GL_KHR_context_flush_control 1 -#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC -#endif /* GL_KHR_context_flush_control */ - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -typedef void (GL_APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -#define GL_SAMPLER 0x82E6 -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 -#define GL_DEBUG_SOURCE_API_KHR 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A -#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B -#define GL_DEBUG_TYPE_ERROR_KHR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 -#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 -#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D -#define GL_BUFFER_KHR 0x82E0 -#define GL_SHADER_KHR 0x82E1 -#define GL_PROGRAM_KHR 0x82E2 -#define GL_VERTEX_ARRAY_KHR 0x8074 -#define GL_QUERY_KHR 0x82E3 -#define GL_PROGRAM_PIPELINE_KHR 0x82E4 -#define GL_SAMPLER_KHR 0x82E6 -#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 -#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 -#define GL_DEBUG_OUTPUT_KHR 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 -#define GL_STACK_OVERFLOW_KHR 0x0503 -#define GL_STACK_UNDERFLOW_KHR 0x0504 -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam); -typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void); -typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam); -GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message); -GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void); -GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params); -#endif -#endif /* GL_KHR_debug */ - -#ifndef GL_KHR_no_error -#define GL_KHR_no_error 1 -#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 -#endif /* GL_KHR_no_error */ - -#ifndef GL_KHR_parallel_shader_compile -#define GL_KHR_parallel_shader_compile 1 -#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 -#define GL_COMPLETION_STATUS_KHR 0x91B1 -typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count); -#endif -#endif /* GL_KHR_parallel_shader_compile */ - -#ifndef GL_KHR_robust_buffer_access_behavior -#define GL_KHR_robust_buffer_access_behavior 1 -#endif /* GL_KHR_robust_buffer_access_behavior */ - -#ifndef GL_KHR_robustness -#define GL_KHR_robustness 1 -#define GL_CONTEXT_ROBUST_ACCESS_KHR 0x90F3 -#define GL_LOSE_CONTEXT_ON_RESET_KHR 0x8252 -#define GL_GUILTY_CONTEXT_RESET_KHR 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_KHR 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_KHR 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_KHR 0x8256 -#define GL_NO_RESET_NOTIFICATION_KHR 0x8261 -#define GL_CONTEXT_LOST_KHR 0x0507 -typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC) (void); -typedef void (GL_APIENTRYP PFNGLREADNPIXELSKHRPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusKHR (void); -GL_APICALL void GL_APIENTRY glReadnPixelsKHR (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GL_APICALL void GL_APIENTRY glGetnUniformfvKHR (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetnUniformivKHR (GLuint program, GLint location, GLsizei bufSize, GLint *params); -GL_APICALL void GL_APIENTRY glGetnUniformuivKHR (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -#endif -#endif /* GL_KHR_robustness */ - -#ifndef GL_KHR_shader_subgroup -#define GL_KHR_shader_subgroup 1 -#define GL_SUBGROUP_SIZE_KHR 0x9532 -#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533 -#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534 -#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535 -#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001 -#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002 -#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004 -#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008 -#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010 -#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020 -#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040 -#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080 -#endif /* GL_KHR_shader_subgroup */ - -#ifndef GL_KHR_texture_compression_astc_hdr -#define GL_KHR_texture_compression_astc_hdr 1 -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD -#endif /* GL_KHR_texture_compression_astc_hdr */ - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 -#endif /* GL_KHR_texture_compression_astc_ldr */ - -#ifndef GL_KHR_texture_compression_astc_sliced_3d -#define GL_KHR_texture_compression_astc_sliced_3d 1 -#endif /* GL_KHR_texture_compression_astc_sliced_3d */ - -#ifndef GL_OES_EGL_image -#define GL_OES_EGL_image 1 -typedef void *GLeglImageOES; -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); -GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); -#endif -#endif /* GL_OES_EGL_image */ - -#ifndef GL_OES_EGL_image_external -#define GL_OES_EGL_image_external 1 -#define GL_TEXTURE_EXTERNAL_OES 0x8D65 -#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 -#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 -#define GL_SAMPLER_EXTERNAL_OES 0x8D66 -#endif /* GL_OES_EGL_image_external */ - -#ifndef GL_OES_EGL_image_external_essl3 -#define GL_OES_EGL_image_external_essl3 1 -#endif /* GL_OES_EGL_image_external_essl3 */ - -#ifndef GL_OES_compressed_ETC1_RGB8_sub_texture -#define GL_OES_compressed_ETC1_RGB8_sub_texture 1 -#endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */ - -#ifndef GL_OES_compressed_ETC1_RGB8_texture -#define GL_OES_compressed_ETC1_RGB8_texture 1 -#define GL_ETC1_RGB8_OES 0x8D64 -#endif /* GL_OES_compressed_ETC1_RGB8_texture */ - -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#endif /* GL_OES_compressed_paletted_texture */ - -#ifndef GL_OES_copy_image -#define GL_OES_copy_image 1 -typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAOESPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyImageSubDataOES (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -#endif -#endif /* GL_OES_copy_image */ - -#ifndef GL_OES_depth24 -#define GL_OES_depth24 1 -#define GL_DEPTH_COMPONENT24_OES 0x81A6 -#endif /* GL_OES_depth24 */ - -#ifndef GL_OES_depth32 -#define GL_OES_depth32 1 -#define GL_DEPTH_COMPONENT32_OES 0x81A7 -#endif /* GL_OES_depth32 */ - -#ifndef GL_OES_depth_texture -#define GL_OES_depth_texture 1 -#endif /* GL_OES_depth_texture */ - -#ifndef GL_OES_draw_buffers_indexed -#define GL_OES_draw_buffers_indexed 1 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -typedef void (GL_APIENTRYP PFNGLENABLEIOESPROC) (GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLDISABLEIOESPROC) (GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIOESPROC) (GLuint buf, GLenum mode); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIOESPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCIOESPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIOESPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GL_APIENTRYP PFNGLCOLORMASKIOESPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIOESPROC) (GLenum target, GLuint index); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEnableiOES (GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glDisableiOES (GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glBlendEquationiOES (GLuint buf, GLenum mode); -GL_APICALL void GL_APIENTRY glBlendEquationSeparateiOES (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFunciOES (GLuint buf, GLenum src, GLenum dst); -GL_APICALL void GL_APIENTRY glBlendFuncSeparateiOES (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glColorMaskiOES (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GL_APICALL GLboolean GL_APIENTRY glIsEnablediOES (GLenum target, GLuint index); -#endif -#endif /* GL_OES_draw_buffers_indexed */ - -#ifndef GL_OES_draw_elements_base_vertex -#define GL_OES_draw_elements_base_vertex 1 -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); -#endif -#endif /* GL_OES_draw_elements_base_vertex */ - -#ifndef GL_OES_element_index_uint -#define GL_OES_element_index_uint 1 -#endif /* GL_OES_element_index_uint */ - -#ifndef GL_OES_fbo_render_mipmap -#define GL_OES_fbo_render_mipmap 1 -#endif /* GL_OES_fbo_render_mipmap */ - -#ifndef GL_OES_fragment_precision_high -#define GL_OES_fragment_precision_high 1 -#endif /* GL_OES_fragment_precision_high */ - -#ifndef GL_OES_geometry_point_size -#define GL_OES_geometry_point_size 1 -#endif /* GL_OES_geometry_point_size */ - -#ifndef GL_OES_geometry_shader -#define GL_OES_geometry_shader 1 -#define GL_GEOMETRY_SHADER_OES 0x8DD9 -#define GL_GEOMETRY_SHADER_BIT_OES 0x00000004 -#define GL_GEOMETRY_LINKED_VERTICES_OUT_OES 0x8916 -#define GL_GEOMETRY_LINKED_INPUT_TYPE_OES 0x8917 -#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_OES 0x8918 -#define GL_GEOMETRY_SHADER_INVOCATIONS_OES 0x887F -#define GL_LAYER_PROVOKING_VERTEX_OES 0x825E -#define GL_LINES_ADJACENCY_OES 0x000A -#define GL_LINE_STRIP_ADJACENCY_OES 0x000B -#define GL_TRIANGLES_ADJACENCY_OES 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_OES 0x000D -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8DDF -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_OES 0x8A2C -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8A32 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_OES 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_OES 0x9124 -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_OES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES 0x8DE1 -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_OES 0x8E5A -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_OES 0x8C29 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_OES 0x92CF -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_OES 0x92D5 -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_OES 0x90CD -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_OES 0x90D7 -#define GL_FIRST_VERTEX_CONVENTION_OES 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_OES 0x8E4E -#define GL_UNDEFINED_VERTEX_OES 0x8260 -#define GL_PRIMITIVES_GENERATED_OES 0x8C87 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS_OES 0x9312 -#define GL_MAX_FRAMEBUFFER_LAYERS_OES 0x9317 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_OES 0x8DA8 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_OES 0x8DA7 -#define GL_REFERENCED_BY_GEOMETRY_SHADER_OES 0x9309 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREOESPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferTextureOES (GLenum target, GLenum attachment, GLuint texture, GLint level); -#endif -#endif /* GL_OES_geometry_shader */ - -#ifndef GL_OES_get_program_binary -#define GL_OES_get_program_binary 1 -#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE -#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF -typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length); -#endif -#endif /* GL_OES_get_program_binary */ - -#ifndef GL_OES_gpu_shader5 -#define GL_OES_gpu_shader5 1 -#endif /* GL_OES_gpu_shader5 */ - -#ifndef GL_OES_mapbuffer -#define GL_OES_mapbuffer 1 -#define GL_WRITE_ONLY_OES 0x88B9 -#define GL_BUFFER_ACCESS_OES 0x88BB -#define GL_BUFFER_MAPPED_OES 0x88BC -#define GL_BUFFER_MAP_POINTER_OES 0x88BD -typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); -typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void *GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); -GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); -GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_OES_mapbuffer */ - -#ifndef GL_OES_packed_depth_stencil -#define GL_OES_packed_depth_stencil 1 -#define GL_DEPTH_STENCIL_OES 0x84F9 -#define GL_UNSIGNED_INT_24_8_OES 0x84FA -#define GL_DEPTH24_STENCIL8_OES 0x88F0 -#endif /* GL_OES_packed_depth_stencil */ - -#ifndef GL_OES_primitive_bounding_box -#define GL_OES_primitive_bounding_box 1 -#define GL_PRIMITIVE_BOUNDING_BOX_OES 0x92BE -typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXOESPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxOES (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -#endif -#endif /* GL_OES_primitive_bounding_box */ - -#ifndef GL_OES_required_internalformat -#define GL_OES_required_internalformat 1 -#define GL_ALPHA8_OES 0x803C -#define GL_DEPTH_COMPONENT16_OES 0x81A5 -#define GL_LUMINANCE4_ALPHA4_OES 0x8043 -#define GL_LUMINANCE8_ALPHA8_OES 0x8045 -#define GL_LUMINANCE8_OES 0x8040 -#define GL_RGBA4_OES 0x8056 -#define GL_RGB5_A1_OES 0x8057 -#define GL_RGB565_OES 0x8D62 -#define GL_RGB8_OES 0x8051 -#define GL_RGBA8_OES 0x8058 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB10_A2_EXT 0x8059 -#endif /* GL_OES_required_internalformat */ - -#ifndef GL_OES_rgb8_rgba8 -#define GL_OES_rgb8_rgba8 1 -#endif /* GL_OES_rgb8_rgba8 */ - -#ifndef GL_OES_sample_shading -#define GL_OES_sample_shading 1 -#define GL_SAMPLE_SHADING_OES 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE_OES 0x8C37 -typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGOESPROC) (GLfloat value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMinSampleShadingOES (GLfloat value); -#endif -#endif /* GL_OES_sample_shading */ - -#ifndef GL_OES_sample_variables -#define GL_OES_sample_variables 1 -#endif /* GL_OES_sample_variables */ - -#ifndef GL_OES_shader_image_atomic -#define GL_OES_shader_image_atomic 1 -#endif /* GL_OES_shader_image_atomic */ - -#ifndef GL_OES_shader_io_blocks -#define GL_OES_shader_io_blocks 1 -#endif /* GL_OES_shader_io_blocks */ - -#ifndef GL_OES_shader_multisample_interpolation -#define GL_OES_shader_multisample_interpolation 1 -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5C -#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES 0x8E5D -#endif /* GL_OES_shader_multisample_interpolation */ - -#ifndef GL_OES_standard_derivatives -#define GL_OES_standard_derivatives 1 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B -#endif /* GL_OES_standard_derivatives */ - -#ifndef GL_OES_stencil1 -#define GL_OES_stencil1 1 -#define GL_STENCIL_INDEX1_OES 0x8D46 -#endif /* GL_OES_stencil1 */ - -#ifndef GL_OES_stencil4 -#define GL_OES_stencil4 1 -#define GL_STENCIL_INDEX4_OES 0x8D47 -#endif /* GL_OES_stencil4 */ - -#ifndef GL_OES_surfaceless_context -#define GL_OES_surfaceless_context 1 -#define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219 -#endif /* GL_OES_surfaceless_context */ - -#ifndef GL_OES_tessellation_point_size -#define GL_OES_tessellation_point_size 1 -#endif /* GL_OES_tessellation_point_size */ - -#ifndef GL_OES_tessellation_shader -#define GL_OES_tessellation_shader 1 -#define GL_PATCHES_OES 0x000E -#define GL_PATCH_VERTICES_OES 0x8E72 -#define GL_TESS_CONTROL_OUTPUT_VERTICES_OES 0x8E75 -#define GL_TESS_GEN_MODE_OES 0x8E76 -#define GL_TESS_GEN_SPACING_OES 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER_OES 0x8E78 -#define GL_TESS_GEN_POINT_MODE_OES 0x8E79 -#define GL_ISOLINES_OES 0x8E7A -#define GL_QUADS_OES 0x0007 -#define GL_FRACTIONAL_ODD_OES 0x8E7B -#define GL_FRACTIONAL_EVEN_OES 0x8E7C -#define GL_MAX_PATCH_VERTICES_OES 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL_OES 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_OES 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_OES 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_OES 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS_OES 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_OES 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_OES 0x8E86 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_OES 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_OES 0x8E8A -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_OES 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_OES 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E1F -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_OES 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_OES 0x92CE -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_OES 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_OES 0x92D4 -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_OES 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_OES 0x90CC -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_OES 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_OES 0x90D9 -#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED_OES 0x8221 -#define GL_IS_PER_PATCH_OES 0x92E7 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_OES 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_OES 0x9308 -#define GL_TESS_CONTROL_SHADER_OES 0x8E88 -#define GL_TESS_EVALUATION_SHADER_OES 0x8E87 -#define GL_TESS_CONTROL_SHADER_BIT_OES 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT_OES 0x00000010 -typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIOESPROC) (GLenum pname, GLint value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPatchParameteriOES (GLenum pname, GLint value); -#endif -#endif /* GL_OES_tessellation_shader */ - -#ifndef GL_OES_texture_3D -#define GL_OES_texture_3D 1 -#define GL_TEXTURE_WRAP_R_OES 0x8072 -#define GL_TEXTURE_3D_OES 0x806F -#define GL_TEXTURE_BINDING_3D_OES 0x806A -#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 -#define GL_SAMPLER_3D_OES 0x8B5F -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 -typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -#endif -#endif /* GL_OES_texture_3D */ - -#ifndef GL_OES_texture_border_clamp -#define GL_OES_texture_border_clamp 1 -#define GL_TEXTURE_BORDER_COLOR_OES 0x1004 -#define GL_CLAMP_TO_BORDER_OES 0x812D -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, const GLuint *param); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexParameterIivOES (GLenum target, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glTexParameterIuivOES (GLenum target, GLenum pname, const GLuint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIivOES (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIuivOES (GLenum target, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glSamplerParameterIivOES (GLuint sampler, GLenum pname, const GLint *param); -GL_APICALL void GL_APIENTRY glSamplerParameterIuivOES (GLuint sampler, GLenum pname, const GLuint *param); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIivOES (GLuint sampler, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivOES (GLuint sampler, GLenum pname, GLuint *params); -#endif -#endif /* GL_OES_texture_border_clamp */ - -#ifndef GL_OES_texture_buffer -#define GL_OES_texture_buffer 1 -#define GL_TEXTURE_BUFFER_OES 0x8C2A -#define GL_TEXTURE_BUFFER_BINDING_OES 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_OES 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_OES 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_OES 0x8C2D -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_OES 0x919F -#define GL_SAMPLER_BUFFER_OES 0x8DC2 -#define GL_INT_SAMPLER_BUFFER_OES 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_OES 0x8DD8 -#define GL_IMAGE_BUFFER_OES 0x9051 -#define GL_INT_IMAGE_BUFFER_OES 0x905C -#define GL_UNSIGNED_INT_IMAGE_BUFFER_OES 0x9067 -#define GL_TEXTURE_BUFFER_OFFSET_OES 0x919D -#define GL_TEXTURE_BUFFER_SIZE_OES 0x919E -typedef void (GL_APIENTRYP PFNGLTEXBUFFEROESPROC) (GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEOESPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexBufferOES (GLenum target, GLenum internalformat, GLuint buffer); -GL_APICALL void GL_APIENTRY glTexBufferRangeOES (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -#endif -#endif /* GL_OES_texture_buffer */ - -#ifndef GL_OES_texture_compression_astc -#define GL_OES_texture_compression_astc 1 -#define GL_COMPRESSED_RGBA_ASTC_3x3x3_OES 0x93C0 -#define GL_COMPRESSED_RGBA_ASTC_4x3x3_OES 0x93C1 -#define GL_COMPRESSED_RGBA_ASTC_4x4x3_OES 0x93C2 -#define GL_COMPRESSED_RGBA_ASTC_4x4x4_OES 0x93C3 -#define GL_COMPRESSED_RGBA_ASTC_5x4x4_OES 0x93C4 -#define GL_COMPRESSED_RGBA_ASTC_5x5x4_OES 0x93C5 -#define GL_COMPRESSED_RGBA_ASTC_5x5x5_OES 0x93C6 -#define GL_COMPRESSED_RGBA_ASTC_6x5x5_OES 0x93C7 -#define GL_COMPRESSED_RGBA_ASTC_6x6x5_OES 0x93C8 -#define GL_COMPRESSED_RGBA_ASTC_6x6x6_OES 0x93C9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES 0x93E0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES 0x93E1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES 0x93E2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES 0x93E3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES 0x93E4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES 0x93E5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES 0x93E6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES 0x93E7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES 0x93E8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES 0x93E9 -#endif /* GL_OES_texture_compression_astc */ - -#ifndef GL_OES_texture_cube_map_array -#define GL_OES_texture_cube_map_array 1 -#define GL_TEXTURE_CUBE_MAP_ARRAY_OES 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_OES 0x900A -#define GL_SAMPLER_CUBE_MAP_ARRAY_OES 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_OES 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900F -#define GL_IMAGE_CUBE_MAP_ARRAY_OES 0x9054 -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x905F -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x906A -#endif /* GL_OES_texture_cube_map_array */ - -#ifndef GL_OES_texture_float -#define GL_OES_texture_float 1 -#endif /* GL_OES_texture_float */ - -#ifndef GL_OES_texture_float_linear -#define GL_OES_texture_float_linear 1 -#endif /* GL_OES_texture_float_linear */ - -#ifndef GL_OES_texture_half_float -#define GL_OES_texture_half_float 1 -#define GL_HALF_FLOAT_OES 0x8D61 -#endif /* GL_OES_texture_half_float */ - -#ifndef GL_OES_texture_half_float_linear -#define GL_OES_texture_half_float_linear 1 -#endif /* GL_OES_texture_half_float_linear */ - -#ifndef GL_OES_texture_npot -#define GL_OES_texture_npot 1 -#endif /* GL_OES_texture_npot */ - -#ifndef GL_OES_texture_stencil8 -#define GL_OES_texture_stencil8 1 -#define GL_STENCIL_INDEX_OES 0x1901 -#define GL_STENCIL_INDEX8_OES 0x8D48 -#endif /* GL_OES_texture_stencil8 */ - -#ifndef GL_OES_texture_storage_multisample_2d_array -#define GL_OES_texture_storage_multisample_2d_array 1 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES 0x9102 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES 0x9105 -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910D -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEOESPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleOES (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -#endif -#endif /* GL_OES_texture_storage_multisample_2d_array */ - -#ifndef GL_OES_texture_view -#define GL_OES_texture_view 1 -#define GL_TEXTURE_VIEW_MIN_LEVEL_OES 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS_OES 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER_OES 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS_OES 0x82DE -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF -typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWOESPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTextureViewOES (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -#endif -#endif /* GL_OES_texture_view */ - -#ifndef GL_OES_vertex_array_object -#define GL_OES_vertex_array_object 1 -#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 -typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); -typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); -typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); -GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); -GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); -GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); -#endif -#endif /* GL_OES_vertex_array_object */ - -#ifndef GL_OES_vertex_half_float -#define GL_OES_vertex_half_float 1 -#endif /* GL_OES_vertex_half_float */ - -#ifndef GL_OES_vertex_type_10_10_10_2 -#define GL_OES_vertex_type_10_10_10_2 1 -#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 -#define GL_INT_10_10_10_2_OES 0x8DF7 -#endif /* GL_OES_vertex_type_10_10_10_2 */ - -#ifndef GL_OES_viewport_array -#define GL_OES_viewport_array 1 -#define GL_MAX_VIEWPORTS_OES 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS_OES 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE_OES 0x825D -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_OES 0x825F -typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVOESPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFOESPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVOESPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVOESPROC) (GLuint first, GLsizei count, const GLint *v); -typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDOESPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVOESPROC) (GLuint index, const GLint *v); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVOESPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFOESPROC) (GLuint index, GLfloat n, GLfloat f); -typedef void (GL_APIENTRYP PFNGLGETFLOATI_VOESPROC) (GLenum target, GLuint index, GLfloat *data); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glViewportArrayvOES (GLuint first, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glViewportIndexedfOES (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -GL_APICALL void GL_APIENTRY glViewportIndexedfvOES (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glScissorArrayvOES (GLuint first, GLsizei count, const GLint *v); -GL_APICALL void GL_APIENTRY glScissorIndexedOES (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glScissorIndexedvOES (GLuint index, const GLint *v); -GL_APICALL void GL_APIENTRY glDepthRangeArrayfvOES (GLuint first, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glDepthRangeIndexedfOES (GLuint index, GLfloat n, GLfloat f); -GL_APICALL void GL_APIENTRY glGetFloati_vOES (GLenum target, GLuint index, GLfloat *data); -#endif -#endif /* GL_OES_viewport_array */ - -#ifndef GL_AMD_compressed_3DC_texture -#define GL_AMD_compressed_3DC_texture 1 -#define GL_3DC_X_AMD 0x87F9 -#define GL_3DC_XY_AMD 0x87FA -#endif /* GL_AMD_compressed_3DC_texture */ - -#ifndef GL_AMD_compressed_ATC_texture -#define GL_AMD_compressed_ATC_texture 1 -#define GL_ATC_RGB_AMD 0x8C92 -#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 -#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE -#endif /* GL_AMD_compressed_ATC_texture */ - -#ifndef GL_AMD_framebuffer_multisample_advanced -#define GL_AMD_framebuffer_multisample_advanced 1 -#define GL_RENDERBUFFER_STORAGE_SAMPLES_AMD 0x91B2 -#define GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD 0x91B3 -#define GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD 0x91B4 -#define GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD 0x91B5 -#define GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B6 -#define GL_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B7 -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAdvancedAMD (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glNamedRenderbufferStorageMultisampleAdvancedAMD (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_AMD_framebuffer_multisample_advanced */ - -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); -typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); -GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); -GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); -GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); -GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif -#endif /* GL_AMD_performance_monitor */ - -#ifndef GL_AMD_program_binary_Z400 -#define GL_AMD_program_binary_Z400 1 -#define GL_Z400_BINARY_AMD 0x8740 -#endif /* GL_AMD_program_binary_Z400 */ - -#ifndef GL_ANDROID_extension_pack_es31a -#define GL_ANDROID_extension_pack_es31a 1 -#endif /* GL_ANDROID_extension_pack_es31a */ - -#ifndef GL_ANGLE_depth_texture -#define GL_ANGLE_depth_texture 1 -#endif /* GL_ANGLE_depth_texture */ - -#ifndef GL_ANGLE_framebuffer_blit -#define GL_ANGLE_framebuffer_blit 1 -#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -#endif /* GL_ANGLE_framebuffer_blit */ - -#ifndef GL_ANGLE_framebuffer_multisample -#define GL_ANGLE_framebuffer_multisample 1 -#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 -#define GL_MAX_SAMPLES_ANGLE 0x8D57 -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_ANGLE_framebuffer_multisample */ - -#ifndef GL_ANGLE_instanced_arrays -#define GL_ANGLE_instanced_arrays 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor); -#endif -#endif /* GL_ANGLE_instanced_arrays */ - -#ifndef GL_ANGLE_pack_reverse_row_order -#define GL_ANGLE_pack_reverse_row_order 1 -#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 -#endif /* GL_ANGLE_pack_reverse_row_order */ - -#ifndef GL_ANGLE_program_binary -#define GL_ANGLE_program_binary 1 -#define GL_PROGRAM_BINARY_ANGLE 0x93A6 -#endif /* GL_ANGLE_program_binary */ - -#ifndef GL_ANGLE_texture_compression_dxt3 -#define GL_ANGLE_texture_compression_dxt3 1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 -#endif /* GL_ANGLE_texture_compression_dxt3 */ - -#ifndef GL_ANGLE_texture_compression_dxt5 -#define GL_ANGLE_texture_compression_dxt5 1 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 -#endif /* GL_ANGLE_texture_compression_dxt5 */ - -#ifndef GL_ANGLE_texture_usage -#define GL_ANGLE_texture_usage 1 -#define GL_TEXTURE_USAGE_ANGLE 0x93A2 -#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 -#endif /* GL_ANGLE_texture_usage */ - -#ifndef GL_ANGLE_translated_shader_source -#define GL_ANGLE_translated_shader_source 1 -#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 -typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -#endif -#endif /* GL_ANGLE_translated_shader_source */ - -#ifndef GL_APPLE_clip_distance -#define GL_APPLE_clip_distance 1 -#define GL_MAX_CLIP_DISTANCES_APPLE 0x0D32 -#define GL_CLIP_DISTANCE0_APPLE 0x3000 -#define GL_CLIP_DISTANCE1_APPLE 0x3001 -#define GL_CLIP_DISTANCE2_APPLE 0x3002 -#define GL_CLIP_DISTANCE3_APPLE 0x3003 -#define GL_CLIP_DISTANCE4_APPLE 0x3004 -#define GL_CLIP_DISTANCE5_APPLE 0x3005 -#define GL_CLIP_DISTANCE6_APPLE 0x3006 -#define GL_CLIP_DISTANCE7_APPLE 0x3007 -#endif /* GL_APPLE_clip_distance */ - -#ifndef GL_APPLE_color_buffer_packed_float -#define GL_APPLE_color_buffer_packed_float 1 -#endif /* GL_APPLE_color_buffer_packed_float */ - -#ifndef GL_APPLE_copy_texture_levels -#define GL_APPLE_copy_texture_levels 1 -typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); -#endif -#endif /* GL_APPLE_copy_texture_levels */ - -#ifndef GL_APPLE_framebuffer_multisample -#define GL_APPLE_framebuffer_multisample 1 -#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 -#define GL_MAX_SAMPLES_APPLE 0x8D57 -#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); -#endif -#endif /* GL_APPLE_framebuffer_multisample */ - -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 -#define GL_RGB_422_APPLE 0x8A1F -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#define GL_RGB_RAW_422_APPLE 0x8A51 -#endif /* GL_APPLE_rgb_422 */ - -#ifndef GL_APPLE_sync -#define GL_APPLE_sync 1 -#define GL_SYNC_OBJECT_APPLE 0x8A53 -#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 -#define GL_OBJECT_TYPE_APPLE 0x9112 -#define GL_SYNC_CONDITION_APPLE 0x9113 -#define GL_SYNC_STATUS_APPLE 0x9114 -#define GL_SYNC_FLAGS_APPLE 0x9115 -#define GL_SYNC_FENCE_APPLE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 -#define GL_UNSIGNALED_APPLE 0x9118 -#define GL_SIGNALED_APPLE 0x9119 -#define GL_ALREADY_SIGNALED_APPLE 0x911A -#define GL_TIMEOUT_EXPIRED_APPLE 0x911B -#define GL_CONDITION_SATISFIED_APPLE 0x911C -#define GL_WAIT_FAILED_APPLE 0x911D -#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 -#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull -typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); -typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); -typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); -typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); -GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); -GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); -GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); -#endif -#endif /* GL_APPLE_sync */ - -#ifndef GL_APPLE_texture_format_BGRA8888 -#define GL_APPLE_texture_format_BGRA8888 1 -#define GL_BGRA_EXT 0x80E1 -#define GL_BGRA8_EXT 0x93A1 -#endif /* GL_APPLE_texture_format_BGRA8888 */ - -#ifndef GL_APPLE_texture_max_level -#define GL_APPLE_texture_max_level 1 -#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D -#endif /* GL_APPLE_texture_max_level */ - -#ifndef GL_APPLE_texture_packed_float -#define GL_APPLE_texture_packed_float 1 -#define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B -#define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E -#define GL_R11F_G11F_B10F_APPLE 0x8C3A -#define GL_RGB9_E5_APPLE 0x8C3D -#endif /* GL_APPLE_texture_packed_float */ - -#ifndef GL_ARM_mali_program_binary -#define GL_ARM_mali_program_binary 1 -#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 -#endif /* GL_ARM_mali_program_binary */ - -#ifndef GL_ARM_mali_shader_binary -#define GL_ARM_mali_shader_binary 1 -#define GL_MALI_SHADER_BINARY_ARM 0x8F60 -#endif /* GL_ARM_mali_shader_binary */ - -#ifndef GL_ARM_rgba8 -#define GL_ARM_rgba8 1 -#endif /* GL_ARM_rgba8 */ - -#ifndef GL_ARM_shader_framebuffer_fetch -#define GL_ARM_shader_framebuffer_fetch 1 -#define GL_FETCH_PER_SAMPLE_ARM 0x8F65 -#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 -#endif /* GL_ARM_shader_framebuffer_fetch */ - -#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil -#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1 -#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */ - -#ifndef GL_ARM_texture_unnormalized_coordinates -#define GL_ARM_texture_unnormalized_coordinates 1 -#define GL_TEXTURE_UNNORMALIZED_COORDINATES_ARM 0x8F6A -#endif /* GL_ARM_texture_unnormalized_coordinates */ - -#ifndef GL_DMP_program_binary -#define GL_DMP_program_binary 1 -#define GL_SMAPHS30_PROGRAM_BINARY_DMP 0x9251 -#define GL_SMAPHS_PROGRAM_BINARY_DMP 0x9252 -#define GL_DMP_PROGRAM_BINARY_DMP 0x9253 -#endif /* GL_DMP_program_binary */ - -#ifndef GL_DMP_shader_binary -#define GL_DMP_shader_binary 1 -#define GL_SHADER_BINARY_DMP 0x9250 -#endif /* GL_DMP_shader_binary */ - -#ifndef GL_EXT_EGL_image_array -#define GL_EXT_EGL_image_array 1 -#endif /* GL_EXT_EGL_image_array */ - -#ifndef GL_EXT_EGL_image_storage -#define GL_EXT_EGL_image_storage 1 -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list); -GL_APICALL void GL_APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list); -#endif -#endif /* GL_EXT_EGL_image_storage */ - -#ifndef GL_EXT_YUV_target -#define GL_EXT_YUV_target 1 -#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7 -#endif /* GL_EXT_YUV_target */ - -#ifndef GL_EXT_base_instance -#define GL_EXT_base_instance 1 -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedBaseInstanceEXT (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -#endif -#endif /* GL_EXT_base_instance */ - -#ifndef GL_EXT_blend_func_extended -#define GL_EXT_blend_func_extended 1 -#define GL_SRC1_COLOR_EXT 0x88F9 -#define GL_SRC1_ALPHA_EXT 0x8589 -#define GL_ONE_MINUS_SRC1_COLOR_EXT 0x88FA -#define GL_ONE_MINUS_SRC1_ALPHA_EXT 0x88FB -#define GL_SRC_ALPHA_SATURATE_EXT 0x0308 -#define GL_LOCATION_INDEX_EXT 0x930F -#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC -typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATAINDEXEXTPROC) (GLuint program, const GLchar *name); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBindFragDataLocationIndexedEXT (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -GL_APICALL void GL_APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); -GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocationIndexEXT (GLuint program, GLenum programInterface, const GLchar *name); -GL_APICALL GLint GL_APIENTRY glGetFragDataIndexEXT (GLuint program, const GLchar *name); -#endif -#endif /* GL_EXT_blend_func_extended */ - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#endif /* GL_EXT_blend_minmax */ - -#ifndef GL_EXT_buffer_storage -#define GL_EXT_buffer_storage 1 -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_PERSISTENT_BIT_EXT 0x0040 -#define GL_MAP_COHERENT_BIT_EXT 0x0080 -#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 -#define GL_CLIENT_STORAGE_BIT_EXT 0x0200 -#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 -#define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F -#define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 -typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBufferStorageEXT (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -#endif -#endif /* GL_EXT_buffer_storage */ - -#ifndef GL_EXT_clear_texture -#define GL_EXT_clear_texture 1 -typedef void (GL_APIENTRYP PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -typedef void (GL_APIENTRYP PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glClearTexImageEXT (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -GL_APICALL void GL_APIENTRY glClearTexSubImageEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -#endif -#endif /* GL_EXT_clear_texture */ - -#ifndef GL_EXT_clip_control -#define GL_EXT_clip_control 1 -#define GL_LOWER_LEFT_EXT 0x8CA1 -#define GL_UPPER_LEFT_EXT 0x8CA2 -#define GL_NEGATIVE_ONE_TO_ONE_EXT 0x935E -#define GL_ZERO_TO_ONE_EXT 0x935F -#define GL_CLIP_ORIGIN_EXT 0x935C -#define GL_CLIP_DEPTH_MODE_EXT 0x935D -typedef void (GL_APIENTRYP PFNGLCLIPCONTROLEXTPROC) (GLenum origin, GLenum depth); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glClipControlEXT (GLenum origin, GLenum depth); -#endif -#endif /* GL_EXT_clip_control */ - -#ifndef GL_EXT_clip_cull_distance -#define GL_EXT_clip_cull_distance 1 -#define GL_MAX_CLIP_DISTANCES_EXT 0x0D32 -#define GL_MAX_CULL_DISTANCES_EXT 0x82F9 -#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA -#define GL_CLIP_DISTANCE0_EXT 0x3000 -#define GL_CLIP_DISTANCE1_EXT 0x3001 -#define GL_CLIP_DISTANCE2_EXT 0x3002 -#define GL_CLIP_DISTANCE3_EXT 0x3003 -#define GL_CLIP_DISTANCE4_EXT 0x3004 -#define GL_CLIP_DISTANCE5_EXT 0x3005 -#define GL_CLIP_DISTANCE6_EXT 0x3006 -#define GL_CLIP_DISTANCE7_EXT 0x3007 -#endif /* GL_EXT_clip_cull_distance */ - -#ifndef GL_EXT_color_buffer_float -#define GL_EXT_color_buffer_float 1 -#endif /* GL_EXT_color_buffer_float */ - -#ifndef GL_EXT_color_buffer_half_float -#define GL_EXT_color_buffer_half_float 1 -#define GL_RGBA16F_EXT 0x881A -#define GL_RGB16F_EXT 0x881B -#define GL_RG16F_EXT 0x822F -#define GL_R16F_EXT 0x822D -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 -#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 -#endif /* GL_EXT_color_buffer_half_float */ - -#ifndef GL_EXT_conservative_depth -#define GL_EXT_conservative_depth 1 -#endif /* GL_EXT_conservative_depth */ - -#ifndef GL_EXT_copy_image -#define GL_EXT_copy_image 1 -typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAEXTPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyImageSubDataEXT (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -#endif -#endif /* GL_EXT_copy_image */ - -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -#define GL_TRANSFORM_FEEDBACK 0x8E22 -typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -#endif /* GL_EXT_debug_label */ - -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); -GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); -GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void); -#endif -#endif /* GL_EXT_debug_marker */ - -#ifndef GL_EXT_depth_clamp -#define GL_EXT_depth_clamp 1 -#define GL_DEPTH_CLAMP_EXT 0x864F -#endif /* GL_EXT_depth_clamp */ - -#ifndef GL_EXT_discard_framebuffer -#define GL_EXT_discard_framebuffer 1 -#define GL_COLOR_EXT 0x1800 -#define GL_DEPTH_EXT 0x1801 -#define GL_STENCIL_EXT 0x1802 -typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); -#endif -#endif /* GL_EXT_discard_framebuffer */ - -#ifndef GL_EXT_disjoint_timer_query -#define GL_EXT_disjoint_timer_query 1 -#define GL_QUERY_COUNTER_BITS_EXT 0x8864 -#define GL_CURRENT_QUERY_EXT 0x8865 -#define GL_QUERY_RESULT_EXT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 -#define GL_TIME_ELAPSED_EXT 0x88BF -#define GL_TIMESTAMP_EXT 0x8E28 -#define GL_GPU_DISJOINT_EXT 0x8FBB -typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); -typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); -typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); -typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target); -typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64VEXTPROC) (GLenum pname, GLint64 *data); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids); -GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids); -GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id); -GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id); -GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target); -GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target); -GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); -GL_APICALL void GL_APIENTRY glGetInteger64vEXT (GLenum pname, GLint64 *data); -#endif -#endif /* GL_EXT_disjoint_timer_query */ - -#ifndef GL_EXT_draw_buffers -#define GL_EXT_draw_buffers 1 -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 -#define GL_DRAW_BUFFER0_EXT 0x8825 -#define GL_DRAW_BUFFER1_EXT 0x8826 -#define GL_DRAW_BUFFER2_EXT 0x8827 -#define GL_DRAW_BUFFER3_EXT 0x8828 -#define GL_DRAW_BUFFER4_EXT 0x8829 -#define GL_DRAW_BUFFER5_EXT 0x882A -#define GL_DRAW_BUFFER6_EXT 0x882B -#define GL_DRAW_BUFFER7_EXT 0x882C -#define GL_DRAW_BUFFER8_EXT 0x882D -#define GL_DRAW_BUFFER9_EXT 0x882E -#define GL_DRAW_BUFFER10_EXT 0x882F -#define GL_DRAW_BUFFER11_EXT 0x8830 -#define GL_DRAW_BUFFER12_EXT 0x8831 -#define GL_DRAW_BUFFER13_EXT 0x8832 -#define GL_DRAW_BUFFER14_EXT 0x8833 -#define GL_DRAW_BUFFER15_EXT 0x8834 -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs); -#endif -#endif /* GL_EXT_draw_buffers */ - -#ifndef GL_EXT_draw_buffers_indexed -#define GL_EXT_draw_buffers_indexed 1 -typedef void (GL_APIENTRYP PFNGLENABLEIEXTPROC) (GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GL_APIENTRYP PFNGLCOLORMASKIEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEnableiEXT (GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glDisableiEXT (GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glBlendEquationiEXT (GLuint buf, GLenum mode); -GL_APICALL void GL_APIENTRY glBlendEquationSeparateiEXT (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFunciEXT (GLuint buf, GLenum src, GLenum dst); -GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXT (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glColorMaskiEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT (GLenum target, GLuint index); -#endif -#endif /* GL_EXT_draw_buffers_indexed */ - -#ifndef GL_EXT_draw_elements_base_vertex -#define GL_EXT_draw_elements_base_vertex 1 -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -#endif -#endif /* GL_EXT_draw_elements_base_vertex */ - -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#endif -#endif /* GL_EXT_draw_instanced */ - -#ifndef GL_EXT_draw_transform_feedback -#define GL_EXT_draw_transform_feedback 1 -typedef void (GL_APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKEXTPROC) (GLenum mode, GLuint id); -typedef void (GL_APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDEXTPROC) (GLenum mode, GLuint id, GLsizei instancecount); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawTransformFeedbackEXT (GLenum mode, GLuint id); -GL_APICALL void GL_APIENTRY glDrawTransformFeedbackInstancedEXT (GLenum mode, GLuint id, GLsizei instancecount); -#endif -#endif /* GL_EXT_draw_transform_feedback */ - -#ifndef GL_EXT_external_buffer -#define GL_EXT_external_buffer 1 -typedef void *GLeglClientBufferEXT; -typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -GL_APICALL void GL_APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -#endif -#endif /* GL_EXT_external_buffer */ - -#ifndef GL_EXT_float_blend -#define GL_EXT_float_blend 1 -#endif /* GL_EXT_float_blend */ - -#ifndef GL_EXT_geometry_point_size -#define GL_EXT_geometry_point_size 1 -#endif /* GL_EXT_geometry_point_size */ - -#ifndef GL_EXT_geometry_shader -#define GL_EXT_geometry_shader 1 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 -#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 -#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 -#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 -#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F -#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_UNDEFINED_VERTEX_EXT 0x8260 -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 -#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); -#endif -#endif /* GL_EXT_geometry_shader */ - -#ifndef GL_EXT_gpu_shader5 -#define GL_EXT_gpu_shader5 1 -#endif /* GL_EXT_gpu_shader5 */ - -#ifndef GL_EXT_instanced_arrays -#define GL_EXT_instanced_arrays 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXT (GLuint index, GLuint divisor); -#endif -#endif /* GL_EXT_instanced_arrays */ - -#ifndef GL_EXT_map_buffer_range -#define GL_EXT_map_buffer_range 1 -#define GL_MAP_READ_BIT_EXT 0x0001 -#define GL_MAP_WRITE_BIT_EXT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 -typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void *GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); -#endif -#endif /* GL_EXT_map_buffer_range */ - -#ifndef GL_EXT_memory_object -#define GL_EXT_memory_object 1 -#define GL_TEXTURE_TILING_EXT 0x9580 -#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 -#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B -#define GL_NUM_TILING_TYPES_EXT 0x9582 -#define GL_TILING_TYPES_EXT 0x9583 -#define GL_OPTIMAL_TILING_EXT 0x9584 -#define GL_LINEAR_TILING_EXT 0x9585 -#define GL_NUM_DEVICE_UUIDS_EXT 0x9596 -#define GL_DEVICE_UUID_EXT 0x9597 -#define GL_DRIVER_UUID_EXT 0x9598 -#define GL_UUID_SIZE_EXT 16 -typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte *data); -typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte *data); -typedef void (GL_APIENTRYP PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint *memoryObjects); -typedef GLboolean (GL_APIENTRYP PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject); -typedef void (GL_APIENTRYP PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint *memoryObjects); -typedef void (GL_APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetUnsignedBytevEXT (GLenum pname, GLubyte *data); -GL_APICALL void GL_APIENTRY glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte *data); -GL_APICALL void GL_APIENTRY glDeleteMemoryObjectsEXT (GLsizei n, const GLuint *memoryObjects); -GL_APICALL GLboolean GL_APIENTRY glIsMemoryObjectEXT (GLuint memoryObject); -GL_APICALL void GL_APIENTRY glCreateMemoryObjectsEXT (GLsizei n, GLuint *memoryObjects); -GL_APICALL void GL_APIENTRY glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); -#endif -#endif /* GL_EXT_memory_object */ - -#ifndef GL_EXT_memory_object_fd -#define GL_EXT_memory_object_fd 1 -#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 -typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); -#endif -#endif /* GL_EXT_memory_object_fd */ - -#ifndef GL_EXT_memory_object_win32 -#define GL_EXT_memory_object_win32 1 -#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 -#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 -#define GL_DEVICE_LUID_EXT 0x9599 -#define GL_DEVICE_NODE_MASK_EXT 0x959A -#define GL_LUID_SIZE_EXT 8 -#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 -#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A -#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B -#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C -typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle); -typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle); -GL_APICALL void GL_APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name); -#endif -#endif /* GL_EXT_memory_object_win32 */ - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); -#endif -#endif /* GL_EXT_multi_draw_arrays */ - -#ifndef GL_EXT_multi_draw_indirect -#define GL_EXT_multi_draw_indirect 1 -typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMultiDrawArraysIndirectEXT (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); -GL_APICALL void GL_APIENTRY glMultiDrawElementsIndirectEXT (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); -#endif -#endif /* GL_EXT_multi_draw_indirect */ - -#ifndef GL_EXT_multisampled_compatibility -#define GL_EXT_multisampled_compatibility 1 -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#endif /* GL_EXT_multisampled_compatibility */ - -#ifndef GL_EXT_multisampled_render_to_texture -#define GL_EXT_multisampled_render_to_texture 1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif -#endif /* GL_EXT_multisampled_render_to_texture */ - -#ifndef GL_EXT_multisampled_render_to_texture2 -#define GL_EXT_multisampled_render_to_texture2 1 -#endif /* GL_EXT_multisampled_render_to_texture2 */ - -#ifndef GL_EXT_multiview_draw_buffers -#define GL_EXT_multiview_draw_buffers 1 -#define GL_COLOR_ATTACHMENT_EXT 0x90F0 -#define GL_MULTIVIEW_EXT 0x90F1 -#define GL_DRAW_BUFFER_EXT 0x0C01 -#define GL_READ_BUFFER_EXT 0x0C02 -#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 -typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices); -typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index); -GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices); -GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data); -#endif -#endif /* GL_EXT_multiview_draw_buffers */ - -#ifndef GL_EXT_multiview_tessellation_geometry_shader -#define GL_EXT_multiview_tessellation_geometry_shader 1 -#endif /* GL_EXT_multiview_tessellation_geometry_shader */ - -#ifndef GL_EXT_multiview_texture_multisample -#define GL_EXT_multiview_texture_multisample 1 -#endif /* GL_EXT_multiview_texture_multisample */ - -#ifndef GL_EXT_multiview_timer_query -#define GL_EXT_multiview_timer_query 1 -#endif /* GL_EXT_multiview_timer_query */ - -#ifndef GL_EXT_occlusion_query_boolean -#define GL_EXT_occlusion_query_boolean 1 -#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A -#endif /* GL_EXT_occlusion_query_boolean */ - -#ifndef GL_EXT_polygon_offset_clamp -#define GL_EXT_polygon_offset_clamp 1 -#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B -typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPolygonOffsetClampEXT (GLfloat factor, GLfloat units, GLfloat clamp); -#endif -#endif /* GL_EXT_polygon_offset_clamp */ - -#ifndef GL_EXT_post_depth_coverage -#define GL_EXT_post_depth_coverage 1 -#endif /* GL_EXT_post_depth_coverage */ - -#ifndef GL_EXT_primitive_bounding_box -#define GL_EXT_primitive_bounding_box 1 -#define GL_PRIMITIVE_BOUNDING_BOX_EXT 0x92BE -typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXEXTPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxEXT (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -#endif -#endif /* GL_EXT_primitive_bounding_box */ - -#ifndef GL_EXT_protected_textures -#define GL_EXT_protected_textures 1 -#define GL_CONTEXT_FLAG_PROTECTED_CONTENT_BIT_EXT 0x00000010 -#define GL_TEXTURE_PROTECTED_EXT 0x8BFA -#endif /* GL_EXT_protected_textures */ - -#ifndef GL_EXT_pvrtc_sRGB -#define GL_EXT_pvrtc_sRGB 1 -#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 -#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 -#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 -#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 -#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG 0x93F0 -#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1 -#endif /* GL_EXT_pvrtc_sRGB */ - -#ifndef GL_EXT_raster_multisample -#define GL_EXT_raster_multisample 1 -#define GL_RASTER_MULTISAMPLE_EXT 0x9327 -#define GL_RASTER_SAMPLES_EXT 0x9328 -#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 -#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A -#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B -#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C -typedef void (GL_APIENTRYP PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations); -#endif -#endif /* GL_EXT_raster_multisample */ - -#ifndef GL_EXT_read_format_bgra -#define GL_EXT_read_format_bgra 1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 -#endif /* GL_EXT_read_format_bgra */ - -#ifndef GL_EXT_render_snorm -#define GL_EXT_render_snorm 1 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM_EXT 0x8F98 -#define GL_RG16_SNORM_EXT 0x8F99 -#define GL_RGBA16_SNORM_EXT 0x8F9B -#endif /* GL_EXT_render_snorm */ - -#ifndef GL_EXT_robustness -#define GL_EXT_robustness 1 -#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 -#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 -#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 -#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 -#define GL_NO_RESET_NOTIFICATION_EXT 0x8261 -typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); -typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void); -GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params); -#endif -#endif /* GL_EXT_robustness */ - -#ifndef GL_EXT_sRGB -#define GL_EXT_sRGB 1 -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 -#endif /* GL_EXT_sRGB */ - -#ifndef GL_EXT_sRGB_write_control -#define GL_EXT_sRGB_write_control 1 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#endif /* GL_EXT_sRGB_write_control */ - -#ifndef GL_EXT_semaphore -#define GL_EXT_semaphore 1 -#define GL_LAYOUT_GENERAL_EXT 0x958D -#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E -#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F -#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 -#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 -#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 -#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593 -#define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530 -#define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531 -typedef void (GL_APIENTRYP PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores); -typedef void (GL_APIENTRYP PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores); -typedef GLboolean (GL_APIENTRYP PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore); -typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params); -typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params); -typedef void (GL_APIENTRYP PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); -typedef void (GL_APIENTRYP PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGenSemaphoresEXT (GLsizei n, GLuint *semaphores); -GL_APICALL void GL_APIENTRY glDeleteSemaphoresEXT (GLsizei n, const GLuint *semaphores); -GL_APICALL GLboolean GL_APIENTRY glIsSemaphoreEXT (GLuint semaphore); -GL_APICALL void GL_APIENTRY glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64 *params); -GL_APICALL void GL_APIENTRY glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64 *params); -GL_APICALL void GL_APIENTRY glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); -GL_APICALL void GL_APIENTRY glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); -#endif -#endif /* GL_EXT_semaphore */ - -#ifndef GL_EXT_semaphore_fd -#define GL_EXT_semaphore_fd 1 -typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd); -#endif -#endif /* GL_EXT_semaphore_fd */ - -#ifndef GL_EXT_semaphore_win32 -#define GL_EXT_semaphore_win32 1 -#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 -#define GL_D3D12_FENCE_VALUE_EXT 0x9595 -typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle); -typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle); -GL_APICALL void GL_APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name); -#endif -#endif /* GL_EXT_semaphore_win32 */ - -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 -#define GL_ACTIVE_PROGRAM_EXT 0x8259 -#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 -#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE_EXT 0x8258 -#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A -typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); -typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); -typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); -typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program); -GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline); -GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings); -GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines); -GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines); -GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params); -GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); -GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); -GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); -GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); -GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); -GL_APICALL void GL_APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); -GL_APICALL void GL_APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GL_APICALL void GL_APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GL_APICALL void GL_APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif -#endif /* GL_EXT_separate_shader_objects */ - -#ifndef GL_EXT_shader_framebuffer_fetch -#define GL_EXT_shader_framebuffer_fetch 1 -#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 -#endif /* GL_EXT_shader_framebuffer_fetch */ - -#ifndef GL_EXT_shader_framebuffer_fetch_non_coherent -#define GL_EXT_shader_framebuffer_fetch_non_coherent 1 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierEXT (void); -#endif -#endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */ - -#ifndef GL_EXT_shader_group_vote -#define GL_EXT_shader_group_vote 1 -#endif /* GL_EXT_shader_group_vote */ - -#ifndef GL_EXT_shader_implicit_conversions -#define GL_EXT_shader_implicit_conversions 1 -#endif /* GL_EXT_shader_implicit_conversions */ - -#ifndef GL_EXT_shader_integer_mix -#define GL_EXT_shader_integer_mix 1 -#endif /* GL_EXT_shader_integer_mix */ - -#ifndef GL_EXT_shader_io_blocks -#define GL_EXT_shader_io_blocks 1 -#endif /* GL_EXT_shader_io_blocks */ - -#ifndef GL_EXT_shader_non_constant_global_initializers -#define GL_EXT_shader_non_constant_global_initializers 1 -#endif /* GL_EXT_shader_non_constant_global_initializers */ - -#ifndef GL_EXT_shader_pixel_local_storage -#define GL_EXT_shader_pixel_local_storage 1 -#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 -#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67 -#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64 -#endif /* GL_EXT_shader_pixel_local_storage */ - -#ifndef GL_EXT_shader_pixel_local_storage2 -#define GL_EXT_shader_pixel_local_storage2 1 -#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_FAST_SIZE_EXT 0x9650 -#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_SIZE_EXT 0x9651 -#define GL_FRAMEBUFFER_INCOMPLETE_INSUFFICIENT_SHADER_COMBINED_LOCAL_STORAGE_EXT 0x9652 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target, GLsizei size); -typedef GLsizei (GL_APIENTRYP PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target); -typedef void (GL_APIENTRYP PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC) (GLsizei offset, GLsizei n, const GLuint *values); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferPixelLocalStorageSizeEXT (GLuint target, GLsizei size); -GL_APICALL GLsizei GL_APIENTRY glGetFramebufferPixelLocalStorageSizeEXT (GLuint target); -GL_APICALL void GL_APIENTRY glClearPixelLocalStorageuiEXT (GLsizei offset, GLsizei n, const GLuint *values); -#endif -#endif /* GL_EXT_shader_pixel_local_storage2 */ - -#ifndef GL_EXT_shader_texture_lod -#define GL_EXT_shader_texture_lod 1 -#endif /* GL_EXT_shader_texture_lod */ - -#ifndef GL_EXT_shadow_samplers -#define GL_EXT_shadow_samplers 1 -#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C -#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D -#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E -#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 -#endif /* GL_EXT_shadow_samplers */ - -#ifndef GL_EXT_sparse_texture -#define GL_EXT_sparse_texture 1 -#define GL_TEXTURE_SPARSE_EXT 0x91A6 -#define GL_VIRTUAL_PAGE_SIZE_INDEX_EXT 0x91A7 -#define GL_NUM_SPARSE_LEVELS_EXT 0x91AA -#define GL_NUM_VIRTUAL_PAGE_SIZES_EXT 0x91A8 -#define GL_VIRTUAL_PAGE_SIZE_X_EXT 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_EXT 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_EXT 0x9197 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_TEXTURE_3D 0x806F -#define GL_MAX_SPARSE_TEXTURE_SIZE_EXT 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A -#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9 -typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexPageCommitmentEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -#endif -#endif /* GL_EXT_sparse_texture */ - -#ifndef GL_EXT_sparse_texture2 -#define GL_EXT_sparse_texture2 1 -#endif /* GL_EXT_sparse_texture2 */ - -#ifndef GL_EXT_tessellation_point_size -#define GL_EXT_tessellation_point_size 1 -#endif /* GL_EXT_tessellation_point_size */ - -#ifndef GL_EXT_tessellation_shader -#define GL_EXT_tessellation_shader 1 -#define GL_PATCHES_EXT 0x000E -#define GL_PATCH_VERTICES_EXT 0x8E72 -#define GL_TESS_CONTROL_OUTPUT_VERTICES_EXT 0x8E75 -#define GL_TESS_GEN_MODE_EXT 0x8E76 -#define GL_TESS_GEN_SPACING_EXT 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER_EXT 0x8E78 -#define GL_TESS_GEN_POINT_MODE_EXT 0x8E79 -#define GL_ISOLINES_EXT 0x8E7A -#define GL_QUADS_EXT 0x0007 -#define GL_FRACTIONAL_ODD_EXT 0x8E7B -#define GL_FRACTIONAL_EVEN_EXT 0x8E7C -#define GL_MAX_PATCH_VERTICES_EXT 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL_EXT 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS_EXT 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT 0x8E86 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT 0x8E8A -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E1F -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT 0x92CE -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT 0x92D4 -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT 0x90CC -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT 0x90D9 -#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 -#define GL_IS_PER_PATCH_EXT 0x92E7 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT 0x9308 -#define GL_TESS_CONTROL_SHADER_EXT 0x8E88 -#define GL_TESS_EVALUATION_SHADER_EXT 0x8E87 -#define GL_TESS_CONTROL_SHADER_BIT_EXT 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT_EXT 0x00000010 -typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIEXTPROC) (GLenum pname, GLint value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPatchParameteriEXT (GLenum pname, GLint value); -#endif -#endif /* GL_EXT_tessellation_shader */ - -#ifndef GL_EXT_texture_border_clamp -#define GL_EXT_texture_border_clamp 1 -#define GL_TEXTURE_BORDER_COLOR_EXT 0x1004 -#define GL_CLAMP_TO_BORDER_EXT 0x812D -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, const GLuint *param); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glSamplerParameterIivEXT (GLuint sampler, GLenum pname, const GLint *param); -GL_APICALL void GL_APIENTRY glSamplerParameterIuivEXT (GLuint sampler, GLenum pname, const GLuint *param); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIivEXT (GLuint sampler, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivEXT (GLuint sampler, GLenum pname, GLuint *params); -#endif -#endif /* GL_EXT_texture_border_clamp */ - -#ifndef GL_EXT_texture_buffer -#define GL_EXT_texture_buffer 1 -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_TEXTURE_BUFFER_BINDING_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT 0x919F -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#define GL_IMAGE_BUFFER_EXT 0x9051 -#define GL_INT_IMAGE_BUFFER_EXT 0x905C -#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 -#define GL_TEXTURE_BUFFER_OFFSET_EXT 0x919D -#define GL_TEXTURE_BUFFER_SIZE_EXT 0x919E -typedef void (GL_APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEEXTPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); -GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -#endif -#endif /* GL_EXT_texture_buffer */ - -#ifndef GL_EXT_texture_compression_astc_decode_mode -#define GL_EXT_texture_compression_astc_decode_mode 1 -#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 -#endif /* GL_EXT_texture_compression_astc_decode_mode */ - -#ifndef GL_EXT_texture_compression_bptc -#define GL_EXT_texture_compression_bptc 1 -#define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F -#endif /* GL_EXT_texture_compression_bptc */ - -#ifndef GL_EXT_texture_compression_dxt1 -#define GL_EXT_texture_compression_dxt1 1 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#endif /* GL_EXT_texture_compression_dxt1 */ - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#endif /* GL_EXT_texture_compression_rgtc */ - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif /* GL_EXT_texture_compression_s3tc */ - -#ifndef GL_EXT_texture_compression_s3tc_srgb -#define GL_EXT_texture_compression_s3tc_srgb 1 -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#endif /* GL_EXT_texture_compression_s3tc_srgb */ - -#ifndef GL_EXT_texture_cube_map_array -#define GL_EXT_texture_cube_map_array 1 -#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A -#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F -#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A -#endif /* GL_EXT_texture_cube_map_array */ - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif /* GL_EXT_texture_filter_anisotropic */ - -#ifndef GL_EXT_texture_filter_minmax -#define GL_EXT_texture_filter_minmax 1 -#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 -#define GL_WEIGHTED_AVERAGE_EXT 0x9367 -#endif /* GL_EXT_texture_filter_minmax */ - -#ifndef GL_EXT_texture_format_BGRA8888 -#define GL_EXT_texture_format_BGRA8888 1 -#endif /* GL_EXT_texture_format_BGRA8888 */ - -#ifndef GL_EXT_texture_format_sRGB_override -#define GL_EXT_texture_format_sRGB_override 1 -#define GL_TEXTURE_FORMAT_SRGB_OVERRIDE_EXT 0x8FBF -#endif /* GL_EXT_texture_format_sRGB_override */ - -#ifndef GL_EXT_texture_mirror_clamp_to_edge -#define GL_EXT_texture_mirror_clamp_to_edge 1 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#endif /* GL_EXT_texture_mirror_clamp_to_edge */ - -#ifndef GL_EXT_texture_norm16 -#define GL_EXT_texture_norm16 1 -#define GL_R16_EXT 0x822A -#define GL_RG16_EXT 0x822C -#define GL_RGBA16_EXT 0x805B -#define GL_RGB16_EXT 0x8054 -#define GL_RGB16_SNORM_EXT 0x8F9A -#endif /* GL_EXT_texture_norm16 */ - -#ifndef GL_EXT_texture_query_lod -#define GL_EXT_texture_query_lod 1 -#endif /* GL_EXT_texture_query_lod */ - -#ifndef GL_EXT_texture_rg -#define GL_EXT_texture_rg 1 -#define GL_RED_EXT 0x1903 -#define GL_RG_EXT 0x8227 -#define GL_R8_EXT 0x8229 -#define GL_RG8_EXT 0x822B -#endif /* GL_EXT_texture_rg */ - -#ifndef GL_EXT_texture_sRGB_R8 -#define GL_EXT_texture_sRGB_R8 1 -#define GL_SR8_EXT 0x8FBD -#endif /* GL_EXT_texture_sRGB_R8 */ - -#ifndef GL_EXT_texture_sRGB_RG8 -#define GL_EXT_texture_sRGB_RG8 1 -#define GL_SRG8_EXT 0x8FBE -#endif /* GL_EXT_texture_sRGB_RG8 */ - -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A -#endif /* GL_EXT_texture_sRGB_decode */ - -#ifndef GL_EXT_texture_shadow_lod -#define GL_EXT_texture_shadow_lod 1 -#endif /* GL_EXT_texture_shadow_lod */ - -#ifndef GL_EXT_texture_storage -#define GL_EXT_texture_storage 1 -#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F -#define GL_ALPHA8_EXT 0x803C -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_RGBA32F_EXT 0x8814 -#define GL_RGB32F_EXT 0x8815 -#define GL_ALPHA32F_EXT 0x8816 -#define GL_LUMINANCE32F_EXT 0x8818 -#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 -#define GL_ALPHA16F_EXT 0x881C -#define GL_LUMINANCE16F_EXT 0x881E -#define GL_LUMINANCE_ALPHA16F_EXT 0x881F -#define GL_R32F_EXT 0x822E -#define GL_RG32F_EXT 0x8230 -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#endif -#endif /* GL_EXT_texture_storage */ - -#ifndef GL_EXT_texture_type_2_10_10_10_REV -#define GL_EXT_texture_type_2_10_10_10_REV 1 -#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 -#endif /* GL_EXT_texture_type_2_10_10_10_REV */ - -#ifndef GL_EXT_texture_view -#define GL_EXT_texture_view 1 -#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE -typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTextureViewEXT (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -#endif -#endif /* GL_EXT_texture_view */ - -#ifndef GL_EXT_unpack_subimage -#define GL_EXT_unpack_subimage 1 -#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 -#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 -#endif /* GL_EXT_unpack_subimage */ - -#ifndef GL_EXT_win32_keyed_mutex -#define GL_EXT_win32_keyed_mutex 1 -typedef GLboolean (GL_APIENTRYP PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout); -typedef GLboolean (GL_APIENTRYP PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLboolean GL_APIENTRY glAcquireKeyedMutexWin32EXT (GLuint memory, GLuint64 key, GLuint timeout); -GL_APICALL GLboolean GL_APIENTRY glReleaseKeyedMutexWin32EXT (GLuint memory, GLuint64 key); -#endif -#endif /* GL_EXT_win32_keyed_mutex */ - -#ifndef GL_EXT_window_rectangles -#define GL_EXT_window_rectangles 1 -#define GL_INCLUSIVE_EXT 0x8F10 -#define GL_EXCLUSIVE_EXT 0x8F11 -#define GL_WINDOW_RECTANGLE_EXT 0x8F12 -#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 -#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 -#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 -typedef void (GL_APIENTRYP PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint *box); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glWindowRectanglesEXT (GLenum mode, GLsizei count, const GLint *box); -#endif -#endif /* GL_EXT_window_rectangles */ - -#ifndef GL_FJ_shader_binary_GCCSO -#define GL_FJ_shader_binary_GCCSO 1 -#define GL_GCCSO_SHADER_BINARY_FJ 0x9260 -#endif /* GL_FJ_shader_binary_GCCSO */ - -#ifndef GL_IMG_bindless_texture -#define GL_IMG_bindless_texture 1 -typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLEIMGPROC) (GLuint texture); -typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEIMGPROC) (GLuint texture, GLuint sampler); -typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64IMGPROC) (GLint location, GLuint64 value); -typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VIMGPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64IMGPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VIMGPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleIMG (GLuint texture); -GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleIMG (GLuint texture, GLuint sampler); -GL_APICALL void GL_APIENTRY glUniformHandleui64IMG (GLint location, GLuint64 value); -GL_APICALL void GL_APIENTRY glUniformHandleui64vIMG (GLint location, GLsizei count, const GLuint64 *value); -GL_APICALL void GL_APIENTRY glProgramUniformHandleui64IMG (GLuint program, GLint location, GLuint64 value); -GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vIMG (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -#endif -#endif /* GL_IMG_bindless_texture */ - -#ifndef GL_IMG_framebuffer_downsample -#define GL_IMG_framebuffer_downsample 1 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_AND_DOWNSAMPLE_IMG 0x913C -#define GL_NUM_DOWNSAMPLE_SCALES_IMG 0x913D -#define GL_DOWNSAMPLE_SCALES_IMG 0x913E -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SCALE_IMG 0x913F -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DDOWNSAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint xscale, GLint yscale); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERDOWNSAMPLEIMGPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer, GLint xscale, GLint yscale); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferTexture2DDownsampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint xscale, GLint yscale); -GL_APICALL void GL_APIENTRY glFramebufferTextureLayerDownsampleIMG (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer, GLint xscale, GLint yscale); -#endif -#endif /* GL_IMG_framebuffer_downsample */ - -#ifndef GL_IMG_multisampled_render_to_texture -#define GL_IMG_multisampled_render_to_texture 1 -#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 -#define GL_MAX_SAMPLES_IMG 0x9135 -#define GL_TEXTURE_SAMPLES_IMG 0x9136 -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif -#endif /* GL_IMG_multisampled_render_to_texture */ - -#ifndef GL_IMG_program_binary -#define GL_IMG_program_binary 1 -#define GL_SGX_PROGRAM_BINARY_IMG 0x9130 -#endif /* GL_IMG_program_binary */ - -#ifndef GL_IMG_read_format -#define GL_IMG_read_format 1 -#define GL_BGRA_IMG 0x80E1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 -#endif /* GL_IMG_read_format */ - -#ifndef GL_IMG_shader_binary -#define GL_IMG_shader_binary 1 -#define GL_SGX_BINARY_IMG 0x8C0A -#endif /* GL_IMG_shader_binary */ - -#ifndef GL_IMG_texture_compression_pvrtc -#define GL_IMG_texture_compression_pvrtc 1 -#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 -#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 -#endif /* GL_IMG_texture_compression_pvrtc */ - -#ifndef GL_IMG_texture_compression_pvrtc2 -#define GL_IMG_texture_compression_pvrtc2 1 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 -#endif /* GL_IMG_texture_compression_pvrtc2 */ - -#ifndef GL_IMG_texture_filter_cubic -#define GL_IMG_texture_filter_cubic 1 -#define GL_CUBIC_IMG 0x9139 -#define GL_CUBIC_MIPMAP_NEAREST_IMG 0x913A -#define GL_CUBIC_MIPMAP_LINEAR_IMG 0x913B -#endif /* GL_IMG_texture_filter_cubic */ - -#ifndef GL_INTEL_blackhole_render -#define GL_INTEL_blackhole_render 1 -#define GL_BLACKHOLE_RENDER_INTEL 0x83FC -#endif /* GL_INTEL_blackhole_render */ - -#ifndef GL_INTEL_conservative_rasterization -#define GL_INTEL_conservative_rasterization 1 -#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE -#endif /* GL_INTEL_conservative_rasterization */ - -#ifndef GL_INTEL_framebuffer_CMAA -#define GL_INTEL_framebuffer_CMAA 1 -typedef void (GL_APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glApplyFramebufferAttachmentCMAAINTEL (void); -#endif -#endif /* GL_INTEL_framebuffer_CMAA */ - -#ifndef GL_INTEL_performance_query -#define GL_INTEL_performance_query 1 -#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 -#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 -#define GL_PERFQUERY_WAIT_INTEL 0x83FB -#define GL_PERFQUERY_FLUSH_INTEL 0x83FA -#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 -#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 -#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 -#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 -#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 -#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 -#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 -#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 -#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 -#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA -#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB -#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC -#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD -#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE -#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF -#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 -typedef void (GL_APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (GL_APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); -typedef void (GL_APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (GL_APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (GL_APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); -typedef void (GL_APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); -typedef void (GL_APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); -typedef void (GL_APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); -typedef void (GL_APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); -GL_APICALL void GL_APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); -GL_APICALL void GL_APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); -GL_APICALL void GL_APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); -GL_APICALL void GL_APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); -GL_APICALL void GL_APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); -GL_APICALL void GL_APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); -GL_APICALL void GL_APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); -GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#endif -#endif /* GL_INTEL_performance_query */ - -#ifndef GL_MESA_bgra -#define GL_MESA_bgra 1 -#define GL_BGR_EXT 0x80E0 -#endif /* GL_MESA_bgra */ - -#ifndef GL_MESA_framebuffer_flip_x -#define GL_MESA_framebuffer_flip_x 1 -#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC -#endif /* GL_MESA_framebuffer_flip_x */ - -#ifndef GL_MESA_framebuffer_flip_y -#define GL_MESA_framebuffer_flip_y 1 -#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params); -#endif -#endif /* GL_MESA_framebuffer_flip_y */ - -#ifndef GL_MESA_framebuffer_swap_xy -#define GL_MESA_framebuffer_swap_xy 1 -#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD -#endif /* GL_MESA_framebuffer_swap_xy */ - -#ifndef GL_MESA_program_binary_formats -#define GL_MESA_program_binary_formats 1 -#define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F -#endif /* GL_MESA_program_binary_formats */ - -#ifndef GL_MESA_shader_integer_functions -#define GL_MESA_shader_integer_functions 1 -#endif /* GL_MESA_shader_integer_functions */ - -#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers -#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1 -#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */ - -#ifndef GL_NV_bindless_texture -#define GL_NV_bindless_texture 1 -typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); -typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); -typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef GLuint64 (GL_APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); -typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); -typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef GLboolean (GL_APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleNV (GLuint texture); -GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); -GL_APICALL void GL_APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); -GL_APICALL void GL_APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); -GL_APICALL GLuint64 GL_APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GL_APICALL void GL_APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); -GL_APICALL void GL_APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); -GL_APICALL void GL_APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); -GL_APICALL void GL_APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); -GL_APICALL void GL_APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); -GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -GL_APICALL GLboolean GL_APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); -GL_APICALL GLboolean GL_APIENTRY glIsImageHandleResidentNV (GLuint64 handle); -#endif -#endif /* GL_NV_bindless_texture */ - -#ifndef GL_NV_blend_equation_advanced -#define GL_NV_blend_equation_advanced 1 -#define GL_BLEND_OVERLAP_NV 0x9281 -#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 -#define GL_BLUE_NV 0x1905 -#define GL_COLORBURN_NV 0x929A -#define GL_COLORDODGE_NV 0x9299 -#define GL_CONJOINT_NV 0x9284 -#define GL_CONTRAST_NV 0x92A1 -#define GL_DARKEN_NV 0x9297 -#define GL_DIFFERENCE_NV 0x929E -#define GL_DISJOINT_NV 0x9283 -#define GL_DST_ATOP_NV 0x928F -#define GL_DST_IN_NV 0x928B -#define GL_DST_NV 0x9287 -#define GL_DST_OUT_NV 0x928D -#define GL_DST_OVER_NV 0x9289 -#define GL_EXCLUSION_NV 0x92A0 -#define GL_GREEN_NV 0x1904 -#define GL_HARDLIGHT_NV 0x929B -#define GL_HARDMIX_NV 0x92A9 -#define GL_HSL_COLOR_NV 0x92AF -#define GL_HSL_HUE_NV 0x92AD -#define GL_HSL_LUMINOSITY_NV 0x92B0 -#define GL_HSL_SATURATION_NV 0x92AE -#define GL_INVERT_OVG_NV 0x92B4 -#define GL_INVERT_RGB_NV 0x92A3 -#define GL_LIGHTEN_NV 0x9298 -#define GL_LINEARBURN_NV 0x92A5 -#define GL_LINEARDODGE_NV 0x92A4 -#define GL_LINEARLIGHT_NV 0x92A7 -#define GL_MINUS_CLAMPED_NV 0x92B3 -#define GL_MINUS_NV 0x929F -#define GL_MULTIPLY_NV 0x9294 -#define GL_OVERLAY_NV 0x9296 -#define GL_PINLIGHT_NV 0x92A8 -#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 -#define GL_PLUS_CLAMPED_NV 0x92B1 -#define GL_PLUS_DARKER_NV 0x9292 -#define GL_PLUS_NV 0x9291 -#define GL_RED_NV 0x1903 -#define GL_SCREEN_NV 0x9295 -#define GL_SOFTLIGHT_NV 0x929C -#define GL_SRC_ATOP_NV 0x928E -#define GL_SRC_IN_NV 0x928A -#define GL_SRC_NV 0x9286 -#define GL_SRC_OUT_NV 0x928C -#define GL_SRC_OVER_NV 0x9288 -#define GL_UNCORRELATED_NV 0x9282 -#define GL_VIVIDLIGHT_NV 0x92A6 -#define GL_XOR_NV 0x1506 -typedef void (GL_APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlendParameteriNV (GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glBlendBarrierNV (void); -#endif -#endif /* GL_NV_blend_equation_advanced */ - -#ifndef GL_NV_blend_equation_advanced_coherent -#define GL_NV_blend_equation_advanced_coherent 1 -#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 -#endif /* GL_NV_blend_equation_advanced_coherent */ - -#ifndef GL_NV_blend_minmax_factor -#define GL_NV_blend_minmax_factor 1 -#define GL_FACTOR_MIN_AMD 0x901C -#define GL_FACTOR_MAX_AMD 0x901D -#endif /* GL_NV_blend_minmax_factor */ - -#ifndef GL_NV_clip_space_w_scaling -#define GL_NV_clip_space_w_scaling 1 -#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C -#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D -#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E -typedef void (GL_APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff); -#endif -#endif /* GL_NV_clip_space_w_scaling */ - -#ifndef GL_NV_compute_shader_derivatives -#define GL_NV_compute_shader_derivatives 1 -#endif /* GL_NV_compute_shader_derivatives */ - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -typedef void (GL_APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (GL_APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); -GL_APICALL void GL_APIENTRY glEndConditionalRenderNV (void); -#endif -#endif /* GL_NV_conditional_render */ - -#ifndef GL_NV_conservative_raster -#define GL_NV_conservative_raster 1 -#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 -#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 -#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 -#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 -typedef void (GL_APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits); -#endif -#endif /* GL_NV_conservative_raster */ - -#ifndef GL_NV_conservative_raster_pre_snap -#define GL_NV_conservative_raster_pre_snap 1 -#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV 0x9550 -#endif /* GL_NV_conservative_raster_pre_snap */ - -#ifndef GL_NV_conservative_raster_pre_snap_triangles -#define GL_NV_conservative_raster_pre_snap_triangles 1 -#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D -#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E -#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F -typedef void (GL_APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param); -#endif -#endif /* GL_NV_conservative_raster_pre_snap_triangles */ - -#ifndef GL_NV_copy_buffer -#define GL_NV_copy_buffer 1 -#define GL_COPY_READ_BUFFER_NV 0x8F36 -#define GL_COPY_WRITE_BUFFER_NV 0x8F37 -typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyBufferSubDataNV (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -#endif -#endif /* GL_NV_copy_buffer */ - -#ifndef GL_NV_coverage_sample -#define GL_NV_coverage_sample 1 -#define GL_COVERAGE_COMPONENT_NV 0x8ED0 -#define GL_COVERAGE_COMPONENT4_NV 0x8ED1 -#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 -#define GL_COVERAGE_BUFFERS_NV 0x8ED3 -#define GL_COVERAGE_SAMPLES_NV 0x8ED4 -#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 -#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 -#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 -#define GL_COVERAGE_BUFFER_BIT_NV 0x00008000 -typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); -typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); -GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); -#endif -#endif /* GL_NV_coverage_sample */ - -#ifndef GL_NV_depth_nonlinear -#define GL_NV_depth_nonlinear 1 -#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C -#endif /* GL_NV_depth_nonlinear */ - -#ifndef GL_NV_draw_buffers -#define GL_NV_draw_buffers 1 -#define GL_MAX_DRAW_BUFFERS_NV 0x8824 -#define GL_DRAW_BUFFER0_NV 0x8825 -#define GL_DRAW_BUFFER1_NV 0x8826 -#define GL_DRAW_BUFFER2_NV 0x8827 -#define GL_DRAW_BUFFER3_NV 0x8828 -#define GL_DRAW_BUFFER4_NV 0x8829 -#define GL_DRAW_BUFFER5_NV 0x882A -#define GL_DRAW_BUFFER6_NV 0x882B -#define GL_DRAW_BUFFER7_NV 0x882C -#define GL_DRAW_BUFFER8_NV 0x882D -#define GL_DRAW_BUFFER9_NV 0x882E -#define GL_DRAW_BUFFER10_NV 0x882F -#define GL_DRAW_BUFFER11_NV 0x8830 -#define GL_DRAW_BUFFER12_NV 0x8831 -#define GL_DRAW_BUFFER13_NV 0x8832 -#define GL_DRAW_BUFFER14_NV 0x8833 -#define GL_DRAW_BUFFER15_NV 0x8834 -#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 -#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 -#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 -#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 -#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 -#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 -#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 -#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 -#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 -#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 -#define GL_COLOR_ATTACHMENT10_NV 0x8CEA -#define GL_COLOR_ATTACHMENT11_NV 0x8CEB -#define GL_COLOR_ATTACHMENT12_NV 0x8CEC -#define GL_COLOR_ATTACHMENT13_NV 0x8CED -#define GL_COLOR_ATTACHMENT14_NV 0x8CEE -#define GL_COLOR_ATTACHMENT15_NV 0x8CEF -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs); -#endif -#endif /* GL_NV_draw_buffers */ - -#ifndef GL_NV_draw_instanced -#define GL_NV_draw_instanced 1 -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#endif -#endif /* GL_NV_draw_instanced */ - -#ifndef GL_NV_draw_vulkan_image -#define GL_NV_draw_vulkan_image 1 -typedef void (GL_APIENTRY *GLVULKANPROCNV)(void); -typedef void (GL_APIENTRYP PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -typedef GLVULKANPROCNV (GL_APIENTRYP PFNGLGETVKPROCADDRNVPROC) (const GLchar *name); -typedef void (GL_APIENTRYP PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); -typedef void (GL_APIENTRYP PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); -typedef void (GL_APIENTRYP PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawVkImageNV (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -GL_APICALL GLVULKANPROCNV GL_APIENTRY glGetVkProcAddrNV (const GLchar *name); -GL_APICALL void GL_APIENTRY glWaitVkSemaphoreNV (GLuint64 vkSemaphore); -GL_APICALL void GL_APIENTRY glSignalVkSemaphoreNV (GLuint64 vkSemaphore); -GL_APICALL void GL_APIENTRY glSignalVkFenceNV (GLuint64 vkFence); -#endif -#endif /* GL_NV_draw_vulkan_image */ - -#ifndef GL_NV_explicit_attrib_location -#define GL_NV_explicit_attrib_location 1 -#endif /* GL_NV_explicit_attrib_location */ - -#ifndef GL_NV_fbo_color_attachments -#define GL_NV_fbo_color_attachments 1 -#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF -#endif /* GL_NV_fbo_color_attachments */ - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); -GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); -GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence); -GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence); -GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence); -GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition); -#endif -#endif /* GL_NV_fence */ - -#ifndef GL_NV_fill_rectangle -#define GL_NV_fill_rectangle 1 -#define GL_FILL_RECTANGLE_NV 0x933C -#endif /* GL_NV_fill_rectangle */ - -#ifndef GL_NV_fragment_coverage_to_color -#define GL_NV_fragment_coverage_to_color 1 -#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD -#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE -typedef void (GL_APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFragmentCoverageColorNV (GLuint color); -#endif -#endif /* GL_NV_fragment_coverage_to_color */ - -#ifndef GL_NV_fragment_shader_barycentric -#define GL_NV_fragment_shader_barycentric 1 -#endif /* GL_NV_fragment_shader_barycentric */ - -#ifndef GL_NV_fragment_shader_interlock -#define GL_NV_fragment_shader_interlock 1 -#endif /* GL_NV_fragment_shader_interlock */ - -#ifndef GL_NV_framebuffer_blit -#define GL_NV_framebuffer_blit 1 -#define GL_READ_FRAMEBUFFER_NV 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -#endif /* GL_NV_framebuffer_blit */ - -#ifndef GL_NV_framebuffer_mixed_samples -#define GL_NV_framebuffer_mixed_samples 1 -#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 -#define GL_COLOR_SAMPLES_NV 0x8E20 -#define GL_DEPTH_SAMPLES_NV 0x932D -#define GL_STENCIL_SAMPLES_NV 0x932E -#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F -#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 -#define GL_COVERAGE_MODULATION_NV 0x9332 -#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 -typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v); -typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v); -GL_APICALL void GL_APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v); -GL_APICALL void GL_APIENTRY glCoverageModulationNV (GLenum components); -#endif -#endif /* GL_NV_framebuffer_mixed_samples */ - -#ifndef GL_NV_framebuffer_multisample -#define GL_NV_framebuffer_multisample 1 -#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 -#define GL_MAX_SAMPLES_NV 0x8D57 -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_NV_framebuffer_multisample */ - -#ifndef GL_NV_generate_mipmap_sRGB -#define GL_NV_generate_mipmap_sRGB 1 -#endif /* GL_NV_generate_mipmap_sRGB */ - -#ifndef GL_NV_geometry_shader_passthrough -#define GL_NV_geometry_shader_passthrough 1 -#endif /* GL_NV_geometry_shader_passthrough */ - -#ifndef GL_NV_gpu_shader5 -#define GL_NV_gpu_shader5 1 -typedef khronos_int64_t GLint64EXT; -typedef khronos_uint64_t GLuint64EXT; -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB -#define GL_PATCHES 0x000E -typedef void (GL_APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); -typedef void (GL_APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); -typedef void (GL_APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (GL_APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (GL_APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); -typedef void (GL_APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (GL_APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (GL_APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (GL_APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); -GL_APICALL void GL_APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); -GL_APICALL void GL_APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GL_APICALL void GL_APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GL_APICALL void GL_APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); -GL_APICALL void GL_APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); -GL_APICALL void GL_APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GL_APICALL void GL_APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GL_APICALL void GL_APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); -GL_APICALL void GL_APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); -GL_APICALL void GL_APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -GL_APICALL void GL_APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GL_APICALL void GL_APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GL_APICALL void GL_APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); -GL_APICALL void GL_APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -GL_APICALL void GL_APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GL_APICALL void GL_APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GL_APICALL void GL_APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif -#endif /* GL_NV_gpu_shader5 */ - -#ifndef GL_NV_image_formats -#define GL_NV_image_formats 1 -#endif /* GL_NV_image_formats */ - -#ifndef GL_NV_instanced_arrays -#define GL_NV_instanced_arrays 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor); -#endif -#endif /* GL_NV_instanced_arrays */ - -#ifndef GL_NV_internalformat_sample_query -#define GL_NV_internalformat_sample_query 1 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_MULTISAMPLES_NV 0x9371 -#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 -#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 -#define GL_CONFORMANT_NV 0x9374 -typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); -#endif -#endif /* GL_NV_internalformat_sample_query */ - -#ifndef GL_NV_memory_attachment -#define GL_NV_memory_attachment 1 -#define GL_ATTACHED_MEMORY_OBJECT_NV 0x95A4 -#define GL_ATTACHED_MEMORY_OFFSET_NV 0x95A5 -#define GL_MEMORY_ATTACHABLE_ALIGNMENT_NV 0x95A6 -#define GL_MEMORY_ATTACHABLE_SIZE_NV 0x95A7 -#define GL_MEMORY_ATTACHABLE_NV 0x95A8 -#define GL_DETACHED_MEMORY_INCARNATION_NV 0x95A9 -#define GL_DETACHED_TEXTURES_NV 0x95AA -#define GL_DETACHED_BUFFERS_NV 0x95AB -#define GL_MAX_DETACHED_TEXTURES_NV 0x95AC -#define GL_MAX_DETACHED_BUFFERS_NV 0x95AD -typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC) (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); -typedef void (GL_APIENTRYP PFNGLRESETMEMORYOBJECTPARAMETERNVPROC) (GLuint memory, GLenum pname); -typedef void (GL_APIENTRYP PFNGLTEXATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLBUFFERATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXTUREATTACHMEMORYNVPROC) (GLuint texture, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERATTACHMEMORYNVPROC) (GLuint buffer, GLuint memory, GLuint64 offset); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetMemoryObjectDetachedResourcesuivNV (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); -GL_APICALL void GL_APIENTRY glResetMemoryObjectParameterNV (GLuint memory, GLenum pname); -GL_APICALL void GL_APIENTRY glTexAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glBufferAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTextureAttachMemoryNV (GLuint texture, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, GLuint64 offset); -#endif -#endif /* GL_NV_memory_attachment */ - -#ifndef GL_NV_memory_object_sparse -#define GL_NV_memory_object_sparse 1 -typedef void (GL_APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -typedef void (GL_APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -GL_APICALL void GL_APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -GL_APICALL void GL_APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -GL_APICALL void GL_APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -#endif -#endif /* GL_NV_memory_object_sparse */ - -#ifndef GL_NV_mesh_shader -#define GL_NV_mesh_shader 1 -#define GL_MESH_SHADER_NV 0x9559 -#define GL_TASK_SHADER_NV 0x955A -#define GL_MAX_MESH_UNIFORM_BLOCKS_NV 0x8E60 -#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61 -#define GL_MAX_MESH_IMAGE_UNIFORMS_NV 0x8E62 -#define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63 -#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64 -#define GL_MAX_MESH_ATOMIC_COUNTERS_NV 0x8E65 -#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66 -#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67 -#define GL_MAX_TASK_UNIFORM_BLOCKS_NV 0x8E68 -#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69 -#define GL_MAX_TASK_IMAGE_UNIFORMS_NV 0x8E6A -#define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B -#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C -#define GL_MAX_TASK_ATOMIC_COUNTERS_NV 0x8E6D -#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E -#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F -#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2 -#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3 -#define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV 0x9536 -#define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV 0x9537 -#define GL_MAX_MESH_OUTPUT_VERTICES_NV 0x9538 -#define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV 0x9539 -#define GL_MAX_TASK_OUTPUT_COUNT_NV 0x953A -#define GL_MAX_DRAW_MESH_TASKS_COUNT_NV 0x953D -#define GL_MAX_MESH_VIEWS_NV 0x9557 -#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF -#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543 -#define GL_MAX_MESH_WORK_GROUP_SIZE_NV 0x953B -#define GL_MAX_TASK_WORK_GROUP_SIZE_NV 0x953C -#define GL_MESH_WORK_GROUP_SIZE_NV 0x953E -#define GL_TASK_WORK_GROUP_SIZE_NV 0x953F -#define GL_MESH_VERTICES_OUT_NV 0x9579 -#define GL_MESH_PRIMITIVES_OUT_NV 0x957A -#define GL_MESH_OUTPUT_TYPE_NV 0x957B -#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D -#define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0 -#define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1 -#define GL_MESH_SHADER_BIT_NV 0x00000040 -#define GL_TASK_SHADER_BIT_NV 0x00000080 -#define GL_MESH_SUBROUTINE_NV 0x957C -#define GL_TASK_SUBROUTINE_NV 0x957D -#define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E -#define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F -typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count); -typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count); -GL_APICALL void GL_APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect); -GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride); -GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#endif -#endif /* GL_NV_mesh_shader */ - -#ifndef GL_NV_non_square_matrices -#define GL_NV_non_square_matrices 1 -#define GL_FLOAT_MAT2x3_NV 0x8B65 -#define GL_FLOAT_MAT2x4_NV 0x8B66 -#define GL_FLOAT_MAT3x2_NV 0x8B67 -#define GL_FLOAT_MAT3x4_NV 0x8B68 -#define GL_FLOAT_MAT4x2_NV 0x8B69 -#define GL_FLOAT_MAT4x3_NV 0x8B6A -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glUniformMatrix2x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix3x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix2x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix4x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix3x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif -#endif /* GL_NV_non_square_matrices */ - -#ifndef GL_NV_path_rendering -#define GL_NV_path_rendering 1 -typedef double GLdouble; -#define GL_PATH_FORMAT_SVG_NV 0x9070 -#define GL_PATH_FORMAT_PS_NV 0x9071 -#define GL_STANDARD_FONT_NAME_NV 0x9072 -#define GL_SYSTEM_FONT_NAME_NV 0x9073 -#define GL_FILE_NAME_NV 0x9074 -#define GL_PATH_STROKE_WIDTH_NV 0x9075 -#define GL_PATH_END_CAPS_NV 0x9076 -#define GL_PATH_INITIAL_END_CAP_NV 0x9077 -#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 -#define GL_PATH_JOIN_STYLE_NV 0x9079 -#define GL_PATH_MITER_LIMIT_NV 0x907A -#define GL_PATH_DASH_CAPS_NV 0x907B -#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C -#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D -#define GL_PATH_DASH_OFFSET_NV 0x907E -#define GL_PATH_CLIENT_LENGTH_NV 0x907F -#define GL_PATH_FILL_MODE_NV 0x9080 -#define GL_PATH_FILL_MASK_NV 0x9081 -#define GL_PATH_FILL_COVER_MODE_NV 0x9082 -#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 -#define GL_PATH_STROKE_MASK_NV 0x9084 -#define GL_COUNT_UP_NV 0x9088 -#define GL_COUNT_DOWN_NV 0x9089 -#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A -#define GL_CONVEX_HULL_NV 0x908B -#define GL_BOUNDING_BOX_NV 0x908D -#define GL_TRANSLATE_X_NV 0x908E -#define GL_TRANSLATE_Y_NV 0x908F -#define GL_TRANSLATE_2D_NV 0x9090 -#define GL_TRANSLATE_3D_NV 0x9091 -#define GL_AFFINE_2D_NV 0x9092 -#define GL_AFFINE_3D_NV 0x9094 -#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 -#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 -#define GL_UTF8_NV 0x909A -#define GL_UTF16_NV 0x909B -#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C -#define GL_PATH_COMMAND_COUNT_NV 0x909D -#define GL_PATH_COORD_COUNT_NV 0x909E -#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F -#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 -#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 -#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 -#define GL_SQUARE_NV 0x90A3 -#define GL_ROUND_NV 0x90A4 -#define GL_TRIANGULAR_NV 0x90A5 -#define GL_BEVEL_NV 0x90A6 -#define GL_MITER_REVERT_NV 0x90A7 -#define GL_MITER_TRUNCATE_NV 0x90A8 -#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 -#define GL_USE_MISSING_GLYPH_NV 0x90AA -#define GL_PATH_ERROR_POSITION_NV 0x90AB -#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD -#define GL_ADJACENT_PAIRS_NV 0x90AE -#define GL_FIRST_TO_REST_NV 0x90AF -#define GL_PATH_GEN_MODE_NV 0x90B0 -#define GL_PATH_GEN_COEFF_NV 0x90B1 -#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 -#define GL_PATH_STENCIL_FUNC_NV 0x90B7 -#define GL_PATH_STENCIL_REF_NV 0x90B8 -#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 -#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD -#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE -#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF -#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 -#define GL_MOVE_TO_RESETS_NV 0x90B5 -#define GL_MOVE_TO_CONTINUES_NV 0x90B6 -#define GL_CLOSE_PATH_NV 0x00 -#define GL_MOVE_TO_NV 0x02 -#define GL_RELATIVE_MOVE_TO_NV 0x03 -#define GL_LINE_TO_NV 0x04 -#define GL_RELATIVE_LINE_TO_NV 0x05 -#define GL_HORIZONTAL_LINE_TO_NV 0x06 -#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 -#define GL_VERTICAL_LINE_TO_NV 0x08 -#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 -#define GL_QUADRATIC_CURVE_TO_NV 0x0A -#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B -#define GL_CUBIC_CURVE_TO_NV 0x0C -#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D -#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E -#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F -#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 -#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 -#define GL_SMALL_CCW_ARC_TO_NV 0x12 -#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 -#define GL_SMALL_CW_ARC_TO_NV 0x14 -#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 -#define GL_LARGE_CCW_ARC_TO_NV 0x16 -#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 -#define GL_LARGE_CW_ARC_TO_NV 0x18 -#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 -#define GL_RESTART_PATH_NV 0xF0 -#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 -#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 -#define GL_RECT_NV 0xF6 -#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 -#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA -#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC -#define GL_ARC_TO_NV 0xFE -#define GL_RELATIVE_ARC_TO_NV 0xFF -#define GL_BOLD_BIT_NV 0x01 -#define GL_ITALIC_BIT_NV 0x02 -#define GL_GLYPH_WIDTH_BIT_NV 0x01 -#define GL_GLYPH_HEIGHT_BIT_NV 0x02 -#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 -#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 -#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 -#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 -#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 -#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 -#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 -#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 -#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 -#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 -#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 -#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 -#define GL_FONT_ASCENDER_BIT_NV 0x00200000 -#define GL_FONT_DESCENDER_BIT_NV 0x00400000 -#define GL_FONT_HEIGHT_BIT_NV 0x00800000 -#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 -#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 -#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 -#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 -#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 -#define GL_ROUNDED_RECT_NV 0xE8 -#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 -#define GL_ROUNDED_RECT2_NV 0xEA -#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB -#define GL_ROUNDED_RECT4_NV 0xEC -#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED -#define GL_ROUNDED_RECT8_NV 0xEE -#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF -#define GL_RELATIVE_RECT_NV 0xF7 -#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 -#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 -#define GL_FONT_UNAVAILABLE_NV 0x936A -#define GL_FONT_UNINTELLIGIBLE_NV 0x936B -#define GL_CONIC_CURVE_TO_NV 0x1A -#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B -#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 -#define GL_STANDARD_FONT_FORMAT_NV 0x936C -#define GL_PATH_PROJECTION_NV 0x1701 -#define GL_PATH_MODELVIEW_NV 0x1700 -#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 -#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 -#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 -#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 -#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 -#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 -#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 -#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 -#define GL_FRAGMENT_INPUT_NV 0x936D -typedef GLuint (GL_APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); -typedef void (GL_APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); -typedef GLboolean (GL_APIENTRYP PFNGLISPATHNVPROC) (GLuint path); -typedef void (GL_APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (GL_APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (GL_APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (GL_APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (GL_APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); -typedef void (GL_APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (GL_APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (GL_APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -typedef void (GL_APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); -typedef void (GL_APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -typedef void (GL_APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); -typedef void (GL_APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -typedef void (GL_APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (GL_APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); -typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); -typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); -typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); -typedef void (GL_APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); -typedef void (GL_APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); -typedef void (GL_APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); -typedef void (GL_APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -typedef void (GL_APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -typedef void (GL_APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); -typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); -typedef GLfloat (GL_APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); -typedef GLboolean (GL_APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); -typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); -typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef GLenum (GL_APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (GL_APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (GL_APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (GL_APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (GL_APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLuint GL_APIENTRY glGenPathsNV (GLsizei range); -GL_APICALL void GL_APIENTRY glDeletePathsNV (GLuint path, GLsizei range); -GL_APICALL GLboolean GL_APIENTRY glIsPathNV (GLuint path); -GL_APICALL void GL_APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GL_APICALL void GL_APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -GL_APICALL void GL_APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GL_APICALL void GL_APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -GL_APICALL void GL_APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); -GL_APICALL void GL_APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GL_APICALL void GL_APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GL_APICALL void GL_APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -GL_APICALL void GL_APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); -GL_APICALL void GL_APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -GL_APICALL void GL_APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); -GL_APICALL void GL_APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); -GL_APICALL void GL_APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); -GL_APICALL void GL_APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -GL_APICALL void GL_APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); -GL_APICALL void GL_APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glPathCoverDepthFuncNV (GLenum func); -GL_APICALL void GL_APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); -GL_APICALL void GL_APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); -GL_APICALL void GL_APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); -GL_APICALL void GL_APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); -GL_APICALL void GL_APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); -GL_APICALL void GL_APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); -GL_APICALL void GL_APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); -GL_APICALL void GL_APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -GL_APICALL void GL_APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -GL_APICALL void GL_APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -GL_APICALL GLboolean GL_APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); -GL_APICALL GLboolean GL_APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); -GL_APICALL GLfloat GL_APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); -GL_APICALL GLboolean GL_APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -GL_APICALL void GL_APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); -GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); -GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); -GL_APICALL void GL_APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GL_APICALL void GL_APIENTRY glMatrixLoadIdentityEXT (GLenum mode); -GL_APICALL void GL_APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); -GL_APICALL void GL_APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); -GL_APICALL void GL_APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); -GL_APICALL void GL_APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); -GL_APICALL void GL_APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GL_APICALL void GL_APIENTRY glMatrixPopEXT (GLenum mode); -GL_APICALL void GL_APIENTRY glMatrixPushEXT (GLenum mode); -GL_APICALL void GL_APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -GL_APICALL void GL_APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GL_APICALL void GL_APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -#endif -#endif /* GL_NV_path_rendering */ - -#ifndef GL_NV_path_rendering_shared_edge -#define GL_NV_path_rendering_shared_edge 1 -#define GL_SHARED_EDGE_NV 0xC0 -#endif /* GL_NV_path_rendering_shared_edge */ - -#ifndef GL_NV_pixel_buffer_object -#define GL_NV_pixel_buffer_object 1 -#define GL_PIXEL_PACK_BUFFER_NV 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_NV 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_NV 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF -#endif /* GL_NV_pixel_buffer_object */ - -#ifndef GL_NV_polygon_mode -#define GL_NV_polygon_mode 1 -#define GL_POLYGON_MODE_NV 0x0B40 -#define GL_POLYGON_OFFSET_POINT_NV 0x2A01 -#define GL_POLYGON_OFFSET_LINE_NV 0x2A02 -#define GL_POINT_NV 0x1B00 -#define GL_LINE_NV 0x1B01 -#define GL_FILL_NV 0x1B02 -typedef void (GL_APIENTRYP PFNGLPOLYGONMODENVPROC) (GLenum face, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPolygonModeNV (GLenum face, GLenum mode); -#endif -#endif /* GL_NV_polygon_mode */ - -#ifndef GL_NV_primitive_shading_rate -#define GL_NV_primitive_shading_rate 1 -#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1 -#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2 -#endif /* GL_NV_primitive_shading_rate */ - -#ifndef GL_NV_read_buffer -#define GL_NV_read_buffer 1 -#define GL_READ_BUFFER_NV 0x0C02 -typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); -#endif -#endif /* GL_NV_read_buffer */ - -#ifndef GL_NV_read_buffer_front -#define GL_NV_read_buffer_front 1 -#endif /* GL_NV_read_buffer_front */ - -#ifndef GL_NV_read_depth -#define GL_NV_read_depth 1 -#endif /* GL_NV_read_depth */ - -#ifndef GL_NV_read_depth_stencil -#define GL_NV_read_depth_stencil 1 -#endif /* GL_NV_read_depth_stencil */ - -#ifndef GL_NV_read_stencil -#define GL_NV_read_stencil 1 -#endif /* GL_NV_read_stencil */ - -#ifndef GL_NV_representative_fragment_test -#define GL_NV_representative_fragment_test 1 -#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F -#endif /* GL_NV_representative_fragment_test */ - -#ifndef GL_NV_sRGB_formats -#define GL_NV_sRGB_formats 1 -#define GL_SLUMINANCE_NV 0x8C46 -#define GL_SLUMINANCE_ALPHA_NV 0x8C44 -#define GL_SRGB8_NV 0x8C41 -#define GL_SLUMINANCE8_NV 0x8C47 -#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 -#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F -#define GL_ETC1_SRGB8_NV 0x88EE -#endif /* GL_NV_sRGB_formats */ - -#ifndef GL_NV_sample_locations -#define GL_NV_sample_locations 1 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 -#define GL_SAMPLE_LOCATION_NV 0x8E50 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glResolveDepthValuesNV (void); -#endif -#endif /* GL_NV_sample_locations */ - -#ifndef GL_NV_sample_mask_override_coverage -#define GL_NV_sample_mask_override_coverage 1 -#endif /* GL_NV_sample_mask_override_coverage */ - -#ifndef GL_NV_scissor_exclusive -#define GL_NV_scissor_exclusive 1 -#define GL_SCISSOR_TEST_EXCLUSIVE_NV 0x9555 -#define GL_SCISSOR_BOX_EXCLUSIVE_NV 0x9556 -typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVENVPROC) (GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVEARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glScissorExclusiveNV (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei count, const GLint *v); -#endif -#endif /* GL_NV_scissor_exclusive */ - -#ifndef GL_NV_shader_atomic_fp16_vector -#define GL_NV_shader_atomic_fp16_vector 1 -#endif /* GL_NV_shader_atomic_fp16_vector */ - -#ifndef GL_NV_shader_noperspective_interpolation -#define GL_NV_shader_noperspective_interpolation 1 -#endif /* GL_NV_shader_noperspective_interpolation */ - -#ifndef GL_NV_shader_subgroup_partitioned -#define GL_NV_shader_subgroup_partitioned 1 -#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100 -#endif /* GL_NV_shader_subgroup_partitioned */ - -#ifndef GL_NV_shader_texture_footprint -#define GL_NV_shader_texture_footprint 1 -#endif /* GL_NV_shader_texture_footprint */ - -#ifndef GL_NV_shading_rate_image -#define GL_NV_shading_rate_image 1 -#define GL_SHADING_RATE_IMAGE_NV 0x9563 -#define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564 -#define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565 -#define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566 -#define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567 -#define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568 -#define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569 -#define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A -#define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B -#define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C -#define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D -#define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E -#define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F -#define GL_SHADING_RATE_IMAGE_BINDING_NV 0x955B -#define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C -#define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D -#define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E -#define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F -#define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE -#define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF -#define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0 -typedef void (GL_APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture); -typedef void (GL_APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate); -typedef void (GL_APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location); -typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize); -typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); -typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order); -typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBindShadingRateImageNV (GLuint texture); -GL_APICALL void GL_APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate); -GL_APICALL void GL_APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location); -GL_APICALL void GL_APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize); -GL_APICALL void GL_APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); -GL_APICALL void GL_APIENTRY glShadingRateSampleOrderNV (GLenum order); -GL_APICALL void GL_APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations); -#endif -#endif /* GL_NV_shading_rate_image */ - -#ifndef GL_NV_shadow_samplers_array -#define GL_NV_shadow_samplers_array 1 -#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 -#endif /* GL_NV_shadow_samplers_array */ - -#ifndef GL_NV_shadow_samplers_cube -#define GL_NV_shadow_samplers_cube 1 -#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 -#endif /* GL_NV_shadow_samplers_cube */ - -#ifndef GL_NV_stereo_view_rendering -#define GL_NV_stereo_view_rendering 1 -#endif /* GL_NV_stereo_view_rendering */ - -#ifndef GL_NV_texture_border_clamp -#define GL_NV_texture_border_clamp 1 -#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 -#define GL_CLAMP_TO_BORDER_NV 0x812D -#endif /* GL_NV_texture_border_clamp */ - -#ifndef GL_NV_texture_compression_s3tc_update -#define GL_NV_texture_compression_s3tc_update 1 -#endif /* GL_NV_texture_compression_s3tc_update */ - -#ifndef GL_NV_texture_npot_2D_mipmap -#define GL_NV_texture_npot_2D_mipmap 1 -#endif /* GL_NV_texture_npot_2D_mipmap */ - -#ifndef GL_NV_timeline_semaphore -#define GL_NV_timeline_semaphore 1 -#define GL_TIMELINE_SEMAPHORE_VALUE_NV 0x9595 -#define GL_SEMAPHORE_TYPE_NV 0x95B3 -#define GL_SEMAPHORE_TYPE_BINARY_NV 0x95B4 -#define GL_SEMAPHORE_TYPE_TIMELINE_NV 0x95B5 -#define GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV 0x95B6 -typedef void (GL_APIENTRYP PFNGLCREATESEMAPHORESNVPROC) (GLsizei n, GLuint *semaphores); -typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCreateSemaphoresNV (GLsizei n, GLuint *semaphores); -GL_APICALL void GL_APIENTRY glSemaphoreParameterivNV (GLuint semaphore, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glGetSemaphoreParameterivNV (GLuint semaphore, GLenum pname, GLint *params); -#endif -#endif /* GL_NV_timeline_semaphore */ - -#ifndef GL_NV_viewport_array -#define GL_NV_viewport_array 1 -#define GL_MAX_VIEWPORTS_NV 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS_NV 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE_NV 0x825D -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F -typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVNVPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVNVPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v); -typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDNVPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVNVPROC) (GLuint index, const GLint *v); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVNVPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFNVPROC) (GLuint index, GLfloat n, GLfloat f); -typedef void (GL_APIENTRYP PFNGLGETFLOATI_VNVPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (GL_APIENTRYP PFNGLENABLEINVPROC) (GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLDISABLEINVPROC) (GLenum target, GLuint index); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDINVPROC) (GLenum target, GLuint index); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glViewportArrayvNV (GLuint first, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glViewportIndexedfNV (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -GL_APICALL void GL_APIENTRY glViewportIndexedfvNV (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glScissorArrayvNV (GLuint first, GLsizei count, const GLint *v); -GL_APICALL void GL_APIENTRY glScissorIndexedNV (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glScissorIndexedvNV (GLuint index, const GLint *v); -GL_APICALL void GL_APIENTRY glDepthRangeArrayfvNV (GLuint first, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glDepthRangeIndexedfNV (GLuint index, GLfloat n, GLfloat f); -GL_APICALL void GL_APIENTRY glGetFloati_vNV (GLenum target, GLuint index, GLfloat *data); -GL_APICALL void GL_APIENTRY glEnableiNV (GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glDisableiNV (GLenum target, GLuint index); -GL_APICALL GLboolean GL_APIENTRY glIsEnablediNV (GLenum target, GLuint index); -#endif -#endif /* GL_NV_viewport_array */ - -#ifndef GL_NV_viewport_array2 -#define GL_NV_viewport_array2 1 -#endif /* GL_NV_viewport_array2 */ - -#ifndef GL_NV_viewport_swizzle -#define GL_NV_viewport_swizzle 1 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 -#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358 -#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 -#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A -#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B -typedef void (GL_APIENTRYP PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); -#endif -#endif /* GL_NV_viewport_swizzle */ - -#ifndef GL_OVR_multiview -#define GL_OVR_multiview 1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 -#define GL_MAX_VIEWS_OVR 0x9631 -#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); -#endif -#endif /* GL_OVR_multiview */ - -#ifndef GL_OVR_multiview2 -#define GL_OVR_multiview2 1 -#endif /* GL_OVR_multiview2 */ - -#ifndef GL_OVR_multiview_multisampled_render_to_texture -#define GL_OVR_multiview_multisampled_render_to_texture 1 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferTextureMultisampleMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); -#endif -#endif /* GL_OVR_multiview_multisampled_render_to_texture */ - -#ifndef GL_QCOM_YUV_texture_gather -#define GL_QCOM_YUV_texture_gather 1 -#endif /* GL_QCOM_YUV_texture_gather */ - -#ifndef GL_QCOM_alpha_test -#define GL_QCOM_alpha_test 1 -#define GL_ALPHA_TEST_QCOM 0x0BC0 -#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 -#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 -typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref); -#endif -#endif /* GL_QCOM_alpha_test */ - -#ifndef GL_QCOM_binning_control -#define GL_QCOM_binning_control 1 -#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 -#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 -#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 -#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 -#endif /* GL_QCOM_binning_control */ - -#ifndef GL_QCOM_driver_control -#define GL_QCOM_driver_control 1 -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); -typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); -typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); -GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); -GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); -GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); -#endif -#endif /* GL_QCOM_driver_control */ - -#ifndef GL_QCOM_extended_get -#define GL_QCOM_extended_get 1 -#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 -#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 -#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 -#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 -#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 -#define GL_TEXTURE_TYPE_QCOM 0x8BD7 -#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 -#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 -#define GL_TEXTURE_TARGET_QCOM 0x8BDA -#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB -#define GL_STATE_RESTORE 0x8BDC -typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); -typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); -typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); -GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); -GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); -GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); -GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); -GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params); -#endif -#endif /* GL_QCOM_extended_get */ - -#ifndef GL_QCOM_extended_get2 -#define GL_QCOM_extended_get2 1 -typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); -typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); -typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); -GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); -GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); -GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); -#endif -#endif /* GL_QCOM_extended_get2 */ - -#ifndef GL_QCOM_frame_extrapolation -#define GL_QCOM_frame_extrapolation 1 -typedef void (GL_APIENTRYP PFNGLEXTRAPOLATETEX2DQCOMPROC) (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glExtrapolateTex2DQCOM (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor); -#endif -#endif /* GL_QCOM_frame_extrapolation */ - -#ifndef GL_QCOM_framebuffer_foveated -#define GL_QCOM_framebuffer_foveated 1 -#define GL_FOVEATION_ENABLE_BIT_QCOM 0x00000001 -#define GL_FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x00000002 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC) (GLuint framebuffer, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint *providedFeatures); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC) (GLuint framebuffer, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferFoveationConfigQCOM (GLuint framebuffer, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint *providedFeatures); -GL_APICALL void GL_APIENTRY glFramebufferFoveationParametersQCOM (GLuint framebuffer, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); -#endif -#endif /* GL_QCOM_framebuffer_foveated */ - -#ifndef GL_QCOM_motion_estimation -#define GL_QCOM_motion_estimation 1 -#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_X_QCOM 0x8C90 -#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_Y_QCOM 0x8C91 -typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONQCOMPROC) (GLuint ref, GLuint target, GLuint output); -typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONREGIONSQCOMPROC) (GLuint ref, GLuint target, GLuint output, GLuint mask); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexEstimateMotionQCOM (GLuint ref, GLuint target, GLuint output); -GL_APICALL void GL_APIENTRY glTexEstimateMotionRegionsQCOM (GLuint ref, GLuint target, GLuint output, GLuint mask); -#endif -#endif /* GL_QCOM_motion_estimation */ - -#ifndef GL_QCOM_perfmon_global_mode -#define GL_QCOM_perfmon_global_mode 1 -#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 -#endif /* GL_QCOM_perfmon_global_mode */ - -#ifndef GL_QCOM_render_shared_exponent -#define GL_QCOM_render_shared_exponent 1 -#endif /* GL_QCOM_render_shared_exponent */ - -#ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent -#define GL_QCOM_shader_framebuffer_fetch_noncoherent 1 -#define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierQCOM (void); -#endif -#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ - -#ifndef GL_QCOM_shader_framebuffer_fetch_rate -#define GL_QCOM_shader_framebuffer_fetch_rate 1 -#endif /* GL_QCOM_shader_framebuffer_fetch_rate */ - -#ifndef GL_QCOM_shading_rate -#define GL_QCOM_shading_rate 1 -#define GL_SHADING_RATE_QCOM 0x96A4 -#define GL_SHADING_RATE_PRESERVE_ASPECT_RATIO_QCOM 0x96A5 -#define GL_SHADING_RATE_1X1_PIXELS_QCOM 0x96A6 -#define GL_SHADING_RATE_1X2_PIXELS_QCOM 0x96A7 -#define GL_SHADING_RATE_2X1_PIXELS_QCOM 0x96A8 -#define GL_SHADING_RATE_2X2_PIXELS_QCOM 0x96A9 -#define GL_SHADING_RATE_4X2_PIXELS_QCOM 0x96AC -#define GL_SHADING_RATE_4X4_PIXELS_QCOM 0x96AE -typedef void (GL_APIENTRYP PFNGLSHADINGRATEQCOMPROC) (GLenum rate); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glShadingRateQCOM (GLenum rate); -#endif -#endif /* GL_QCOM_shading_rate */ - -#ifndef GL_QCOM_texture_foveated -#define GL_QCOM_texture_foveated 1 -#define GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM 0x8BFB -#define GL_TEXTURE_FOVEATED_MIN_PIXEL_DENSITY_QCOM 0x8BFC -#define GL_TEXTURE_FOVEATED_FEATURE_QUERY_QCOM 0x8BFD -#define GL_TEXTURE_FOVEATED_NUM_FOCAL_POINTS_QUERY_QCOM 0x8BFE -#define GL_FRAMEBUFFER_INCOMPLETE_FOVEATION_QCOM 0x8BFF -typedef void (GL_APIENTRYP PFNGLTEXTUREFOVEATIONPARAMETERSQCOMPROC) (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); -#endif -#endif /* GL_QCOM_texture_foveated */ - -#ifndef GL_QCOM_texture_foveated2 -#define GL_QCOM_texture_foveated2 1 -#define GL_TEXTURE_FOVEATED_CUTOFF_DENSITY_QCOM 0x96A0 -#endif /* GL_QCOM_texture_foveated2 */ - -#ifndef GL_QCOM_texture_foveated_subsampled_layout -#define GL_QCOM_texture_foveated_subsampled_layout 1 -#define GL_FOVEATION_SUBSAMPLED_LAYOUT_METHOD_BIT_QCOM 0x00000004 -#define GL_MAX_SHADER_SUBSAMPLED_IMAGE_UNITS_QCOM 0x8FA1 -#endif /* GL_QCOM_texture_foveated_subsampled_layout */ - -#ifndef GL_QCOM_tiled_rendering -#define GL_QCOM_tiled_rendering 1 -#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 -#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 -#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 -#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 -#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 -#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 -#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 -#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 -#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 -#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 -#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 -#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 -#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 -#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 -#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 -#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 -#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 -#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 -#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 -#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 -#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 -#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 -#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 -#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 -#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 -#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 -#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 -#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 -#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 -#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 -#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 -#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 -typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); -typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); -GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); -#endif -#endif /* GL_QCOM_tiled_rendering */ - -#ifndef GL_QCOM_writeonly_rendering -#define GL_QCOM_writeonly_rendering 1 -#define GL_WRITEONLY_RENDERING_QCOM 0x8823 -#endif /* GL_QCOM_writeonly_rendering */ - -#ifndef GL_VIV_shader_binary -#define GL_VIV_shader_binary 1 -#define GL_SHADER_BINARY_VIV 0x8FC4 -#endif /* GL_VIV_shader_binary */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/extinclude/GLES2/gl2platform.h b/extinclude/GLES2/gl2platform.h deleted file mode 100644 index 5bcce6d8..00000000 --- a/extinclude/GLES2/gl2platform.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __gl2platform_h_ -#define __gl2platform_h_ - -/* -** Copyright 2017-2020 The Khronos Group Inc. -** SPDX-License-Identifier: Apache-2.0 -*/ - -/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h - * - * Adopters may modify khrplatform.h and this file to suit their platform. - * Please contribute modifications back to Khronos as pull requests on the - * public github repository: - * https://github.com/KhronosGroup/OpenGL-Registry - */ - -#include - -#ifndef GL_APICALL -#define GL_APICALL KHRONOS_APICALL -#endif - -#ifndef GL_APIENTRY -#define GL_APIENTRY KHRONOS_APIENTRY -#endif - -#endif /* __gl2platform_h_ */ diff --git a/extinclude/ODAPI.h b/extinclude/ODAPI.h deleted file mode 100644 index d9b31f17..00000000 --- a/extinclude/ODAPI.h +++ /dev/null @@ -1,224 +0,0 @@ -/****************************************************************************** - * $Id: ODAPI.h,v 1.0 2016/06/17 01:54:37 jongough Exp $ - * - * Project: OpenCPN - * Purpose: OpenCPN General Drawing Plugin API - * Author: Jon Gough - * - *************************************************************************** - * Copyright (C) 2010 by David S. Register * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - **************************************************************************/ - -#ifndef _ODAPI_H_ -#define _ODAPI_H_ - -#define ODAPI_VERSION_MAJOR 1 -#define ODAPI_VERSION_MINOR 1 - -#include - -enum { - EXCLUSION_BOUNDARY = 0, - INCLUSION_BOUNDARY, - NEITHER_BOUNDARY -}; - -enum { - TEXTPOINT_DISPLAY_TEXT_SHOW_ALWAYS = 0, - TEXTPOINT_DISPLAY_TEXT_SHOW_ON_ROLLOVER, - TEXTPOINT_DISPLAY_TEXT_SHOW_NEVER, - TEXTPOINT_DISPLAY_TEXT_SHOW_DEFAULT, - - TEXTPOINT_DISPLAY_TEXT_SHOW_LAST -}; - -enum { - TEXT_TOP = 0, - TEXT_CENTRE_TOP, - TEXT_BOTTOM, - TEXT_CENTRE_BOTTOM, - TEXT_CENTRE, - TEXT_RIGHT, - TEXT_LEFT, - TEXT_DEFAULT, - - TEXT_POSTION_LAST -}; - -enum { - TEXTPOINT_TEXT_BACKGROUND_TRANSPARANCY_DEFAULT = -1 -}; - -struct ODAPIVersion_t { - int ODAPIVersionMajor; - int ODAPIVersionMinor; - ODAPIVersion_t() : ODAPIVersionMajor(ODAPI_VERSION_MAJOR), ODAPIVersionMinor(ODAPI_VERSION_MINOR) {} -}; - -struct HyperLinkList_t { - wxString sDescription; - wxString sLink; - wxString sType; -}; - -struct FindPointInAnyBoundary_t { - double dLat; - double dLon; - wxString sBoundaryType; - wxString sBoundaryState; - wxString sName; - wxString sDescription; - wxString sGUID; - wxString sBoundaryObjectType; -}; - -struct FindClosestBoundaryLineCrossing_t { - double dStartLat; - double dStartLon; - double dEndLat; - double dEndLon; - double dCrossingLat; - double dCrossingLon; - double dCrossingDistance; - wxString sBoundaryType; - wxString sBoundaryState; - wxString sName; - wxString sDescription; - wxString sGUID; - wxString sBoundaryObjectType; -}; - -struct CreateBoundaryPoint_t : public ODAPIVersion_t { - wxString name; - wxString iconname; - double lat; - double lon; - int type; - bool visible; - bool ringsvisible; - int ringsnumber; - double ringssteps; - int ringsunits; - bool defaultRingColour; - wxColour ringscolour; - wxString GUID; - std::list BoundaryPointHyperLinkList; -}; - -struct DeleteBoundaryPoint_t : public ODAPIVersion_t { - wxString GUID; -}; - -struct CreateBoundary_t : public ODAPIVersion_t { - wxString name; - int type; - bool pathIsActive; - bool visible; - bool defaultLineColour; - wxColour lineColour; - bool defaultFillColour; - wxColour fillColour; - wxString GUID; - bool temporary; - std::list BoundaryPointsList; -}; - -struct DeleteBoundary_t : public ODAPIVersion_t { - wxString GUID; -}; - -struct CreateTextPoint_t : public ODAPIVersion_t{ - wxString name; //Point name - wxString iconname; //Icon Name - double lat; - double lon; - wxString description; - wxString TextToDisplay; - bool Visible; //Point visible - bool ShowName; //Show name - int TextPosition; //enum, i.e. TEXT_CENTRE - wxString TextColour; - wxString BackgroundColour; - int BackgroundTransparancy; - bool defaultFont; - wxFont TextFont; - int TextPointDisplayTextWhen; - bool defaultRangeRings; - bool ringsvisible; - int ringsnumber; - double ringssteps; - int ringsunits; - bool defaultRingColour; - wxString ringscolour; - wxString GUID; - std::list TextPointHyperLinkList; - bool temporary; -}; - -struct DeleteTextPoint_t : public ODAPIVersion_t { - wxString GUID; -}; - -struct AddPointIcon_t : ODAPIVersion_t { - wxBitmap PointIcon; - wxString PointIconName; - wxString PointIconDescription; -}; - -struct DeletePointIcon_t :ODAPIVersion_t { - wxString PointIconName; -}; - -class ODAPI -{ -public: - ODAPI(); - ~ODAPI(); - static bool OD_FindPathByGUID( wxString sGUID, wxString *sName, wxString *sDescription ); - static bool OD_FindPointInAnyBoundary( FindPointInAnyBoundary_t *pFPIAB ); - static bool OD_FindClosestBoundaryLineCrossing( FindClosestBoundaryLineCrossing_t *pFCBLC ); - static bool OD_FindFirstBoundaryLineCrossing( FindClosestBoundaryLineCrossing_t *pFCBLC ); - static bool OD_CreateBoundary( CreateBoundary_t *pCB ); - static bool OD_CreateBoundaryPoint( CreateBoundaryPoint_t *pCBP ); - static bool OD_CreateTextPoint( CreateTextPoint_t *pCTP ); - static bool OD_AddPointIcon( AddPointIcon_t *pAPI ); - static bool OD_DeletePointIcon( DeletePointIcon_t *pDPI ); - static bool OD_DeleteBoundary( DeleteBoundary_t *pDB ); - static bool OD_DeleteBoundaryPoint( DeleteBoundaryPoint_t *pDBP ); - static bool OD_DeleteTextPoint( DeleteTextPoint_t *pDTP ); - -protected: - -private: - -}; - -typedef bool (*OD_FindPathByGUID) (wxString, wxString *, wxString *); -typedef bool (*OD_FindPointInAnyBoundary) (FindPointInAnyBoundary_t *); -typedef bool (*OD_FindClosestBoundaryLineCrossing) (FindClosestBoundaryLineCrossing_t *); -typedef bool (*OD_FindFirstBoundaryLineCrossing) (FindClosestBoundaryLineCrossing_t *); -typedef bool (*OD_CreateBoundary) (CreateBoundary_t *); -typedef bool (*OD_CreateBoundaryPoint) (CreateBoundaryPoint_t *); -typedef bool (*OD_CreateTextPoint) (CreateTextPoint_t *); -typedef bool (*OD_AddPointIcon) (AddPointIcon_t *); -typedef bool (*OD_DeletePointIcon) (DeletePointIcon_t *); -typedef bool (*OD_DeleteBoundary) (DeleteBoundary_t *); -typedef bool (*OD_DeleteBoundaryPoint) (DeleteBoundaryPoint_t *); -typedef bool (*OD_DeleteTextPoint) (DeleteTextPoint_t *); - -#endif //_ODAPI_H_ diff --git a/extinclude/ODJSONSchemas.h b/extinclude/ODJSONSchemas.h deleted file mode 100644 index 0410d50c..00000000 --- a/extinclude/ODJSONSchemas.h +++ /dev/null @@ -1,340 +0,0 @@ -/****************************************************************************** - * $Id: ocpn_draw_pi.h,v 1.0 2015/01/28 01:54:37 jongough Exp $ - * - * Project: OpenCPN - * Purpose: OpenCPN General Drawing Plugin - * Author: Jon Gough - * - *************************************************************************** - * Copyright (C) 2010 by David S. Register * - * $EMAIL$ * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - *************************************************************************** - */ - -/* The header file contains the schema for the JSON messages that are being used. However it relies on Draf7 of the JSON schema - * which is not fully implemented yet in a C++ library. The code is defined out that will use this as the implementation changes the - * ABI code of the executable and is then not compatible with OpenCPN. There is basic checking for schema compliance but - * it is not robust and it is possible to crash OpenCPN if the values are not valid. - * - */ - -static json jSchema = R"( -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OD Schemas", - "definitions": { - "schemahead": { - "description": "Standalone for simple queries or required for complex internactions as a part of the message", - "type": "object", - "properties": { - "Msg": { - "description": "Message Name", - "enum": ["Version", "GetAPIAddresses", "CreateBoundaryPoint", "CreateBoundary", "CreateTextPoint", "DeleteTextPoint", "DeleteBoundaryPoint", "DeleteBoundary"] - }, - "Type": { - "description": "Type of Message", - "enum": ["Request","Response"] - }, - "Source": { - "description": "Source of message", - "type": "string" - }, - "MsgId": { - "description": "Message Name", - "type": "string" - } - }, - "required": ["Msg", "Type", "Source", "MsgId"], - "addtionalProperties": false - }, - "ODPoint": { - "description": "Generic OD Point", - "type": "object", - "properties" : { - "Name": { - "description": "Boundary Point Name", - "type": "string" - }, - "Lat": { - "description": "Latitude of Boundary Point", - "type": "number", - "minimum": -90, - "maximum": 90 - }, - "Lon": { - "description": "Longitude of Boundary Point", - "type": "number", - "minimum": -180, - "maximum": 180 - }, - "IconName": { - "description": "Boundary Point Icon Name", - "type": "string" - }, - "Visible": { - "description": "Visibility of Boundary Point", - "type": "boolean", - "default": false - }, - "RingsVisible": { - "description": "Visibility of Boundary Point Range Rings", - "type": "boolean", - "default": false - }, - "RingsNumber": { - "description": "Number of Boundary Point Rings", - "type": "number", - "minimum": 0, - "maximum": 10 - }, - "RingsSteps": { - "description": "Steps between Boundary Point Rings", - "type": "number", - "minimum": 0.0 - }, - "RingUnits": { - "description": "Boundary Point Range Ring Step Units", - "enum": [0,1,2,3,4,5,6,7,8,9,10] - }, - "RingsColour": { - "description": "Boundary Point Range Rings Colour", - "type": "string" - }, - "HyperLinks": { - "description": "Array of hyperlinks to local or internet documents", - "type": "array", - "Items": { - "allOf" : [ - { - "LinkDescription": { - "description": "Text description of hyper link", - "type": "string" - } - }, - { - "LinkURL": { - "description": "Actual Hyperlink", - "type": "string" - } - } - ] - } - } - }, - "required": [ - "Lat", - "Lon" - ] - }, - "boundarypoint": { - "description": "Used to create a boundary point", - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/ODPoint" - }, - "BoundaryPointType": { - "description": "Boundary Point Type", - "enum": ["Exclusion", "Inclusion", "Neither"] - } - }, - "required": [ - "BoundaryPointType" - ] - }, - "textpoint": { - "description": "Used to create a text point", - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/ODPoint" - }, - "Temporary": { - "description": "Text point life, false - exists over restart, true - non persistent", - "type": "boolean", - "default": false - }, - "GUID": { - "description": "GUID of Text Point", - "type": "string", - "optional": true - }, - "TextToDisplay": { - "description": "Text Point Text", - "type": "string" - }, - "TextPosition": { - "description": "Text Point Text Position", - "enum": [0,1,2,3,4,5,6] - }, - "TextColour": { - "description": "Text Point Text Colour", - "type": "string" - }, - "BackgroundColour": { - "description": "Text Point Text BackgroundColour", - "type": "string" - }, - "BackgroundTransparancy": { - "description": "Text Point Text BackgroundTransparancy", - "type": "number", - "minimum": 0, - "maximum": 255 - }, - "TextFont": { - "description": "Text Point Font", - "type": "string" - }, - "TextPointDisplayTextWhen": { - "description": "Text Point When To Display", - "type": "string" - } - } - }, - "ODObject": { - "description": "Used to delete an object", - "type": "object", - "properties": { - "GUID": { - "description": "GUID of object", - "type": "string" - } - }, - "required": [ - "GUID" - ] - }, - "PointIcon": { - "description": "Used to delete add an point icon", - "type": "object", - "properties": { - "PointIcon": { - "description": "Point Icon in Base64", - "type": "string", - "optional": false - }, - "PointIconName": { - "description": "Point Icon name", - "type": "string", - "optional": false - }, - "PointIconDescription": { - "description": "Point Icon Description", - "type": "string", - "optional": false - } - }, - "required": [ - "PointIcon", - "PointIconName", - "PointIconDescription" - ] - }, - "boundary": { - "description": "Used to create or modify a boundary", - "type": "object", - "properties": { - "BoundaryName": { - "description": "Boundary Name", - "type": "string" - }, - "BoundaryType": { - "description": "Boundary Type", - "enum": ["Exclusion","Inclusion","Neither"] - }, - "Active": { - "description": "Is Boundary Active", - "type": "boolean", - "boolean": true - }, - "Visible": { - "description": "Visibility of Boundary", - "type": "boolean", - "default": true - }, - "Temporary": { - "description": "Boundary life, false - exists over restart, true - non persistent", - "type": "boolean", - "default": false - }, - "BoundaryPoints": { - "description": "Array of boundary points needed to define a boundary", - "type": "array", - "items": { - "$ref": "#/definitions/boundarypoint" - }, - "minItems": 3, - "additionalItems": false - } - }, - "required": [ - "BoundaryPoints", - "BoundaryType" - ] - } - }, - "type": "object", - "allOf": [ - {"$ref": "#/definitions/schemahead"}, - { - "if": { "properties": {"Msg": {"const": "CreateBoundary"}} - }, - "then": { - "$ref": "#/definitions/boundary" - } - }, - { - "if": { "properties": {"Msg": {"const": "CreateBoundaryPoint"}} - }, - "then": { - "$ref": "#/definitions/boundarypoint" - } - }, - { - "if": { "properties": {"Msg": {"const": "CreateTextPoint"}} - }, - "then": { - "$ref": "#/definitions/textpoint" - } - }, - { - "if": { "properties": {"Msg": {"const": "DeleteTextPoint"}} - }, - "then": { - "$ref": "#/definitions/ODObject" - } - }, - { - "if": { "properties": {"Msg": {"const": "DeleteBoundaryPoint"}} - }, - "then": { - "$ref": "#/definitions/ODObject" - } - }, - { - "if": { "properties": {"Msg": {"const": "DeleteBoundary"}} - }, - "then": { - "$ref": "#/definitions/ODObject" - } - } - - ] -} -)"_json; - diff --git a/extinclude/nlohmann/json-schema.hpp b/extinclude/nlohmann/json-schema.hpp deleted file mode 100644 index 46dc6006..00000000 --- a/extinclude/nlohmann/json-schema.hpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * JSON schema validator for JSON for modern C++ - * - * Copyright (c) 2016-2019 Patrick Boettcher . - * - * SPDX-License-Identifier: MIT - * - */ -#ifndef NLOHMANN_JSON_SCHEMA_HPP__ -#define NLOHMANN_JSON_SCHEMA_HPP__ - -#ifdef _WIN32 -# if defined(JSON_SCHEMA_VALIDATOR_EXPORTS) -# define JSON_SCHEMA_VALIDATOR_API __declspec(dllexport) -# elif defined(JSON_SCHEMA_VALIDATOR_IMPORTS) -# define JSON_SCHEMA_VALIDATOR_API __declspec(dllimport) -# else -# define JSON_SCHEMA_VALIDATOR_API -# endif -#else -# define JSON_SCHEMA_VALIDATOR_API -#endif - -#include - -#ifdef NLOHMANN_JSON_VERSION_MAJOR -# if NLOHMANN_JSON_VERSION_MAJOR < 3 || NLOHMANN_JSON_VERSION_MINOR < 5 || NLOHMANN_JSON_VERSION_PATCH < 0 -# error "Please use this library with NLohmann's JSON version 3.5.0 or higher" -# endif -#else -# error "expected existing NLOHMANN_JSON_VERSION_MAJOR preproc variable, please update to NLohmann's JSON 3.5.0" -#endif - -// make yourself a home - welcome to nlohmann's namespace -namespace nlohmann -{ - -// A class representing a JSON-URI for schemas derived from -// section 8 of JSON Schema: A Media Type for Describing JSON Documents -// draft-wright-json-schema-00 -// -// New URIs can be derived from it using the derive()-method. -// This is useful for resolving refs or subschema-IDs in json-schemas. -// -// This is done implement the requirements described in section 8.2. -// -class JSON_SCHEMA_VALIDATOR_API json_uri -{ - std::string urn_; - - std::string proto_; - std::string hostname_; - std::string path_; - nlohmann::json::json_pointer pointer_; - -protected: - // decodes a JSON uri and replaces all or part of the currently stored values - void update(const std::string &uri); - - std::tuple tie() const - { - return std::tie(urn_, proto_, hostname_, path_, pointer_); - } - -public: - json_uri(const std::string &uri) - { - update(uri); - } - - const std::string protocol() const { return proto_; } - const std::string hostname() const { return hostname_; } - const std::string path() const { return path_; } - - const nlohmann::json::json_pointer pointer() const { return pointer_; } - - const std::string url() const { return location(); } - const std::string location() const; - - static std::string escape(const std::string &); - - // create a new json_uri based in this one and the given uri - // resolves relative changes (pathes or pointers) and resets part if proto or hostname changes - json_uri derive(const std::string &uri) const - { - json_uri u = *this; - u.update(uri); - return u; - } - - // append a pointer-field to the pointer-part of this uri - json_uri append(const std::string &field) const - { - json_uri u = *this; - u.pointer_ = nlohmann::json::json_pointer(u.pointer_.to_string() + '/' + escape(field)); - return u; - } - - std::string to_string() const; - - friend bool operator<(const json_uri &l, const json_uri &r) - { - return l.tie() < r.tie(); - } - - friend bool operator==(const json_uri &l, const json_uri &r) - { - return l.tie() == r.tie(); - } - - friend std::ostream &operator<<(std::ostream &os, const json_uri &u); -}; - -namespace json_schema -{ - -extern json draft7_schema_builtin; - -class basic_error_handler -{ - bool error_{false}; - -public: - virtual void error(const std::string & /*path*/, const json & /* instance */, const std::string & /*message*/) - { - error_ = true; - } - - void reset() { error_ = false; } - operator bool() const { return error_; } -}; - -class root_schema; - -class JSON_SCHEMA_VALIDATOR_API json_validator -{ - std::unique_ptr root_; - -public: - json_validator(std::function loader = nullptr, - std::function format = nullptr); - ~json_validator(); - - // insert and set thea root-schema - void set_root_schema(const json &); - - // validate a json-document based on the root-schema - void validate(const json &); - - // validate a json-document based on the root-schema with a custom error-handler - void validate(const json &, basic_error_handler &); -}; - -} // namespace json_schema -} // namespace nlohmann - -#endif /* NLOHMANN_JSON_SCHEMA_HPP__ */ diff --git a/extinclude/nlohmann/json.hpp b/extinclude/nlohmann/json.hpp deleted file mode 100644 index 5003a4fa..00000000 --- a/extinclude/nlohmann/json.hpp +++ /dev/null @@ -1,20842 +0,0 @@ -/* - __ _____ _____ _____ - __| | __| | | | JSON for Modern C++ -| | |__ | | | | | | version 3.6.1 -|_____|_____|_____|_|___| https://github.com/nlohmann/json - -Licensed under the MIT License . -SPDX-License-Identifier: MIT -Copyright (c) 2013-2019 Niels Lohmann . - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef INCLUDE_NLOHMANN_JSON_HPP_ -#define INCLUDE_NLOHMANN_JSON_HPP_ - -#define NLOHMANN_JSON_VERSION_MAJOR 3 -#define NLOHMANN_JSON_VERSION_MINOR 6 -#define NLOHMANN_JSON_VERSION_PATCH 1 - -#include // all_of, find, for_each -#include // assert -#include // and, not, or -#include // nullptr_t, ptrdiff_t, size_t -#include // hash, less -#include // initializer_list -#include // istream, ostream -#include // random_access_iterator_tag -#include // unique_ptr -#include // accumulate -#include // string, stoi, to_string -#include // declval, forward, move, pair, swap -#include // vector - -// #include - - -#include - -// #include - - -#include // transform -#include // array -#include // and, not -#include // forward_list -#include // inserter, front_inserter, end -#include // map -#include // string -#include // tuple, make_tuple -#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible -#include // unordered_map -#include // pair, declval -#include // valarray - -// #include - - -#include // exception -#include // runtime_error -#include // to_string - -// #include - - -#include // size_t - -namespace nlohmann -{ -namespace detail -{ -/// struct to capture the start position of the current token -struct position_t -{ - /// the total number of characters read - std::size_t chars_read_total = 0; - /// the number of characters read in the current line - std::size_t chars_read_current_line = 0; - /// the number of lines read - std::size_t lines_read = 0; - - /// conversion to size_t to preserve SAX interface - constexpr operator size_t() const - { - return chars_read_total; - } -}; - -} // namespace detail -} // namespace nlohmann - - -namespace nlohmann -{ -namespace detail -{ -//////////////// -// exceptions // -//////////////// - -/*! -@brief general exception of the @ref basic_json class - -This class is an extension of `std::exception` objects with a member @a id for -exception ids. It is used as the base class for all exceptions thrown by the -@ref basic_json class. This class can hence be used as "wildcard" to catch -exceptions. - -Subclasses: -- @ref parse_error for exceptions indicating a parse error -- @ref invalid_iterator for exceptions indicating errors with iterators -- @ref type_error for exceptions indicating executing a member function with - a wrong type -- @ref out_of_range for exceptions indicating access out of the defined range -- @ref other_error for exceptions indicating other library errors - -@internal -@note To have nothrow-copy-constructible exceptions, we internally use - `std::runtime_error` which can cope with arbitrary-length error messages. - Intermediate strings are built with static functions and then passed to - the actual constructor. -@endinternal - -@liveexample{The following code shows how arbitrary library exceptions can be -caught.,exception} - -@since version 3.0.0 -*/ -class exception : public std::exception -{ - public: - /// returns the explanatory string - const char* what() const noexcept override - { - return m.what(); - } - - /// the id of the exception - const int id; - - protected: - exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} - - static std::string name(const std::string& ename, int id_) - { - return "[json.exception." + ename + "." + std::to_string(id_) + "] "; - } - - private: - /// an exception object as storage for error messages - std::runtime_error m; -}; - -/*! -@brief exception indicating a parse error - -This exception is thrown by the library when a parse error occurs. Parse errors -can occur during the deserialization of JSON text, CBOR, MessagePack, as well -as when using JSON Patch. - -Member @a byte holds the byte index of the last read character in the input -file. - -Exceptions have ids 1xx. - -name / id | example message | description ------------------------------- | --------------- | ------------------------- -json.exception.parse_error.101 | parse error at 2: unexpected end of input; expected string literal | This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member @a byte indicates the error position. -json.exception.parse_error.102 | parse error at 14: missing or wrong low surrogate | JSON uses the `\uxxxx` format to describe Unicode characters. Code points above above 0xFFFF are split into two `\uxxxx` entries ("surrogate pairs"). This error indicates that the surrogate pair is incomplete or contains an invalid code point. -json.exception.parse_error.103 | parse error: code points above 0x10FFFF are invalid | Unicode supports code points up to 0x10FFFF. Code points above 0x10FFFF are invalid. -json.exception.parse_error.104 | parse error: JSON patch must be an array of objects | [RFC 6902](https://tools.ietf.org/html/rfc6902) requires a JSON Patch document to be a JSON document that represents an array of objects. -json.exception.parse_error.105 | parse error: operation must have string member 'op' | An operation of a JSON Patch document must contain exactly one "op" member, whose value indicates the operation to perform. Its value must be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors. -json.exception.parse_error.106 | parse error: array index '01' must not begin with '0' | An array index in a JSON Pointer ([RFC 6901](https://tools.ietf.org/html/rfc6901)) may be `0` or any number without a leading `0`. -json.exception.parse_error.107 | parse error: JSON pointer must be empty or begin with '/' - was: 'foo' | A JSON Pointer must be a Unicode string containing a sequence of zero or more reference tokens, each prefixed by a `/` character. -json.exception.parse_error.108 | parse error: escape character '~' must be followed with '0' or '1' | In a JSON Pointer, only `~0` and `~1` are valid escape sequences. -json.exception.parse_error.109 | parse error: array index 'one' is not a number | A JSON Pointer array index must be a number. -json.exception.parse_error.110 | parse error at 1: cannot read 2 bytes from vector | When parsing CBOR or MessagePack, the byte vector ends before the complete value has been read. -json.exception.parse_error.112 | parse error at 1: error reading CBOR; last byte: 0xF8 | Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read. -json.exception.parse_error.113 | parse error at 2: expected a CBOR string; last byte: 0x98 | While parsing a map key, a value that is not a string has been read. -json.exception.parse_error.114 | parse error: Unsupported BSON record type 0x0F | The parsing of the corresponding BSON record type is not implemented (yet). - -@note For an input with n bytes, 1 is the index of the first character and n+1 - is the index of the terminating null byte or the end of file. This also - holds true when reading a byte vector (CBOR or MessagePack). - -@liveexample{The following code shows how a `parse_error` exception can be -caught.,parse_error} - -@sa - @ref exception for the base class of the library exceptions -@sa - @ref invalid_iterator for exceptions indicating errors with iterators -@sa - @ref type_error for exceptions indicating executing a member function with - a wrong type -@sa - @ref out_of_range for exceptions indicating access out of the defined range -@sa - @ref other_error for exceptions indicating other library errors - -@since version 3.0.0 -*/ -class parse_error : public exception -{ - public: - /*! - @brief create a parse error exception - @param[in] id_ the id of the exception - @param[in] pos the position where the error occurred (or with - chars_read_total=0 if the position cannot be - determined) - @param[in] what_arg the explanatory string - @return parse_error object - */ - static parse_error create(int id_, const position_t& pos, const std::string& what_arg) - { - std::string w = exception::name("parse_error", id_) + "parse error" + - position_string(pos) + ": " + what_arg; - return parse_error(id_, pos.chars_read_total, w.c_str()); - } - - static parse_error create(int id_, std::size_t byte_, const std::string& what_arg) - { - std::string w = exception::name("parse_error", id_) + "parse error" + - (byte_ != 0 ? (" at byte " + std::to_string(byte_)) : "") + - ": " + what_arg; - return parse_error(id_, byte_, w.c_str()); - } - - /*! - @brief byte index of the parse error - - The byte index of the last read character in the input file. - - @note For an input with n bytes, 1 is the index of the first character and - n+1 is the index of the terminating null byte or the end of file. - This also holds true when reading a byte vector (CBOR or MessagePack). - */ - const std::size_t byte; - - private: - parse_error(int id_, std::size_t byte_, const char* what_arg) - : exception(id_, what_arg), byte(byte_) {} - - static std::string position_string(const position_t& pos) - { - return " at line " + std::to_string(pos.lines_read + 1) + - ", column " + std::to_string(pos.chars_read_current_line); - } -}; - -/*! -@brief exception indicating errors with iterators - -This exception is thrown if iterators passed to a library function do not match -the expected semantics. - -Exceptions have ids 2xx. - -name / id | example message | description ------------------------------------ | --------------- | ------------------------- -json.exception.invalid_iterator.201 | iterators are not compatible | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. -json.exception.invalid_iterator.202 | iterator does not fit current value | In an erase or insert function, the passed iterator @a pos does not belong to the JSON value for which the function was called. It hence does not define a valid position for the deletion/insertion. -json.exception.invalid_iterator.203 | iterators do not fit current value | Either iterator passed to function @ref erase(IteratorType first, IteratorType last) does not belong to the JSON value from which values shall be erased. It hence does not define a valid range to delete values from. -json.exception.invalid_iterator.204 | iterators out of range | When an iterator range for a primitive type (number, boolean, or string) is passed to a constructor or an erase function, this range has to be exactly (@ref begin(), @ref end()), because this is the only way the single stored value is expressed. All other ranges are invalid. -json.exception.invalid_iterator.205 | iterator out of range | When an iterator for a primitive type (number, boolean, or string) is passed to an erase function, the iterator has to be the @ref begin() iterator, because it is the only way to address the stored value. All other iterators are invalid. -json.exception.invalid_iterator.206 | cannot construct with iterators from null | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) belong to a JSON null value and hence to not define a valid range. -json.exception.invalid_iterator.207 | cannot use key() for non-object iterators | The key() member function can only be used on iterators belonging to a JSON object, because other types do not have a concept of a key. -json.exception.invalid_iterator.208 | cannot use operator[] for object iterators | The operator[] to specify a concrete offset cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. -json.exception.invalid_iterator.209 | cannot use offsets with object iterators | The offset operators (+, -, +=, -=) cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. -json.exception.invalid_iterator.210 | iterators do not fit | The iterator range passed to the insert function are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. -json.exception.invalid_iterator.211 | passed iterators may not belong to container | The iterator range passed to the insert function must not be a subrange of the container to insert to. -json.exception.invalid_iterator.212 | cannot compare iterators of different containers | When two iterators are compared, they must belong to the same container. -json.exception.invalid_iterator.213 | cannot compare order of object iterators | The order of object iterators cannot be compared, because JSON objects are unordered. -json.exception.invalid_iterator.214 | cannot get value | Cannot get value for iterator: Either the iterator belongs to a null value or it is an iterator to a primitive type (number, boolean, or string), but the iterator is different to @ref begin(). - -@liveexample{The following code shows how an `invalid_iterator` exception can be -caught.,invalid_iterator} - -@sa - @ref exception for the base class of the library exceptions -@sa - @ref parse_error for exceptions indicating a parse error -@sa - @ref type_error for exceptions indicating executing a member function with - a wrong type -@sa - @ref out_of_range for exceptions indicating access out of the defined range -@sa - @ref other_error for exceptions indicating other library errors - -@since version 3.0.0 -*/ -class invalid_iterator : public exception -{ - public: - static invalid_iterator create(int id_, const std::string& what_arg) - { - std::string w = exception::name("invalid_iterator", id_) + what_arg; - return invalid_iterator(id_, w.c_str()); - } - - private: - invalid_iterator(int id_, const char* what_arg) - : exception(id_, what_arg) {} -}; - -/*! -@brief exception indicating executing a member function with a wrong type - -This exception is thrown in case of a type error; that is, a library function is -executed on a JSON value whose type does not match the expected semantics. - -Exceptions have ids 3xx. - -name / id | example message | description ------------------------------ | --------------- | ------------------------- -json.exception.type_error.301 | cannot create object from initializer list | To create an object from an initializer list, the initializer list must consist only of a list of pairs whose first element is a string. When this constraint is violated, an array is created instead. -json.exception.type_error.302 | type must be object, but is array | During implicit or explicit value conversion, the JSON type must be compatible to the target type. For instance, a JSON string can only be converted into string types, but not into numbers or boolean types. -json.exception.type_error.303 | incompatible ReferenceType for get_ref, actual type is object | To retrieve a reference to a value stored in a @ref basic_json object with @ref get_ref, the type of the reference must match the value type. For instance, for a JSON array, the @a ReferenceType must be @ref array_t &. -json.exception.type_error.304 | cannot use at() with string | The @ref at() member functions can only be executed for certain JSON types. -json.exception.type_error.305 | cannot use operator[] with string | The @ref operator[] member functions can only be executed for certain JSON types. -json.exception.type_error.306 | cannot use value() with string | The @ref value() member functions can only be executed for certain JSON types. -json.exception.type_error.307 | cannot use erase() with string | The @ref erase() member functions can only be executed for certain JSON types. -json.exception.type_error.308 | cannot use push_back() with string | The @ref push_back() and @ref operator+= member functions can only be executed for certain JSON types. -json.exception.type_error.309 | cannot use insert() with | The @ref insert() member functions can only be executed for certain JSON types. -json.exception.type_error.310 | cannot use swap() with number | The @ref swap() member functions can only be executed for certain JSON types. -json.exception.type_error.311 | cannot use emplace_back() with string | The @ref emplace_back() member function can only be executed for certain JSON types. -json.exception.type_error.312 | cannot use update() with string | The @ref update() member functions can only be executed for certain JSON types. -json.exception.type_error.313 | invalid value to unflatten | The @ref unflatten function converts an object whose keys are JSON Pointers back into an arbitrary nested JSON value. The JSON Pointers must not overlap, because then the resulting value would not be well defined. -json.exception.type_error.314 | only objects can be unflattened | The @ref unflatten function only works for an object whose keys are JSON Pointers. -json.exception.type_error.315 | values in object must be primitive | The @ref unflatten function only works for an object whose keys are JSON Pointers and whose values are primitive. -json.exception.type_error.316 | invalid UTF-8 byte at index 10: 0x7E | The @ref dump function only works with UTF-8 encoded strings; that is, if you assign a `std::string` to a JSON value, make sure it is UTF-8 encoded. | -json.exception.type_error.317 | JSON value cannot be serialized to requested format | The dynamic type of the object cannot be represented in the requested serialization format (e.g. a raw `true` or `null` JSON object cannot be serialized to BSON) | - -@liveexample{The following code shows how a `type_error` exception can be -caught.,type_error} - -@sa - @ref exception for the base class of the library exceptions -@sa - @ref parse_error for exceptions indicating a parse error -@sa - @ref invalid_iterator for exceptions indicating errors with iterators -@sa - @ref out_of_range for exceptions indicating access out of the defined range -@sa - @ref other_error for exceptions indicating other library errors - -@since version 3.0.0 -*/ -class type_error : public exception -{ - public: - static type_error create(int id_, const std::string& what_arg) - { - std::string w = exception::name("type_error", id_) + what_arg; - return type_error(id_, w.c_str()); - } - - private: - type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} -}; - -/*! -@brief exception indicating access out of the defined range - -This exception is thrown in case a library function is called on an input -parameter that exceeds the expected range, for instance in case of array -indices or nonexisting object keys. - -Exceptions have ids 4xx. - -name / id | example message | description -------------------------------- | --------------- | ------------------------- -json.exception.out_of_range.401 | array index 3 is out of range | The provided array index @a i is larger than @a size-1. -json.exception.out_of_range.402 | array index '-' (3) is out of range | The special array index `-` in a JSON Pointer never describes a valid element of the array, but the index past the end. That is, it can only be used to add elements at this position, but not to read it. -json.exception.out_of_range.403 | key 'foo' not found | The provided key was not found in the JSON object. -json.exception.out_of_range.404 | unresolved reference token 'foo' | A reference token in a JSON Pointer could not be resolved. -json.exception.out_of_range.405 | JSON pointer has no parent | The JSON Patch operations 'remove' and 'add' can not be applied to the root element of the JSON value. -json.exception.out_of_range.406 | number overflow parsing '10E1000' | A parsed number could not be stored as without changing it to NaN or INF. -json.exception.out_of_range.407 | number overflow serializing '9223372036854775808' | UBJSON and BSON only support integer numbers up to 9223372036854775807. | -json.exception.out_of_range.408 | excessive array size: 8658170730974374167 | The size (following `#`) of an UBJSON array or object exceeds the maximal capacity. | -json.exception.out_of_range.409 | BSON key cannot contain code point U+0000 (at byte 2) | Key identifiers to be serialized to BSON cannot contain code point U+0000, since the key is stored as zero-terminated c-string | - -@liveexample{The following code shows how an `out_of_range` exception can be -caught.,out_of_range} - -@sa - @ref exception for the base class of the library exceptions -@sa - @ref parse_error for exceptions indicating a parse error -@sa - @ref invalid_iterator for exceptions indicating errors with iterators -@sa - @ref type_error for exceptions indicating executing a member function with - a wrong type -@sa - @ref other_error for exceptions indicating other library errors - -@since version 3.0.0 -*/ -class out_of_range : public exception -{ - public: - static out_of_range create(int id_, const std::string& what_arg) - { - std::string w = exception::name("out_of_range", id_) + what_arg; - return out_of_range(id_, w.c_str()); - } - - private: - out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} -}; - -/*! -@brief exception indicating other library errors - -This exception is thrown in case of errors that cannot be classified with the -other exception types. - -Exceptions have ids 5xx. - -name / id | example message | description ------------------------------- | --------------- | ------------------------- -json.exception.other_error.501 | unsuccessful: {"op":"test","path":"/baz", "value":"bar"} | A JSON Patch operation 'test' failed. The unsuccessful operation is also printed. - -@sa - @ref exception for the base class of the library exceptions -@sa - @ref parse_error for exceptions indicating a parse error -@sa - @ref invalid_iterator for exceptions indicating errors with iterators -@sa - @ref type_error for exceptions indicating executing a member function with - a wrong type -@sa - @ref out_of_range for exceptions indicating access out of the defined range - -@liveexample{The following code shows how an `other_error` exception can be -caught.,other_error} - -@since version 3.0.0 -*/ -class other_error : public exception -{ - public: - static other_error create(int id_, const std::string& what_arg) - { - std::string w = exception::name("other_error", id_) + what_arg; - return other_error(id_, w.c_str()); - } - - private: - other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} -}; -} // namespace detail -} // namespace nlohmann - -// #include - - -#include // pair - -// This file contains all internal macro definitions -// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them - -// exclude unsupported compilers -#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) - #if defined(__clang__) - #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 - #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" - #endif - #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) - #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 - #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" - #endif - #endif -#endif - -// disable float-equal warnings on GCC/clang -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wfloat-equal" -#endif - -// disable documentation warnings on clang -#if defined(__clang__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdocumentation" -#endif - -// allow for portable deprecation warnings -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #define JSON_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) - #define JSON_DEPRECATED __declspec(deprecated) -#else - #define JSON_DEPRECATED -#endif - -// allow for portable nodiscard warnings -#if defined(__has_cpp_attribute) - #if __has_cpp_attribute(nodiscard) - #define JSON_NODISCARD [[nodiscard]] - #elif __has_cpp_attribute(gnu::warn_unused_result) - #define JSON_NODISCARD [[gnu::warn_unused_result]] - #else - #define JSON_NODISCARD - #endif -#else - #define JSON_NODISCARD -#endif - -// allow to disable exceptions -#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) - #define JSON_THROW(exception) throw exception - #define JSON_TRY try - #define JSON_CATCH(exception) catch(exception) - #define JSON_INTERNAL_CATCH(exception) catch(exception) -#else - #include - #define JSON_THROW(exception) std::abort() - #define JSON_TRY if(true) - #define JSON_CATCH(exception) if(false) - #define JSON_INTERNAL_CATCH(exception) if(false) -#endif - -// override exception macros -#if defined(JSON_THROW_USER) - #undef JSON_THROW - #define JSON_THROW JSON_THROW_USER -#endif -#if defined(JSON_TRY_USER) - #undef JSON_TRY - #define JSON_TRY JSON_TRY_USER -#endif -#if defined(JSON_CATCH_USER) - #undef JSON_CATCH - #define JSON_CATCH JSON_CATCH_USER - #undef JSON_INTERNAL_CATCH - #define JSON_INTERNAL_CATCH JSON_CATCH_USER -#endif -#if defined(JSON_INTERNAL_CATCH_USER) - #undef JSON_INTERNAL_CATCH - #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER -#endif - -// manual branch prediction -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #define JSON_LIKELY(x) __builtin_expect(x, 1) - #define JSON_UNLIKELY(x) __builtin_expect(x, 0) -#else - #define JSON_LIKELY(x) x - #define JSON_UNLIKELY(x) x -#endif - -// C++ language standard detection -#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 - #define JSON_HAS_CPP_17 - #define JSON_HAS_CPP_14 -#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) - #define JSON_HAS_CPP_14 -#endif - -/*! -@brief macro to briefly define a mapping between an enum and JSON -@def NLOHMANN_JSON_SERIALIZE_ENUM -@since version 3.4.0 -*/ -#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ - template \ - inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ - { \ - static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ - static const std::pair m[] = __VA_ARGS__; \ - auto it = std::find_if(std::begin(m), std::end(m), \ - [e](const std::pair& ej_pair) -> bool \ - { \ - return ej_pair.first == e; \ - }); \ - j = ((it != std::end(m)) ? it : std::begin(m))->second; \ - } \ - template \ - inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ - { \ - static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ - static const std::pair m[] = __VA_ARGS__; \ - auto it = std::find_if(std::begin(m), std::end(m), \ - [j](const std::pair& ej_pair) -> bool \ - { \ - return ej_pair.second == j; \ - }); \ - e = ((it != std::end(m)) ? it : std::begin(m))->first; \ - } - -// Ugly macros to avoid uglier copy-paste when specializing basic_json. They -// may be removed in the future once the class is split. - -#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ - template class ObjectType, \ - template class ArrayType, \ - class StringType, class BooleanType, class NumberIntegerType, \ - class NumberUnsignedType, class NumberFloatType, \ - template class AllocatorType, \ - template class JSONSerializer> - -#define NLOHMANN_BASIC_JSON_TPL \ - basic_json - -// #include - - -#include // not -#include // size_t -#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type - -namespace nlohmann -{ -namespace detail -{ -// alias templates to reduce boilerplate -template -using enable_if_t = typename std::enable_if::type; - -template -using uncvref_t = typename std::remove_cv::type>::type; - -// implementation of C++14 index_sequence and affiliates -// source: https://stackoverflow.com/a/32223343 -template -struct index_sequence -{ - using type = index_sequence; - using value_type = std::size_t; - static constexpr std::size_t size() noexcept - { - return sizeof...(Ints); - } -}; - -template -struct merge_and_renumber; - -template -struct merge_and_renumber, index_sequence> - : index_sequence < I1..., (sizeof...(I1) + I2)... > {}; - -template -struct make_index_sequence - : merge_and_renumber < typename make_index_sequence < N / 2 >::type, - typename make_index_sequence < N - N / 2 >::type > {}; - -template<> struct make_index_sequence<0> : index_sequence<> {}; -template<> struct make_index_sequence<1> : index_sequence<0> {}; - -template -using index_sequence_for = make_index_sequence; - -// dispatch utility (taken from ranges-v3) -template struct priority_tag : priority_tag < N - 1 > {}; -template<> struct priority_tag<0> {}; - -// taken from ranges-v3 -template -struct static_const -{ - static constexpr T value{}; -}; - -template -constexpr T static_const::value; -} // namespace detail -} // namespace nlohmann - -// #include - - -#include // not -#include // numeric_limits -#include // false_type, is_constructible, is_integral, is_same, true_type -#include // declval - -// #include - - -#include // random_access_iterator_tag - -// #include - - -namespace nlohmann -{ -namespace detail -{ -template struct make_void -{ - using type = void; -}; -template using void_t = typename make_void::type; -} // namespace detail -} // namespace nlohmann - -// #include - - -namespace nlohmann -{ -namespace detail -{ -template -struct iterator_types {}; - -template -struct iterator_types < - It, - void_t> -{ - using difference_type = typename It::difference_type; - using value_type = typename It::value_type; - using pointer = typename It::pointer; - using reference = typename It::reference; - using iterator_category = typename It::iterator_category; -}; - -// This is required as some compilers implement std::iterator_traits in a way that -// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. -template -struct iterator_traits -{ -}; - -template -struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> - : iterator_types -{ -}; - -template -struct iterator_traits::value>> -{ - using iterator_category = std::random_access_iterator_tag; - using value_type = T; - using difference_type = ptrdiff_t; - using pointer = T*; - using reference = T&; -}; -} // namespace detail -} // namespace nlohmann - -// #include - -// #include - -// #include - - -#include - -// #include - - -// http://en.cppreference.com/w/cpp/experimental/is_detected -namespace nlohmann -{ -namespace detail -{ -struct nonesuch -{ - nonesuch() = delete; - ~nonesuch() = delete; - nonesuch(nonesuch const&) = delete; - nonesuch(nonesuch const&&) = delete; - void operator=(nonesuch const&) = delete; - void operator=(nonesuch&&) = delete; -}; - -template class Op, - class... Args> -struct detector -{ - using value_t = std::false_type; - using type = Default; -}; - -template class Op, class... Args> -struct detector>, Op, Args...> -{ - using value_t = std::true_type; - using type = Op; -}; - -template