diff --git a/.fvmrc b/.fvmrc index 07470f9c..afd20432 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,3 @@ { - "flutter": "3.29.3" -} + "flutter": "3.44.2" +} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1f7b112..715698bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,23 +2,70 @@ name: CI on: push: - branches: - - '**' - tags: - - '*' + branches: ['**'] + tags: ['*'] pull_request: workflow_dispatch: +# Auto-cancel in-flight runs when a new push lands on the same ref. +# Tag builds (refs/tags/*) get a unique-per-run group so release runs +# never cancel each other. +concurrency: + group: ${{ github.workflow }}-${{ startsWith(github.ref, 'refs/tags/') && github.run_id || github.ref }} + cancel-in-progress: true + env: ROOT: "${{ github.workspace }}" SCRIPTS: "${{ github.workspace }}/.github/scripts" SERIOUS_PYTHON_SITE_PACKAGES: "${{ github.workspace }}/site-packages" UV_PYTHON: "3.12" + # futureware-tech/simulator-action upstream still declares node20 in + # action.yml (no Node 24 release as of v5). Force the runner to execute + # node20-declared JS actions on Node 24 so we don't trip the deprecation + # warning that becomes a hard error on 2026-09-16. + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" + # Pin flet so the Python side matches the Dart-side flet version. With + # `--only-binary :all:`, pip would otherwise silently downgrade to an + # older flet whose transitive deps (e.g. msgpack) have wheels for the + # target python_version / platform, leaving the two halves mismatched. + FLET_VERSION: "0.85.3" jobs: - macos: - name: Test on macOS (Python ${{ matrix.python_version }}) - runs-on: macos-latest + version_tables_in_sync: + name: Version tables in sync with manifest + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Setup Flutter + uses: kuhnroyal/flutter-fvm-config-action/setup@v3 + with: + path: '.fvmrc' + cache: true + + - name: Regenerate version tables and check for drift + working-directory: src/serious_python + run: | + set -euo pipefail + flutter pub get >/dev/null + dart run serious_python:gen_version_tables + if ! git diff --quiet; then + echo "::error::Generated Python version tables are out of date." + echo "The committed lib/src/python_versions.dart and the four" + echo "python_versions.properties must match python-build's" + echo "manifest.json for the pinned pythonReleaseDate. To fix: edit" + echo "python-build's manifest.json + cut a release, bump" + echo "pythonReleaseDate, then run" + echo " (cd src/serious_python && dart run serious_python:gen_version_tables)" + echo "and commit the regenerated files." + git --no-pager diff + exit 1 + fi + + bridge_example_macos: + name: Test Bridge example on macOS (Python ${{ matrix.python_version }}) + runs-on: macos-26 strategy: fail-fast: false matrix: @@ -27,7 +74,7 @@ jobs: SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }} steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Flutter uses: kuhnroyal/flutter-fvm-config-action/setup@v3 @@ -35,15 +82,33 @@ jobs: path: '.fvmrc' cache: true - - name: Run tests - working-directory: "src/serious_python/example/flet_example" + - name: Cache flet downloads + uses: actions/cache@v5 + with: + path: ~/.flet/cache + key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} + restore-keys: | + flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}- + flet-cache-${{ runner.os }}-${{ runner.arch }}- + + - name: Package + run integration test + working-directory: "src/serious_python/example/bridge_example" run: | - dart run serious_python:main package app/src --platform Darwin --python-version ${{ matrix.python_version }} --requirements flet==0.28.3 - flutter test integration_test --device-id macos --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} - - ios: - name: Test on iOS (Python ${{ matrix.python_version }}) - runs-on: macos-latest + dart run serious_python:main package app/src --platform Darwin --python-version ${{ matrix.python_version }} + # Each test file is invoked separately. `flutter test integration_test` + # over the directory reuses one VM session, but the second file's + # `runApp()` then trips "Unable to start the app on the device" — + # the spawn-then-teardown of bridge_example's embedded Python + + # PythonBridge ports isn't clean enough for VM reuse. One process + # per file sidesteps the issue. + flutter test integration_test/interactivity_test.dart -d macos --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} + flutter test integration_test/throughput_test.dart -d macos --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} + flutter test integration_test/memory_test.dart -d macos --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} + + bridge_example_ios: + name: Test Bridge example on iOS (Python ${{ matrix.python_version }}) + runs-on: macos-26 + timeout-minutes: 25 strategy: fail-fast: false matrix: @@ -52,7 +117,7 @@ jobs: SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }} steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Flutter uses: kuhnroyal/flutter-fvm-config-action/setup@v3 @@ -60,35 +125,57 @@ jobs: path: '.fvmrc' cache: true + - name: Cache flet downloads + uses: actions/cache@v5 + with: + path: ~/.flet/cache + key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} + restore-keys: | + flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}- + flet-cache-${{ runner.os }}-${{ runner.arch }}- + - name: Setup iOS Simulator id: simulator - uses: futureware-tech/simulator-action@v4 + uses: futureware-tech/simulator-action@v5 with: - # https://github.com/futureware-tech/simulator-action/wiki/Devices-macos-latest - model: 'iPhone 16 Pro Max' + model: 'iPhone 17 Pro Max' os: "iOS" - os_version: "^18.6" + os_version: "26.5" shutdown_after_job: true wait_for_boot: true - - name: Run tests - working-directory: "src/serious_python/example/flet_example" + - name: Package + run integration test + working-directory: "src/serious_python/example/bridge_example" run: | - dart run serious_python:main package app/src --platform iOS --python-version ${{ matrix.python_version }} --requirements flet==0.28.3 - flutter test integration_test --device-id ${{ steps.simulator.outputs.udid }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} - - android: - name: Test on Android (Python ${{ matrix.python_version }}) + ts() { date '+%H:%M:%S'; } + echo "[$(ts)] >>> dart run serious_python:main package" + # certifi is a placeholder requirement: serious_python_darwin's + # sync_site_packages.sh only populates dist_ios/site-xcframeworks + # (which bundle-python-frameworks-ios.sh then requires at build + # time) when iOS-specific site-packages subdirs exist. Empty + # --requirements skips that branch and the build fails. + dart run serious_python:main package app/src --platform iOS --python-version ${{ matrix.python_version }} --requirements certifi + echo "[$(ts)] >>> flutter test integration_test (per-file)" + # See macOS job for why each file runs as a separate invocation. + flutter test integration_test/interactivity_test.dart --device-id ${{ steps.simulator.outputs.udid }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} + flutter test integration_test/throughput_test.dart --device-id ${{ steps.simulator.outputs.udid }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} + flutter test integration_test/memory_test.dart --device-id ${{ steps.simulator.outputs.udid }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} + echo "[$(ts)] >>> done" + + bridge_example_android: + name: Test Bridge example on Android (Python ${{ matrix.python_version }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: + # x86_64 matches the emulator architecture; only build/install for + # that ABI to keep CI fast. python_version: ['3.12', '3.13', '3.14'] env: SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }} steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Flutter uses: kuhnroyal/flutter-fvm-config-action/setup@v3 @@ -96,6 +183,15 @@ jobs: path: '.fvmrc' cache: true + - name: Cache flet downloads + uses: actions/cache@v5 + with: + path: ~/.flet/cache + key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} + restore-keys: | + flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}- + flet-cache-${{ runner.os }}-${{ runner.arch }}- + - name: Enable KVM run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules @@ -103,16 +199,20 @@ jobs: sudo udevadm trigger --name-match=kvm - name: Gradle cache - uses: gradle/actions/setup-gradle@v3 + # Stay on v5 — v6 moved the caching component to a separate + # `gradle-actions-caching` library under proprietary commercial + # Terms of Use (https://blog.gradle.org/github-actions-for-gradle-v6). + # v5 was the last fully MIT-licensed major and is on Node 24. + uses: gradle/actions/setup-gradle@v5 - name: AVD cache - uses: actions/cache@v4 + uses: actions/cache@v5 id: avd-cache with: path: | ~/.android/avd/* ~/.android/adb* - key: avd + key: avd-bridge - name: Setup Android Emulator + Run tests uses: reactivecircus/android-emulator-runner@v2 @@ -133,12 +233,38 @@ jobs: pre-emulator-launch-script: | sdkmanager --list_installed script: | - cd src/serious_python/example/flet_example && dart run serious_python:main package app/src --platform Android --python-version ${{ matrix.python_version }} --requirements flet==0.28.3 - cd src/serious_python/example/flet_example && flutter test integration_test --device-id emulator-${{ env.EMULATOR_PORT }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} + cd src/serious_python/example/bridge_example && dart run serious_python:main package app/src --platform Android --python-version ${{ matrix.python_version }} + # Per-file: `flutter test integration_test` (whole dir) reuses one + # VM session and the second file fails to start the app. See + # bridge_example_macos for the discovery. + cd src/serious_python/example/bridge_example && flutter test integration_test/interactivity_test.dart --device-id emulator-${{ env.EMULATOR_PORT }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} + cd src/serious_python/example/bridge_example && flutter test integration_test/throughput_test.dart --device-id emulator-${{ env.EMULATOR_PORT }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} + cd src/serious_python/example/bridge_example && flutter test integration_test/memory_test.dart --device-id emulator-${{ env.EMULATOR_PORT }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} + + - name: Diagnostics on failure + if: failure() + shell: bash + run: | + set +e + REPO="$GITHUB_WORKSPACE" + ABI=x86_64 + echo "=== serious_python_android/android/src/main/jniLibs/$ABI/ ===" + ls -la "$REPO/src/serious_python_android/android/src/main/jniLibs/$ABI/" 2>/dev/null || echo "(not found)" + echo + echo "=== example/build/app/outputs/apk/debug/*.apk ===" + APK=$(find "$REPO/src/serious_python/example/bridge_example/build" -name "*-debug.apk" 2>/dev/null | head -n1) + echo "APK: $APK" + if [ -n "$APK" ]; then + echo "Native libs inside APK:" + unzip -l "$APK" | grep -E "lib/$ABI/" || echo "(no lib/$ABI/ entries)" + fi - windows: - name: Test on Windows (Python ${{ matrix.python_version }}) - runs-on: windows-latest + bridge_example_windows: + name: Test Bridge example on Windows (Python ${{ matrix.python_version }}) + # Explicit pin instead of `windows-latest` to avoid silent image moves. + # `windows-2025-vs2026` is what GitHub redirects `windows-latest` to + # starting 2026-06-15 (Server 2025 + VS 2026). + runs-on: windows-2025-vs2026 strategy: fail-fast: false matrix: @@ -147,7 +273,7 @@ jobs: SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }} steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Flutter uses: kuhnroyal/flutter-fvm-config-action/setup@v3 @@ -155,37 +281,72 @@ jobs: path: '.fvmrc' cache: true - - name: Run tests - working-directory: "src/serious_python/example/flet_example" + - name: Cache flet downloads + uses: actions/cache@v5 + with: + path: ~/.flet/cache + key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} + restore-keys: | + flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}- + flet-cache-${{ runner.os }}-${{ runner.arch }}- + + - name: Package + run integration test + working-directory: "src/serious_python/example/bridge_example" + shell: bash run: | - dart run serious_python:main package app/src --platform Windows --python-version ${{ matrix.python_version }} --requirements flet==0.28.3 - flutter test integration_test -d windows --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} - - linux: - name: Test on Linux ${{ matrix.title }} (Python ${{ matrix.python_version }}) + dart run serious_python:main package app/src --platform Windows --python-version ${{ matrix.python_version }} + # bash + pipefail so the test step actually fails when flutter fails + # (default PowerShell shell on windows runners eats the failure when + # piping into tail). + set -o pipefail + # Per-file: `flutter test integration_test` (whole dir) reuses one + # VM session and the second file fails to start the app. See + # bridge_example_macos for the discovery. + flutter test integration_test/interactivity_test.dart -d windows --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} -v 2>&1 | tail -300 + flutter test integration_test/throughput_test.dart -d windows --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} -v 2>&1 | tail -300 + flutter test integration_test/memory_test.dart -d windows --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} -v 2>&1 | tail -300 + + - name: Diagnostics on failure + if: failure() + shell: bash + working-directory: "src/serious_python/example/bridge_example" + run: | + set +e + DBG_DIR=build/windows/x64/runner/Debug + echo "=== runner/Debug dir ===" + ls -la $DBG_DIR/ || true + echo + echo "=== dart_bridge*.dll bundled? ===" + ls -la $DBG_DIR/dart_bridge*.dll || echo "(no dart_bridge dll bundled)" + echo + echo "=== runner/Debug/Lib (Python stdlib) ===" + ls $DBG_DIR/Lib | head -20 || true + echo + echo "=== runner/Debug/site-packages ===" + ls -la $DBG_DIR/site-packages/ || true + + bridge_example_linux: + name: Test Bridge example on Linux ${{ matrix.title }} (Python ${{ matrix.python_version }}) runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: python_version: ['3.12', '3.13', '3.14'] - arch: [arm64, amd64] + arch: [amd64, arm64] include: - - arch: arm64 - runner: ubuntu-24.04-arm - title: ARM64 - arch: amd64 runner: ubuntu-24.04 title: AMD64 + - arch: arm64 + runner: ubuntu-24.04-arm + title: ARM64 env: SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }} steps: - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup uv - uses: astral-sh/setup-uv@v6 + uses: actions/checkout@v6 - - name: Get Flutter version from ".fvmrc" + - name: Get Flutter version from .fvmrc uses: kuhnroyal/flutter-fvm-config-action/config@v3 id: fvm-config-action with: @@ -195,66 +356,103 @@ jobs: uses: subosito/flutter-action@v2 with: flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} - channel: ${{ matrix.arch == 'arm64' && 'master' || 'stable' }} # https://github.com/subosito/flutter-action/issues/345#issuecomment-2657332687 + channel: ${{ matrix.arch == 'arm64' && 'master' || 'stable' }} cache: true - - name: Install dependencies + - name: Cache flet downloads + uses: actions/cache@v5 + with: + path: ~/.flet/cache + key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} + restore-keys: | + flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}- + flet-cache-${{ runner.os }}-${{ runner.arch }}- + + - name: Install Linux desktop build deps run: | sudo apt-get update --allow-releaseinfo-change sudo apt-get install -y xvfb libgtk-3-dev - if [ "${{ matrix.arch }}" = "amd64" ]; then sudo apt-get install -y \ - libgstreamer1.0-dev \ - libgstreamer-plugins-base1.0-dev \ - libgstreamer-plugins-bad1.0-dev \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-libav \ - gstreamer1.0-tools \ - gstreamer1.0-x \ - gstreamer1.0-alsa \ - gstreamer1.0-gl \ - gstreamer1.0-gtk3 \ - gstreamer1.0-qt5 \ - gstreamer1.0-pulseaudio + libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly gstreamer1.0-libav else sudo apt-get install -y \ - clang \ - ninja-build \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-libav + clang ninja-build gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly gstreamer1.0-libav fi - - name: Run tests - working-directory: src/serious_python/example/flet_example + - name: Package + run integration test + working-directory: src/serious_python/example/bridge_example run: | flutter pub get - dart run serious_python:main package app/src --platform Linux --python-version ${{ matrix.python_version }} --requirements flet==0.28.3 - xvfb-run flutter test integration_test -d linux --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} - + dart run serious_python:main package app/src \ + --platform Linux \ + --python-version ${{ matrix.python_version }} + set -o pipefail + + # Three back-to-back `xvfb-run` invocations race for display + # numbers — the second/third sometimes trips "Xvfb failed to + # start" because the previous Xvfb's display isn't released yet + # (3-of-6 Linux jobs in run 27441055242 hit this). Start one + # Xvfb up front, share DISPLAY across all three test runs. + Xvfb :99 -screen 0 1280x1024x24 >/tmp/xvfb.log 2>&1 & + XVFB_PID=$! + export DISPLAY=:99 + trap 'kill $XVFB_PID 2>/dev/null || true' EXIT + # Brief settle so Xvfb is accepting connections before flutter + # test tries to open the window. xdpyinfo isn't in the ubuntu + # runner's default toolchain; a fixed sleep is sufficient. + sleep 1 + + # Per-file: `flutter test integration_test` (whole dir) reuses one + # VM session and the second file fails to start the app. See + # bridge_example_macos for the discovery. + flutter test integration_test/interactivity_test.dart -d linux --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} -v 2>&1 | tail -300 + flutter test integration_test/throughput_test.dart -d linux --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} -v 2>&1 | tail -300 + flutter test integration_test/memory_test.dart -d linux --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} -v 2>&1 | tail -300 + + - name: Diagnostics on failure + if: failure() + working-directory: src/serious_python/example/bridge_example + run: | + set +e + DBG_DIR=build/linux/${{ matrix.arch == 'arm64' && 'arm64' || 'x64' }}/debug/bundle + echo "=== bundle dir ===" + ls -la $DBG_DIR/ 2>/dev/null + echo + echo "=== bundle/lib (bundled shared libs) ===" + ls -la $DBG_DIR/lib/ 2>/dev/null + echo + echo "=== readelf -d on libdart_bridge.so ===" + readelf -d $DBG_DIR/lib/libdart_bridge.so 2>/dev/null | grep -E "NEEDED|libpython" || echo "(libdart_bridge.so not found)" + echo + echo "=== bundle data/flutter_assets/native_assets/linux/ ===" + ls -la $DBG_DIR/data/flutter_assets/native_assets/linux/ 2>/dev/null + echo + echo "=== Python stdlib dir ===" + ls -d $DBG_DIR/python3.* 2>/dev/null | head -5 publish: name: Publish to pub.dev needs: - - macos - - ios - - android - - windows - - linux + - bridge_example_macos + - bridge_example_ios + - bridge_example_android + - bridge_example_linux + - bridge_example_windows runs-on: ubuntu-22.04 if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup uv - uses: astral-sh/setup-uv@v6 + uses: astral-sh/setup-uv@v8.2.0 - name: Setup Flutter uses: kuhnroyal/flutter-fvm-config-action/setup@v3 @@ -302,13 +500,13 @@ jobs: "serious_python_darwin" \ "serious_python_windows" \ "serious_python_linux"; do - + uv run "$SCRIPTS/patch_pubspec.py" "$pkg/pubspec.yaml" "$PKG_VER" done - name: Publish packages run: | - publish_pkg () { + publish_pkg () { pushd "$1" >/dev/null dart pub publish --force popd >/dev/null @@ -321,4 +519,4 @@ jobs: publish_pkg src/serious_python_windows publish_pkg src/serious_python_linux sleep 600 - publish_pkg src/serious_python \ No newline at end of file + publish_pkg src/serious_python diff --git a/.gitignore b/.gitignore index b4ec5742..47c84825 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,13 @@ dist/ # Python .venv/ -__pypackages__/ \ No newline at end of file +__pypackages__/ +*.so +*.pyd +*.dylib +*.dll +*.egg-info/ +*.egg/ + +# FVM +.fvm/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 327284e8..5079aed6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,6 +16,35 @@ Bump `serious_python` dependency version with `flutter pub get` in example lock Update `CHANGELOG.md`. +## Python runtime versions + +The supported Python versions, their CPython / Pyodide / dart_bridge details, and +which versions get built are all defined in a single source of truth: the +**`manifest.json`** in [`flet-dev/python-build`](https://github.com/flet-dev/python-build), +published as an asset on each date-keyed (`YYYYMMDD`) release. + +serious_python pins one release date (`pythonReleaseDate`) and commits generated +snapshots of that manifest — **never hand-edit these**: + +* `src/serious_python/lib/src/python_versions.dart` — read by the CLI commands +* `python_versions.properties` in each platform package — read by the + Android / Darwin / Linux / Windows build configs + +To add or bump a Python / Pyodide / dart_bridge version: + +1. Edit `manifest.json` in python-build and cut a new release (run the **Build + Python Packages** workflow with a `YYYYMMDD` `release_date`). +2. Regenerate the snapshots from the new release: + + ``` + cd src/serious_python + dart run serious_python:gen_version_tables --release-date + ``` + + (Omit `--release-date` to re-fetch the currently pinned release.) +3. Commit the regenerated `python_versions.dart` and `python_versions.properties` + files. CI's **Version tables in sync with manifest** job fails if they drift. + ## Getting token for automatic publishing to pub.dev Token locations on different OSes: https://stackoverflow.com/a/70487480/1435891 diff --git a/docs/dedicated-data-channels.md b/docs/dedicated-data-channels.md new file mode 100644 index 00000000..aab40476 --- /dev/null +++ b/docs/dedicated-data-channels.md @@ -0,0 +1,376 @@ +# Dedicated data channels for Flet widgets + +> **Status:** implemented in Flet 0.86.0. +> Implementation lives in +> [`packages/flet/lib/src/transport/data_channel.dart`](https://github.com/flet-dev/flet/blob/main/packages/flet/lib/src/transport/data_channel.dart) +> (Dart abstract API), +> [`packages/flet/lib/src/transport/protocol_muxed_data_channel.dart`](https://github.com/flet-dev/flet/blob/main/packages/flet/lib/src/transport/protocol_muxed_data_channel.dart) +> (cross-mode muxed fallback), and +> [`sdk/python/packages/flet/src/flet/data_channel.py`](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet/src/flet/data_channel.py) +> (Python). First production consumer is +> [`flet-charts.MatplotlibChartCanvas`](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-charts/src/flet_charts/matplotlib_chart_canvas.py). +> Empirical baseline: this repo's +> [`bridge_example`](../src/serious_python/example/bridge_example/README.md). + +## Problem + +Flet's main control protocol carries widget state and events over a single +MsgPack-framed channel. Every byte — including bulk payloads like image +frames or audio buffers — pays the protocol cost: + +- Python: `msgpack.packb(big_bytes_field)` allocates a fresh buffer and + serializes into it. +- Dart: the streaming MsgPack decoder allocates another `Uint8List`, + decodes the ext, copies again. + +End-to-end throughput tops out around ~1 GB/s with several allocations +per frame. Fine for widget state diffs (tens of bytes per event). Not +fine for: + +- A chart / image widget receiving large bitmaps from Python (1080p RGBA + at 60 fps = 480 MB/s). +- A camera widget pushing frames from Dart into Python for ML inference. +- A microphone widget streaming PCM to a Python signal-processing + pipeline. + +`DataChannel` gives such widgets a dedicated byte channel alongside the +protocol — control flows still ride the protocol, bulk bytes bypass +MsgPack entirely. + +## What's available today + +`libdart_bridge` already supports an arbitrary number of independent +port↔handler pairs per process. The `flet build` template uses two +`PythonBridge` instances internally (one for the Flet protocol, one for +exit-code transmission). [`bridge_example`](../src/serious_python/example/bridge_example/) +opens two channels (JSON control + raw bytes echo) and round-trips +~16 MB payloads at **7 GiB/s** on M2 Pro — see +[bridge_example/README.md → Performance & memory baseline](../src/serious_python/example/bridge_example/README.md#performance--memory-baseline). + +A widget gets the same headroom: open a dedicated channel via `flet`'s +`DataChannel` API, ship raw bytes, never touch MsgPack on the hot path. + +## Architecture + +``` + package:flet (no Python deps, no transport deps) + ┌──────────────────────────────────────────────────────────────────┐ + │ abstract DataChannel { id, messages, send, close } │ + │ abstract DataChannelFactory { open() } │ + │ FletApp(dataChannelFactory: …) │ + │ FletBackend.openDataChannel() │ + │ │ + │ DEFAULT (built-in) ProtocolMuxedDataChannelFactory: │ + │ – muxes bytes over the existing FletBackendChannel │ + │ – works on every transport (UDS, TCP, WebSocket, postMessage) │ + │ – activated when no faster factory was injected │ + └──────────────────────────────────────────────────────────────────┘ + ▲ ▲ + │ injected by │ used by every non-embedded mode: + │ flet build template │ - dev (UDS/TCP socket) + │ │ - web with Pyodide (postMessage + Transferable) + │ │ - web with Python server (WebSocket) + ┌──────────────────────────────┐ ┌──────────────────────────────────────────────────────┐ + │ _PythonBridgeDataChannel │ │ DEFAULT (built-in) ProtocolMuxedDataChannel impl │ + │ wraps PythonBridge directly │ │ rides the active FletBackendChannel using the wire │ + │ (4–7 GiB/s) │ │ format below. Zero-copy on postMessage via │ + └──────────────────────────────┘ │ Transferable ArrayBuffer on that transport. │ + └──────────────────────────────────────────────────────┘ + ▲ uses + ┌─────────────────────────────────────────────────────────────────┐ + │ Extension widget (3rd-party) — imports only `package:flet` │ + │ Dart: final ch = FletBackend.of(context).openDataChannel(); │ + │ ch.send(bytes); ch.messages.listen(...) │ + │ Python: on_data_channel_open handler ↓ │ + │ self._channel = self.get_data_channel(e.channel_id) │ + └─────────────────────────────────────────────────────────────────┘ +``` + +Key shape decisions that fell out of implementation: + +1. **`flet` stays Python-independent.** Widget code on either side imports + only `package:flet` / `flet`. The `serious_python` dependency lives in + the `flet build` template's `native_runtime.dart`, behind a conditional + import. Web builds don't pull it in at all. +2. **Allocator: Dart side, always.** `FletBackend.of(context).openDataChannel()` + mints the id (a Dart native port in embedded mode, a monotonic u32 in + muxed mode). Python never allocates a channel — it only attaches to + ones Dart has already opened. +3. **Handshake: control event, not a property.** When the Dart widget + opens a channel it fires `data_channel_open` (a normal Flet control + event) carrying `{channel_name, channel_id}`. Python receives this via + the standard event handler and calls `self.get_data_channel(channel_id)` + to attach. No polling, no exception, no race window. A widget that + opens N channels fires N events with distinct `channel_name` values + for handler-side dispatch. +4. **Cross-mode.** Same widget code runs in four modes; only the + transport changes (see *Cross-mode operation* below). + +## Public API + +### Python side + +```python +import flet as ft +from typing import Optional + +@ft.control("MyImageChart") +class MyImageChart(ft.LayoutControl): + on_data_channel_open: Optional[ + ft.EventHandler[ft.DataChannelOpenEvent] + ] = None + + def init(self) -> None: + self._frames: Optional[ft.DataChannel] = None + if self.on_data_channel_open is None: + self.on_data_channel_open = self._capture_channel + + def _capture_channel(self, e: ft.DataChannelOpenEvent) -> None: + # Single-channel widget — no need to dispatch on e.channel_name. + # Multi-channel widgets `match e.channel_name:` here. + self._frames = self.get_data_channel(e.channel_id) + # Optional inbound handler: + self._frames.on_bytes(self._on_frame_from_dart) + + def push_frame(self, rgba_bytes: bytes) -> None: + if self._frames is not None: + self._frames.send(rgba_bytes) + + def _on_frame_from_dart(self, payload: bytes) -> None: + # called from the transport's delivery thread — push to a queue, + # don't block here + ... +``` + +### Dart side + +```dart +import 'package:flet/flet.dart'; +// No imports of `serious_python` or `dart_bridge`. + +class MyImageChartState extends State { + late final DataChannel _frames; + StreamSubscription? _sub; + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_frames != null) return; // initialize lazily, once + _frames = FletBackend.of(context).openDataChannel(); + _sub = _frames.messages.listen(_onFrameFromPython); + // Announce the channel to Python. + widget.control.triggerEvent("data_channel_open", { + "channel_name": "frames", + "channel_id": _frames.id, + }); + } + + void _onFrameFromPython(Uint8List bytes) { + // Hand to a Texture, dart:ui.Image.fromPixels, etc. + } + + @override + void dispose() { + _sub?.cancel(); + _frames.close(); + super.dispose(); + } +} +``` + +The `data_channel_open` event name is a **Flet convention, not framework- +intercepted** — the framework provides `Control.get_data_channel(id)` and +`FletBackend.openDataChannel()`; the widget wires the event on both ends. + +## Cross-mode operation + +Flet runs Python in different processes depending on deployment. Each +mode picks its own data-channel transport; the widget API is identical: + +| Mode | Flet protocol transport | DataChannel transport | Performance | +|------|------------------------|----------------------|-------------| +| **Embedded native** (`flet build` apk/macos/ios/...) | dart_bridge FFI | Dedicated `PythonBridge` per channel | 4–7 GiB/s (memory-copy bound) | +| **Web with Pyodide** | `postMessage` | Muxed over postMessage, Transferable ArrayBuffer | ~memory-bandwidth, zero-copy | +| **`flet run` dev mode** | UDS / TCP socket | Muxed over the protocol socket | ~hundreds of MB/s | +| **Web with Python server** | WebSocket | Muxed over WebSocket | ~hundreds of MB/s | + +Embedded native gets dedicated bridges because the FFI runtime supports +them natively at zero overhead. The other three modes share the built-in +`ProtocolMuxedDataChannelFactory` — channel frames ride the same byte +transport as the Flet protocol, with a 1-byte type discriminator to +disambiguate. + +## Wire format (muxed fallback) + +``` +type 0x00 → legacy Flet protocol frame (msgpack array [ClientAction, body]) +type 0x01 → raw DataChannel frame: [channel_id:u32 LE][raw payload bytes] +``` + +- **Message-oriented transports** (WebSocket, postMessage, dart_bridge): + each `send` is one packet of shape `[type:u8][payload]`. 5 bytes of + overhead per data-channel frame. +- **Stream-oriented transports** (UDS, TCP): each packet is prefixed + with `[length:u32 LE]` so the receiver can re-frame. 9 bytes of + overhead per data-channel frame. + +Under 1% overhead at any payload size that motivates a dedicated channel +(≥ 1 KB). + +**Channel-id allocation.** Embedded mode uses the Dart native port (64-bit, +allocated by `RawReceivePort`). Muxed mode uses a session-scoped +monotonic 32-bit counter — 0 reserved as "unallocated," ids never recycled +within a session. At 1 alloc/μs the u32 space lasts ~1 hour; real apps +open single-digit channels. The public `DataChannel.id : int` API is +64-bit; the u32 truncation is an internal contract of the muxed wire +format only. + +**Compatibility.** This wire format is **not backwards-compatible** with +pre-0.86 Flet servers/clients. Mixed-version `flet run` setups fail at +the first packet decode. See the Flet 0.86 breaking-change guide: +[Flet protocol framing upgraded for DataChannel support](https://flet.dev/docs/updates/breaking-changes/data-channel-protocol-upgrade). + +## Backpressure pattern (WebAgg-style) + +`DataChannel.send` is **synchronous fire-and-forget** on the Python side. +For producers that can outpace the consumer (camera streams, animation +loops, interactive matplotlib drags), the widget must implement explicit +backpressure — otherwise frames pile up in the Dart-side queue and replay +in a burst. + +The canonical pattern is a 1-byte ack from Dart after each frame paints, +mirroring matplotlib WebAgg's `img.onload` → `waiting=false` flow: + +**Dart side**, after the apply chain resolves: +```dart +_enqueue(() => applyFull(payload)).whenComplete(() { + _channel?.send(Uint8List.fromList([0xFF])); // ack +}); +``` + +**Python side** registers a callback for inbound bytes that observes the +ack and clears the producer-side `_waiting` flag. Matplotlib's existing +draw-request gate (`if not self._waiting: send(draw_request)`) then +naturally rate-limits to one frame in flight. + +Reference: [`flet-charts/matplotlib_chart_canvas`](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-charts/src/flet_charts/matplotlib_chart_canvas.py) ++ [`matplotlib_chart_canvas.dart`](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-charts/src/flutter/flet_charts/lib/src/matplotlib_chart_canvas.dart). +The Python side exposes `canvas.set_on_frame_applied(callback)` for +producer widgets like `MatplotlibChart` to chain onto. + +## Concurrency model + +### Python side — GIL-bound + +`channel.on_bytes(handler)` fires the handler synchronously under the GIL +on whatever OS thread the transport delivered from (dart_bridge thread in +embedded mode, asyncio loop in muxed mode). Heavy work in the handler +starves Python; the right pattern is enqueue-then-process with a bounded +queue + worker pool: + +```python +def did_mount(self): + self._queue = queue.Queue(maxsize=4) # bounded → drop policy + self._pool = ThreadPoolExecutor(max_workers=4) + self._frames.on_bytes(self._enqueue) + threading.Thread(target=self._pump, daemon=True).start() + +def _enqueue(self, payload): + try: self._queue.put_nowait(payload) + except queue.Full: pass # drop overflow + +def _pump(self): + while True: + payload = self._queue.get() + self._pool.submit(self._decode_and_reply, payload) +``` + +Real parallelism comes from C extensions that **release the GIL during +their work** — NumPy, PyTorch, Pillow, cryptography. Pure-Python CPU work +serialises on the GIL; for that, use `multiprocessing` or +PEP 684 subinterpreters. + +### Dart side — Isolate scope + +**`FletBackend.of(context).openDataChannel()` is main-Isolate only.** +`BuildContext` is part of Flutter's widget tree, which lives on the main +Isolate. The `PythonBridge` it constructs has its `RawReceivePort` on the +main Isolate. + +For worker-Isolate parallelism (e.g. a video decoder offloading texture +upload from the UI thread), the worker has to construct its **own** +`PythonBridge` directly — bypassing the framework helper, importing +`package:serious_python/bridge.dart` in the worker's entry-point file — +and ship its port back to main via `SendPort` for the +`data_channel_open` event fire. + +| Operation | Safe? | +|-----------|-------| +| `FletBackend.of(context).openDataChannel()` from a worker Isolate | ✗ BuildContext is main-Isolate only | +| Multiple `PythonBridge` instances across Isolates (worker constructs its own) | ✓ libdart_bridge multiplexes | +| One `PythonBridge` instance used from multiple Isolates | ✗ `RawReceivePort` is single-Isolate | +| Python `dart_bridge.send_bytes(port, ...)` from worker threads | ✓ serialised internally | +| Python handler running concurrently for one port | ✗ GIL — one in-flight handler per port | + +Non-embedded modes are single-Isolate by design — the muxed channel +registry lives in `FletBackend` on the main Isolate. Workers there ship +payloads via `TransferableTypedData` from/to main rather than opening +channels themselves. + +## Empirical baseline + +Measured 2026-06-12 on M2 Pro / macOS 26.5 / Flutter Debug build via +[`bridge_example`](../src/serious_python/example/bridge_example/README.md). +These are the `PythonBridge` numbers — they apply directly to embedded +native mode. Muxed-fallback throughput on dev/web transports is +transport-bound (sockets ~hundreds of MB/s; postMessage Transferable +~memory-bandwidth at large payloads). + +| Payload | Mean round-trip | Throughput | +|--------:|----------------:|-----------:| +| 1 KB | 0.08 ms | 23 MB/s | +| 64 KB | 0.09 ms | 1.3 GB/s | +| 1 MB | 0.45 ms | **4.5 GB/s** | +| 16 MB | 4.45 ms | **7.2 GB/s** | + +Memory: 1000 × 1 MB hammer loop (2 GB through the bridge) grows Python's +`tracemalloc` heap by **0 bytes**. Peak in-flight is one frame's worth. + +For a real-widget reference, the matplotlib pilot at a 3D figure with +heavy surface + contour layers measures ~15 fps at ~200 KB PNG/frame; +the bottleneck is matplotlib's mplot3d render (~53 ms/frame), not the +DataChannel (which runs at ~3 MB/s here against a ~4500 MB/s budget). + +## Known limitations / not in this release + +- **No built-in backpressure knob.** Per-channel queue depth or + "latest frame only" mode is the widget author's responsibility (see + *Backpressure pattern* above). A framework-level + `channel.queue_depth` knob is a future addition. +- **No discovery / introspection.** No "how many channels are open" or + "queue depth per channel" debug surface yet. +- **No Pyodide-dedicated MessageChannels.** v1 muxes through one + `postMessage` transport with Transferable for zero-copy outbound. If + head-of-line blocking on Pyodide becomes a visible issue, a v2 PR can + inject a per-channel `MessageChannel` factory through the same + `DataChannelFactory` injection point — no widget API changes. +- **No Python-initiated channel opens.** Dart is the always-allocator. + Reversing direction (Python wants a channel before any Dart widget has + asked) is a v2 question. +- **True zero-copy shared memory** (mmap + offset handoff) — the bridge + still does one `memcpy` per direction. Eliminating it requires + lifetime/ownership coordination between Dart's GC and CPython's + refcounting that's out of scope here. The 4–7 GiB/s ceiling is plenty + for the foreseeable use cases. + +## References + +- [`bridge_example`](../src/serious_python/example/bridge_example/) — + empirical baseline + reproducible test suite. Throughput and memory + numbers above come from its `throughput_test.dart` and `memory_test.dart`. +- [Flet 0.86 breaking-change guide](https://flet.dev/docs/updates/breaking-changes/data-channel-protocol-upgrade) + — wire format change details for anyone speaking the Flet protocol + outside the bundled CLI/runtime. +- [`matplotlib_chart_canvas.py`](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-charts/src/flet_charts/matplotlib_chart_canvas.py) + + [`matplotlib_chart_canvas.dart`](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-charts/src/flutter/flet_charts/lib/src/matplotlib_chart_canvas.dart) + — first production widget using DataChannel end-to-end, with backpressure ack. diff --git a/src/serious_python/CHANGELOG.md b/src/serious_python/CHANGELOG.md index 68ee1513..72ce22b0 100644 --- a/src/serious_python/CHANGELOG.md +++ b/src/serious_python/CHANGELOG.md @@ -1,3 +1,18 @@ +## 3.0.0 + +* **New in-process transport (dart_bridge FFI).** `SeriousPython.run` can now run the embedded interpreter **in-process** through the `dart_bridge` FFI bridge instead of talking to it over a socket. The Python lifecycle (initialize / run / teardown) is absorbed into the `dart_bridge` native library on every platform — `dart_bridge.xcframework` (iOS/macOS), `libdart_bridge.so` (Android/Linux), and `dart_bridge.dll` / `dart_bridge.pyd` (Windows) — and a new `PythonBridge` API exposes a MsgPack control channel plus dedicated binary data channels between Dart and Python. See the `bridge_example` app. The bundled `dart_bridge` is **1.4.0**. +* **Android native packaging — memory-mapped from the APK.** Python extension modules are relocated into `jniLibs` and loaded **directly from the APK** (mmap, no extraction) by a custom importer that resolves them from `.soref` markers; pure Python ships in stored, ABI-common asset zips read via `zipimport` (no per-ABI duplication). Apps no longer need `useLegacyPackaging` / `keepDebugSymbols` — the brittle per-app packaging config is gone. Set **`SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES`** (comma-separated relative paths) to ship path-hungry packages extracted to disk. The dart-bridge Android binary uses the full CPython API (`PyConfig`) to install the importer before `site` runs. +* **Breaking change:** requires Flutter **3.44.2** / Dart 3.12+. The Android plugin moves to AGP **8.11.1**, `compileSdk` **36**, Java **17**, and the Kotlin-DSL Gradle build (`build.gradle.kts`). +* Python runtime versions are now a committed snapshot of `flet-dev/python-build`'s date-keyed `manifest.json`, generated by `dart run serious_python:gen_version_tables`. **`SERIOUS_PYTHON_VERSION`** (short, e.g. `3.14`) is the single input — the full CPython version, python-build release date, Pyodide version + platform tag, and `dart_bridge` version all derive from it. `SERIOUS_PYTHON_FULL_VERSION`, `SERIOUS_PYTHON_BUILD_DATE`, and `DART_BRIDGE_VERSION` remain as rarely-needed escape hatches. The native build configs (Android `build.gradle`, Darwin podspec, Linux/Windows `CMakeLists.txt`) read the generated `python_versions.properties`, and a CI job fails if the snapshots drift from the manifest. This replaces the per-config hardcoded defaults and the `flet build`-exported `SERIOUS_PYTHON_FULL_VERSION` / `SERIOUS_PYTHON_BUILD_DATE` introduced in 2.0.0. +* Bundle **3.12.13 / 3.13.14 / 3.14.6** (python-build `20260614`); Pyodide **0.27.7 / 0.29.4 / 314.0.0** (314.0.0 GA, up from the 314.0.0a2 in 2.0.0). +* Add **`dart run serious_python:main version [--json]`** — prints the serious_python version, the pinned python-build release, and the supported Python / Pyodide / dart_bridge matrix. +* The embedded Darwin runtime re-extracts when the selected Python version changes (a version marker guards `dist_ios` / `dist_macos`), so a clean build after switching `--python-version` can't mix C-extension ABIs (`bad magic number` / `unknown slot ID`). +* Cache downloaded Python distributions and `dart_bridge` artifacts under `$FLET_CACHE_DIR` (default `~/.flet/cache`) across all platforms. +* Remove the scaffold `getPlatformVersion` method from the platform plugins. +* Drop the `x86` (32-bit Intel) Android ABI — Flutter no longer produces it. Android builds target `arm64-v8a` + `x86_64` (plus `armeabi-v7a` on Python 3.12); the `x86` wheel platform-tag entry and the Android packaging rules referencing it are removed. +* **Breaking change:** the `configure` command (and the bare in-place version-switching machinery, including `stageDarwinRuntime`) is removed. Switching the bundled Python version between builds is now handled by a clean rebuild — `flet build` wipes its build dir on a version change, and the Darwin `dist_ios` / `dist_macos` version marker re-extracts the runtime — so a separate `serious_python configure` step is no longer needed. +* **Bug fix:** the Pyodide 0.29 wheel platform tag for the 3.13 row was `pyodide-2025.0-wasm32`, but Pyodide publishes 0.29 wheels under `pyemscripten_2025_0_wasm32`; corrected to `pyemscripten-2025.0-wasm32` so `flet build web --python-version 3.13` matches native wheels. + ## 2.0.0 * **Breaking change:** the `package` command's default Python is now the latest supported stable (3.14), up from the previously implicit 3.12. Scripts that ran `dart run serious_python:main package …` without `--python-version` will now download CPython 3.14, install 3.14 wheels, and use the matching Pyodide / Android platform tags. Pin explicitly with `--python-version 3.12` (or `SERIOUS_PYTHON_VERSION=3.12`) to preserve the old behavior. diff --git a/src/serious_python/README.md b/src/serious_python/README.md index 6c921c59..c1834aab 100644 --- a/src/serious_python/README.md +++ b/src/serious_python/README.md @@ -22,11 +22,11 @@ the `--python-version X.Y` flag of `serious_python:main package` (or the plugin build scripts). Defaults to the latest supported version when nothing is specified. -| Short | CPython runtime | Pyodide (web) | Pyodide wheel platform tag | -| ----- | --------------- | ------------- | -------------------------- | -| 3.12 | 3.12.13 | 0.27.7 | `pyodide-2024.0-wasm32` | -| 3.13 | 3.13.13 | 0.29.4 | `pyodide-2025.0-wasm32` | -| 3.14 | 3.14.5 | 314.0.0a2 | `pyemscripten-2026.0-wasm32`| +| Short | CPython runtime | Pyodide (web) | Pyodide wheel platform tag | +| ----- | --------------- | ------------- | -------------------------------- | +| 3.12 | 3.12.13 | 0.27.7 | `pyodide-2024.0-wasm32` | +| 3.13 | 3.13.14 | 0.29.4 | `pyemscripten-2025.0-wasm32` | +| 3.14 | 3.14.6 | 314.0.0 | `pyemscripten-2026.0-wasm32` | The default is the latest stable row (currently **3.14**) when neither `--python-version` nor `SERIOUS_PYTHON_VERSION` is set. When running through @@ -34,12 +34,21 @@ The default is the latest stable row (currently **3.14**) when neither applied to `[project].requires-python` in your `pyproject.toml`, so most users never need to touch this flag directly. -Source of truth: the `_pythonReleases` map in -[`bin/package_command.dart`](bin/package_command.dart) (Dart side) and -`flet_cli/utils/python_versions.py` (Python side). Adding a new short version -means appending a row to both. Pre-release CPython lines (e.g. 3.15) can be -listed with `prerelease: true` so they're opt-in via explicit -`--python-version 3.15` (or `requires-python = "==3.15.*"`) without becoming +`SERIOUS_PYTHON_VERSION` (short, e.g. `3.14`) is the only input you set — the +full version, python-build release date, Pyodide version/tag, and dart_bridge +version all derive from it. (`SERIOUS_PYTHON_FULL_VERSION`, +`SERIOUS_PYTHON_BUILD_DATE`, `DART_BRIDGE_VERSION` exist as rarely-needed escape +hatches.) A single `export SERIOUS_PYTHON_VERSION=3.13` covers both the +packaging phase and the later Flutter build. + +Source of truth: the date-keyed `manifest.json` published by +[`flet-dev/python-build`](https://github.com/flet-dev/python-build). +serious_python pins one release and commits generated snapshots of it — +`lib/src/python_versions.dart` (used by the CLI) and a `python_versions.properties` +in each platform package (read by the native build configs). To bump versions +see [CONTRIBUTING.md](CONTRIBUTING.md); never hand-edit the generated files. +Pre-release CPython lines are marked `prerelease: true`, so they're opt-in via +explicit `--python-version` (or `requires-python = "==3.15.*"`) without becoming the auto-resolved default. ## Usage @@ -142,6 +151,11 @@ read by each platform plugin's build script (`build.gradle`, the phase and the Flutter build phase. See the [Python versions](#python-versions) table above for the matching CPython and Pyodide releases. +> **Note:** changing the bundled Python version for an app you've already built +> requires a clean build (delete the app's `build/` directory, or run +> `flutter clean`) so stale compiled bytecode from the previous version isn't +> reused. + #### Installing requirements Python app dependencies are installed with the `--requirements` option (alias `-r`). The value is passed verbatim to `pip`, so any flag pip accepts works. Pass each dependency as its own option to support specifiers that contain commas: @@ -193,6 +207,47 @@ Additional Python binary packages for iOS and Android can be built with adding a Request additional packages for iOS and Android on [Flet Discussions - Packages](https://github.com/flet-dev/flet/discussions/categories/packages). +## How packaging works + +`dart run serious_python:main package` assembles two things, which the platform plugin then bundles into your Flutter app: + +1. **The CPython runtime + standard library** — a per-target build downloaded from [flet-dev/python-build](https://github.com/flet-dev/python-build) (and, for native extensions, [mobile-forge](https://github.com/flet-dev/mobile-forge)) and bundled by the plugin at build time. +2. **Your app + its dependencies** — your Python sources are zipped into an **asset** (`app/app.zip` by default), and `pip`-installed packages are placed where each platform expects them. + +At runtime the plugin sets `PYTHONHOME` / `PYTHONPATH` (or, on Android, installs a custom importer) so the interpreter finds the stdlib, your dependencies, and your app. + +The on-disk layout differs per platform, mostly because each OS has different rules for shipping **native (compiled) extension modules** — the `.so`/`.pyd`/`.dylib` files inside packages like `numpy`: + +| Platform | Standard library | Site-packages (deps) | Native extension modules | Architectures | +| --- | --- | --- | --- | --- | +| **Android** | `stdlib.zip` asset, read via `zipimport` | `sitepackages.zip` asset, read via `zipimport` | relocated to `jniLibs//`, **memory-mapped from the APK** (no extraction), resolved by a custom importer | natives per-ABI in `jniLibs`; pure zips are ABI-common (shipped once) | +| **iOS** | dir inside the framework resource bundle | dir inside the framework resource bundle | each `.so` wrapped in a signed `.framework` inside an `.xcframework`, loaded via CPython's `AppleFrameworkLoader` (`.fwork` markers) | device `arm64` + simulator `arm64`/`x86_64` xcframework slices | +| **macOS** | dir inside the framework resource bundle | dir (universal) | universal (`lipo`'d `arm64`+`x86_64`) `.so`, loaded directly | `arm64`+`x86_64` merged into fat binaries | +| **Linux** | `/python/` | `/site-packages/` | on-disk `.so` (in `lib-dynload` / package dirs) | one of `x86_64` / `aarch64` per build | +| **Windows** | `/Lib/` | `/site-packages/` | on-disk `.pyd`/`.dll` in `/DLLs/` | `x86_64` | +| **Web** | bundled inside Pyodide | `__pypackages__/` inside `app.zip` | Pyodide WebAssembly wheels | `wasm32` | + +### Your app program (all platforms) + +`package` copies your Python sources into a temp dir (honoring `--exclude` globs, optionally compiling to `.pyc` with `--compile-app`), zips it to `app/app.zip` (override with `-a`/`--asset`), and writes an `app.zip.hash` next to it. At runtime the asset is extracted once to the app's support directory (`/flet/app`), guarded by a hash + an optional `invalidateKey` (typically your app version) so it only re-extracts when the bundle changes — debug builds always re-extract. Your app dir is placed first on `sys.path`; a sibling `__pypackages__/` is also added (so you can vendor pure-Python deps next to your code). + +`pip install` output goes to `build/site-packages` by default (override with the `SERIOUS_PYTHON_SITE_PACKAGES` env var). For mobile, packages are installed **per architecture** (a `sitecustomize.py` shim spoofs the wheel platform tag so the correct mobile wheels resolve), then merged or split per platform as shown above. + +### Android specifics + +- **Pure Python** (stdlib + dependencies) ships in two **stored** (uncompressed) ABI-common zips — `stdlib.zip` and `sitepackages.zip` — copied once to the app's files dir and imported in place via `zipimport`. Final `sys.path` (highest first): your app dir, the extract dir, `sitepackages.zip`, `stdlib.zip`. +- **Native modules** (stdlib `lib-dynload` and site-package extensions) are relocated to `jniLibs//lib.so` and loaded **directly from the APK** (memory-mapped, never extracted to disk); a `sys.meta_path` finder resolves them from `.soref` markers left in the zips. This is why Android needs **no** `useLegacyPackaging` / `keepDebugSymbols` config and the stdlib is **not** duplicated per ABI. +- **Path-hungry packages** (those that read bundled data via `__file__` / `pkg_resources` rather than `importlib.resources`) can be shipped extracted to disk instead of inside the zip — list them (comma-separated relative paths) in `SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES`; they go into `extract.zip` and are unpacked to disk at first launch. +- Works for both **single APK** (`flutter build apk`) and **Play Store App Bundles** (per-ABI config splits); under legacy packaging / `minSdk < 23` the same finder falls back to loading from the extracted `nativeLibraryDir`. + +### iOS / macOS specifics + +The CPython runtime, stdlib, and (on iOS) native extensions are bundled into `serious_python_darwin.framework` as resources. On **iOS**, the App Store forbids loose `.dylib`s, so every native extension `.so` is repackaged into a signed `.framework` inside an `.xcframework`, with a `.fwork` text marker left at the module's import path; CPython's `AppleFrameworkLoader` reads the marker and loads the framework binary. On **macOS**, native extensions stay as plain `.so`, merged into universal (`arm64`+`x86_64`) binaries at package time. `PYTHONHOME` is the framework's resource path; `sys.path` includes `/site-packages`, `/stdlib`, and `/stdlib/lib-dynload`. + +### Linux / Windows specifics + +The CPython runtime (`libpython3.so` + `libpython.so` on Linux; `python3.dll` + `python.dll` on Windows), `libdart_bridge`, the stdlib, and native modules are copied next to your app's executable at build time. `PYTHONHOME` is the executable's directory. On Windows, extension modules (`.pyd`) and their dependent DLLs live in `/DLLs/`, which is added to `sys.path`. + ## Platform notes ### Build matrix @@ -224,17 +279,15 @@ MACOSX_DEPLOYMENT_TARGET = 10.15; ### Android -To make `serious_python` work in your own Android app: - -If you build an App Bundle Edit `android/gradle.properties` and add the flag: +No special native-library packaging config is required (see [How packaging works](#how-packaging-works)). serious_python loads native modules directly from the APK and ships pure Python in stored asset zips, so you don't need `useLegacyPackaging`, `keepDebugSymbols`, `extractNativeLibs`, or `android.bundle.enableUncompressedNativeLibs`. Just use a `minSdk` of 23+ so native libs stay uncompressed/page-aligned in the APK: +```kotlin +android { + defaultConfig { + minSdk = 23 + } +} ``` -android.bundle.enableUncompressedNativeLibs=false -``` - -If you build an APK Make sure `android/app/src/AndroidManifest.xml` has `android:extractNativeLibs="true"` in the `` tag. - -For more information, see the [public issue](https://issuetracker.google.com/issues/147096055). ## Troubleshooting diff --git a/src/serious_python/bin/gen_version_tables.dart b/src/serious_python/bin/gen_version_tables.dart new file mode 100644 index 00000000..d4dc43af --- /dev/null +++ b/src/serious_python/bin/gen_version_tables.dart @@ -0,0 +1,170 @@ +// Generates the committed Python-version snapshots from python-build's +// date-keyed manifest.json (the single source of truth): +// +// * lib/src/python_versions.dart — Dart consts for the CLI commands +// * /python_versions.properties — KEY=VALUE tables the +// Android/Darwin/Linux/Windows build configs read at build time +// +// Usage (run from the serious_python package dir): +// dart run serious_python:gen_version_tables # re-fetch the pinned release +// dart run serious_python:gen_version_tables --release-date 20260615 +// dart run serious_python:gen_version_tables --manifest path/to/manifest.json +// +// CI runs the no-arg form and `git diff --exit-code`s the result to guard drift. +import 'dart:convert'; +import 'dart:io'; + +import 'package:http/http.dart' as http; +import 'package:path/path.dart' as p; + +const _releaseUrlBase = + 'https://github.com/flet-dev/python-build/releases/download'; +const _generatedDartFile = 'lib/src/python_versions.dart'; + +// Native packages (siblings under src/) that read python_versions.properties. +const _nativePackageDirs = [ + '../serious_python_android/android', + '../serious_python_darwin/darwin', + '../serious_python_linux/linux', + '../serious_python_windows/windows', +]; + +Future main(List args) async { + String? releaseDate; + String? manifestPath; + for (var i = 0; i < args.length; i++) { + switch (args[i]) { + case '--release-date': + releaseDate = args[++i]; + break; + case '--manifest': + manifestPath = args[++i]; + break; + default: + stderr.writeln('Unknown argument: ${args[i]}'); + exit(2); + } + } + + final Map manifest; + if (manifestPath != null) { + manifest = jsonDecode(await File(manifestPath).readAsString()) + as Map; + } else { + releaseDate ??= _readPinnedReleaseDate(); + if (releaseDate == null) { + stderr.writeln('Pass --release-date YYYYMMDD (or --manifest PATH) — no ' + 'pinned release found in $_generatedDartFile.'); + exit(2); + } + final url = '$_releaseUrlBase/$releaseDate/manifest.json'; + final resp = await http.get(Uri.parse(url)); + if (resp.statusCode != 200) { + stderr.writeln('Failed to fetch $url (HTTP ${resp.statusCode}).'); + exit(1); + } + manifest = jsonDecode(resp.body) as Map; + } + + final release = (manifest['release'] ?? releaseDate) as String?; + if (release == null) { + stderr.writeln('Manifest has no "release" field; pass --release-date.'); + exit(2); + } + final defaultPython = manifest['default_python_version'] as String; + final dartBridge = manifest['dart_bridge_version'] as String; + final pythons = (manifest['pythons'] as Map).cast(); + final shorts = pythons.keys.toList()..sort(); + + await File(_generatedDartFile) + .writeAsString(_dartFile(release, defaultPython, dartBridge, pythons, shorts)); + + final props = _propertiesFile(release, defaultPython, dartBridge, pythons, shorts); + for (final dir in _nativePackageDirs) { + await File(p.join(dir, 'python_versions.properties')).writeAsString(props); + } + + stdout.writeln( + 'Generated version tables for release $release (${shorts.join(", ")}).'); +} + +String? _readPinnedReleaseDate() { + final f = File(_generatedDartFile); + if (!f.existsSync()) return null; + final m = RegExp(r'''pythonReleaseDate\s*=\s*["'](\d+)["']''') + .firstMatch(f.readAsStringSync()); + return m?.group(1); +} + +String _genHeader(String release) => ''' +// GENERATED by `dart run serious_python:gen_version_tables` from python-build's +// manifest.json (release $release). Do not edit by hand — edit python-build's +// manifest.json, cut a release, bump `pythonReleaseDate`, and regenerate. +'''; + +String _dartFile(String release, String defaultPython, String dartBridge, + Map pythons, List shorts) { + final b = StringBuffer(_genHeader(release)) + ..writeln() + ..writeln('const pythonVersionEnvironmentVariable = "SERIOUS_PYTHON_VERSION";') + ..writeln( + 'const pythonFullVersionEnvironmentVariable = "SERIOUS_PYTHON_FULL_VERSION";') + ..writeln( + 'const pythonDistReleaseEnvironmentVariable = "SERIOUS_PYTHON_DIST_RELEASE";') + ..writeln( + 'const pythonBuildDateEnvironmentVariable = "SERIOUS_PYTHON_BUILD_DATE";') + ..writeln( + 'const pyodideVersionEnvironmentVariable = "SERIOUS_PYTHON_PYODIDE_VERSION";') + ..writeln('const dartBridgeVersionEnvironmentVariable = "DART_BRIDGE_VERSION";') + ..writeln() + ..writeln('/// python-build release the bundled runtimes come from (YYYYMMDD).') + ..writeln('const pythonReleaseDate = "$release";') + ..writeln('const dartBridgeVersion = "$dartBridge";') + ..writeln('const defaultPythonVersion = "$defaultPython";') + ..writeln() + ..writeln('class PythonRelease {') + ..writeln(' const PythonRelease({') + ..writeln(' required this.standaloneVersion,') + ..writeln(' required this.standaloneReleaseDate,') + ..writeln(' required this.pyodideVersion,') + ..writeln(' required this.pyodidePlatformTag,') + ..writeln(' required this.prerelease,') + ..writeln(' });') + ..writeln() + ..writeln(' final String standaloneVersion;') + ..writeln(' final String standaloneReleaseDate;') + ..writeln(' final String pyodideVersion;') + ..writeln(' final String pyodidePlatformTag;') + ..writeln(' final bool prerelease;') + ..writeln('}') + ..writeln() + ..writeln('const pythonReleases = {'); + for (final s in shorts) { + final r = pythons[s] as Map; + b + ..writeln(' "$s": PythonRelease(') + ..writeln(' standaloneVersion: "${r['full_version']}",') + ..writeln(' standaloneReleaseDate: "${r['standalone_release_date']}",') + ..writeln(' pyodideVersion: "${r['pyodide_version']}",') + ..writeln(' pyodidePlatformTag: "${r['pyodide_platform_tag']}",') + ..writeln(' prerelease: ${r['prerelease'] == true},') + ..writeln(' ),'); + } + b.writeln('};'); + return b.toString(); +} + +String _propertiesFile(String release, String defaultPython, String dartBridge, + Map pythons, List shorts) { + final b = StringBuffer() + ..writeln('# GENERATED by `dart run serious_python:gen_version_tables` from') + ..writeln('# python-build manifest.json (release $release). Do not edit by hand.') + ..writeln('default_python_version=$defaultPython') + ..writeln('dart_bridge_version=$dartBridge') + ..writeln('python_build_release_date=$release'); + for (final s in shorts) { + final r = pythons[s] as Map; + b.writeln('$s.full_version=${r['full_version']}'); + } + return b.toString(); +} diff --git a/src/serious_python/bin/main.dart b/src/serious_python/bin/main.dart index 6beb72eb..7e03cff1 100644 --- a/src/serious_python/bin/main.dart +++ b/src/serious_python/bin/main.dart @@ -1,11 +1,13 @@ import 'package:args/command_runner.dart'; import 'package_command.dart'; +import 'version_command.dart'; void main(List arguments) async { var runner = CommandRunner("dart run serious_python:main", "A tool for packaging Python apps to work with serious_python package.") - ..addCommand(PackageCommand()); + ..addCommand(PackageCommand()) + ..addCommand(VersionCommand()); await runner.run(arguments); } diff --git a/src/serious_python/bin/package_command.dart b/src/serious_python/bin/package_command.dart index b21541b8..720a1f09 100644 --- a/src/serious_python/bin/package_command.dart +++ b/src/serious_python/bin/package_command.dart @@ -9,6 +9,7 @@ import 'package:glob/list_local_fs.dart'; import 'package:http/http.dart' as http; import 'package:path/path.dart' as path; import 'package:shelf/shelf.dart'; +import 'package:serious_python/src/python_versions.dart'; import 'package:shelf/shelf_io.dart' as shelf_io; import 'macos_utils.dart' as macos_utils; @@ -24,69 +25,11 @@ const flutterPackagesFlutterEnvironmentVariable = const allowSourceDistrosEnvironmentVariable = "SERIOUS_PYTHON_ALLOW_SOURCE_DISTRIBUTIONS"; -const pythonVersionEnvironmentVariable = "SERIOUS_PYTHON_VERSION"; -const pythonDistReleaseEnvironmentVariable = "SERIOUS_PYTHON_DIST_RELEASE"; -const pyodideVersionEnvironmentVariable = "SERIOUS_PYTHON_PYODIDE_VERSION"; - -const defaultPythonVersion = "3.14"; - -class _PythonRelease { - const _PythonRelease({ - required this.standaloneVersion, - required this.standaloneReleaseDate, - required this.pyodideVersion, - required this.pyodidePlatformTag, - required this.prerelease, - }); - - final String standaloneVersion; - final String standaloneReleaseDate; - final String pyodideVersion; - final String pyodidePlatformTag; - - // When true, this release is supported by `--python-version` but is not - // picked automatically by the default or by `[project].requires-python` - // resolution on the Flet CLI side. Use for beta CPython lines. - final bool prerelease; -} - -// Source of truth for the Python <-> CPython standalone <-> Pyodide mapping. -// Mirror any change here in flet-cli's python_versions.py. -const _pythonReleases = { - "3.12": _PythonRelease( - standaloneVersion: "3.12.13", - standaloneReleaseDate: "20260602", - pyodideVersion: "0.27.7", - pyodidePlatformTag: "pyodide-2024.0-wasm32", - prerelease: false, - ), - "3.13": _PythonRelease( - standaloneVersion: "3.13.13", - standaloneReleaseDate: "20260602", - pyodideVersion: "0.29.4", - pyodidePlatformTag: "pyodide-2025.0-wasm32", - prerelease: false, - ), - "3.14": _PythonRelease( - standaloneVersion: "3.14.5", - standaloneReleaseDate: "20260602", - pyodideVersion: "314.0.0a2", - pyodidePlatformTag: "pyemscripten-2026.0-wasm32", - prerelease: false, - ), - // Add future pre-release CPython lines by setting `prerelease: true`. They - // become opt-in via `--python-version 3.15` (or an explicit - // `requires-python = "==3.15.*"` on the Flet CLI side) without becoming - // the default or matching open-ended `requires-python` specifiers. - // - // "3.15": _PythonRelease( - // standaloneVersion: "3.15.0", - // standaloneReleaseDate: "...", - // pyodideVersion: "...", - // pyodidePlatformTag: "...", - // prerelease: true, - // ), -}; +// Python runtime version data — `defaultPythonVersion`, `pythonReleases`, the +// `*EnvironmentVariable` names, `dartBridgeVersion`, `pythonReleaseDate` — lives +// in the generated `lib/src/python_versions.dart` (imported above). It is a +// snapshot of python-build's manifest.json; regenerate with +// `dart run serious_python:gen_version_tables`. const platforms = { "iOS": { @@ -108,11 +51,10 @@ const platforms = { "arm64-v8a": {"tag": "android-24-arm64_v8a", "mac_ver": ""}, "armeabi-v7a": {"tag": "android-24-armeabi_v7a", "mac_ver": ""}, "x86_64": {"tag": "android-24-x86_64", "mac_ver": ""}, - "x86": {"tag": "android-24-x86", "mac_ver": ""} }, "Emscripten": { // The actual wheel platform tag is resolved per Python release from - // `_pythonReleases[...].pyodidePlatformTag` (see sitecustomize wiring + // `pythonReleases[...].pyodidePlatformTag` (see sitecustomize wiring // below) since it changes with each Pyodide ABI bump. "": {"tag": "", "mac_ver": ""} }, @@ -155,11 +97,25 @@ class PackageCommand extends Command { Directory? _buildDir; Directory? _pythonDir; late String _pythonShortVersion; - late _PythonRelease _release; + late PythonRelease _release; String get _pyodideRootUrl => "https://cdn.jsdelivr.net/pyodide/v${_release.pyodideVersion}/full"; + /// Root of the cross-plugin download cache. Honors `FLET_CACHE_DIR` (the + /// same env var `flet build` and the Android gradle task already use) and + /// otherwise falls back to `~/.flet/cache` (`%USERPROFILE%\.flet\cache` + /// on Windows). The CMake/shell plugins resolve this independently to the + /// same path — keep the layout in sync. + String _fletCacheRoot() { + final env = Platform.environment['FLET_CACHE_DIR']; + if (env != null && env.isNotEmpty) return env; + final home = Platform.environment['HOME'] ?? + Platform.environment['USERPROFILE'] ?? + _buildDir!.path; + return path.join(home, '.flet', 'cache'); + } + @override final name = "package"; @@ -173,7 +129,7 @@ class PackageCommand extends Command { mandatory: true, help: "Install dependencies for specific platform, e.g. 'Android'."); argParser.addOption('python-version', - allowed: _pythonReleases.keys.toList(), + allowed: pythonReleases.keys.toList(), help: "Short Python version to bundle (e.g. 3.13). Defaults to " "\$$pythonVersionEnvironmentVariable env var or " "'$defaultPythonVersion'."); @@ -253,14 +209,16 @@ class PackageCommand extends Command { _pythonShortVersion = argResults?['python-version'] ?? Platform.environment[pythonVersionEnvironmentVariable] ?? defaultPythonVersion; - final baseRelease = _pythonReleases[_pythonShortVersion]; + final baseRelease = pythonReleases[_pythonShortVersion]; if (baseRelease == null) { stderr.writeln( - "Unknown Python version: $_pythonShortVersion. Supported: ${_pythonReleases.keys.join(", ")}"); + "Unknown Python version: $_pythonShortVersion. Supported: ${pythonReleases.keys.join(", ")}"); exit(2); } - _release = _PythonRelease( - standaloneVersion: baseRelease.standaloneVersion, + _release = PythonRelease( + standaloneVersion: + Platform.environment[pythonFullVersionEnvironmentVariable] ?? + baseRelease.standaloneVersion, standaloneReleaseDate: Platform.environment[pythonDistReleaseEnvironmentVariable] ?? baseRelease.standaloneReleaseDate, @@ -396,7 +354,7 @@ class PackageCommand extends Command { // versions, so installing 32-bit wheels would be wasted work. if (platform == "Android" && _pythonShortVersion != "3.12" && - (arch.key == "armeabi-v7a" || arch.key == "x86")) { + arch.key == "armeabi-v7a") { continue; } String? sitePackagesDir; @@ -696,8 +654,13 @@ class PackageCommand extends Command { var pythonArchiveFilename = "cpython-${_release.standaloneVersion}+${_release.standaloneReleaseDate}-$arch-install_only_stripped.tar.gz"; + // Cache CPython by release date: the same tarball is reused across + // every example/project until `_release.standaloneReleaseDate` bumps. + var pythonCacheDir = Directory(path.join(_fletCacheRoot(), + 'python-build-standalone', _release.standaloneReleaseDate)); + await pythonCacheDir.create(recursive: true); var pythonArchivePath = - path.join(_buildDir!.path, pythonArchiveFilename); + path.join(pythonCacheDir.path, pythonArchiveFilename); if (!await File(pythonArchivePath).exists()) { // download Python distr from GitHub @@ -709,11 +672,15 @@ class PackageCommand extends Command { "Downloading Python distributive from $url to $pythonArchivePath"); } else { stdout.writeln( - "Downloading Python distributive from $url to a build directory"); + "Downloading Python distributive from $url to $pythonArchivePath"); } + // Write to a .tmp sibling first so a Ctrl-C / network blip doesn't + // poison the cache with a truncated archive on the next run. + var tmpPath = "$pythonArchivePath.tmp"; var response = await http.get(Uri.parse(url)); - await File(pythonArchivePath).writeAsBytes(response.bodyBytes); + await File(tmpPath).writeAsBytes(response.bodyBytes); + await File(tmpPath).rename(pythonArchivePath); } // extract Python from archive @@ -727,6 +694,8 @@ class PackageCommand extends Command { await Process.run( 'tar', ['-xzf', pythonArchivePath, '-C', _pythonDir!.path]); + stdout.writeln("Python distributive extracted to ${_pythonDir!.path}"); + if (Platform.isMacOS) { duplicateSysconfigFile(_pythonDir!.path); } @@ -737,8 +706,9 @@ class PackageCommand extends Command { ? path.join(_pythonDir!.path, 'python', 'python.exe') : path.join(_pythonDir!.path, 'python', 'bin', 'python3'); - // Run the python executable - verbose([pythonExePath, ...args].join(" ")); + // Always log the Python command so a silent pip install (typical during + // `pip install git+…` while git is cloning) doesn't look like a hang. + stdout.writeln("Running: ${[pythonExePath, ...args].join(" ")}"); return await runExec(pythonExePath, args, environment: environment); } diff --git a/src/serious_python/bin/version_command.dart b/src/serious_python/bin/version_command.dart new file mode 100644 index 00000000..1770737b --- /dev/null +++ b/src/serious_python/bin/version_command.dart @@ -0,0 +1,89 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:args/command_runner.dart'; +import 'package:package_config/package_config.dart'; +import 'package:serious_python/src/python_versions.dart'; + +/// `version` subcommand: prints the serious_python package version, the +/// default Python version, and the supported-Python matrix sourced from +/// [pythonReleases] in the generated `lib/src/python_versions.dart`. With +/// `--json`, emits a machine-readable document for CI / tooling consumption. +class VersionCommand extends Command { + @override + final name = "version"; + + @override + final description = + "Print serious_python version and the supported Python matrix."; + + VersionCommand() { + argParser.addFlag( + "json", + help: "Emit machine-readable JSON instead of the human-readable summary.", + negatable: false, + ); + } + + @override + Future run() async { + final version = await _readSeriousPythonVersion() ?? "unknown"; + final jsonMode = argResults?["json"] ?? false; + + if (jsonMode) { + final doc = { + "serious_python_version": version, + "python_build_release_date": pythonReleaseDate, + "default_python_version": defaultPythonVersion, + "dart_bridge_version": dartBridgeVersion, + "python_releases": { + for (final entry in pythonReleases.entries) + entry.key: { + "standalone_version": entry.value.standaloneVersion, + "standalone_release_date": entry.value.standaloneReleaseDate, + "pyodide_version": entry.value.pyodideVersion, + "pyodide_platform_tag": entry.value.pyodidePlatformTag, + "prerelease": entry.value.prerelease, + }, + }, + }; + stdout.writeln(const JsonEncoder.withIndent(" ").convert(doc)); + return; + } + + stdout.writeln("serious_python $version"); + stdout.writeln("Default Python: $defaultPythonVersion"); + stdout.writeln("Supported Python versions:"); + // Sort descending so the default + newest stable is on top, matching the + // ordering convention used by `flet --version`. + final keys = pythonReleases.keys.toList() + ..sort((a, b) => b.compareTo(a)); + for (final k in keys) { + final r = pythonReleases[k]!; + final markers = []; + if (k == defaultPythonVersion) markers.add("default"); + if (r.prerelease) markers.add("pre-release"); + final markerSuffix = markers.isEmpty ? "" : " (${markers.join(", ")})"; + stdout.writeln( + " $k$markerSuffix: CPython ${r.standaloneVersion} / Pyodide ${r.pyodideVersion}"); + } + } + + /// Read this package's `version:` from its `pubspec.yaml`, found via the + /// caller's `package_config.json`. Returns `null` if the package_config + /// can't be located (e.g. invoked from a compiled snapshot outside any + /// pub workspace). + Future _readSeriousPythonVersion() async { + final config = await findPackageConfig(Directory.current); + final pkg = config?["serious_python"]; + if (pkg == null) return null; + final pubspec = File.fromUri(pkg.root.resolve("pubspec.yaml")); + if (!pubspec.existsSync()) return null; + final versionPattern = RegExp(r'^version:\s*(\S+)\s*$'); + for (final line in pubspec.readAsLinesSync()) { + final match = versionPattern.firstMatch(line); + if (match != null) return match.group(1); + } + return null; + } +} diff --git a/src/serious_python/example/bridge_example/.gitignore b/src/serious_python/example/bridge_example/.gitignore new file mode 100644 index 00000000..480a7ff6 --- /dev/null +++ b/src/serious_python/example/bridge_example/.gitignore @@ -0,0 +1,50 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + +# serious_python packaging artifacts (built by `dart run serious_python:main package`) +/app/app.zip +/app/app.zip.hash +pubspec.lock diff --git a/src/serious_python/example/bridge_example/.metadata b/src/serious_python/example/bridge_example/.metadata new file mode 100644 index 00000000..d3f20b97 --- /dev/null +++ b/src/serious_python/example/bridge_example/.metadata @@ -0,0 +1,42 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "c9a6c484230f8b5e408ec57be1ef71dee1e77020" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: android + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: ios + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: linux + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: macos + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: windows + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/src/serious_python/example/bridge_example/README.md b/src/serious_python/example/bridge_example/README.md new file mode 100644 index 00000000..3d045880 --- /dev/null +++ b/src/serious_python/example/bridge_example/README.md @@ -0,0 +1,113 @@ +# bridge_example + +Direct exercise of [`PythonBridge`](../../lib/bridge.dart) — the in-process byte transport between Dart and the embedded CPython runtime. No Flet, no MsgPack, no protocol layer beyond what this example draws itself. Used as the CI gate for the `serious_python` repo and as the perf / leak baseline for every change to `libdart_bridge`. + +## What it does + +Two independent `PythonBridge` channels open at startup; Python registers a handler per channel: + +| Channel | Env var carrying the Dart-side native port to Python | Wire format | Purpose | +|---------|------------------------------------------------------|----------------------------------------------|------------------------------------------| +| Control | `BRIDGE_EXAMPLE_CONTROL_PORT` | UTF-8 JSON, `{"op": …}` ↔ `{"event": …}` | Interactivity (counter, version), memory snapshots | +| Echo | `BRIDGE_EXAMPLE_ECHO_PORT` | Raw bytes — Python echoes the frame verbatim | Throughput timing, memory hammer loop | + +Separating channels means the throughput / memory hot path is just `bridge.send` → `dart_bridge.send_bytes` echo back, with zero framing tax on either side. The JSON dispatcher only runs for tiny control messages where the encoding cost is irrelevant. + +## Build the Python app bundle + +```sh +# From this directory: +dart run serious_python:main package app/src --platform Darwin \ + --python-version 3.14 +``` + +Substitute `Darwin` with `Linux`, `Windows`, `iOS`, or `Android`. Each platform plugin's CMake / Gradle pipeline downloads the prebuilt `dart_bridge` native binary from [flet-dev/dart-bridge](https://github.com/flet-dev/dart-bridge) at build time — no `--bridge` flag, no PyPI wheel. + +## Run + +```sh +flutter run -d macos # or -d linux / windows / +``` + +Tap `+` / `−` to send `{"op": "inc"}` / `{"op": "dec"}` on the control channel; the displayed counter updates from the Python-side `{"event": "count", "value": …}` response. The version banner is populated by an analogous `{"op": "version"}` round-trip on `initState`. + +## Integration tests + +Three tests under [`integration_test/`](integration_test/): + +| Test | What it covers | +|----------------------------|------------------------------------------------------------------------------------------------------| +| `interactivity_test.dart` | Counter +/-, version banner. Asserts UI text via Flutter widget keys; matches `EXPECTED_PYTHON_VERSION` if supplied via `--dart-define`. | +| `throughput_test.dart` | Size sweep 1 KB → 16 MB, 100 round-trips each. Logs min/p50/p95/mean + MB/s. Floor assertion at ≥ 1 MB. | +| `memory_test.dart` | 1 000 × 1 MB echo round-trips (~2 GB total). Snapshots Python `tracemalloc` + RSS before/after. Asserts `traced_delta < 5 MB`. | + +```sh +# After `dart run serious_python:main package …`: +flutter test integration_test/throughput_test.dart -d macos +flutter test integration_test/memory_test.dart -d macos +flutter test integration_test/interactivity_test.dart -d macos \ + --dart-define=EXPECTED_PYTHON_VERSION=3.14 +``` + +--- + +# Performance & memory baseline + +> Measured 2026-06-12 on the bridge_example integration tests. Re-running these is the canonical way to refresh the numbers after any `libdart_bridge` / `serious-python` bump. + +## Test environment + +| | | +|----------------|----------------------------------------------------------| +| Hardware | MacBook Pro M2 Pro, 32 GB | +| OS | macOS 26.5 | +| Python | CPython 3.14.6 (embedded via `libdart_bridge`) | +| Flutter | 3.44.2, Debug build | +| Test harness | `bridge_example/integration_test/` (`flutter test integration_test`) | + +## Throughput + +Methodology — round-trip = `Dart.send(N bytes) → Python echo handler → Dart receives N bytes back`. Throughput counted as `(2 × N) / mean_seconds` since both directions cross the bridge. Payload is `Random()`-seeded so each iteration is unique. 100 iterations per size. + +| Payload | min | p50 | p95 | mean | Throughput | +|--------:|--------:|--------:|--------:|--------:|---------------:| +| 1 KB | 0.08 ms | 0.08 ms | 0.11 ms | 0.08 ms | 23 MB/s | +| 64 KB | 0.07 ms | 0.09 ms | 0.12 ms | 0.09 ms | 1.3 GB/s | +| 256 KB | 0.11 ms | 0.16 ms | 0.33 ms | 0.21 ms | 2.4 GB/s | +| 1 MB | 0.24 ms | 0.31 ms | 0.84 ms | 0.45 ms | **4.5 GB/s** | +| 4 MB | 0.82 ms | 1.01 ms | 3.83 ms | 1.55 ms | 5.2 GB/s | +| 16 MB | 2.45 ms | 3.32 ms | 9.12 ms | 4.45 ms | **7.2 GB/s** | + +### What the curve says + +- **Below ~64 KB the transport is call-overhead-bound.** Every round-trip pays a fixed ~80 µs floor (Dart isolate scheduling + Python GIL acquisition + two `bridge.send_bytes` calls). At 1 KB this overhead swamps the byte work — 23 MB/s is the *call rate*, not the *memory rate*. +- **At 64 KB → 16 MB it scales linearly with payload size.** Throughput goes from 1.3 GB/s to 7.2 GB/s as the per-byte cost (memory copy + Dart Native API marshalling) dominates the fixed per-call cost. +- **7.2 GB/s at 16 MB is within an order of magnitude of M2 Pro's main-memory bandwidth ceiling** (~200 GB/s theoretical, ~50 GB/s achievable for non-tuned `memcpy`). Practically: the bridge is memory-copy-bound, which is the best you can do without a true zero-copy shared-buffer scheme. + +For comparison: a Unix-domain socket transport on the same hardware tops out near 1 GB/s for similar-sized payloads, because every byte traverses the kernel. + +## Memory + +Methodology — 1 000 × 1 MB echo round-trips (~2 GB of bytes crossing the bridge total). Python heap measured via `tracemalloc.get_traced_memory()` (load-bearing leak signal — unit-stable, byte-accurate). RSS measured via `resource.getrusage(RUSAGE_SELF).ru_maxrss` on the Python side and `ProcessInfo.currentRss` on the Dart side (informational only — page residency, not retention). + +| Metric | Before | After | Delta | +|-------------------------------------|----------:|----------:|--------------------------------------------:| +| Python heap (`tracemalloc`) | 10 179 B | 10 179 B | **0 B** | +| Python RSS (`ru_maxrss`) | 350 MB | 457 MB | +112 MB | +| Dart RSS (`ProcessInfo.currentRss`) | 1 232 MB | 1 239 MB | +7 MB | +| Python `tracemalloc` peak | 11 446 B | 1.0 MB | +~1 MB (per-iteration buffer; reclaimed) | + +### What the deltas say + +- **`traced_delta = 0 B` after 2 GB of throughput.** This is the only number that matters for "does the bridge leak?" — Python's heap accounting is exact down to the byte. Zero growth means **the bridge does not retain a single byte** of the data it transports. +- **`traced_peak` rose to ~1 MB** — exactly the size of one in-flight payload, then reclaimed. The bridge holds at most one frame's worth of bytes per direction. +- **RSS growth (Python +112 MB, Dart +7 MB) is OS-level page residency**, not retention. macOS keeps recently-faulted-in pages mapped for performance; the kernel will release them under pressure. This is normal behaviour for any process that has briefly touched a lot of memory, and is decoupled from actual ownership of bytes. + +## Bottom line + +| Concern | Result | +|---------------------------------------------|-----------------------------------------------------------------| +| Speed at typical Flet message size (~KB) | ~80 µs per round-trip (~12 000 messages/sec round-trip rate) | +| Speed at "moving files / images" sizes (MB) | **4.5 GB/s at 1 MB, 7.2 GB/s at 16 MB** — memory-bandwidth class | +| Leaks? | **None. 2 GB moved, Python heap unchanged.** | +| Bytes retained per round-trip | Zero (peak ≤ 1 MB during one frame, then reclaimed) | diff --git a/src/serious_python/example/bridge_example/analysis_options.yaml b/src/serious_python/example/bridge_example/analysis_options.yaml new file mode 100644 index 00000000..0d290213 --- /dev/null +++ b/src/serious_python/example/bridge_example/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/src/serious_python/example/bridge_example/android/.gitignore b/src/serious_python/example/bridge_example/android/.gitignore new file mode 100644 index 00000000..be3943c9 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/src/serious_python/example/bridge_example/android/app/build.gradle.kts b/src/serious_python/example/bridge_example/android/app/build.gradle.kts new file mode 100644 index 00000000..169d8b4b --- /dev/null +++ b/src/serious_python/example/bridge_example/android/app/build.gradle.kts @@ -0,0 +1,47 @@ +plugins { + id("com.android.application") + // Kotlin is provided by the Flutter Gradle Plugin (Built-in Kotlin), so the + // app no longer applies the Kotlin Gradle Plugin itself. + // The Flutter Gradle Plugin must be applied after the Android Gradle plugin. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.flet.serious_python_bridge_example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.flet.serious_python_bridge_example" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + +flutter { + source = "../.." +} diff --git a/src/serious_python/example/bridge_example/android/app/src/debug/AndroidManifest.xml b/src/serious_python/example/bridge_example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..399f6981 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/src/serious_python/example/bridge_example/android/app/src/main/AndroidManifest.xml b/src/serious_python/example/bridge_example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..6789e302 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/serious_python/example/bridge_example/android/app/src/main/kotlin/com/flet/serious_python_bridge_example/MainActivity.kt b/src/serious_python/example/bridge_example/android/app/src/main/kotlin/com/flet/serious_python_bridge_example/MainActivity.kt new file mode 100644 index 00000000..19d8bb67 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/app/src/main/kotlin/com/flet/serious_python_bridge_example/MainActivity.kt @@ -0,0 +1,5 @@ +package com.flet.serious_python_bridge_example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/src/serious_python/example/bridge_example/android/app/src/main/res/drawable-v21/launch_background.xml b/src/serious_python/example/bridge_example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..f74085f3 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/src/serious_python/example/bridge_example/android/app/src/main/res/drawable/launch_background.xml b/src/serious_python/example/bridge_example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/src/serious_python/example/bridge_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/serious_python/example/bridge_example/android/app/src/main/res/values-night/styles.xml b/src/serious_python/example/bridge_example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..06952be7 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/src/serious_python/example/bridge_example/android/app/src/main/res/values/styles.xml b/src/serious_python/example/bridge_example/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..cb1ef880 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/src/serious_python/example/bridge_example/android/app/src/profile/AndroidManifest.xml b/src/serious_python/example/bridge_example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..399f6981 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/src/serious_python/example/bridge_example/android/build.gradle.kts b/src/serious_python/example/bridge_example/android/build.gradle.kts new file mode 100644 index 00000000..dbee657b --- /dev/null +++ b/src/serious_python/example/bridge_example/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/src/serious_python/example/bridge_example/android/gradle.properties b/src/serious_python/example/bridge_example/android/gradle.properties new file mode 100644 index 00000000..d5da7278 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/gradle.properties @@ -0,0 +1,6 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +# This builtInKotlin flag was added automatically by Flutter migrator +android.builtInKotlin=false +# This newDsl flag was added automatically by Flutter migrator +android.newDsl=false diff --git a/src/serious_python/example/bridge_example/android/gradle/wrapper/gradle-wrapper.properties b/src/serious_python/example/bridge_example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..e4ef43fb --- /dev/null +++ b/src/serious_python/example/bridge_example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/src/serious_python/example/bridge_example/android/settings.gradle.kts b/src/serious_python/example/bridge_example/android/settings.gradle.kts new file mode 100644 index 00000000..ca1f8f00 --- /dev/null +++ b/src/serious_python/example/bridge_example/android/settings.gradle.kts @@ -0,0 +1,28 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + // Declared (but not applied) so Built-in Kotlin — where the Flutter Gradle + // Plugin applies kotlin-android for us — uses this KGP version. + id("org.jetbrains.kotlin.android") version "2.2.20" apply false +} + +include(":app") diff --git a/src/serious_python/example/bridge_example/app/src/main.py b/src/serious_python/example/bridge_example/app/src/main.py new file mode 100644 index 00000000..1b10d4fb --- /dev/null +++ b/src/serious_python/example/bridge_example/app/src/main.py @@ -0,0 +1,136 @@ +"""Two-channel PythonBridge harness for bridge_example. + +Channels (matching dart_bridge v1.2+ keyed-handler API; each +PythonBridge instance has its own native port): + + - **control** (BRIDGE_EXAMPLE_CONTROL_PORT): UTF-8 JSON frames. Dart + sends `{"op": ...}`; Python responds with `{"event": ...}`. Used + by the interactivity test (counter + version) and the memory test + (rss + tracemalloc snapshots). + - **echo** (BRIDGE_EXAMPLE_ECHO_PORT): pure raw bytes. Python echoes + whatever it receives, verbatim. Used by the throughput test and + by the memory test's hammer loop — keeping the per-frame cost on + Python's side as close to zero as possible so any cost we measure + is the transport's. + +Python keeps the interpreter alive indefinitely so messages can keep +arriving; Dart drives the process lifetime. +""" + +from __future__ import annotations + +import json +import os +import sys +import threading +import tracemalloc + +import dart_bridge + +CONTROL_PORT_ENV = "BRIDGE_EXAMPLE_CONTROL_PORT" +ECHO_PORT_ENV = "BRIDGE_EXAMPLE_ECHO_PORT" + +try: + control_port = int(os.environ[CONTROL_PORT_ENV]) + echo_port = int(os.environ[ECHO_PORT_ENV]) +except (KeyError, ValueError) as e: + print(f"[bridge_example] missing/invalid env var: {e}", + file=sys.stderr, flush=True) + raise SystemExit(1) + +counter = 0 + + +def _rss_bytes() -> int: + """Resident set size, in bytes. + + POSIX: ``resource.getrusage(RUSAGE_SELF).ru_maxrss``. macOS reports + bytes; Linux/Android report kilobytes. We leave that unit quirk to + the Dart caller — the leak assertion relies on ``tracemalloc``'s + unit-stable bytes count, not on this number. + + Windows: ``resource`` isn't available — fall back to ctypes → + GetProcessMemoryInfo.WorkingSetSize. + """ + try: + import resource + return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss + except (ImportError, AttributeError): + import ctypes + from ctypes import wintypes + + class _PMC(ctypes.Structure): + _fields_ = [ + ("cb", wintypes.DWORD), + ("PageFaultCount", wintypes.DWORD), + ("PeakWorkingSetSize", ctypes.c_size_t), + ("WorkingSetSize", ctypes.c_size_t), + ("QuotaPeakPagedPoolUsage", ctypes.c_size_t), + ("QuotaPagedPoolUsage", ctypes.c_size_t), + ("QuotaPeakNonPagedPoolUsage", ctypes.c_size_t), + ("QuotaNonPagedPoolUsage", ctypes.c_size_t), + ("PagefileUsage", ctypes.c_size_t), + ("PeakPagefileUsage", ctypes.c_size_t), + ] + + psapi = ctypes.WinDLL("psapi") + proc = ctypes.windll.kernel32.GetCurrentProcess() + pmc = _PMC() + pmc.cb = ctypes.sizeof(_PMC) + psapi.GetProcessMemoryInfo(proc, ctypes.byref(pmc), pmc.cb) + return pmc.WorkingSetSize + + +def _emit(event: dict) -> None: + dart_bridge.send_bytes(control_port, json.dumps(event).encode("utf-8")) + + +def on_control(payload: bytes) -> None: + global counter + if not payload: + return + try: + msg = json.loads(payload.decode("utf-8")) + except (UnicodeDecodeError, json.JSONDecodeError): + # Forward-compatible: unknown / unparseable frames are dropped + # silently rather than crashing the interpreter. + return + op = msg.get("op") + if op == "inc": + counter += 1 + _emit({"event": "count", "value": counter}) + elif op == "dec": + counter -= 1 + _emit({"event": "count", "value": counter}) + elif op == "version": + v = sys.version_info + _emit({"event": "version", "value": f"{v.major}.{v.minor}.{v.micro}"}) + elif op == "mem": + # tracemalloc adds ~10–20% overhead so we don't enable it until the + # memory test asks for it — keeps the throughput test pristine. + if not tracemalloc.is_tracing(): + tracemalloc.start() + cur, peak = tracemalloc.get_traced_memory() + _emit({ + "event": "mem", + "rss": _rss_bytes(), + "traced_current": cur, + "traced_peak": peak, + }) + + +def on_echo(payload: bytes) -> None: + # Verbatim, zero framing. The Dart-side Stopwatch around send → + # bridge.messages.first wraps exactly the bridge transport. + dart_bridge.send_bytes(echo_port, payload) + + +dart_bridge.set_enqueue_handler_func(control_port, on_control) +dart_bridge.set_enqueue_handler_func(echo_port, on_echo) +print( + f"[bridge_example] control_port={control_port} echo_port={echo_port}", + flush=True, +) + +# Keep the embedded interpreter alive; Dart drives the process lifetime. +threading.Event().wait() diff --git a/src/serious_python/example/bridge_example/app/src/requirements.txt b/src/serious_python/example/bridge_example/app/src/requirements.txt new file mode 100644 index 00000000..c63040cf --- /dev/null +++ b/src/serious_python/example/bridge_example/app/src/requirements.txt @@ -0,0 +1,3 @@ +# No external dependencies — dart_bridge is bundled with every serious_python +# app as a built-in Python module (registered via PyImport_AppendInittab from +# the dart_bridge native library before Py_Initialize). diff --git a/src/serious_python/example/bridge_example/integration_test/_helpers.dart b/src/serious_python/example/bridge_example/integration_test/_helpers.dart new file mode 100644 index 00000000..a0dc7f5e --- /dev/null +++ b/src/serious_python/example/bridge_example/integration_test/_helpers.dart @@ -0,0 +1,121 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:bridge_example/main.dart' as app; +import 'package:flutter_test/flutter_test.dart'; +import 'package:serious_python/bridge.dart'; + +/// Boot the host app and wait for both PythonBridge channels to be ready +/// (i.e. for Python to have registered its handlers via +/// `dart_bridge.set_enqueue_handler_func`). Once this returns, [sendControl] +/// and `echoRoundTrip` will succeed without retry overhead. +Future bootAndAwaitReady(WidgetTester tester) async { + app.main(); + // Give Flutter + Python a beat. Python starts on a worker thread and + // registers handlers before its `threading.Event().wait()` parks. + await tester.pumpAndSettle(const Duration(seconds: 2)); + + final handle = app.BridgeExampleHandle.instance; + + // Wait for the version event main() requested during initState. It only + // arrives after Python's handler is registered, so it's a natural + // readiness signal for the control channel. + final deadline = DateTime.now().add(const Duration(seconds: 30)); + while (handle.pythonVersion.value == null) { + if (DateTime.now().isAfter(deadline)) { + throw TimeoutException( + 'Python control handler never responded with version event'); + } + await tester.pump(const Duration(milliseconds: 100)); + } + + // Probe the echo channel separately — handlers register independently and + // there's no inherent ordering guarantee. + await _probeEchoReady(handle.echoBridge); + return handle; +} + +Future _probeEchoReady(PythonBridge echo) async { + final probe = Uint8List.fromList([0x00, 0x42]); + final reply = echo.messages + .firstWhere((b) => b.length == probe.length) + .timeout(const Duration(seconds: 30)); + const interval = Duration(milliseconds: 100); + const deadline = Duration(seconds: 30); + final start = DateTime.now(); + while (true) { + if (echo.send(probe)) break; + if (DateTime.now().difference(start) > deadline) { + throw TimeoutException( + 'Python echo handler never registered after $deadline'); + } + await Future.delayed(interval); + } + await reply; +} + +/// Send a JSON control op (Dart→Python). +void sendControl(app.BridgeExampleHandle handle, Map op) { + handle.sendControl(op); +} + +/// Wait for the next control frame with `event == name`, JSON-decoded. +Future> waitControlEvent( + app.BridgeExampleHandle handle, + String name, { + Duration timeout = const Duration(seconds: 5), +}) { + return handle.controlBridge.messages + .map((b) => jsonDecode(utf8.decode(b)) as Map) + .firstWhere((msg) => msg['event'] == name) + .timeout(timeout); +} + +/// One-shot echo round-trip: send `payload`, await the next frame whose +/// length matches, return it. No opcode parsing — the echo channel speaks +/// raw bytes only. +Future echoRoundTrip( + app.BridgeExampleHandle handle, + Uint8List payload, { + Duration timeout = const Duration(seconds: 30), +}) { + final reply = handle.echoBridge.messages + .firstWhere((b) => b.length == payload.length) + .timeout(timeout); + if (!handle.echoBridge.send(payload)) { + return Future.error(StateError( + 'echo bridge handler not registered — call bootAndAwaitReady first')); + } + return reply; +} + +/// Memory snapshot from the Python side (rss in bytes; tracemalloc current +/// and peak in bytes). Convenience wrapper over `sendControl({'op': 'mem'})` +/// + `waitControlEvent('mem')`. +class MemSnapshot { + MemSnapshot({ + required this.rss, + required this.tracedCurrent, + required this.tracedPeak, + }); + final int rss; + final int tracedCurrent; + final int tracedPeak; + + @override + String toString() => + 'MemSnapshot(rss=$rss, traced_current=$tracedCurrent, traced_peak=$tracedPeak)'; +} + +Future memSnapshot(app.BridgeExampleHandle handle) async { + final fut = waitControlEvent(handle, 'mem', + timeout: const Duration(seconds: 10)); + handle.sendControl({'op': 'mem'}); + final msg = await fut; + return MemSnapshot( + rss: msg['rss'] as int, + tracedCurrent: msg['traced_current'] as int, + tracedPeak: msg['traced_peak'] as int, + ); +} diff --git a/src/serious_python/example/bridge_example/integration_test/interactivity_test.dart b/src/serious_python/example/bridge_example/integration_test/interactivity_test.dart new file mode 100644 index 00000000..218260fc --- /dev/null +++ b/src/serious_python/example/bridge_example/integration_test/interactivity_test.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + +import '_helpers.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('counter responds to inc/dec via control channel', + (tester) async { + final handle = await bootAndAwaitReady(tester); + expect(find.byKey(const Key('counter')), findsOneWidget); + expect(find.text('0'), findsOneWidget); + + // Increment once: Python returns {event: count, value: 1}. + await tester.tap(find.byKey(const Key('increment'))); + await tester.pumpAndSettle(); + expect(find.text('1'), findsOneWidget); + + // Decrement twice: 1 -> 0 -> -1. + await tester.tap(find.byKey(const Key('decrement'))); + await tester.tap(find.byKey(const Key('decrement'))); + await tester.pumpAndSettle(); + expect(find.text('-1'), findsOneWidget); + + // Optional version assertion: only when the test harness passes + // EXPECTED_PYTHON_VERSION (CI does; local runs may not). + const expected = String.fromEnvironment('EXPECTED_PYTHON_VERSION'); + if (expected.isNotEmpty) { + expect(handle.pythonVersion.value, isNotNull); + expect(handle.pythonVersion.value, startsWith('$expected.')); + expect( + find.text('Python version: ${handle.pythonVersion.value}'), + findsOneWidget, + ); + } + }); +} diff --git a/src/serious_python/example/bridge_example/integration_test/memory_test.dart b/src/serious_python/example/bridge_example/integration_test/memory_test.dart new file mode 100644 index 00000000..7beb62b7 --- /dev/null +++ b/src/serious_python/example/bridge_example/integration_test/memory_test.dart @@ -0,0 +1,69 @@ +import 'dart:io'; +import 'dart:math'; +import 'dart:typed_data'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + +import '_helpers.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('1000×1MB echo loop does not leak', (tester) async { + final handle = await bootAndAwaitReady(tester); + + // First snapshot also primes tracemalloc on the Python side (the Python + // handler starts tracemalloc lazily on first `mem` op). The very first + // snapshot is intentionally discarded for the leak assertion so the + // tracemalloc warm-up doesn't count against the heap delta. + await memSnapshot(handle); + + // Now take the real baseline. + final dartRssBefore = ProcessInfo.currentRss; + final before = await memSnapshot(handle); + + // Hammer: 1000 × 1 MB round-trips through the echo channel. ~2 GB of + // bytes crossing the bridge total. A leak retaining even ~1% of that + // would show up well above noise in the after-snapshot. + final rng = Random(0xBEEF); + final payload = Uint8List.fromList( + List.generate(1024 * 1024, (_) => rng.nextInt(256))); + for (var i = 0; i < 1000; i++) { + await echoRoundTrip(handle, payload); + } + + // Encourage Python to collect what it can before the second snapshot — + // a noop if no garbage; cheap if there's any. + handle.sendControl({'op': 'mem'}); // triggers another tracemalloc tick + await Future.delayed(const Duration(milliseconds: 200)); + + final after = await memSnapshot(handle); + final dartRssAfter = ProcessInfo.currentRss; + + final tracedDelta = after.tracedCurrent - before.tracedCurrent; + final rssDelta = after.rss - before.rss; + final dartRssDelta = dartRssAfter - dartRssBefore; + + // ignore: avoid_print + print('[bridge_mem] before=$before'); + // ignore: avoid_print + print('[bridge_mem] after=$after'); + // ignore: avoid_print + print('[bridge_mem] traced_delta=${tracedDelta}B ' + 'rss_delta=${rssDelta}B ' + 'dart_rss_delta=${dartRssDelta}B ' + '(dart_rss may be 0 on iOS/Android)'); + + // tracemalloc is unit-stable (bytes) and is the load-bearing leak check. + // 5 MB is generous: a per-iteration leak of 1 KB across 100 rounds would + // be 100 KB, well within budget; a 5%+ leak of 1 MB payloads would not. + expect(tracedDelta, lessThan(5 * 1024 * 1024), + reason: 'Python heap grew >5MB across 100×1MB echo loop — ' + 'likely a Python-side leak (libdart_bridge buffer retained, etc.)'); + + // ru_maxrss has a unit quirk (kB on Linux/Android, bytes on macOS/iOS) + // and is influenced by OS-level page allocation patterns, so we + // log-only. Real assertion lives in tracedDelta above. + }); +} diff --git a/src/serious_python/example/bridge_example/integration_test/throughput_test.dart b/src/serious_python/example/bridge_example/integration_test/throughput_test.dart new file mode 100644 index 00000000..613b58d7 --- /dev/null +++ b/src/serious_python/example/bridge_example/integration_test/throughput_test.dart @@ -0,0 +1,72 @@ +import 'dart:math'; +import 'dart:typed_data'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + +import '_helpers.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + // (payloadBytes, iterations) — sizes go up to 16 MB; iteration count drops + // for bigger payloads so total wall-time stays bounded (~30 s on macOS). + const sizes = <(int, int)>[ + (1024, 100), + (64 * 1024, 100), + (256 * 1024, 100), + (1024 * 1024, 100), + (4 * 1024 * 1024, 100), + (16 * 1024 * 1024, 100), + ]; + + testWidgets('echo channel throughput across size sweep', (tester) async { + final handle = await bootAndAwaitReady(tester); + for (final (size, iterations) in sizes) { + final rng = Random(0xC0FFEE ^ size); + final payload = + Uint8List.fromList(List.generate(size, (_) => rng.nextInt(256))); + + // Verify byte identity once per size; per-iteration assert would + // dominate the timing measurement. + final first = await echoRoundTrip(handle, payload); + expect(first, equals(payload), + reason: 'echo mutated payload at size=$size'); + + final samples = []; // microseconds per round-trip + for (var i = 0; i < iterations; i++) { + final sw = Stopwatch()..start(); + await echoRoundTrip(handle, payload); + sw.stop(); + samples.add(sw.elapsedMicroseconds); + } + + samples.sort(); + final min = samples.first; + final p50 = samples[samples.length ~/ 2]; + final p95 = + samples[(samples.length * 95 ~/ 100).clamp(0, samples.length - 1)]; + final mean = samples.reduce((a, b) => a + b) / samples.length; + + // Throughput in MB/s based on the mean. A round-trip moves 2×size + // bytes through the bridge (Dart→Py + Py→Dart). + final meanSeconds = mean / 1e6; + final mbPerSec = (2 * size) / (meanSeconds * 1024 * 1024); + + // ignore: avoid_print + print('[bridge_perf] size=$size N=$iterations ' + 'min=${(min / 1000).toStringAsFixed(2)}ms ' + 'p50=${(p50 / 1000).toStringAsFixed(2)}ms ' + 'p95=${(p95 / 1000).toStringAsFixed(2)}ms ' + 'mean=${(mean / 1000).toStringAsFixed(2)}ms ' + 'throughput=${mbPerSec.toStringAsFixed(1)}MB/s'); + + // Order-of-magnitude floor — catches >5× regressions without flaking + // on slow Windows Debug runs. Tune after a stable week. + if (size >= 1024 * 1024) { + expect(mbPerSec, greaterThan(50), + reason: 'echo throughput dropped below floor at size=$size'); + } + } + }); +} diff --git a/src/serious_python/example/bridge_example/ios/.gitignore b/src/serious_python/example/bridge_example/ios/.gitignore new file mode 100644 index 00000000..7a7f9873 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/src/serious_python/example/bridge_example/ios/Flutter/AppFrameworkInfo.plist b/src/serious_python/example/bridge_example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..391a902b --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + + diff --git a/src/serious_python/example/bridge_example/ios/Flutter/Debug.xcconfig b/src/serious_python/example/bridge_example/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..ec97fc6f --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/src/serious_python/example/bridge_example/ios/Flutter/Release.xcconfig b/src/serious_python/example/bridge_example/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..c4855bfe --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/src/serious_python/example/bridge_example/ios/Podfile b/src/serious_python/example/bridge_example/ios/Podfile new file mode 100644 index 00000000..620e46eb --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '13.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/src/serious_python/example/bridge_example/ios/Podfile.lock b/src/serious_python/example/bridge_example/ios/Podfile.lock new file mode 100644 index 00000000..3542b7d0 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Podfile.lock @@ -0,0 +1,23 @@ +PODS: + - Flutter (1.0.0) + - serious_python_darwin (2.0.0): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - Flutter (from `Flutter`) + - serious_python_darwin (from `.symlinks/plugins/serious_python_darwin/darwin`) + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + serious_python_darwin: + :path: ".symlinks/plugins/serious_python_darwin/darwin" + +SPEC CHECKSUMS: + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 + serious_python_darwin: 6d58c9837595683a71e20114bdd4607568c98e84 + +PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e + +COCOAPODS: 1.14.3 diff --git a/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..42b493f2 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,774 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 322065C92ECD18A3C98F2E11 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AEAC0F331ED26F69BB615515 /* Pods_Runner.framework */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + BB71784870DB16DD1FC6B8E4 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D718E008AC07AD742D1D5F2A /* Pods_RunnerTests.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0EA787A14BD0ED9CFE9C064B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 848FDA6EB4378C354BE9F993 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AEAC0F331ED26F69BB615515 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B74C01FE66DFA70A7798AE72 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + BCF5E9006721CF8B1D8B3154 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + D718E008AC07AD742D1D5F2A /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + DA8C113A8CD3D0382C92CA01 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + F334390AF67B5D9F075A9A9B /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, + 322065C92ECD18A3C98F2E11 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BA6E6CB399860768894B99C0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BB71784870DB16DD1FC6B8E4 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 40476432BF971A28FA9657B8 /* Pods */ = { + isa = PBXGroup; + children = ( + 0EA787A14BD0ED9CFE9C064B /* Pods-Runner.debug.xcconfig */, + DA8C113A8CD3D0382C92CA01 /* Pods-Runner.release.xcconfig */, + F334390AF67B5D9F075A9A9B /* Pods-Runner.profile.xcconfig */, + 848FDA6EB4378C354BE9F993 /* Pods-RunnerTests.debug.xcconfig */, + BCF5E9006721CF8B1D8B3154 /* Pods-RunnerTests.release.xcconfig */, + B74C01FE66DFA70A7798AE72 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + 40476432BF971A28FA9657B8 /* Pods */, + D9D3ED68A64296A2A76B395E /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + D9D3ED68A64296A2A76B395E /* Frameworks */ = { + isa = PBXGroup; + children = ( + AEAC0F331ED26F69BB615515 /* Pods_Runner.framework */, + D718E008AC07AD742D1D5F2A /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + F3B1F0D1E68C4E672BCDCEAA /* [CP] Check Pods Manifest.lock */, + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + BA6E6CB399860768894B99C0 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 72D7BF28028CDE740A51BCA6 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + B2C65F2690B6BBEF6E20F674 /* [CP] Embed Pods Frameworks */, + 1D3A8F88F6DC96CBAD5977F8 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 1D3A8F88F6DC96CBAD5977F8 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 72D7BF28028CDE740A51BCA6 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + B2C65F2690B6BBEF6E20F674 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + F3B1F0D1E68C4E672BCDCEAA /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.flet.seriousPythonBridgeExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 848FDA6EB4378C354BE9F993 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.flet.seriousPythonBridgeExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BCF5E9006721CF8B1D8B3154 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.flet.seriousPythonBridgeExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B74C01FE66DFA70A7798AE72 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.flet.seriousPythonBridgeExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.flet.seriousPythonBridgeExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.flet.seriousPythonBridgeExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..c3fedb29 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/serious_python/example/bridge_example/ios/Runner.xcworkspace/contents.xcworkspacedata b/src/serious_python/example/bridge_example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..21a3cc14 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/src/serious_python/example/bridge_example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/src/serious_python/example/bridge_example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/src/serious_python/example/bridge_example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/src/serious_python/example/bridge_example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/src/serious_python/example/bridge_example/ios/Runner/AppDelegate.swift b/src/serious_python/example/bridge_example/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..c30b367e --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner/AppDelegate.swift @@ -0,0 +1,16 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } +} diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..7353c41e Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..797d452e Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..6ed2d933 Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cd7b009 Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..fe730945 Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..321773cd Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..797d452e Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..502f463a Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..0ec30343 Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..0ec30343 Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..e9f5fea2 Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..84ac32ae Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..8953cba0 Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..0467bf12 Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/src/serious_python/example/bridge_example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/src/serious_python/example/bridge_example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/serious_python/example/bridge_example/ios/Runner/Base.lproj/Main.storyboard b/src/serious_python/example/bridge_example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/serious_python/example/bridge_example/ios/Runner/Info.plist b/src/serious_python/example/bridge_example/ios/Runner/Info.plist new file mode 100644 index 00000000..532e679b --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner/Info.plist @@ -0,0 +1,70 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Serious Python Bridge Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + serious_python_bridge_example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/src/serious_python/example/bridge_example/ios/Runner/Runner-Bridging-Header.h b/src/serious_python/example/bridge_example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/src/serious_python/example/bridge_example/ios/Runner/SceneDelegate.swift b/src/serious_python/example/bridge_example/ios/Runner/SceneDelegate.swift new file mode 100644 index 00000000..b9ce8ea2 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/src/serious_python/example/bridge_example/ios/RunnerTests/RunnerTests.swift b/src/serious_python/example/bridge_example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..86a7c3b1 --- /dev/null +++ b/src/serious_python/example/bridge_example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/src/serious_python/example/bridge_example/lib/main.dart b/src/serious_python/example/bridge_example/lib/main.dart new file mode 100644 index 00000000..9d7c995e --- /dev/null +++ b/src/serious_python/example/bridge_example/lib/main.dart @@ -0,0 +1,207 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:serious_python/bridge.dart'; +import 'package:serious_python/serious_python.dart'; + +/// Env-var names carrying the Dart-side native ports to Python. The bridge +/// library doesn't bake in a convention — the example picks names and Python +/// reads them from os.environ. +const _controlPortEnv = 'BRIDGE_EXAMPLE_CONTROL_PORT'; +const _echoPortEnv = 'BRIDGE_EXAMPLE_ECHO_PORT'; + +/// Top-level handle exposing the two bridges + the latest counter/version to +/// integration tests, so they can interact with the transport without traversing +/// the widget tree. Populated by `main()` once both bridges are constructed. +class BridgeExampleHandle { + BridgeExampleHandle._(this.controlBridge, this.echoBridge); + + static BridgeExampleHandle? _instance; + static BridgeExampleHandle get instance { + final v = _instance; + if (v == null) { + throw StateError( + 'BridgeExampleHandle not initialised — main() must run first'); + } + return v; + } + + final PythonBridge controlBridge; + final PythonBridge echoBridge; + + /// Current counter value (updated when Python emits {event: count}). + final ValueNotifier counter = ValueNotifier(0); + + /// Python version string, e.g. "3.14.6". `null` until the first `version` + /// event arrives. + final ValueNotifier pythonVersion = ValueNotifier(null); + + /// Send a JSON control op (Dart → Python) on the control channel. + void sendControl(Map op) { + final bytes = Uint8List.fromList(utf8.encode(jsonEncode(op))); + if (controlBridge.send(bytes)) return; + _retrySend(controlBridge, bytes); + } + + /// Brief retry to cover the startup window where Python's handler hasn't + /// registered yet. Matches the pattern in flet_example's + /// `_DartBridgeBackendChannel._retrySend`. + static void _retrySend(PythonBridge bridge, Uint8List bytes) { + const interval = Duration(milliseconds: 50); + const deadline = Duration(seconds: 30); + final start = DateTime.now(); + Timer.periodic(interval, (timer) { + if (bridge.send(bytes)) { + timer.cancel(); + } else if (DateTime.now().difference(start) > deadline) { + timer.cancel(); + debugPrint( + '[bridge_example] send timed out — Python handler never registered'); + } + }); + } +} + +void main() { + // Bridges live for the app's lifetime; constructed before runApp so the + // testable handle is available immediately. + final control = PythonBridge(); + final echo = PythonBridge(); + BridgeExampleHandle._instance = + BridgeExampleHandle._(control, echo); + + // Fire-and-forget: Python's main.py blocks forever waiting for messages. + // Awaiting SeriousPython.run() would deadlock the UI. + unawaited(SeriousPython.run( + 'app/app.zip', + environmentVariables: { + _controlPortEnv: '${control.port}', + _echoPortEnv: '${echo.port}', + }, + )); + + runApp(const BridgeExampleApp()); +} + +class BridgeExampleApp extends StatefulWidget { + const BridgeExampleApp({super.key}); + + @override + State createState() => _BridgeExampleAppState(); +} + +class _BridgeExampleAppState extends State { + StreamSubscription? _controlSub; + final List _log = []; + + @override + void initState() { + super.initState(); + final handle = BridgeExampleHandle.instance; + _controlSub = handle.controlBridge.messages.listen(_onControl); + + // Request the Python version once Python has had a moment to register + // its handler. sendControl() retries internally if the handler isn't + // ready yet, so we can fire immediately. + handle.sendControl({'op': 'version'}); + _log.add('control_port=${handle.controlBridge.port} ' + 'echo_port=${handle.echoBridge.port}'); + } + + void _onControl(Uint8List bytes) { + final handle = BridgeExampleHandle.instance; + Map msg; + try { + msg = jsonDecode(utf8.decode(bytes)) as Map; + } catch (e) { + debugPrint('[bridge_example] control parse error: $e'); + return; + } + final event = msg['event']; + if (event == 'count') { + handle.counter.value = msg['value'] as int; + } else if (event == 'version') { + handle.pythonVersion.value = msg['value'] as String; + } + // 'mem' events are consumed by the memory test directly via its own + // listener — no widget-visible state for them. + setState(() => _log.add('Python -> Dart: ${msg.toString()}')); + } + + @override + void dispose() { + _controlSub?.cancel(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final handle = BridgeExampleHandle.instance; + return MaterialApp( + title: 'bridge_example', + home: Scaffold( + appBar: AppBar(title: const Text('PythonBridge example')), + body: Column( + children: [ + Padding( + padding: const EdgeInsets.all(16), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + key: const Key('decrement'), + icon: const Icon(Icons.remove), + onPressed: () => handle.sendControl({'op': 'dec'}), + ), + ValueListenableBuilder( + valueListenable: handle.counter, + builder: (_, value, __) => Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Text( + '$value', + key: const Key('counter'), + style: Theme.of(context).textTheme.headlineMedium, + ), + ), + ), + IconButton( + key: const Key('increment'), + icon: const Icon(Icons.add), + onPressed: () => handle.sendControl({'op': 'inc'}), + ), + ], + ), + ), + ValueListenableBuilder( + valueListenable: handle.pythonVersion, + builder: (_, version, __) => Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Text( + version == null + ? 'Python version: …' + : 'Python version: $version', + key: const Key('version'), + ), + ), + ), + const Divider(), + Expanded( + child: ListView.builder( + itemCount: _log.length, + itemBuilder: (context, index) => ListTile( + dense: true, + title: Text( + _log[index], + style: const TextStyle(fontSize: 12), + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/src/serious_python/example/bridge_example/linux/.gitignore b/src/serious_python/example/bridge_example/linux/.gitignore new file mode 100644 index 00000000..d3896c98 --- /dev/null +++ b/src/serious_python/example/bridge_example/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/src/serious_python/example/bridge_example/linux/CMakeLists.txt b/src/serious_python/example/bridge_example/linux/CMakeLists.txt new file mode 100644 index 00000000..6e2c3aa1 --- /dev/null +++ b/src/serious_python/example/bridge_example/linux/CMakeLists.txt @@ -0,0 +1,128 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "serious_python_bridge_example") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.flet.serious_python_bridge_example") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/src/serious_python/example/bridge_example/linux/flutter/CMakeLists.txt b/src/serious_python/example/bridge_example/linux/flutter/CMakeLists.txt new file mode 100644 index 00000000..d5bd0164 --- /dev/null +++ b/src/serious_python/example/bridge_example/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/src/serious_python/example/bridge_example/linux/flutter/generated_plugin_registrant.cc b/src/serious_python/example/bridge_example/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..4dbcd894 --- /dev/null +++ b/src/serious_python/example/bridge_example/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) serious_python_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "SeriousPythonLinuxPlugin"); + serious_python_linux_plugin_register_with_registrar(serious_python_linux_registrar); +} diff --git a/src/serious_python/example/bridge_example/linux/flutter/generated_plugin_registrant.h b/src/serious_python/example/bridge_example/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..e0f0a47b --- /dev/null +++ b/src/serious_python/example/bridge_example/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/src/serious_python/example/bridge_example/linux/flutter/generated_plugins.cmake b/src/serious_python/example/bridge_example/linux/flutter/generated_plugins.cmake new file mode 100644 index 00000000..ab50859e --- /dev/null +++ b/src/serious_python/example/bridge_example/linux/flutter/generated_plugins.cmake @@ -0,0 +1,25 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + serious_python_linux +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/src/serious_python/example/bridge_example/linux/runner/CMakeLists.txt b/src/serious_python/example/bridge_example/linux/runner/CMakeLists.txt new file mode 100644 index 00000000..e97dabc7 --- /dev/null +++ b/src/serious_python/example/bridge_example/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/src/serious_python/example/flask_example/linux/main.cc b/src/serious_python/example/bridge_example/linux/runner/main.cc similarity index 100% rename from src/serious_python/example/flask_example/linux/main.cc rename to src/serious_python/example/bridge_example/linux/runner/main.cc diff --git a/src/serious_python/example/bridge_example/linux/runner/my_application.cc b/src/serious_python/example/bridge_example/linux/runner/my_application.cc new file mode 100644 index 00000000..11eb205b --- /dev/null +++ b/src/serious_python/example/bridge_example/linux/runner/my_application.cc @@ -0,0 +1,148 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "serious_python_bridge_example"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "serious_python_bridge_example"); + } + + gtk_window_set_default_size(window, 1280, 720); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); +} diff --git a/src/serious_python/example/flask_example/linux/my_application.h b/src/serious_python/example/bridge_example/linux/runner/my_application.h similarity index 70% rename from src/serious_python/example/flask_example/linux/my_application.h rename to src/serious_python/example/bridge_example/linux/runner/my_application.h index 72271d5e..db16367a 100644 --- a/src/serious_python/example/flask_example/linux/my_application.h +++ b/src/serious_python/example/bridge_example/linux/runner/my_application.h @@ -3,7 +3,10 @@ #include -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, GtkApplication) /** diff --git a/src/serious_python/example/bridge_example/macos/.gitignore b/src/serious_python/example/bridge_example/macos/.gitignore new file mode 100644 index 00000000..746adbb6 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/src/serious_python/example/bridge_example/macos/Flutter/Flutter-Debug.xcconfig b/src/serious_python/example/bridge_example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 00000000..4b81f9b2 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/src/serious_python/example/bridge_example/macos/Flutter/Flutter-Release.xcconfig b/src/serious_python/example/bridge_example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 00000000..5caa9d15 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/src/serious_python/example/bridge_example/macos/Flutter/GeneratedPluginRegistrant.swift b/src/serious_python/example/bridge_example/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 00000000..7ef3a6c2 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,12 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import serious_python_darwin + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + SeriousPythonPlugin.register(with: registry.registrar(forPlugin: "SeriousPythonPlugin")) +} diff --git a/src/serious_python/example/bridge_example/macos/Podfile b/src/serious_python/example/bridge_example/macos/Podfile new file mode 100644 index 00000000..ff5ddb3b --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '10.15' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/src/serious_python/example/bridge_example/macos/Podfile.lock b/src/serious_python/example/bridge_example/macos/Podfile.lock new file mode 100644 index 00000000..8a6bd931 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Podfile.lock @@ -0,0 +1,23 @@ +PODS: + - FlutterMacOS (1.0.0) + - serious_python_darwin (2.0.0): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - FlutterMacOS (from `Flutter/ephemeral`) + - serious_python_darwin (from `Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin`) + +EXTERNAL SOURCES: + FlutterMacOS: + :path: Flutter/ephemeral + serious_python_darwin: + :path: Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin + +SPEC CHECKSUMS: + FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 + serious_python_darwin: 6d58c9837595683a71e20114bdd4607568c98e84 + +PODFILE CHECKSUM: 54d867c82ac51cbd61b565781b9fada492027009 + +COCOAPODS: 1.14.3 diff --git a/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..8dda9eb0 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,819 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + B72E96C288A175DA4181F1E9 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9E3AB6184BEAE07C5108EE3 /* Pods_Runner.framework */; }; + E3DFE7ECAF91BB85499213B0 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E0FC039480642B362225F49B /* Pods_RunnerTests.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 2775C3F1F7682B199C8C7E03 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* serious_python_bridge_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = serious_python_bridge_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 39E5122CF63AF062558CE40F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 4DDC5FA0C150DCFDA5784BFA /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 7556ABD1A47FA4D65C4B0DFC /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 8B28C1B131F74EC8875EDFCF /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + B9E3AB6184BEAE07C5108EE3 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E0E386E07F09A8340444FB67 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + E0FC039480642B362225F49B /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E3DFE7ECAF91BB85499213B0 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B72E96C288A175DA4181F1E9 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + DFB3DE593331416D447154E0 /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* serious_python_bridge_example.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + B9E3AB6184BEAE07C5108EE3 /* Pods_Runner.framework */, + E0FC039480642B362225F49B /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + DFB3DE593331416D447154E0 /* Pods */ = { + isa = PBXGroup; + children = ( + 4DDC5FA0C150DCFDA5784BFA /* Pods-Runner.debug.xcconfig */, + 39E5122CF63AF062558CE40F /* Pods-Runner.release.xcconfig */, + 2775C3F1F7682B199C8C7E03 /* Pods-Runner.profile.xcconfig */, + E0E386E07F09A8340444FB67 /* Pods-RunnerTests.debug.xcconfig */, + 7556ABD1A47FA4D65C4B0DFC /* Pods-RunnerTests.release.xcconfig */, + 8B28C1B131F74EC8875EDFCF /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + BBA99A121B65ED7E52DABCEE /* [CP] Check Pods Manifest.lock */, + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + DEC72C495FFE1070D6EED4DF /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + 5019070AFE2F41F3F49E930B /* [CP] Embed Pods Frameworks */, + 583F80258F9FB1DB887F6668 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* serious_python_bridge_example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + 5019070AFE2F41F3F49E930B /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 583F80258F9FB1DB887F6668 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + BBA99A121B65ED7E52DABCEE /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + DEC72C495FFE1070D6EED4DF /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E0E386E07F09A8340444FB67 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.flet.seriousPythonBridgeExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/serious_python_bridge_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/serious_python_bridge_example"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7556ABD1A47FA4D65C4B0DFC /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.flet.seriousPythonBridgeExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/serious_python_bridge_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/serious_python_bridge_example"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8B28C1B131F74EC8875EDFCF /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.flet.seriousPythonBridgeExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/serious_python_bridge_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/serious_python_bridge_example"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..1fb7fdd6 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/serious_python/example/bridge_example/macos/Runner.xcworkspace/contents.xcworkspacedata b/src/serious_python/example/bridge_example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..21a3cc14 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/src/serious_python/example/bridge_example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/src/serious_python/example/bridge_example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/src/serious_python/example/bridge_example/macos/Runner/AppDelegate.swift b/src/serious_python/example/bridge_example/macos/Runner/AppDelegate.swift new file mode 100644 index 00000000..b3c17614 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Cocoa +import FlutterMacOS + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } +} diff --git a/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..a2ec33f1 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 00000000..82b6f9d9 Binary files /dev/null and b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 00000000..13b35eba Binary files /dev/null and b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 00000000..0a3f5fa4 Binary files /dev/null and b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 00000000..bdb57226 Binary files /dev/null and b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 00000000..f083318e Binary files /dev/null and b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 00000000..326c0e72 Binary files /dev/null and b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 00000000..2f1632cf Binary files /dev/null and b/src/serious_python/example/bridge_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/src/serious_python/example/bridge_example/macos/Runner/Base.lproj/MainMenu.xib b/src/serious_python/example/bridge_example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 00000000..80e867a4 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/serious_python/example/bridge_example/macos/Runner/Configs/AppInfo.xcconfig b/src/serious_python/example/bridge_example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 00000000..6558c5b4 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = serious_python_bridge_example + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.flet.seriousPythonBridgeExample + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2026 com.flet. All rights reserved. diff --git a/src/serious_python/example/bridge_example/macos/Runner/Configs/Debug.xcconfig b/src/serious_python/example/bridge_example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 00000000..36b0fd94 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/src/serious_python/example/bridge_example/macos/Runner/Configs/Release.xcconfig b/src/serious_python/example/bridge_example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 00000000..dff4f495 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/src/serious_python/example/bridge_example/macos/Runner/Configs/Warnings.xcconfig b/src/serious_python/example/bridge_example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 00000000..42bcbf47 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/src/serious_python/example/bridge_example/macos/Runner/DebugProfile.entitlements b/src/serious_python/example/bridge_example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 00000000..9f56413f --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/src/serious_python/example/bridge_example/macos/Runner/Info.plist b/src/serious_python/example/bridge_example/macos/Runner/Info.plist new file mode 100644 index 00000000..4789daa6 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/src/serious_python/example/bridge_example/macos/Runner/MainFlutterWindow.swift b/src/serious_python/example/bridge_example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 00000000..3cc05eb2 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/src/serious_python/example/bridge_example/macos/Runner/Release.entitlements b/src/serious_python/example/bridge_example/macos/Runner/Release.entitlements new file mode 100644 index 00000000..e89b7f32 --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/src/serious_python/example/bridge_example/macos/RunnerTests/RunnerTests.swift b/src/serious_python/example/bridge_example/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..61f3bd1f --- /dev/null +++ b/src/serious_python/example/bridge_example/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/src/serious_python/example/bridge_example/pubspec.yaml b/src/serious_python/example/bridge_example/pubspec.yaml new file mode 100644 index 00000000..8c33a095 --- /dev/null +++ b/src/serious_python/example/bridge_example/pubspec.yaml @@ -0,0 +1,31 @@ +name: bridge_example +description: "Minimal Flutter app exercising the in-process Dart ↔ Python byte transport via PythonBridge." +publish_to: 'none' + +version: 1.0.0+1 + +environment: + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.7.0" + +dependencies: + flutter: + sdk: flutter + + serious_python: + path: ../../ + + cupertino_icons: ^1.0.8 + +dev_dependencies: + flutter_test: + sdk: flutter + integration_test: + sdk: flutter + flutter_lints: ^2.0.0 + +flutter: + uses-material-design: true + + assets: + - app/app.zip diff --git a/src/serious_python/example/bridge_example/windows/.gitignore b/src/serious_python/example/bridge_example/windows/.gitignore new file mode 100644 index 00000000..d492d0d9 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/src/serious_python/example/bridge_example/windows/CMakeLists.txt b/src/serious_python/example/bridge_example/windows/CMakeLists.txt new file mode 100644 index 00000000..1d3f761b --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/CMakeLists.txt @@ -0,0 +1,108 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(serious_python_bridge_example LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "serious_python_bridge_example") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/src/serious_python/example/bridge_example/windows/flutter/CMakeLists.txt b/src/serious_python/example/bridge_example/windows/flutter/CMakeLists.txt new file mode 100644 index 00000000..903f4899 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/flutter/CMakeLists.txt @@ -0,0 +1,109 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + ${FLUTTER_TARGET_PLATFORM} $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/src/serious_python/example/bridge_example/windows/flutter/generated_plugin_registrant.cc b/src/serious_python/example/bridge_example/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..e985e51a --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,14 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + SeriousPythonWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("SeriousPythonWindowsPluginCApi")); +} diff --git a/src/serious_python/example/bridge_example/windows/flutter/generated_plugin_registrant.h b/src/serious_python/example/bridge_example/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..dc139d85 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/src/serious_python/example/bridge_example/windows/flutter/generated_plugins.cmake b/src/serious_python/example/bridge_example/windows/flutter/generated_plugins.cmake new file mode 100644 index 00000000..f2f58d64 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/flutter/generated_plugins.cmake @@ -0,0 +1,25 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + serious_python_windows +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/src/serious_python/example/bridge_example/windows/runner/CMakeLists.txt b/src/serious_python/example/bridge_example/windows/runner/CMakeLists.txt new file mode 100644 index 00000000..394917c0 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/src/serious_python/example/bridge_example/windows/runner/Runner.rc b/src/serious_python/example/bridge_example/windows/runner/Runner.rc new file mode 100644 index 00000000..330bcad5 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.flet" "\0" + VALUE "FileDescription", "serious_python_bridge_example" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "serious_python_bridge_example" "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.flet. All rights reserved." "\0" + VALUE "OriginalFilename", "serious_python_bridge_example.exe" "\0" + VALUE "ProductName", "serious_python_bridge_example" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/src/serious_python/example/bridge_example/windows/runner/flutter_window.cpp b/src/serious_python/example/bridge_example/windows/runner/flutter_window.cpp new file mode 100644 index 00000000..955ee303 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/src/serious_python/example/bridge_example/windows/runner/flutter_window.h b/src/serious_python/example/bridge_example/windows/runner/flutter_window.h new file mode 100644 index 00000000..6da0652f --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/src/serious_python/example/bridge_example/windows/runner/main.cpp b/src/serious_python/example/bridge_example/windows/runner/main.cpp new file mode 100644 index 00000000..d6f35140 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"serious_python_bridge_example", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/src/serious_python/example/bridge_example/windows/runner/resource.h b/src/serious_python/example/bridge_example/windows/runner/resource.h new file mode 100644 index 00000000..66a65d1e --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/src/serious_python/example/bridge_example/windows/runner/resources/app_icon.ico b/src/serious_python/example/bridge_example/windows/runner/resources/app_icon.ico new file mode 100644 index 00000000..c04e20ca Binary files /dev/null and b/src/serious_python/example/bridge_example/windows/runner/resources/app_icon.ico differ diff --git a/src/serious_python/example/bridge_example/windows/runner/runner.exe.manifest b/src/serious_python/example/bridge_example/windows/runner/runner.exe.manifest new file mode 100644 index 00000000..153653e8 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/runner.exe.manifest @@ -0,0 +1,14 @@ + + + + + PerMonitorV2 + + + + + + + + + diff --git a/src/serious_python/example/bridge_example/windows/runner/utils.cpp b/src/serious_python/example/bridge_example/windows/runner/utils.cpp new file mode 100644 index 00000000..3a0b4651 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + unsigned int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/src/serious_python/example/bridge_example/windows/runner/utils.h b/src/serious_python/example/bridge_example/windows/runner/utils.h new file mode 100644 index 00000000..3879d547 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/src/serious_python/example/bridge_example/windows/runner/win32_window.cpp b/src/serious_python/example/bridge_example/windows/runner/win32_window.cpp new file mode 100644 index 00000000..60608d0f --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/src/serious_python/example/bridge_example/windows/runner/win32_window.h b/src/serious_python/example/bridge_example/windows/runner/win32_window.h new file mode 100644 index 00000000..e901dde6 --- /dev/null +++ b/src/serious_python/example/bridge_example/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/src/serious_python/example/flask_example/.gitignore b/src/serious_python/example/flask_example/.gitignore index 3efbe6a0..4be25775 100644 --- a/src/serious_python/example/flask_example/.gitignore +++ b/src/serious_python/example/flask_example/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/src/serious_python/example/flask_example/.metadata b/src/serious_python/example/flask_example/.metadata index 82c76b0e..d3f20b97 100644 --- a/src/serious_python/example/flask_example/.metadata +++ b/src/serious_python/example/flask_example/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e" + revision: "c9a6c484230f8b5e408ec57be1ef71dee1e77020" channel: "stable" project_type: app @@ -13,11 +13,23 @@ project_type: app migration: platforms: - platform: root - create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e - base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: android + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: ios + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 - platform: linux - create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e - base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: macos + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: windows + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 # User provided section diff --git a/src/serious_python/example/flask_example/README.md b/src/serious_python/example/flask_example/README.md index 831d854b..24c72c17 100644 --- a/src/serious_python/example/flask_example/README.md +++ b/src/serious_python/example/flask_example/README.md @@ -6,42 +6,47 @@ For Android: ``` export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages -dart run serious_python:main package app/src -p Android --requirements -r,app/src/requirements.txt +dart run serious_python:main package app/src -p Android -r -r -r app/src/requirements.txt ``` For iOS: ``` export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages -dart run serious_python:main package app/src -p iOS --requirements -r,app/src/requirements.txt +dart run serious_python:main package app/src -p iOS -r -r -r app/src/requirements.txt ``` For macOS: ``` -dart run serious_python:main package app/src -p Darwin --requirements -r,app/src/requirements.txt +export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +dart run serious_python:main package app/src -p Darwin -r -r -r app/src/requirements.txt ``` For Windows: ``` -dart run serious_python:main package app/src -p Windows --requirements -r,app/src/requirements.txt +export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +dart run serious_python:main package app/src -p Windows -r -r -r app/src/requirements.txt ``` For Linux: ``` -dart run serious_python:main package app/src -p Linux --requirements -r,app/src/requirements.txt -``` - -Important: to make `serious_python` work in your own Android app: - -If you build an App Bundle Edit `android/gradle.properties` and add the flag: - -``` -android.bundle.enableUncompressedNativeLibs=false -``` - -If you build an APK Make sure `android/app/src/AndroidManifest.xml` has `android:extractNativeLibs="true"` in the `` tag. - -For more information, see the [public issue](https://issuetracker.google.com/issues/147096055). \ No newline at end of file +export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +dart run serious_python:main package app/src -p Linux -r -r -r app/src/requirements.txt +``` + +For Android, no special native-library packaging config is required. +`serious_python` relocates Python extension modules into `jniLibs` and loads them +directly from the APK (memory-mapped, no extraction), and ships pure Python in +stored asset zips. Just use a `minSdk` of 23+ so native libs stay uncompressed and +page-aligned in the APK: + +```kotlin +android { + defaultConfig { + minSdk = 23 + } +} +``` \ No newline at end of file diff --git a/src/serious_python/example/flask_example/android/.gitignore b/src/serious_python/example/flask_example/android/.gitignore index b776a2ff..be3943c9 100644 --- a/src/serious_python/example/flask_example/android/.gitignore +++ b/src/serious_python/example/flask_example/android/.gitignore @@ -5,10 +5,10 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java -**/.cxx/ +.cxx/ # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/src/serious_python/example/flask_example/android/app/build.gradle b/src/serious_python/example/flask_example/android/app/build.gradle deleted file mode 100644 index 7dd8667f..00000000 --- a/src/serious_python/example/flask_example/android/app/build.gradle +++ /dev/null @@ -1,72 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - namespace "com.example.flask_example" - compileSdkVersion flutter.compileSdkVersion - ndkVersion flutter.ndkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.flask_example" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/src/serious_python/example/flask_example/android/app/build.gradle.kts b/src/serious_python/example/flask_example/android/app/build.gradle.kts new file mode 100644 index 00000000..2039132c --- /dev/null +++ b/src/serious_python/example/flask_example/android/app/build.gradle.kts @@ -0,0 +1,52 @@ +plugins { + id("com.android.application") + // Kotlin is provided by the Flutter Gradle Plugin (Built-in Kotlin), so the + // app no longer applies the Kotlin Gradle Plugin itself. + // The Flutter Gradle Plugin must be applied after the Android Gradle plugin. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.flask_example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + // No native-library packaging config is needed: serious_python loads Python + // extension modules directly from the APK (memory-mapped) and ships pure + // Python in stored asset zips. Modern packaging (the default at minSdk 23+) is + // all that's required. + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.flask_example" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + +flutter { + source = "../.." +} diff --git a/src/serious_python/example/flask_example/android/app/src/main/AndroidManifest.xml b/src/serious_python/example/flask_example/android/app/src/main/AndroidManifest.xml index ea56d134..97e1ff4d 100644 --- a/src/serious_python/example/flask_example/android/app/src/main/AndroidManifest.xml +++ b/src/serious_python/example/flask_example/android/app/src/main/AndroidManifest.xml @@ -1,13 +1,16 @@ + + + android:icon="@mipmap/ic_launcher"> + + + + + + + diff --git a/src/serious_python/example/flask_example/android/app/src/main/kotlin/com/example/flask_example/MainActivity.kt b/src/serious_python/example/flask_example/android/app/src/main/kotlin/com/example/flask_example/MainActivity.kt index b2780adc..6ef2d40c 100644 --- a/src/serious_python/example/flask_example/android/app/src/main/kotlin/com/example/flask_example/MainActivity.kt +++ b/src/serious_python/example/flask_example/android/app/src/main/kotlin/com/example/flask_example/MainActivity.kt @@ -2,5 +2,4 @@ package com.example.flask_example import io.flutter.embedding.android.FlutterActivity -class MainActivity: FlutterActivity() { -} +class MainActivity : FlutterActivity() diff --git a/src/serious_python/example/flask_example/android/build.gradle b/src/serious_python/example/flask_example/android/build.gradle deleted file mode 100644 index f7eb7f63..00000000 --- a/src/serious_python/example/flask_example/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.7.10' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/src/serious_python/example/flask_example/android/build.gradle.kts b/src/serious_python/example/flask_example/android/build.gradle.kts new file mode 100644 index 00000000..dbee657b --- /dev/null +++ b/src/serious_python/example/flask_example/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/src/serious_python/example/flask_example/android/gradle.properties b/src/serious_python/example/flask_example/android/gradle.properties index 4efbcd2b..d5da7278 100644 --- a/src/serious_python/example/flask_example/android/gradle.properties +++ b/src/serious_python/example/flask_example/android/gradle.properties @@ -1,4 +1,6 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true -android.bundle.enableUncompressedNativeLibs=false \ No newline at end of file +# This builtInKotlin flag was added automatically by Flutter migrator +android.builtInKotlin=false +# This newDsl flag was added automatically by Flutter migrator +android.newDsl=false diff --git a/src/serious_python/example/flask_example/android/gradle/wrapper/gradle-wrapper.properties b/src/serious_python/example/flask_example/android/gradle/wrapper/gradle-wrapper.properties index 3c472b99..e4ef43fb 100644 --- a/src/serious_python/example/flask_example/android/gradle/wrapper/gradle-wrapper.properties +++ b/src/serious_python/example/flask_example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/src/serious_python/example/flask_example/android/settings.gradle b/src/serious_python/example/flask_example/android/settings.gradle deleted file mode 100644 index 44e62bcf..00000000 --- a/src/serious_python/example/flask_example/android/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':app' - -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() - -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } - -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/src/serious_python/example/flask_example/android/settings.gradle.kts b/src/serious_python/example/flask_example/android/settings.gradle.kts new file mode 100644 index 00000000..ca1f8f00 --- /dev/null +++ b/src/serious_python/example/flask_example/android/settings.gradle.kts @@ -0,0 +1,28 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + // Declared (but not applied) so Built-in Kotlin — where the Flutter Gradle + // Plugin applies kotlin-android for us — uses this KGP version. + id("org.jetbrains.kotlin.android") version "2.2.20" apply false +} + +include(":app") diff --git a/src/serious_python/example/flask_example/app/app.zip.hash b/src/serious_python/example/flask_example/app/app.zip.hash index 7099c3a9..d9d7e40e 100644 --- a/src/serious_python/example/flask_example/app/app.zip.hash +++ b/src/serious_python/example/flask_example/app/app.zip.hash @@ -1 +1 @@ -9abed4a7d914300e2cf342c04e7dfcf58a5dbda44fc93a99a86b0e8831207840 \ No newline at end of file +0a2b6372a4750525b5a93b7133028630a33e24134d59fae37d2950c8076a7a1f \ No newline at end of file diff --git a/src/serious_python/example/flask_example/ios/Flutter/AppFrameworkInfo.plist b/src/serious_python/example/flask_example/ios/Flutter/AppFrameworkInfo.plist index 9625e105..391a902b 100644 --- a/src/serious_python/example/flask_example/ios/Flutter/AppFrameworkInfo.plist +++ b/src/serious_python/example/flask_example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 11.0 diff --git a/src/serious_python/example/flask_example/ios/Podfile b/src/serious_python/example/flask_example/ios/Podfile index 164df534..e51a31d9 100644 --- a/src/serious_python/example/flask_example/ios/Podfile +++ b/src/serious_python/example/flask_example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '12.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/src/serious_python/example/flask_example/ios/Podfile.lock b/src/serious_python/example/flask_example/ios/Podfile.lock index 60902061..9bae2c46 100644 --- a/src/serious_python/example/flask_example/ios/Podfile.lock +++ b/src/serious_python/example/flask_example/ios/Podfile.lock @@ -1,36 +1,23 @@ PODS: - Flutter (1.0.0) - - package_info_plus (0.4.5): - - Flutter - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - serious_python_darwin (0.6.0): + - serious_python_darwin (2.0.0): - Flutter - FlutterMacOS DEPENDENCIES: - Flutter (from `Flutter`) - - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - serious_python_darwin (from `.symlinks/plugins/serious_python_darwin/darwin`) EXTERNAL SOURCES: Flutter: :path: Flutter - package_info_plus: - :path: ".symlinks/plugins/package_info_plus/ios" - path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/darwin" serious_python_darwin: :path: ".symlinks/plugins/serious_python_darwin/darwin" SPEC CHECKSUMS: - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 - path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 - serious_python_darwin: d5c85ae2cd4539b52c71ea8ba8af357aa6311647 + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 + serious_python_darwin: 6d58c9837595683a71e20114bdd4607568c98e84 -PODFILE CHECKSUM: 7be2f5f74864d463a8ad433546ed1de7e0f29aef +PODFILE CHECKSUM: 4f1c12611da7338d21589c0b2ecd6bd20b109694 -COCOAPODS: 1.12.1 +COCOAPODS: 1.14.3 diff --git a/src/serious_python/example/flask_example/ios/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/flask_example/ios/Runner.xcodeproj/project.pbxproj index c9cbbc0a..fdc569bd 100644 --- a/src/serious_python/example/flask_example/ios/Runner.xcodeproj/project.pbxproj +++ b/src/serious_python/example/flask_example/ios/Runner.xcodeproj/project.pbxproj @@ -10,12 +10,13 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 5B44F7E31402F865514A0858 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96528167AEF905EF935C1B41 /* Pods_Runner.framework */; }; - 6E599DE725A7D68A3238C543 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E1AD4EBDB62E03C336C3EE77 /* Pods_RunnerTests.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 77A988A6D080EF4BC79BE58A /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE3BB40A3B4D14887033B8B8 /* Pods_RunnerTests.framework */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + C4B9804AA9F1E8A527A0A479 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C6DBFEFC8EEC088475FF3B8 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -42,20 +43,19 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0D382C05287807FE4CCE1EC4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 0C6DBFEFC8EEC088475FF3B8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 18C74EFCCAE277889ECB1AC4 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 1D4ACE23F5F3798A85CB2B20 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 362FE1DD228E14D42ECA2A89 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 6045BC150A02902EDD944A0C /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 72FB249CCFCF77C5BC56E58D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 8FDF69CA5955F9CAEB4BAD4C /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - 96528167AEF905EF935C1B41 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 970D04A203EFCE2DE0A80099 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -63,24 +63,26 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AAF0F2A04A9A113E2FDEB3FE /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - E1AD4EBDB62E03C336C3EE77 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A325022E53B09E17C0E31FD6 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + AB437FB78677E7767CB7C835 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + AE3BB40A3B4D14887033B8B8 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D7FDA6251921B5D40B882887 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 865116BAEE02335192FC14A4 /* Frameworks */ = { + 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6E599DE725A7D68A3238C543 /* Pods_RunnerTests.framework in Frameworks */, + C4B9804AA9F1E8A527A0A479 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 97C146EB1CF9000F007C117D /* Frameworks */ = { + E49AB6DC08AE5F55BA07C643 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5B44F7E31402F865514A0858 /* Pods_Runner.framework in Frameworks */, + 77A988A6D080EF4BC79BE58A /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -95,16 +97,17 @@ path = RunnerTests; sourceTree = ""; }; - 579CE9A32D94B33B7F5FA9C5 /* Pods */ = { + 553BA73291320DECD34F1CAA /* Pods */ = { isa = PBXGroup; children = ( - AAF0F2A04A9A113E2FDEB3FE /* Pods-Runner.debug.xcconfig */, - 18C74EFCCAE277889ECB1AC4 /* Pods-Runner.release.xcconfig */, - 0D382C05287807FE4CCE1EC4 /* Pods-Runner.profile.xcconfig */, - 970D04A203EFCE2DE0A80099 /* Pods-RunnerTests.debug.xcconfig */, - 8FDF69CA5955F9CAEB4BAD4C /* Pods-RunnerTests.release.xcconfig */, - 362FE1DD228E14D42ECA2A89 /* Pods-RunnerTests.profile.xcconfig */, - ); + 72FB249CCFCF77C5BC56E58D /* Pods-Runner.debug.xcconfig */, + D7FDA6251921B5D40B882887 /* Pods-Runner.release.xcconfig */, + 1D4ACE23F5F3798A85CB2B20 /* Pods-Runner.profile.xcconfig */, + AB437FB78677E7767CB7C835 /* Pods-RunnerTests.debug.xcconfig */, + A325022E53B09E17C0E31FD6 /* Pods-RunnerTests.release.xcconfig */, + 6045BC150A02902EDD944A0C /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; path = Pods; sourceTree = ""; }; @@ -126,8 +129,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, - 579CE9A32D94B33B7F5FA9C5 /* Pods */, - C81B3572AEA9583327A6C83F /* Frameworks */, + 553BA73291320DECD34F1CAA /* Pods */, + D70B7ECD72C3A320543F16E4 /* Frameworks */, ); sourceTree = ""; }; @@ -150,16 +153,17 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; - C81B3572AEA9583327A6C83F /* Frameworks */ = { + D70B7ECD72C3A320543F16E4 /* Frameworks */ = { isa = PBXGroup; children = ( - 96528167AEF905EF935C1B41 /* Pods_Runner.framework */, - E1AD4EBDB62E03C336C3EE77 /* Pods_RunnerTests.framework */, + 0C6DBFEFC8EEC088475FF3B8 /* Pods_Runner.framework */, + AE3BB40A3B4D14887033B8B8 /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -171,10 +175,10 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 22AE4D140A0649DD74A96896 /* [CP] Check Pods Manifest.lock */, + A09929865224B53C6EDC0DBA /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, - 865116BAEE02335192FC14A4 /* Frameworks */, + E49AB6DC08AE5F55BA07C643 /* Frameworks */, ); buildRules = ( ); @@ -190,14 +194,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 1EE0442A2A194508FAABE79B /* [CP] Check Pods Manifest.lock */, + C8F796EC5C0BBF75DD301401 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - D1EC2B1361F0757AC0569474 /* [CP] Embed Pods Frameworks */, + 76088B6348DC51E21B5F4330 /* [CP] Embed Pods Frameworks */, + CBA805DF563C72EDD8CF9420 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -215,7 +220,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { @@ -269,96 +274,113 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1EE0442A2A194508FAABE79B /* [CP] Check Pods Manifest.lock */ = { + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); + name = "Thin Binary"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 22AE4D140A0649DD74A96896 /* [CP] Check Pods Manifest.lock */ = { + 76088B6348DC51E21B5F4330 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); - name = "Thin Binary"; + name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + A09929865224B53C6EDC0DBA /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "Run Script"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; - D1EC2B1361F0757AC0569474 /* [CP] Embed Pods Frameworks */ = { + C8F796EC5C0BBF75DD301401 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + CBA805DF563C72EDD8CF9420 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -378,6 +400,7 @@ files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -415,6 +438,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -434,7 +458,6 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -445,6 +468,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -453,7 +477,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -469,7 +493,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = GXXRQJK434; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -486,7 +509,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 970D04A203EFCE2DE0A80099 /* Pods-RunnerTests.debug.xcconfig */; + baseConfigurationReference = AB437FB78677E7767CB7C835 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -504,7 +527,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8FDF69CA5955F9CAEB4BAD4C /* Pods-RunnerTests.release.xcconfig */; + baseConfigurationReference = A325022E53B09E17C0E31FD6 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -520,7 +543,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 362FE1DD228E14D42ECA2A89 /* Pods-RunnerTests.profile.xcconfig */; + baseConfigurationReference = 6045BC150A02902EDD944A0C /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -538,6 +561,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -557,7 +581,6 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -568,6 +591,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -582,7 +606,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -594,6 +618,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -613,7 +638,6 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -624,6 +648,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -632,7 +657,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -650,7 +675,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = GXXRQJK434; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -673,7 +697,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = GXXRQJK434; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/src/serious_python/example/flask_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/serious_python/example/flask_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 87131a09..e3773d42 100644 --- a/src/serious_python/example/flask_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/src/serious_python/example/flask_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ diff --git a/src/serious_python/example/flask_example/ios/Runner/AppDelegate.swift b/src/serious_python/example/flask_example/ios/Runner/AppDelegate.swift index 70693e4a..c30b367e 100644 --- a/src/serious_python/example/flask_example/ios/Runner/AppDelegate.swift +++ b/src/serious_python/example/flask_example/ios/Runner/AppDelegate.swift @@ -1,13 +1,16 @@ -import UIKit import Flutter +import UIKit -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { +@main +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/src/serious_python/example/flask_example/ios/Runner/Info.plist b/src/serious_python/example/flask_example/ios/Runner/Info.plist index def0a416..68366381 100644 --- a/src/serious_python/example/flask_example/ios/Runner/Info.plist +++ b/src/serious_python/example/flask_example/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,29 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,11 +66,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - UIViewControllerBasedStatusBarAppearance - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - diff --git a/src/serious_python/example/flask_example/ios/Runner/SceneDelegate.swift b/src/serious_python/example/flask_example/ios/Runner/SceneDelegate.swift new file mode 100644 index 00000000..b9ce8ea2 --- /dev/null +++ b/src/serious_python/example/flask_example/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/src/serious_python/example/flask_example/linux/CMakeLists.txt b/src/serious_python/example/flask_example/linux/CMakeLists.txt index 22a68fe4..86c06dc3 100644 --- a/src/serious_python/example/flask_example/linux/CMakeLists.txt +++ b/src/serious_python/example/flask_example/linux/CMakeLists.txt @@ -1,5 +1,5 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change @@ -54,25 +54,8 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Define the application target. To change its name, change BINARY_NAME above, -# not the value here, or `flutter run` will no longer work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) @@ -123,6 +106,12 @@ foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) COMPONENT Runtime) endforeach(bundled_library) +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") diff --git a/src/serious_python/example/flask_example/linux/flutter/generated_plugins.cmake b/src/serious_python/example/flask_example/linux/flutter/generated_plugins.cmake index 6d77107e..ab50859e 100644 --- a/src/serious_python/example/flask_example/linux/flutter/generated_plugins.cmake +++ b/src/serious_python/example/flask_example/linux/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/src/serious_python/example/flask_example/linux/runner/CMakeLists.txt b/src/serious_python/example/flask_example/linux/runner/CMakeLists.txt new file mode 100644 index 00000000..e97dabc7 --- /dev/null +++ b/src/serious_python/example/flask_example/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/src/serious_python/example/flet_example/linux/main.cc b/src/serious_python/example/flask_example/linux/runner/main.cc similarity index 100% rename from src/serious_python/example/flet_example/linux/main.cc rename to src/serious_python/example/flask_example/linux/runner/main.cc diff --git a/src/serious_python/example/flask_example/linux/my_application.cc b/src/serious_python/example/flask_example/linux/runner/my_application.cc similarity index 59% rename from src/serious_python/example/flask_example/linux/my_application.cc rename to src/serious_python/example/flask_example/linux/runner/my_application.cc index b4b17d9d..8ae8a7a8 100644 --- a/src/serious_python/example/flask_example/linux/my_application.cc +++ b/src/serious_python/example/flask_example/linux/runner/my_application.cc @@ -14,6 +14,11 @@ struct _MyApplication { G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + // Implements GApplication::activate. static void my_application_activate(GApplication* application) { MyApplication* self = MY_APPLICATION(application); @@ -48,31 +53,44 @@ static void my_application_activate(GApplication* application) { } gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); gtk_widget_show(GTK_WIDGET(view)); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); gtk_widget_grab_focus(GTK_WIDGET(view)); } // Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { MyApplication* self = MY_APPLICATION(application); // Strip out the first argument as it is the binary name. self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); g_autoptr(GError) error = nullptr; if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; } g_application_activate(application); @@ -81,6 +99,24 @@ static gboolean my_application_local_command_line(GApplication* application, gch return TRUE; } +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + // Implements GObject::dispose. static void my_application_dispose(GObject* object) { MyApplication* self = MY_APPLICATION(object); @@ -90,15 +126,23 @@ static void my_application_dispose(GObject* object) { static void my_application_class_init(MyApplicationClass* klass) { G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; G_OBJECT_CLASS(klass)->dispose = my_application_dispose; } static void my_application_init(MyApplication* self) {} MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); } diff --git a/src/serious_python/example/run_example/linux/my_application.h b/src/serious_python/example/flask_example/linux/runner/my_application.h similarity index 70% rename from src/serious_python/example/run_example/linux/my_application.h rename to src/serious_python/example/flask_example/linux/runner/my_application.h index 72271d5e..db16367a 100644 --- a/src/serious_python/example/run_example/linux/my_application.h +++ b/src/serious_python/example/flask_example/linux/runner/my_application.h @@ -3,7 +3,10 @@ #include -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, GtkApplication) /** diff --git a/src/serious_python/example/flask_example/macos/Flutter/GeneratedPluginRegistrant.swift b/src/serious_python/example/flask_example/macos/Flutter/GeneratedPluginRegistrant.swift index 6bcae484..7ef3a6c2 100644 --- a/src/serious_python/example/flask_example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/src/serious_python/example/flask_example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,10 +5,8 @@ import FlutterMacOS import Foundation -import path_provider_foundation import serious_python_darwin func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SeriousPythonPlugin.register(with: registry.registrar(forPlugin: "SeriousPythonPlugin")) } diff --git a/src/serious_python/example/flask_example/macos/Podfile.lock b/src/serious_python/example/flask_example/macos/Podfile.lock index 29066625..f59e9b47 100644 --- a/src/serious_python/example/flask_example/macos/Podfile.lock +++ b/src/serious_python/example/flask_example/macos/Podfile.lock @@ -1,35 +1,22 @@ PODS: - FlutterMacOS (1.0.0) - - package_info_plus (0.0.1): - - FlutterMacOS - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - serious_python_darwin (0.7.0): + - serious_python_darwin (2.0.0): - Flutter - FlutterMacOS DEPENDENCIES: - FlutterMacOS (from `Flutter/ephemeral`) - - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) - - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - serious_python_darwin (from `Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin`) EXTERNAL SOURCES: FlutterMacOS: :path: Flutter/ephemeral - package_info_plus: - :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos - path_provider_foundation: - :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin serious_python_darwin: :path: Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin SPEC CHECKSUMS: - FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce - path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 - serious_python_darwin: 0a8c46a529057f91064a327d9c4037e773eef339 + FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 + serious_python_darwin: 6d58c9837595683a71e20114bdd4607568c98e84 PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3 diff --git a/src/serious_python/example/flask_example/macos/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/flask_example/macos/Runner.xcodeproj/project.pbxproj index b29d7a56..17081519 100644 --- a/src/serious_python/example/flask_example/macos/Runner.xcodeproj/project.pbxproj +++ b/src/serious_python/example/flask_example/macos/Runner.xcodeproj/project.pbxproj @@ -21,14 +21,14 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 0C6C8140227664C7C6331564 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C0B1620299264435604BE23 /* Pods_Runner.framework */; }; 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 70DD4839623CB676776399F3 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 548A240DA134EA4087E0F195 /* Pods_RunnerTests.framework */; }; - DDFC9F9001D319D95A5CF60C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D812C755E14C4E5DB444838D /* Pods_Runner.framework */; }; + 627AC8E54BEE5230B268E008 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 02D97E7CDB56C74FAC1AC299 /* Pods_RunnerTests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -62,8 +62,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 2629974C32C79086ADA39ADC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 27097D4FAA1E921277A516D2 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 02D97E7CDB56C74FAC1AC299 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 092BCFF76F3EA9D6C33B9BB2 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 15ACF585AD2FC8DF2FD2524D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; @@ -80,14 +81,13 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 3A957693B9A4702AF65EC727 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - 548A240DA134EA4087E0F195 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 6E578E07C23DB3D3504885B2 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 5C0B1620299264435604BE23 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 5F8D84A5AD1A99A6D80D59CD /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 8495C9548FCC5F61A98535B3 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - D6193355C1ED786CF0CB5585 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - D812C755E14C4E5DB444838D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C47413595F7C13CAA683D0EE /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + CC1D86819F853AC4B987884B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + D37D6C2FF36414D977C848FA /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -95,7 +95,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 70DD4839623CB676776399F3 /* Pods_RunnerTests.framework in Frameworks */, + 627AC8E54BEE5230B268E008 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -103,7 +103,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DDFC9F9001D319D95A5CF60C /* Pods_Runner.framework in Frameworks */, + 0C6C8140227664C7C6331564 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -137,7 +137,7 @@ 331C80D6294CF71000263BE5 /* RunnerTests */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - CF3A62181C2613D4F67718E4 /* Pods */, + 6548A3E8A66FDC482E03923B /* Pods */, ); sourceTree = ""; }; @@ -185,15 +185,15 @@ path = Runner; sourceTree = ""; }; - CF3A62181C2613D4F67718E4 /* Pods */ = { + 6548A3E8A66FDC482E03923B /* Pods */ = { isa = PBXGroup; children = ( - 2629974C32C79086ADA39ADC /* Pods-Runner.debug.xcconfig */, - 8495C9548FCC5F61A98535B3 /* Pods-Runner.release.xcconfig */, - D6193355C1ED786CF0CB5585 /* Pods-Runner.profile.xcconfig */, - 3A957693B9A4702AF65EC727 /* Pods-RunnerTests.debug.xcconfig */, - 6E578E07C23DB3D3504885B2 /* Pods-RunnerTests.release.xcconfig */, - 27097D4FAA1E921277A516D2 /* Pods-RunnerTests.profile.xcconfig */, + 15ACF585AD2FC8DF2FD2524D /* Pods-Runner.debug.xcconfig */, + CC1D86819F853AC4B987884B /* Pods-Runner.release.xcconfig */, + 5F8D84A5AD1A99A6D80D59CD /* Pods-Runner.profile.xcconfig */, + 092BCFF76F3EA9D6C33B9BB2 /* Pods-RunnerTests.debug.xcconfig */, + C47413595F7C13CAA683D0EE /* Pods-RunnerTests.release.xcconfig */, + D37D6C2FF36414D977C848FA /* Pods-RunnerTests.profile.xcconfig */, ); name = Pods; path = Pods; @@ -202,8 +202,8 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - D812C755E14C4E5DB444838D /* Pods_Runner.framework */, - 548A240DA134EA4087E0F195 /* Pods_RunnerTests.framework */, + 5C0B1620299264435604BE23 /* Pods_Runner.framework */, + 02D97E7CDB56C74FAC1AC299 /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -215,7 +215,7 @@ isa = PBXNativeTarget; buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 1814E9C1CD1BD4E59951D766 /* [CP] Check Pods Manifest.lock */, + A85DD80B1E9EE5F3FDA4D4B9 /* [CP] Check Pods Manifest.lock */, 331C80D1294CF70F00263BE5 /* Sources */, 331C80D2294CF70F00263BE5 /* Frameworks */, 331C80D3294CF70F00263BE5 /* Resources */, @@ -234,13 +234,14 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 88C1B0D60BC70E03B6C3518B /* [CP] Check Pods Manifest.lock */, + AF73544ED7B87AF7913AF777 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 590DD7A4F3044A9A023D543F /* [CP] Embed Pods Frameworks */, + 8A958FB37A5E066386C02E70 /* [CP] Embed Pods Frameworks */, + 7F7330796DDC77B192CD6870 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -258,8 +259,9 @@ 33CC10E52044A3C60003C045 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C80D4294CF70F00263BE5 = { @@ -322,67 +324,62 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1814E9C1CD1BD4E59951D766 /* [CP] Check Pods Manifest.lock */ = { + 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", ); - name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; }; - 3399D490228B24CF009A79C7 /* ShellScript */ = { + 33CC111E2044C6BF0003C045 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, ); inputPaths = ( + Flutter/ephemeral/tripwire, ); outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { + 7F7330796DDC77B192CD6870 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, - ); - inputPaths = ( - Flutter/ephemeral/tripwire, + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", ); + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, - ); - outputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; }; - 590DD7A4F3044A9A023D543F /* [CP] Embed Pods Frameworks */ = { + 8A958FB37A5E066386C02E70 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -399,7 +396,29 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 88C1B0D60BC70E03B6C3518B /* [CP] Check Pods Manifest.lock */ = { + A85DD80B1E9EE5F3FDA4D4B9 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + AF73544ED7B87AF7913AF777 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -472,7 +491,7 @@ /* Begin XCBuildConfiguration section */ 331C80DB294CF71000263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3A957693B9A4702AF65EC727 /* Pods-RunnerTests.debug.xcconfig */; + baseConfigurationReference = 092BCFF76F3EA9D6C33B9BB2 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -487,7 +506,7 @@ }; 331C80DC294CF71000263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6E578E07C23DB3D3504885B2 /* Pods-RunnerTests.release.xcconfig */; + baseConfigurationReference = C47413595F7C13CAA683D0EE /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -502,7 +521,7 @@ }; 331C80DD294CF71000263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 27097D4FAA1E921277A516D2 /* Pods-RunnerTests.profile.xcconfig */; + baseConfigurationReference = D37D6C2FF36414D977C848FA /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -520,6 +539,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -543,9 +563,11 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -593,6 +615,7 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -616,9 +639,11 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -646,6 +671,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -669,9 +695,11 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/src/serious_python/example/flask_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/serious_python/example/flask_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 3484ffe7..3d3f6b6c 100644 --- a/src/serious_python/example/flask_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/src/serious_python/example/flask_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ diff --git a/src/serious_python/example/flask_example/macos/Runner/AppDelegate.swift b/src/serious_python/example/flask_example/macos/Runner/AppDelegate.swift index d53ef643..b3c17614 100644 --- a/src/serious_python/example/flask_example/macos/Runner/AppDelegate.swift +++ b/src/serious_python/example/flask_example/macos/Runner/AppDelegate.swift @@ -1,9 +1,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/src/serious_python/example/flask_example/macos/Runner/Configs/AppInfo.xcconfig b/src/serious_python/example/flask_example/macos/Runner/Configs/AppInfo.xcconfig index 053430ce..3789df97 100644 --- a/src/serious_python/example/flask_example/macos/Runner/Configs/AppInfo.xcconfig +++ b/src/serious_python/example/flask_example/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = flask_example PRODUCT_BUNDLE_IDENTIFIER = com.example.flaskExample // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2026 com.example. All rights reserved. diff --git a/src/serious_python/example/flask_example/macos/RunnerTests/RunnerTests.swift b/src/serious_python/example/flask_example/macos/RunnerTests/RunnerTests.swift index 5418c9f5..61f3bd1f 100644 --- a/src/serious_python/example/flask_example/macos/RunnerTests/RunnerTests.swift +++ b/src/serious_python/example/flask_example/macos/RunnerTests/RunnerTests.swift @@ -1,5 +1,5 @@ -import FlutterMacOS import Cocoa +import FlutterMacOS import XCTest class RunnerTests: XCTestCase { diff --git a/src/serious_python/example/flask_example/pubspec.lock b/src/serious_python/example/flask_example/pubspec.lock index 00d534ce..4c0ed4d0 100644 --- a/src/serious_python/example/flask_example/pubspec.lock +++ b/src/serious_python/example/flask_example/pubspec.lock @@ -5,26 +5,26 @@ packages: dependency: transitive description: name: archive - sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff url: "https://pub.dev" source: hosted - version: "4.0.7" + version: "4.0.9" args: dependency: transitive description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.7.0" async: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.1" boolean_selector: dependency: transitive description: @@ -49,6 +49,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 + url: "https://pub.dev" + source: hosted + version: "1.2.1" collection: dependency: transitive description: @@ -61,18 +69,18 @@ packages: dependency: transitive description: name: crypto - sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.7" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" url: "https://pub.dev" source: hosted - version: "1.0.8" + version: "1.0.9" fake_async: dependency: transitive description: @@ -85,10 +93,10 @@ packages: dependency: transitive description: name: ffi - sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.2.0" file: dependency: transitive description: @@ -123,22 +131,46 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" + hooks: + dependency: transitive + description: + name: hooks + sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" + url: "https://pub.dev" + source: hosted + version: "2.0.2" http: dependency: "direct main" description: name: http - sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.6.0" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + jni: + dependency: transitive + description: + name: jni + sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "1.0.0" + jni_flutter: + dependency: transitive + description: + name: jni_flutter + sha256: "8b59e590786050b1cd866677dddaf76b1ade5e7bc751abe04b86e84d379d3ba6" + url: "https://pub.dev" + source: hosted + version: "1.0.1" leak_tracker: dependency: transitive description: @@ -171,6 +203,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" matcher: dependency: transitive description: @@ -191,10 +231,26 @@ packages: dependency: transitive description: name: meta - sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" + url: "https://pub.dev" + source: hosted + version: "1.18.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "6cb691c686fa2838c6deb34980d426145c2a5d537491cb83d463c33cdbc726ed" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "9.4.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" path: dependency: transitive description: @@ -207,26 +263,26 @@ packages: dependency: transitive description: name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" + sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd" url: "https://pub.dev" source: hosted - version: "2.2.10" + version: "2.3.1" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.6.0" path_provider_linux: dependency: transitive description: @@ -255,18 +311,18 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.1.0" platform: dependency: transitive description: name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.5" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -279,60 +335,76 @@ packages: dependency: transitive description: name: posix - sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07" + url: "https://pub.dev" + source: hosted + version: "6.5.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + record_use: + dependency: transitive + description: + name: record_use + sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed" url: "https://pub.dev" source: hosted - version: "6.0.3" + version: "0.6.0" serious_python: dependency: "direct main" description: path: "../.." relative: true source: path - version: "1.0.1" + version: "3.0.0" serious_python_android: dependency: transitive description: path: "../../../serious_python_android" relative: true source: path - version: "1.0.1" + version: "3.0.0" serious_python_darwin: dependency: transitive description: path: "../../../serious_python_darwin" relative: true source: path - version: "1.0.1" + version: "3.0.0" serious_python_linux: dependency: transitive description: path: "../../../serious_python_linux" relative: true source: path - version: "1.0.1" + version: "3.0.0" serious_python_platform_interface: dependency: transitive description: path: "../../../serious_python_platform_interface" relative: true source: path - version: "1.0.1" + version: "3.0.0" serious_python_windows: dependency: transitive description: path: "../../../serious_python_windows" relative: true source: path - version: "1.0.1" + version: "3.0.0" shelf: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" sky_engine: dependency: transitive description: flutter @@ -342,10 +414,10 @@ packages: dependency: transitive description: name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.10.2" stack_trace: dependency: transitive description: @@ -382,10 +454,10 @@ packages: dependency: transitive description: name: test_api - sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.10" + version: "0.7.11" toml: dependency: transitive description: @@ -398,10 +470,10 @@ packages: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" vector_math: dependency: transitive description: @@ -414,26 +486,34 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360" url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.2.0" web: dependency: transitive description: name: web - sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "3.1.3" sdks: - dart: ">=3.9.0-0 <4.0.0" - flutter: ">=3.22.0" + dart: ">=3.10.3 <4.0.0" + flutter: ">=3.38.4" diff --git a/src/serious_python/example/flask_example/windows/CMakeLists.txt b/src/serious_python/example/flask_example/windows/CMakeLists.txt index aee3d683..dbc5f258 100644 --- a/src/serious_python/example/flask_example/windows/CMakeLists.txt +++ b/src/serious_python/example/flask_example/windows/CMakeLists.txt @@ -87,6 +87,12 @@ if(PLUGIN_BUNDLED_LIBRARIES) COMPONENT Runtime) endif() +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") diff --git a/src/serious_python/example/flask_example/windows/flutter/CMakeLists.txt b/src/serious_python/example/flask_example/windows/flutter/CMakeLists.txt index 930d2071..903f4899 100644 --- a/src/serious_python/example/flask_example/windows/flutter/CMakeLists.txt +++ b/src/serious_python/example/flask_example/windows/flutter/CMakeLists.txt @@ -10,6 +10,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake) # https://github.com/flutter/flutter/issues/57146. set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + # === Flutter Library === set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") @@ -92,7 +97,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - windows-x64 $ + ${FLUTTER_TARGET_PLATFORM} $ VERBATIM ) add_custom_target(flutter_assemble DEPENDS diff --git a/src/serious_python/example/flask_example/windows/flutter/generated_plugins.cmake b/src/serious_python/example/flask_example/windows/flutter/generated_plugins.cmake index 159536d6..f2f58d64 100644 --- a/src/serious_python/example/flask_example/windows/flutter/generated_plugins.cmake +++ b/src/serious_python/example/flask_example/windows/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/src/serious_python/example/flask_example/windows/runner/Runner.rc b/src/serious_python/example/flask_example/windows/runner/Runner.rc index f1bd5e34..e85dd602 100644 --- a/src/serious_python/example/flask_example/windows/runner/Runner.rc +++ b/src/serious_python/example/flask_example/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "flask_example" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "flask_example" "\0" - VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "flask_example.exe" "\0" VALUE "ProductName", "flask_example" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/src/serious_python/example/flask_example/windows/runner/runner.exe.manifest b/src/serious_python/example/flask_example/windows/runner/runner.exe.manifest index a42ea768..153653e8 100644 --- a/src/serious_python/example/flask_example/windows/runner/runner.exe.manifest +++ b/src/serious_python/example/flask_example/windows/runner/runner.exe.manifest @@ -9,12 +9,6 @@ - - - - - - diff --git a/src/serious_python/example/flask_example/windows/runner/utils.cpp b/src/serious_python/example/flask_example/windows/runner/utils.cpp index b2b08734..3a0b4651 100644 --- a/src/serious_python/example/flask_example/windows/runner/utils.cpp +++ b/src/serious_python/example/flask_example/windows/runner/utils.cpp @@ -45,13 +45,13 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } - int target_length = ::WideCharToMultiByte( + unsigned int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, nullptr, 0, nullptr, nullptr) -1; // remove the trailing null character int input_length = (int)wcslen(utf16_string); std::string utf8_string; - if (target_length <= 0 || target_length > utf8_string.max_size()) { + if (target_length == 0 || target_length > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length); diff --git a/src/serious_python/example/flet_example/.metadata b/src/serious_python/example/flet_example/.metadata index c7222470..cf4b47a9 100644 --- a/src/serious_python/example/flet_example/.metadata +++ b/src/serious_python/example/flet_example/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3" + revision: "c9a6c484230f8b5e408ec57be1ef71dee1e77020" channel: "stable" project_type: app @@ -13,11 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 - base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 - platform: android - create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 - base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: ios + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: linux + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: macos + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: web + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + - platform: windows + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 # User provided section diff --git a/src/serious_python/example/flet_example/README.md b/src/serious_python/example/flet_example/README.md index e4f079cd..18adcce8 100644 --- a/src/serious_python/example/flet_example/README.md +++ b/src/serious_python/example/flet_example/README.md @@ -1,75 +1,45 @@ # flet_example -Before running the app run the following command to package Python app to an asset. - -For Android: - -``` -export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages -dart run serious_python:main package app/src -p Android --requirements -r,app/src/requirements.txt -``` - -For iOS: - -``` -export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages -dart run serious_python:main package app/src -p iOS --requirements -r,app/src/requirements.txt -``` +A Flet counter app running on `serious_python`'s in-process +`dart_bridge` FFI transport. The Dart side constructs a `PythonBridge` +and hands a custom `FletBackendChannel` to `FletApp` via the +`channelBuilder` parameter; the Python side picks up +`FLET_DART_BRIDGE_PORT` from the environment and `flet.app.run_async()` +selects `FletDartBridgeServer` instead of the legacy +`FletSocketServer`. + +The `flet` Dart package itself stays Python-independent — the +PythonBridge wiring lives entirely in this example. + +## Building + +The Python `flet` package needs the `dart-bridge` branch (because +`FletDartBridgeServer` isn't on PyPI yet), so the `--requirements` arg +installs from git. Mobile targets use `pip install --only-binary :all:` +which would normally reject a git source — the +`SERIOUS_PYTHON_ALLOW_SOURCE_DISTRIBUTIONS=flet` env var opts `flet` +specifically into source installs by injecting `--no-binary flet`. For macOS: ``` -dart run serious_python:main package app/src -p Darwin --requirements -r,app/src/requirements.txt -``` - -For Windows: - -``` -dart run serious_python:main package app/src -p Windows --requirements -r,app/src/requirements.txt -``` - -For Linux: - -``` -dart run serious_python:main package app/src -p Linux --requirements -r,app/src/requirements.txt +export SERIOUS_PYTHON_ALLOW_SOURCE_DISTRIBUTIONS=flet +dart run serious_python:main package app/src \ + --platform Darwin \ + --requirements "flet @ git+https://github.com/flet-dev/flet.git@dart-bridge#subdirectory=sdk/python/packages/flet" ``` -For web: - -``` -dart run serious_python:main package app/src -p Emscripten --requirements -r,app/src/requirements.txt -``` +Replace `--platform Darwin` with `iOS`, `Android`, `Windows`, or `Linux` +as needed. The same `--requirements` works on every platform. -Important: to make `serious_python` work in your own Android app: +## Running locally -If you build an App Bundle Edit `android/gradle.properties` and add the flag: +`sync_site_packages.sh` (in `serious_python_darwin`) requires +`SERIOUS_PYTHON_SITE_PACKAGES` pointing at the freshly-packaged +`build/site-packages/` directory so the .app bundle picks up the +git-installed flet instead of a stale copy from a previous run: ``` -android.bundle.enableUncompressedNativeLibs=false -``` - - -If you build an APK Make sure `android/app/src/AndroidManifest.xml` has `android:extractNativeLibs="true"` in the `` tag. - -For more information, see the [public issue](https://issuetracker.google.com/issues/147096055). - -Add the following to `android/app/build.gradle`: - +export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +fvm flutter test integration_test --device-id macos ``` -android { - ndkVersion "25.1.8937393" - - packagingOptions { - jniLibs { - useLegacyPackaging true - } - } - - packagingOptions { - doNotStrip "*/arm64-v8a/libpython*.so" - doNotStrip "*/armeabi-v7a/libpython*.so" - doNotStrip "*/x86/libpython*.so" - doNotStrip "*/x86_64/libpython*.so" - } -} -``` \ No newline at end of file diff --git a/src/serious_python/example/flet_example/android/.gitignore b/src/serious_python/example/flet_example/android/.gitignore index 5fed52d9..be3943c9 100644 --- a/src/serious_python/example/flet_example/android/.gitignore +++ b/src/serious_python/example/flet_example/android/.gitignore @@ -5,7 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java -**/.cxx/ +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/to/reference-keystore diff --git a/src/serious_python/example/flet_example/android/app/build.gradle b/src/serious_python/example/flet_example/android/app/build.gradle.kts similarity index 64% rename from src/serious_python/example/flet_example/android/app/build.gradle rename to src/serious_python/example/flet_example/android/app/build.gradle.kts index 852bab06..0a526eb6 100644 --- a/src/serious_python/example/flet_example/android/app/build.gradle +++ b/src/serious_python/example/flet_example/android/app/build.gradle.kts @@ -1,8 +1,10 @@ plugins { - id "com.android.application" - id "kotlin-android" - // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. - id "dev.flutter.flutter-gradle-plugin" + id("com.android.application") + // Kotlin is provided by the Flutter Gradle Plugin (Built-in Kotlin) at the + // version declared in settings.gradle.kts, so the app no longer applies the + // Kotlin Gradle Plugin itself. + // The Flutter Gradle Plugin must be applied after the Android Gradle plugin. + id("dev.flutter.flutter-gradle-plugin") } android { @@ -11,12 +13,8 @@ android { ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } defaultConfig { @@ -34,11 +32,17 @@ android { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig = signingConfigs.debug + signingConfig = signingConfigs.getByName("debug") } } } +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + flutter { source = "../.." } diff --git a/src/serious_python/example/flet_example/android/app/src/main/AndroidManifest.xml b/src/serious_python/example/flet_example/android/app/src/main/AndroidManifest.xml index 8f81c74b..3b5c35fb 100644 --- a/src/serious_python/example/flet_example/android/app/src/main/AndroidManifest.xml +++ b/src/serious_python/example/flet_example/android/app/src/main/AndroidManifest.xml @@ -2,7 +2,8 @@ + android:icon="@mipmap/ic_launcher" + android:extractNativeLibs="true"> ("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/src/serious_python/example/flet_example/android/gradle.properties b/src/serious_python/example/flet_example/android/gradle.properties index 25971708..fbee1d8c 100644 --- a/src/serious_python/example/flet_example/android/gradle.properties +++ b/src/serious_python/example/flet_example/android/gradle.properties @@ -1,3 +1,2 @@ -org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true diff --git a/src/serious_python/example/flet_example/android/gradle/wrapper/gradle-wrapper.properties b/src/serious_python/example/flet_example/android/gradle/wrapper/gradle-wrapper.properties index 7bb2df6b..e4ef43fb 100644 --- a/src/serious_python/example/flet_example/android/gradle/wrapper/gradle-wrapper.properties +++ b/src/serious_python/example/flet_example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/src/serious_python/example/flet_example/android/settings.gradle b/src/serious_python/example/flet_example/android/settings.gradle deleted file mode 100644 index b9e43bd3..00000000 --- a/src/serious_python/example/flet_example/android/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - }() - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false -} - -include ":app" diff --git a/src/serious_python/example/flet_example/android/settings.gradle.kts b/src/serious_python/example/flet_example/android/settings.gradle.kts new file mode 100644 index 00000000..24f70299 --- /dev/null +++ b/src/serious_python/example/flet_example/android/settings.gradle.kts @@ -0,0 +1,29 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + // KGP 2.3.21 required: Flet's transitive screen_brightness_android ships a + // Kotlin 2.3.x stdlib whose metadata can't be read by KGP < 2.3 (the 3.44.2 + // template default is 2.2.20). + id("org.jetbrains.kotlin.android") version "2.3.21" apply false +} + +include(":app") diff --git a/src/serious_python/example/flet_example/app/app.zip.hash b/src/serious_python/example/flet_example/app/app.zip.hash index 4ef49a27..e5d849b8 100644 --- a/src/serious_python/example/flet_example/app/app.zip.hash +++ b/src/serious_python/example/flet_example/app/app.zip.hash @@ -1 +1 @@ -c70dd39b2f894beb08c977300587fe6938c3a02649598f13b80d68d998d9cc07 \ No newline at end of file +b92d604f99e8c64859bd16e28c24a0b25eefdcdcb35ba99a08201d614a03772a \ No newline at end of file diff --git a/src/serious_python/example/flet_example/app/src/main.py b/src/serious_python/example/flet_example/app/src/main.py index 2d4eec94..05c566f1 100644 --- a/src/serious_python/example/flet_example/app/src/main.py +++ b/src/serious_python/example/flet_example/app/src/main.py @@ -1,10 +1,9 @@ -import logging import os import sys import urllib.request import flet as ft -from flet.version import version +from flet.version import flet_version # logging.basicConfig(level=logging.DEBUG) @@ -49,18 +48,16 @@ def check_ssl(e): page.add( ft.Row( [ - ft.IconButton( - ft.Icons.REMOVE, key="test:decrement", on_click=minus_click - ), + ft.IconButton(ft.Icons.REMOVE, key="decrement", on_click=minus_click), txt_number, - ft.IconButton(ft.Icons.ADD, key="test:increment", on_click=plus_click), + ft.IconButton(ft.Icons.ADD, key="increment", on_click=plus_click), ], alignment=ft.MainAxisAlignment.CENTER, expand=True, ), ft.Row( [ - ft.Text(f"Flet version: {version}"), + ft.Text(f"Flet version: {flet_version}"), ft.OutlinedButton("Check SSL", on_click=check_ssl), ft.OutlinedButton("Exit app", on_click=lambda _: sys.exit(100)), ], @@ -76,4 +73,4 @@ def check_ssl(e): if __name__ == "__main__": - ft.app(main) + ft.run(main) diff --git a/src/serious_python/example/flet_example/app/src/main_async.py b/src/serious_python/example/flet_example/app/src/main_async.py deleted file mode 100644 index 38f363de..00000000 --- a/src/serious_python/example/flet_example/app/src/main_async.py +++ /dev/null @@ -1,36 +0,0 @@ -import logging - -import flet as ft - -logging.basicConfig(level=logging.DEBUG) - - -async def main(page: ft.Page): - page.title = "Flet counter example" - page.vertical_alignment = ft.MainAxisAlignment.CENTER - - txt_number = ft.TextField(value="0", text_align=ft.TextAlign.RIGHT, width=100) - - async def minus_click(e): - txt_number.value = str(int(txt_number.value) - 1) - await page.update_async() - - async def plus_click(e): - txt_number.value = str(int(txt_number.value) + 1) - await page.update_async() - - await page.add_async( - ft.Row( - [ - ft.IconButton( - ft.Icons.REMOVE, key="test:decrement", on_click=minus_click - ), - txt_number, - ft.IconButton(ft.Icons.ADD, key="test:increment", on_click=plus_click), - ], - alignment=ft.MainAxisAlignment.CENTER, - ) - ) - - -ft.app(main) diff --git a/src/serious_python/example/flet_example/integration_test/app_test.dart b/src/serious_python/example/flet_example/integration_test/app_test.dart index 254a6c73..10b5574c 100644 --- a/src/serious_python/example/flet_example/integration_test/app_test.dart +++ b/src/serious_python/example/flet_example/integration_test/app_test.dart @@ -1,5 +1,5 @@ import 'package:flet_example/main.dart' as app; -import 'package:flutter/foundation.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; @@ -26,15 +26,13 @@ void main() { expect(counterFound, isTrue); // Tap increment button - final incrementButton = find.byKey(const Key('increment')); - await tester.tap(incrementButton); + await tester.tap(find.byKey(const Key('increment'))); await tester.pumpAndSettle(); expect(find.text('1'), findsOneWidget); // Tap decrement button - final decrementButton = find.byKey(const Key('decrement')); - await tester.tap(decrementButton); - await tester.tap(decrementButton); + await tester.tap(find.byKey(const Key('decrement'))); + await tester.tap(find.byKey(const Key('decrement'))); await tester.pumpAndSettle(); expect(find.text('-1'), findsOneWidget); diff --git a/src/serious_python/example/flet_example/ios/Flutter/AppFrameworkInfo.plist b/src/serious_python/example/flet_example/ios/Flutter/AppFrameworkInfo.plist index 7c569640..391a902b 100644 --- a/src/serious_python/example/flet_example/ios/Flutter/AppFrameworkInfo.plist +++ b/src/serious_python/example/flet_example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/src/serious_python/example/flet_example/ios/Podfile b/src/serious_python/example/flet_example/ios/Podfile index 164df534..e51a31d9 100644 --- a/src/serious_python/example/flet_example/ios/Podfile +++ b/src/serious_python/example/flet_example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '12.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/src/serious_python/example/flet_example/ios/Podfile.lock b/src/serious_python/example/flet_example/ios/Podfile.lock deleted file mode 100644 index a6e90d98..00000000 --- a/src/serious_python/example/flet_example/ios/Podfile.lock +++ /dev/null @@ -1,114 +0,0 @@ -PODS: - - DKImagePickerController/Core (4.3.4): - - DKImagePickerController/ImageDataManager - - DKImagePickerController/Resource - - DKImagePickerController/ImageDataManager (4.3.4) - - DKImagePickerController/PhotoGallery (4.3.4): - - DKImagePickerController/Core - - DKPhotoGallery - - DKImagePickerController/Resource (4.3.4) - - DKPhotoGallery (0.0.17): - - DKPhotoGallery/Core (= 0.0.17) - - DKPhotoGallery/Model (= 0.0.17) - - DKPhotoGallery/Preview (= 0.0.17) - - DKPhotoGallery/Resource (= 0.0.17) - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Core (0.0.17): - - DKPhotoGallery/Model - - DKPhotoGallery/Preview - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Model (0.0.17): - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Preview (0.0.17): - - DKPhotoGallery/Model - - DKPhotoGallery/Resource - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Resource (0.0.17): - - SDWebImage - - SwiftyGif - - file_picker (0.0.1): - - DKImagePickerController/PhotoGallery - - Flutter - - Flutter (1.0.0) - - integration_test (0.0.1): - - Flutter - - package_info_plus (0.4.5): - - Flutter - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - SDWebImage (5.18.5): - - SDWebImage/Core (= 5.18.5) - - SDWebImage/Core (5.18.5) - - sensors_plus (0.0.1): - - Flutter - - serious_python_darwin (0.8.0): - - Flutter - - FlutterMacOS - - shared_preferences_foundation (0.0.1): - - Flutter - - FlutterMacOS - - SwiftyGif (5.4.4) - - url_launcher_ios (0.0.1): - - Flutter - -DEPENDENCIES: - - file_picker (from `.symlinks/plugins/file_picker/ios`) - - Flutter (from `Flutter`) - - integration_test (from `.symlinks/plugins/integration_test/ios`) - - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - - sensors_plus (from `.symlinks/plugins/sensors_plus/ios`) - - serious_python_darwin (from `.symlinks/plugins/serious_python_darwin/darwin`) - - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - -SPEC REPOS: - trunk: - - DKImagePickerController - - DKPhotoGallery - - SDWebImage - - SwiftyGif - -EXTERNAL SOURCES: - file_picker: - :path: ".symlinks/plugins/file_picker/ios" - Flutter: - :path: Flutter - integration_test: - :path: ".symlinks/plugins/integration_test/ios" - package_info_plus: - :path: ".symlinks/plugins/package_info_plus/ios" - path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/darwin" - sensors_plus: - :path: ".symlinks/plugins/sensors_plus/ios" - serious_python_darwin: - :path: ".symlinks/plugins/serious_python_darwin/darwin" - shared_preferences_foundation: - :path: ".symlinks/plugins/shared_preferences_foundation/darwin" - url_launcher_ios: - :path: ".symlinks/plugins/url_launcher_ios/ios" - -SPEC CHECKSUMS: - DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac - DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 - file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655 - Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573 - package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c - path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 - SDWebImage: 7ac2b7ddc5e8484c79aa90fc4e30b149d6a2c88f - sensors_plus: 42b9de1b8237675fa8d8121e4bb93be0f79fa61d - serious_python_darwin: 351e50099cb9e34f344f75af29b1d36d3c0922f2 - shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 - SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f - url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe - -PODFILE CHECKSUM: 7be2f5f74864d463a8ad433546ed1de7e0f29aef - -COCOAPODS: 1.14.3 diff --git a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.pbxproj index 92eb9c48..c2fd4bea 100644 --- a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.pbxproj +++ b/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.pbxproj @@ -8,11 +8,10 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2405649350EFCEC25599DE23 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0D7377221887A37973A9920 /* Pods_RunnerTests.framework */; }; - 2CA3C271D8189DF194697D7D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28A203680D8105B35D530F31 /* Pods_Runner.framework */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -42,20 +41,15 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 042C49DB469F256AAA571996 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 1EE1648DA1E83A0AA44BC13A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 28A203680D8105B35D530F31 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 563D6173166309C998296F04 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 5FA1FBC3AE8269E16AA97AD1 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 8273B2F287E69909A7E30065 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -63,8 +57,6 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BC9388593FAE3C4B3E8FDE91 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - D0D7377221887A37973A9920 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -72,30 +64,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2CA3C271D8189DF194697D7D /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B920DD79982F64FC739571F8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 2405649350EFCEC25599DE23 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 103F5AA3589F7D2F915BFF32 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 28A203680D8105B35D530F31 /* Pods_Runner.framework */, - D0D7377221887A37973A9920 /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 331C8082294A63A400263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( @@ -122,8 +96,6 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, - E36498D4F89A08F7B5C19AED /* Pods */, - 103F5AA3589F7D2F915BFF32 /* Frameworks */, ); sourceTree = ""; }; @@ -146,25 +118,12 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; - E36498D4F89A08F7B5C19AED /* Pods */ = { - isa = PBXGroup; - children = ( - 5FA1FBC3AE8269E16AA97AD1 /* Pods-Runner.debug.xcconfig */, - 563D6173166309C998296F04 /* Pods-Runner.release.xcconfig */, - 1EE1648DA1E83A0AA44BC13A /* Pods-Runner.profile.xcconfig */, - 8273B2F287E69909A7E30065 /* Pods-RunnerTests.debug.xcconfig */, - 042C49DB469F256AAA571996 /* Pods-RunnerTests.release.xcconfig */, - BC9388593FAE3C4B3E8FDE91 /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -172,10 +131,8 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 90579612B1A4EF4E391E0626 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, - B920DD79982F64FC739571F8 /* Frameworks */, ); buildRules = ( ); @@ -191,14 +148,12 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - C8A57305F206317D5468F600 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - AE52A9CBDBBC66A5CB483F7A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -215,6 +170,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { @@ -285,28 +241,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 90579612B1A4EF4E391E0626 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -322,45 +256,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - AE52A9CBDBBC66A5CB483F7A /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - C8A57305F206317D5468F600 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -378,6 +273,7 @@ files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -415,6 +311,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -444,6 +341,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -452,7 +350,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -468,7 +366,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = GXXRQJK434; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -485,7 +382,6 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8273B2F287E69909A7E30065 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -503,7 +399,6 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 042C49DB469F256AAA571996 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -519,7 +414,6 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BC9388593FAE3C4B3E8FDE91 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -537,6 +431,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -566,6 +461,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -580,7 +476,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -592,6 +488,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -621,6 +518,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -629,7 +527,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -647,7 +545,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = GXXRQJK434; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -670,7 +567,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = GXXRQJK434; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/serious_python/example/flet_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5df..e3773d42 100644 --- a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/src/serious_python/example/flet_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/src/serious_python/example/flet_example/ios/Runner.xcworkspace/contents.xcworkspacedata b/src/serious_python/example/flet_example/ios/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc14..1d526a16 100644 --- a/src/serious_python/example/flet_example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/src/serious_python/example/flet_example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - diff --git a/src/serious_python/example/flet_example/ios/Runner/AppDelegate.swift b/src/serious_python/example/flet_example/ios/Runner/AppDelegate.swift index b6363034..c30b367e 100644 --- a/src/serious_python/example/flet_example/ios/Runner/AppDelegate.swift +++ b/src/serious_python/example/flet_example/ios/Runner/AppDelegate.swift @@ -1,13 +1,16 @@ -import UIKit import Flutter +import UIKit @main -@objc class AppDelegate: FlutterAppDelegate { +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/src/serious_python/example/flet_example/ios/Runner/Info.plist b/src/serious_python/example/flet_example/ios/Runner/Info.plist index f536cf65..38b2b3d5 100644 --- a/src/serious_python/example/flet_example/ios/Runner/Info.plist +++ b/src/serious_python/example/flet_example/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,29 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,11 +66,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - UIViewControllerBasedStatusBarAppearance - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - diff --git a/src/serious_python/example/flet_example/ios/Runner/SceneDelegate.swift b/src/serious_python/example/flet_example/ios/Runner/SceneDelegate.swift new file mode 100644 index 00000000..b9ce8ea2 --- /dev/null +++ b/src/serious_python/example/flet_example/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/src/serious_python/example/flet_example/lib/main.dart b/src/serious_python/example/flet_example/lib/main.dart index 547bfe22..fe0920df 100644 --- a/src/serious_python/example/flet_example/lib/main.dart +++ b/src/serious_python/example/flet_example/lib/main.dart @@ -1,78 +1,88 @@ import 'dart:async'; -import 'dart:io'; import 'package:flet/flet.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_web_plugins/url_strategy.dart'; +import 'package:msgpack_dart/msgpack_dart.dart' as msgpack; import 'package:package_info_plus/package_info_plus.dart'; import 'package:path/path.dart' as path; import 'package:path_provider/path_provider.dart' as path_provider; +import 'package:serious_python/bridge.dart'; import 'package:serious_python/serious_python.dart'; -import 'package:url_strategy/url_strategy.dart'; const bool isProduction = bool.fromEnvironment('dart.vm.product'); const assetPath = "app/app.zip"; -const pythonModuleName = "main"; // {{ cookiecutter.python_module_name }} +const pythonModuleName = "main"; final hideLoadingPage = bool.tryParse("{{ cookiecutter.hide_loading_animation }}".toLowerCase()) ?? true; -const outLogFilename = "out.log"; const errorExitCode = 100; +/// The Python script is intentionally smaller than in `flet_example`. No +/// stdout-callback socket, no flet.sock — Python startup is just `runpy` +/// on the user module, and stdout/stderr stay attached to whatever the +/// embedded interpreter inherits. The dart_bridge transport in Flet 0.85+ +/// handles IPC directly. const pythonScript = """ -import certifi, os, runpy, socket, sys, traceback +import logging, os, runpy, sys, traceback + +# Redirect stdout/stderr to a file under FLET_APP_TEMP so we can inspect what +# Python is doing without a separate stdout-callback socket. Temporary — once +# the FFI transport is stable a more proper logging story can land. +_log_path = os.path.join( + os.environ.get("FLET_APP_TEMP", "/tmp"), "flet_boot.log" +) +_log = open(_log_path, "w", buffering=1) +sys.stdout = _log +sys.stderr = _log +logging.basicConfig(stream=_log, level=logging.DEBUG) +print(f"[boot] python {sys.version}", flush=True) +print(f"[boot] FLET_DART_BRIDGE_PORT={os.environ.get('FLET_DART_BRIDGE_PORT')}", flush=True) +print(f"[boot] FLET_PLATFORM={os.environ.get('FLET_PLATFORM')}", flush=True) -os.environ["REQUESTS_CA_BUNDLE"] = certifi.where() -os.environ["SSL_CERT_FILE"] = certifi.where() - -if os.getenv("FLET_PLATFORM") == "android": - import ssl - - def create_default_context( - purpose=ssl.Purpose.SERVER_AUTH, *, cafile=None, capath=None, cadata=None - ): - return ssl.create_default_context( - purpose=purpose, cafile=certifi.where(), capath=capath, cadata=cadata - ) - - ssl._create_default_https_context = create_default_context - -out_file = open("$outLogFilename", "w+", buffering=1) - -callback_socket_addr = os.environ.get("FLET_PYTHON_CALLBACK_SOCKET_ADDR") -if ":" in callback_socket_addr: - addr, port = callback_socket_addr.split(":") - callback_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - callback_socket.connect((addr, int(port))) -else: - callback_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - callback_socket.connect(callback_socket_addr) - -sys.stdout = sys.stderr = out_file - -def flet_exit(code=0): - callback_socket.sendall(str(code).encode()) - out_file.close() - callback_socket.close() - -sys.exit = flet_exit - -ex = None +try: + import certifi + os.environ["REQUESTS_CA_BUNDLE"] = certifi.where() + os.environ["SSL_CERT_FILE"] = certifi.where() + + if os.getenv("FLET_PLATFORM") == "android": + import ssl + + def create_default_context( + purpose=ssl.Purpose.SERVER_AUTH, *, + cafile=None, capath=None, cadata=None, + ): + return ssl.create_default_context( + purpose=purpose, + cafile=certifi.where(), + capath=capath, + cadata=cadata, + ) + + ssl._create_default_https_context = create_default_context +except ImportError as e: + print(f"[boot] certifi import failed: {e}", flush=True) + +print("[boot] about to runpy.run_module", flush=True) try: runpy.run_module("{module_name}", run_name="__main__") -except Exception as e: - ex = e - traceback.print_exception(e) - -sys.exit(0 if ex is None else $errorExitCode) + print("[boot] runpy.run_module returned", flush=True) +except SystemExit as e: + print(f"[boot] SystemExit: {e.code}", flush=True) + raise +except Exception: + print("[boot] runpy.run_module raised:", flush=True) + traceback.print_exc() + sys.exit($errorExitCode) """; // global vars -String pageUrl = ""; String assetsDir = ""; String appDir = ""; +late PythonBridge _bridge; Map environmentVariables = {}; void main() async { @@ -85,162 +95,163 @@ void main() async { future: prepareApp(), builder: (BuildContext context, AsyncSnapshot snapshot) { if (snapshot.hasData) { - // OK - start Python program - return kIsWeb - ? FletApp( - pageUrl: pageUrl, - assetsDir: assetsDir, - ) - : FutureBuilder( - future: runPythonApp(), - builder: - (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.hasData || snapshot.hasError) { - // error or premature finish - return MaterialApp( - home: ErrorScreen( - title: "Error running app", - text: snapshot.data ?? snapshot.error.toString()), - ); - } else { - // no result of error - return FletApp( - pageUrl: pageUrl, - assetsDir: assetsDir, - ); - } - }); + return FletApp( + pageUrl: "dartbridge://${_bridge.port}", + assetsDir: assetsDir, + channelBuilder: ({required onMessage, required onDisconnect}) => + _DartBridgeBackendChannel(_bridge, + onMessage: onMessage, onDisconnect: onDisconnect), + ); } else if (snapshot.hasError) { - // error return MaterialApp( home: ErrorScreen( title: "Error starting app", text: snapshot.error.toString())); } else { - // loading return const MaterialApp(home: BlankScreen()); } })); } -Future prepareApp() async { +Future prepareApp() async { if (kIsWeb) { - // web mode - connect via HTTP - pageUrl = Uri.base.toString(); var routeUrlStrategy = getFletRouteUrlStrategy(); if (routeUrlStrategy == "path") { - setPathUrlStrategy(); + usePathUrlStrategy(); } - } else { - await setupDesktop(); - - // extract app from asset - appDir = await extractAssetZip(assetPath, checkHash: true); - - // set current directory to app path - Directory.current = appDir; - - assetsDir = path.join(appDir, "assets"); + return ""; + } - // configure apps DATA and TEMP directories - WidgetsFlutterBinding.ensureInitialized(); + await setupDesktop(); - var appTempPath = (await path_provider.getApplicationCacheDirectory()).path; - var appDataPath = - (await path_provider.getApplicationDocumentsDirectory()).path; + // Extract app from asset. + appDir = await extractAssetZip(assetPath, checkHash: true); + Directory.current = appDir; + assetsDir = path.join(appDir, "assets"); - if (defaultTargetPlatform != TargetPlatform.iOS && - defaultTargetPlatform != TargetPlatform.android) { - // append app name to the path and create dir - PackageInfo packageInfo = await PackageInfo.fromPlatform(); - appDataPath = path.join(appDataPath, "flet", packageInfo.packageName); - if (!await Directory(appDataPath).exists()) { - await Directory(appDataPath).create(recursive: true); - } - } + WidgetsFlutterBinding.ensureInitialized(); + var appTempPath = (await path_provider.getApplicationCacheDirectory()).path; + var appDataPath = + (await path_provider.getApplicationDocumentsDirectory()).path; - environmentVariables["FLET_APP_DATA"] = appDataPath; - environmentVariables["FLET_APP_TEMP"] = appTempPath; - - environmentVariables["FLET_PLATFORM"] = - defaultTargetPlatform.name.toLowerCase(); - - if (defaultTargetPlatform == TargetPlatform.windows) { - // use TCP on Windows - var tcpPort = await getUnusedPort(); - pageUrl = "tcp://localhost:$tcpPort"; - environmentVariables["FLET_SERVER_PORT"] = tcpPort.toString(); - } else { - // use UDS on other platforms - pageUrl = "flet.sock"; - environmentVariables["FLET_SERVER_UDS_PATH"] = pageUrl; + if (defaultTargetPlatform != TargetPlatform.iOS && + defaultTargetPlatform != TargetPlatform.android) { + PackageInfo packageInfo = await PackageInfo.fromPlatform(); + appDataPath = path.join(appDataPath, "flet", packageInfo.packageName); + if (!await Directory(appDataPath).exists()) { + await Directory(appDataPath).create(recursive: true); } } + // Create the PythonBridge before we hand its port to Python. It outlives + // the FletApp widget; the embedded interpreter only stops when the Flutter + // app exits. + _bridge = PythonBridge(); + + environmentVariables.addAll({ + "FLET_APP_DATA": appDataPath, + "FLET_APP_TEMP": appTempPath, + "FLET_PLATFORM": defaultTargetPlatform.name.toLowerCase(), + // Python reads this env var in flet.app.run_async() and starts the + // dart_bridge transport (added in flet's dart-bridge branch) bound to + // the same port. + "FLET_DART_BRIDGE_PORT": "${_bridge.port}", + }); + + // Fire-and-forget: Python lives for the duration of the app. SeriousPython + // dispatches it on a worker thread (sync=false default), so this returns + // immediately after spawning. + var script = pythonScript.replaceAll('{module_name}', pythonModuleName); + unawaited(SeriousPython.runProgram( + path.join(appDir, "$pythonModuleName.pyc"), + script: script, + environmentVariables: environmentVariables, + )); + return ""; } -Future runPythonApp() async { - var script = pythonScript.replaceAll('{module_name}', pythonModuleName); +/// `FletBackendChannel` implementation backed by a [PythonBridge]. Bytes +/// flow Dart↔Python entirely in-process; no Unix socket, no kernel context +/// switch. The wire format is the same MsgPack-framed protocol the existing +/// socket-based `FletSocketBackendChannel` speaks. +class _DartBridgeBackendChannel implements FletBackendChannel { + _DartBridgeBackendChannel(this._bridge, + {required FletBackendChannelOnMessageCallback onMessage, + required FletBackendChannelOnDisconnectCallback onDisconnect}) + : _onMessage = onMessage, + _onDisconnect = onDisconnect, + _deserializer = + StreamingMsgpackDeserializer(extDecoder: FletMsgpackDecoder()); + + final PythonBridge _bridge; + final FletBackendChannelOnMessageCallback _onMessage; + final FletBackendChannelOnDisconnectCallback _onDisconnect; + final StreamingMsgpackDeserializer _deserializer; + StreamSubscription? _subscription; - var completer = Completer(); - - ServerSocket outSocketServer; - String socketAddr = ""; - StringBuffer pythonOut = StringBuffer(); - - if (defaultTargetPlatform == TargetPlatform.windows) { - var tcpAddr = "127.0.0.1"; - outSocketServer = await ServerSocket.bind(tcpAddr, 0); - debugPrint( - 'Python output TCP Server is listening on port ${outSocketServer.port}'); - socketAddr = "$tcpAddr:${outSocketServer.port}"; - } else { - socketAddr = "stdout.sock"; - outSocketServer = await ServerSocket.bind( - InternetAddress(socketAddr, type: InternetAddressType.unix), 0); - debugPrint('Python output Socket Server is listening on $socketAddr'); + @override + Future connect() async { + _subscription = _bridge.messages.listen( + _onBytes, + onError: (error, stack) { + debugPrint("PythonBridge stream error: $error"); + _onDisconnect(); + }, + onDone: () { + debugPrint("PythonBridge stream closed."); + _onDisconnect(); + }, + cancelOnError: false, + ); } - environmentVariables["FLET_PYTHON_CALLBACK_SOCKET_ADDR"] = socketAddr; - - void closeOutServer() async { - outSocketServer.close(); + void _onBytes(Uint8List bytes) { + _deserializer.addChunk(bytes); + final frames = _deserializer.decodeMessages(); + for (final frame in frames) { + _onMessage(Message.fromList(frame)); + } + } - int exitCode = int.tryParse(pythonOut.toString().trim()) ?? 0; + @override + void send(Message message) { + final encoded = Uint8List.fromList( + msgpack.serialize(message.toList(), extEncoder: FletMsgpackEncoder())); + // Retry loop covers the brief startup window where Python hasn't yet + // called dart_bridge.set_enqueue_handler_func — bridge.send returns + // false in that case. Once the handler is registered (Flet's app.py + // dart_bridge server start() does it before run_module dispatch), + // bridge.send returns true synchronously. + if (_bridge.send(encoded)) return; + _retrySend(encoded); + } - if (exitCode == errorExitCode) { - var out = ""; - if (await File(outLogFilename).exists()) { - out = await File(outLogFilename).readAsString(); + void _retrySend(Uint8List encoded) { + const interval = Duration(milliseconds: 50); + const deadline = Duration(seconds: 30); + final start = DateTime.now(); + Timer.periodic(interval, (timer) { + if (_bridge.send(encoded)) { + timer.cancel(); + } else if (DateTime.now().difference(start) > deadline) { + timer.cancel(); + debugPrint("PythonBridge send timed out: Python handler never registered."); } - completer.complete(out); - } else { - exit(exitCode); - } + }); } - outSocketServer.listen((client) { - debugPrint( - 'Connection from: ${client.remoteAddress.address}:${client.remotePort}'); - client.listen((data) { - var s = String.fromCharCodes(data); - pythonOut.write(s); - }, onError: (error) { - client.close(); - closeOutServer(); - }, onDone: () { - client.close(); - closeOutServer(); - }); - }); + @override + bool get isLocalConnection => true; - // run python async - SeriousPython.runProgram(path.join(appDir, "$pythonModuleName.pyc"), - script: script, environmentVariables: environmentVariables); + @override + int get defaultReconnectIntervalMs => 0; - // wait for client connection to close - return completer.future; + @override + void disconnect() { + _subscription?.cancel(); + _subscription = null; + } } class ErrorScreen extends StatelessWidget { @@ -293,9 +304,7 @@ class ErrorScreen extends StatelessWidget { } class BlankScreen extends StatelessWidget { - const BlankScreen({ - super.key, - }); + const BlankScreen({super.key}); @override Widget build(BuildContext context) { @@ -304,11 +313,3 @@ class BlankScreen extends StatelessWidget { ); } } - -Future getUnusedPort() { - return ServerSocket.bind("127.0.0.1", 0).then((socket) { - var port = socket.port; - socket.close(); - return port; - }); -} diff --git a/src/serious_python/example/flet_example/linux/CMakeLists.txt b/src/serious_python/example/flet_example/linux/CMakeLists.txt index 7ef35274..d17d15d3 100644 --- a/src/serious_python/example/flet_example/linux/CMakeLists.txt +++ b/src/serious_python/example/flet_example/linux/CMakeLists.txt @@ -1,5 +1,5 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change @@ -54,25 +54,8 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Define the application target. To change its name, change BINARY_NAME above, -# not the value here, or `flutter run` will no longer work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) @@ -123,20 +106,11 @@ foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) COMPONENT Runtime) endforeach(bundled_library) -# Link bundled libraries from plugins into main executable to enable dlopen -# with only library name. -# Will NOT be needed once: https://github.com/flutter/engine/pull/28525 lands in Flutter channel we are using -# Alternative approach is to update plugin's RUNPATH before packaging: -# chrpath -r \$ORIGIN ./build/linux/arm64/release/bundle/lib/libserious_python_linux_plugin.so -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - if(${plugin}_bundled_libraries) - target_link_libraries( - ${BINARY_NAME} - PRIVATE - ${${plugin}_bundled_libraries} - ) - endif() -endforeach(plugin) +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. diff --git a/src/serious_python/example/flet_example/linux/flutter/generated_plugin_registrant.cc b/src/serious_python/example/flet_example/linux/flutter/generated_plugin_registrant.cc index b07cb4d1..142e738c 100644 --- a/src/serious_python/example/flet_example/linux/flutter/generated_plugin_registrant.cc +++ b/src/serious_python/example/flet_example/linux/flutter/generated_plugin_registrant.cc @@ -6,6 +6,7 @@ #include "generated_plugin_registrant.h" +#include #include #include #include @@ -13,6 +14,9 @@ #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) pasteboard_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "PasteboardPlugin"); + pasteboard_plugin_register_with_registrar(pasteboard_registrar); g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin"); screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar); diff --git a/src/serious_python/example/flet_example/linux/flutter/generated_plugins.cmake b/src/serious_python/example/flet_example/linux/flutter/generated_plugins.cmake index 5524b2d4..7d9bc28c 100644 --- a/src/serious_python/example/flet_example/linux/flutter/generated_plugins.cmake +++ b/src/serious_python/example/flet_example/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + pasteboard screen_retriever_linux serious_python_linux url_launcher_linux @@ -11,6 +12,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/src/serious_python/example/flet_example/linux/runner/CMakeLists.txt b/src/serious_python/example/flet_example/linux/runner/CMakeLists.txt new file mode 100644 index 00000000..e97dabc7 --- /dev/null +++ b/src/serious_python/example/flet_example/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/src/serious_python/example/run_example/linux/main.cc b/src/serious_python/example/flet_example/linux/runner/main.cc similarity index 100% rename from src/serious_python/example/run_example/linux/main.cc rename to src/serious_python/example/flet_example/linux/runner/main.cc diff --git a/src/serious_python/example/flet_example/linux/my_application.cc b/src/serious_python/example/flet_example/linux/runner/my_application.cc similarity index 59% rename from src/serious_python/example/flet_example/linux/my_application.cc rename to src/serious_python/example/flet_example/linux/runner/my_application.cc index 7f876fab..7c4258d0 100644 --- a/src/serious_python/example/flet_example/linux/my_application.cc +++ b/src/serious_python/example/flet_example/linux/runner/my_application.cc @@ -14,6 +14,11 @@ struct _MyApplication { G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + // Implements GApplication::activate. static void my_application_activate(GApplication* application) { MyApplication* self = MY_APPLICATION(application); @@ -48,31 +53,44 @@ static void my_application_activate(GApplication* application) { } gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); gtk_widget_show(GTK_WIDGET(view)); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); gtk_widget_grab_focus(GTK_WIDGET(view)); } // Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { MyApplication* self = MY_APPLICATION(application); // Strip out the first argument as it is the binary name. self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); g_autoptr(GError) error = nullptr; if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; } g_application_activate(application); @@ -81,6 +99,24 @@ static gboolean my_application_local_command_line(GApplication* application, gch return TRUE; } +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + // Implements GObject::dispose. static void my_application_dispose(GObject* object) { MyApplication* self = MY_APPLICATION(object); @@ -90,15 +126,23 @@ static void my_application_dispose(GObject* object) { static void my_application_class_init(MyApplicationClass* klass) { G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; G_OBJECT_CLASS(klass)->dispose = my_application_dispose; } static void my_application_init(MyApplication* self) {} MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); } diff --git a/src/serious_python/example/flet_example/linux/my_application.h b/src/serious_python/example/flet_example/linux/runner/my_application.h similarity index 70% rename from src/serious_python/example/flet_example/linux/my_application.h rename to src/serious_python/example/flet_example/linux/runner/my_application.h index 72271d5e..db16367a 100644 --- a/src/serious_python/example/flet_example/linux/my_application.h +++ b/src/serious_python/example/flet_example/linux/runner/my_application.h @@ -3,7 +3,10 @@ #include -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, GtkApplication) /** diff --git a/src/serious_python/example/flet_example/macos/Flutter/GeneratedPluginRegistrant.swift b/src/serious_python/example/flet_example/macos/Flutter/GeneratedPluginRegistrant.swift index b65df49c..6d5caa62 100644 --- a/src/serious_python/example/flet_example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/src/serious_python/example/flet_example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,26 +5,36 @@ import FlutterMacOS import Foundation +import battery_plus +import connectivity_plus import device_info_plus import file_picker import package_info_plus -import path_provider_foundation +import pasteboard +import screen_brightness_macos import screen_retriever_macos import serious_python_darwin +import share_plus import shared_preferences_foundation import url_launcher_macos +import wakelock_plus import window_manager import window_to_front func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + BatteryPlusMacosPlugin.register(with: registry.registrar(forPlugin: "BatteryPlusMacosPlugin")) + ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin")) + ScreenBrightnessMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenBrightnessMacosPlugin")) ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin")) SeriousPythonPlugin.register(with: registry.registrar(forPlugin: "SeriousPythonPlugin")) + SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) + WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin")) WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin")) WindowToFrontPlugin.register(with: registry.registrar(forPlugin: "WindowToFrontPlugin")) } diff --git a/src/serious_python/example/flet_example/macos/Podfile.lock b/src/serious_python/example/flet_example/macos/Podfile.lock deleted file mode 100644 index 3cbcdcdf..00000000 --- a/src/serious_python/example/flet_example/macos/Podfile.lock +++ /dev/null @@ -1,79 +0,0 @@ -PODS: - - device_info_plus (0.0.1): - - FlutterMacOS - - file_picker (0.0.1): - - FlutterMacOS - - FlutterMacOS (1.0.0) - - package_info_plus (0.0.1): - - FlutterMacOS - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - screen_retriever_macos (0.0.1): - - FlutterMacOS - - serious_python_darwin (0.9.8): - - Flutter - - FlutterMacOS - - shared_preferences_foundation (0.0.1): - - Flutter - - FlutterMacOS - - url_launcher_macos (0.0.1): - - FlutterMacOS - - window_manager (0.2.0): - - FlutterMacOS - - window_to_front (0.0.1): - - FlutterMacOS - -DEPENDENCIES: - - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) - - file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`) - - FlutterMacOS (from `Flutter/ephemeral`) - - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) - - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - - screen_retriever_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos`) - - serious_python_darwin (from `Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin`) - - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) - - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - - window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`) - - window_to_front (from `Flutter/ephemeral/.symlinks/plugins/window_to_front/macos`) - -EXTERNAL SOURCES: - device_info_plus: - :path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos - file_picker: - :path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos - FlutterMacOS: - :path: Flutter/ephemeral - package_info_plus: - :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos - path_provider_foundation: - :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin - screen_retriever_macos: - :path: Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos - serious_python_darwin: - :path: Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin - shared_preferences_foundation: - :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin - url_launcher_macos: - :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos - window_manager: - :path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos - window_to_front: - :path: Flutter/ephemeral/.symlinks/plugins/window_to_front/macos - -SPEC CHECKSUMS: - device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76 - file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a - FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - package_info_plus: a8a591e70e87ce97ce5d21b2594f69cea9e0312f - path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 - screen_retriever_macos: 452e51764a9e1cdb74b3c541238795849f21557f - serious_python_darwin: d8fa26f4b226e433b51fdb0259c60b3ec9c48527 - shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7 - url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673 - window_manager: 1d01fa7ac65a6e6f83b965471b1a7fdd3f06166c - window_to_front: 9e76fd432e36700a197dac86a0011e49c89abe0a - -PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3 - -COCOAPODS: 1.14.3 diff --git a/src/serious_python/example/flet_example/macos/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/flet_example/macos/Runner.xcodeproj/project.pbxproj index e1f5b26b..5f5d96ea 100644 --- a/src/serious_python/example/flet_example/macos/Runner.xcodeproj/project.pbxproj +++ b/src/serious_python/example/flet_example/macos/Runner.xcodeproj/project.pbxproj @@ -21,14 +21,12 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 256EF705489316F00EF3962A /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79EFD430F9D3561B7E79B636 /* Pods_RunnerTests.framework */; }; 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 99AFA56BC7E7B7480D345FDA /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41059CCFE2A63B7F56BFAF1E /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -62,12 +60,11 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 11E10455E245EB5F22EB7A9A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* flet_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = flet_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* flet_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flet_example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -79,15 +76,8 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 3F15EFE98C2771E6DA7CBB05 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - 41059CCFE2A63B7F56BFAF1E /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 5CC50136090D28DA48C52BD8 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - 79EFD430F9D3561B7E79B636 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - B126920E3C82A726215E0DE6 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - F080949AB83300EBF0AAA1E4 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - FE389693C8F3FA4062C95BD0 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -95,7 +85,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 256EF705489316F00EF3962A /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -103,27 +92,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 99AFA56BC7E7B7480D345FDA /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 2FD1AA06884986EE36A305B7 /* Pods */ = { - isa = PBXGroup; - children = ( - 11E10455E245EB5F22EB7A9A /* Pods-Runner.debug.xcconfig */, - F080949AB83300EBF0AAA1E4 /* Pods-Runner.release.xcconfig */, - B126920E3C82A726215E0DE6 /* Pods-Runner.profile.xcconfig */, - 3F15EFE98C2771E6DA7CBB05 /* Pods-RunnerTests.debug.xcconfig */, - 5CC50136090D28DA48C52BD8 /* Pods-RunnerTests.release.xcconfig */, - FE389693C8F3FA4062C95BD0 /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; 331C80D6294CF71000263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( @@ -151,7 +125,6 @@ 331C80D6294CF71000263BE5 /* RunnerTests */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - 2FD1AA06884986EE36A305B7 /* Pods */, ); sourceTree = ""; }; @@ -202,8 +175,6 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - 41059CCFE2A63B7F56BFAF1E /* Pods_Runner.framework */, - 79EFD430F9D3561B7E79B636 /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -215,7 +186,6 @@ isa = PBXNativeTarget; buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 3F5F528C0FAAB19B26F103EC /* [CP] Check Pods Manifest.lock */, 331C80D1294CF70F00263BE5 /* Sources */, 331C80D2294CF70F00263BE5 /* Frameworks */, 331C80D3294CF70F00263BE5 /* Resources */, @@ -234,13 +204,11 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 8F5527630CCCD1FAF8A7F717 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 2904FEB115C05FA6123619BA /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -258,6 +226,7 @@ 33CC10E52044A3C60003C045 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 0920; LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; @@ -322,23 +291,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 2904FEB115C05FA6123619BA /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -377,50 +329,6 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 3F5F528C0FAAB19B26F103EC /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 8F5527630CCCD1FAF8A7F717 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -472,7 +380,6 @@ /* Begin XCBuildConfiguration section */ 331C80DB294CF71000263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3F15EFE98C2771E6DA7CBB05 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -487,7 +394,6 @@ }; 331C80DC294CF71000263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5CC50136090D28DA48C52BD8 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -502,7 +408,6 @@ }; 331C80DD294CF71000263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = FE389693C8F3FA4062C95BD0 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -520,6 +425,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -543,9 +449,11 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -593,6 +501,7 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -616,9 +525,11 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -646,6 +557,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -669,9 +581,11 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/src/serious_python/example/flet_example/macos/Runner.xcworkspace/contents.xcworkspacedata b/src/serious_python/example/flet_example/macos/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc14..1d526a16 100644 --- a/src/serious_python/example/flet_example/macos/Runner.xcworkspace/contents.xcworkspacedata +++ b/src/serious_python/example/flet_example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - diff --git a/src/serious_python/example/flet_example/macos/Runner/Configs/AppInfo.xcconfig b/src/serious_python/example/flet_example/macos/Runner/Configs/AppInfo.xcconfig index 2cadea52..3f116d66 100644 --- a/src/serious_python/example/flet_example/macos/Runner/Configs/AppInfo.xcconfig +++ b/src/serious_python/example/flet_example/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = flet_example PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2026 com.example. All rights reserved. diff --git a/src/serious_python/example/flet_example/macos/RunnerTests/RunnerTests.swift b/src/serious_python/example/flet_example/macos/RunnerTests/RunnerTests.swift index 5418c9f5..61f3bd1f 100644 --- a/src/serious_python/example/flet_example/macos/RunnerTests/RunnerTests.swift +++ b/src/serious_python/example/flet_example/macos/RunnerTests/RunnerTests.swift @@ -1,5 +1,5 @@ -import FlutterMacOS import Cocoa +import FlutterMacOS import XCTest class RunnerTests: XCTestCase { diff --git a/src/serious_python/example/flet_example/pubspec.lock b/src/serious_python/example/flet_example/pubspec.lock index fd7dd747..ec64d540 100644 --- a/src/serious_python/example/flet_example/pubspec.lock +++ b/src/serious_python/example/flet_example/pubspec.lock @@ -5,26 +5,42 @@ packages: dependency: transitive description: name: archive - sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff url: "https://pub.dev" source: hosted - version: "4.0.7" + version: "4.0.9" args: dependency: transitive description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.7.0" async: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.1" + battery_plus: + dependency: transitive + description: + name: battery_plus + sha256: ad16fcb55b7384be6b4bbc763d5e2031ac7ea62b2d9b6b661490c7b9741155bf + url: "https://pub.dev" + source: hosted + version: "7.0.0" + battery_plus_platform_interface: + dependency: transitive + description: + name: battery_plus_platform_interface + sha256: e8342c0f32de4b1dfd0223114b6785e48e579bfc398da9471c9179b907fa4910 + url: "https://pub.dev" + source: hosted + version: "2.0.1" boolean_selector: dependency: transitive description: @@ -37,10 +53,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" clock: dependency: transitive description: @@ -49,6 +65,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 + url: "https://pub.dev" + source: hosted + version: "1.2.1" collection: dependency: transitive description: @@ -57,78 +81,94 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" + connectivity_plus: + dependency: transitive + description: + name: connectivity_plus + sha256: "62ffa266d9a23b79fb3fcbc206afc00bb979417ba57b1324c546b5aab95ba057" + url: "https://pub.dev" + source: hosted + version: "7.1.1" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: "3c09627c536d22fd24691a905cdd8b14520de69da52c7a97499c8be5284a32ed" + url: "https://pub.dev" + source: hosted + version: "2.1.0" cross_file: dependency: transitive description: name: cross_file - sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + sha256: "28bb3ae56f117b5aec029d702a90f57d285cd975c3c5c281eaca38dbc47c5937" url: "https://pub.dev" source: hosted - version: "0.3.4+2" + version: "0.3.5+2" crypto: dependency: transitive description: name: crypto - sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.7" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" url: "https://pub.dev" source: hosted - version: "1.0.8" + version: "1.0.9" dbus: dependency: transitive description: name: dbus - sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + sha256: d0c98dcd4f5169878b6cf8f6e0a52403a9dff371a3e2f019697accbf6f44a270 url: "https://pub.dev" source: hosted - version: "0.7.11" + version: "0.7.12" device_info_plus: dependency: transitive description: name: device_info_plus - sha256: "72d146c6d7098689ff5c5f66bcf593ac11efc530095385356e131070333e64da" + sha256: b4fed1b2835da9d670d7bed7db79ae2a94b0f5ad6312268158a9b5479abbacdd url: "https://pub.dev" source: hosted - version: "11.3.0" + version: "12.4.0" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface - sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2" + sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f url: "https://pub.dev" source: hosted - version: "7.0.2" + version: "7.0.3" equatable: dependency: transitive description: name: equatable - sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.8" fake_async: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" ffi: dependency: transitive description: name: ffi - sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.2.0" file: dependency: transitive description: @@ -141,26 +181,27 @@ packages: dependency: transitive description: name: file_picker - sha256: e7e16c9d15c36330b94ca0e2ad8cb61f93cd5282d0158c09805aed13b5452f22 + sha256: "57d9a1dd5063f85fa3107fb42d1faffda52fdc948cefd5fe5ea85267a5fc7343" url: "https://pub.dev" source: hosted - version: "10.3.2" - fl_chart: + version: "10.3.10" + fixnum: dependency: transitive description: - name: fl_chart - sha256: "74959b99b92b9eebeed1a4049426fd67c4abc3c5a0f4d12e2877097d6a11ae08" + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be url: "https://pub.dev" source: hosted - version: "0.69.2" + version: "1.1.1" flet: dependency: "direct main" description: - name: flet - sha256: "3be85b7d2e70e00d957966a7bcec2b290057d440b7aafd795a197a39ab3783cf" - url: "https://pub.dev" - source: hosted - version: "0.28.3" + path: "packages/flet" + ref: dart-bridge + resolved-ref: f738809348606dc3b5071ebabf540d1f034d2d75 + url: "https://github.com/flet-dev/flet.git" + source: git + version: "0.86.0" flutter: dependency: "direct main" description: flutter @@ -192,45 +233,53 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_markdown: + flutter_markdown_plus: dependency: transitive description: - name: flutter_markdown - sha256: f0e599ba89c9946c8e051780f0ec99aba4ba15895e0380a7ab68f420046fc44e + name: flutter_markdown_plus + sha256: "039177906850278e8fb1cd364115ee0a46281135932fa8ecea8455522166d2de" url: "https://pub.dev" source: hosted - version: "0.7.4+1" - flutter_plugin_android_lifecycle: + version: "1.0.7" + flutter_markdown_plus_latex: dependency: transitive description: - name: flutter_plugin_android_lifecycle - sha256: "9ee02950848f61c4129af3d6ec84a1cfc0e47931abc746b03e7a3bc3e8ff6eda" + name: flutter_markdown_plus_latex + sha256: "2e7698b291f0657ca445efab730bb25a8c5851037e882cb7bf47d16a5c218de7" + url: "https://pub.dev" + source: hosted + version: "1.0.5" + flutter_math_fork: + dependency: transitive + description: + name: flutter_math_fork + sha256: "6d5f2f1aa57ae539ffb0a04bb39d2da67af74601d685a161aff7ce5bda5fa407" url: "https://pub.dev" source: hosted - version: "2.0.22" - flutter_redux: + version: "0.7.4" + flutter_plugin_android_lifecycle: dependency: transitive description: - name: flutter_redux - sha256: "3b20be9e08d0038e1452fbfa1fdb1ea0a7c3738c997734530b3c6d0bb5fcdbdc" + name: flutter_plugin_android_lifecycle + sha256: "3854fe5e3bff0b113c658f260b90c95dea17c92db0f2addeac2e343dd9969785" url: "https://pub.dev" source: hosted - version: "0.10.0" + version: "2.0.35" flutter_svg: dependency: transitive description: name: flutter_svg - sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b + sha256: "35882981abcbfb8c15b286f0cd690ff25bac12d95eff3e25ee207f37d4c42e7f" url: "https://pub.dev" source: hosted - version: "2.0.17" + version: "2.3.0" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" flutter_web_plugins: - dependency: transitive + dependency: "direct main" description: flutter source: sdk version: "0.0.0" @@ -255,22 +304,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.0" + hooks: + dependency: transitive + description: + name: hooks + sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" + url: "https://pub.dev" + source: hosted + version: "2.0.2" http: dependency: transitive description: name: http - sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.6.0" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.2" integration_test: dependency: "direct dev" description: flutter @@ -280,50 +337,58 @@ packages: dependency: transitive description: name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + jni: + dependency: transitive + description: + name: jni + sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f url: "https://pub.dev" source: hosted - version: "0.19.0" - js: + version: "1.0.0" + jni_flutter: dependency: transitive description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + name: jni_flutter + sha256: "8b59e590786050b1cd866677dddaf76b1ade5e7bc751abe04b86e84d379d3ba6" url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "1.0.1" json_annotation: dependency: transitive description: name: json_annotation - sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + sha256: "2a743920d81b7910627f68ee2c9ac1fc0bfee32b9fc3403587d7c6791ca12f80" url: "https://pub.dev" source: hosted - version: "4.9.0" + version: "4.12.0" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -336,58 +401,114 @@ packages: dependency: transitive description: name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" markdown: dependency: transitive description: name: markdown - sha256: ef2a1298144e3f985cc736b22e0ccdaf188b5b3970648f2d9dc13efd1d9df051 + sha256: ee85086ad7698b42522c6ad42fe195f1b9898e4d974a1af4576c1a3a176cada9 url: "https://pub.dev" source: hosted - version: "7.2.2" + version: "7.3.1" matcher: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" meta: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" + url: "https://pub.dev" + source: hosted + version: "1.18.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + msgpack_dart: + dependency: "direct main" + description: + name: msgpack_dart + sha256: c2d235ed01f364719b5296aecf43ac330f0d7bc865fa134d0d7910a40454dffb + url: "https://pub.dev" + source: hosted + version: "1.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "0.5.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "6cb691c686fa2838c6deb34980d426145c2a5d537491cb83d463c33cdbc726ed" + url: "https://pub.dev" + source: hosted + version: "9.4.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" package_info_plus: dependency: "direct main" description: name: package_info_plus - sha256: a75164ade98cb7d24cfd0a13c6408927c6b217fa60dee5a7ff5c116a58f28918 + sha256: "468c26b4254ab01979fa5e4a98cb343ea3631b9acee6f21028997419a80e1a20" url: "https://pub.dev" source: hosted - version: "8.0.2" + version: "9.0.1" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 + sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + pasteboard: + dependency: transitive + description: + name: pasteboard + sha256: "9ff73ada33f79a59ff91f6c01881fd4ed0a0031cfc4ae2d86c0384471525fca1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "0.4.0" path: dependency: "direct main" description: @@ -400,34 +521,34 @@ packages: dependency: transitive description: name: path_parsing - sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" path_provider: dependency: "direct main" description: name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" + sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd" url: "https://pub.dev" source: hosted - version: "2.2.10" + version: "2.3.1" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.6.0" path_provider_linux: dependency: transitive description: @@ -456,10 +577,10 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.1.0" platform: dependency: transitive description: @@ -480,148 +601,244 @@ packages: dependency: transitive description: name: posix - sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07" url: "https://pub.dev" source: hosted - version: "6.0.3" + version: "6.5.0" process: dependency: transitive description: name: process - sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d" + sha256: c6248e4526673988586e8c00bb22a49210c258dc91df5227d5da9748ecf79744 + url: "https://pub.dev" + source: hosted + version: "5.0.5" + provider: + dependency: transitive + description: + name: provider + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + url: "https://pub.dev" + source: hosted + version: "6.1.5+1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + record_use: + dependency: transitive + description: + name: record_use + sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed" url: "https://pub.dev" source: hosted - version: "5.0.3" - redux: + version: "0.6.0" + screen_brightness: dependency: transitive description: - name: redux - sha256: "1e86ed5b1a9a717922d0a0ca41f9bf49c1a587d50050e9426fc65b14e85ec4d7" + name: screen_brightness + sha256: "7ea1c037422f007f022dcff3ee955bf8e61a474d5426b29be9290fd976c3e46b" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "2.1.9" + screen_brightness_android: + dependency: transitive + description: + name: screen_brightness_android + sha256: "0e4b0a07d5f730b91a8780d8436f3a92be8a8cc2066032ed88b93c8fa153fadf" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + screen_brightness_ios: + dependency: transitive + description: + name: screen_brightness_ios + sha256: "0792d8f98852558f831b4b75241c46047b884598b3f4d982b37dc2dd43e2b2e1" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + screen_brightness_macos: + dependency: transitive + description: + name: screen_brightness_macos + sha256: "278712cf5288db57bd335968cbfb2ec5441028f1ee2fcbdc8d1582d8210a3442" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + screen_brightness_ohos: + dependency: transitive + description: + name: screen_brightness_ohos + sha256: "33f495741d5aa53104d3f5875dcb4b6a119f29ef595be17129ee03a5b78e76a9" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + screen_brightness_platform_interface: + dependency: transitive + description: + name: screen_brightness_platform_interface + sha256: "59d50850d6735d677780fc7359c8e997d0ff6df91c8465161c9e617a7b0a11d8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + screen_brightness_windows: + dependency: transitive + description: + name: screen_brightness_windows + sha256: "121f9dd6d62585bfb4e468c2170804ce4f2a2303ae6b2efc3a065c94937505d7" + url: "https://pub.dev" + source: hosted + version: "2.1.1" screen_retriever: dependency: transitive description: name: screen_retriever - sha256: "570dbc8e4f70bac451e0efc9c9bb19fa2d6799a11e6ef04f946d7886d2e23d0c" + sha256: "42cc3b402a0f67d2455a0d067553d0f13453f6a008d98eababf8b63958d506bd" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.2.1" screen_retriever_linux: dependency: transitive description: name: screen_retriever_linux - sha256: f7f8120c92ef0784e58491ab664d01efda79a922b025ff286e29aa123ea3dd18 + sha256: "2a476f1a5538065bc5badf376cfdc83d6ecf07d77eb2391b9c2bff5a76970048" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.2.1" screen_retriever_macos: dependency: transitive description: name: screen_retriever_macos - sha256: "71f956e65c97315dd661d71f828708bd97b6d358e776f1a30d5aa7d22d78a149" + sha256: b5abb900fcb86614ff10b738b34e37b9e1d03b0447280668e2bc8a98bdc7bd59 url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.2.1" screen_retriever_platform_interface: dependency: transitive description: name: screen_retriever_platform_interface - sha256: ee197f4581ff0d5608587819af40490748e1e39e648d7680ecf95c05197240c0 + sha256: "3af22d926bedf20c2caa308eea376776451a3af125919ce072e56525fded8901" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.2.1" screen_retriever_windows: dependency: transitive description: name: screen_retriever_windows - sha256: "449ee257f03ca98a57288ee526a301a430a344a161f9202b4fcc38576716fe13" + sha256: c44b38a4c4bab34af259180a70a4eee1e29384e7b82e627c9faa68afcdab2e73 + url: "https://pub.dev" + source: hosted + version: "0.2.1" + screenshot: + dependency: transitive + description: + name: screenshot + sha256: "63817697a7835e6ce82add4228e15d233b74d42975c143ad8cfe07009fab866b" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "3.0.0" sensors_plus: dependency: transitive description: name: sensors_plus - sha256: "8e7fa79b4940442bb595bfc0ee9da4af5a22a0fe6ebacc74998245ee9496a82d" + sha256: "56e8cd4260d9ed8e00ecd8da5d9fdc8a1b2ec12345a750dfa51ff83fcf12e3fa" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "7.0.0" sensors_plus_platform_interface: dependency: transitive description: name: sensors_plus_platform_interface - sha256: bc472d6cfd622acb4f020e726433ee31788b038056691ba433fec80e448a094f + sha256: "58815d2f5e46c0c41c40fb39375d3f127306f7742efe3b891c0b1c87e2b5cd5d" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "2.0.1" serious_python: dependency: "direct main" description: path: "../.." relative: true source: path - version: "1.0.1" + version: "2.0.0" serious_python_android: dependency: transitive description: path: "../../../serious_python_android" relative: true source: path - version: "1.0.1" + version: "2.0.0" serious_python_darwin: dependency: transitive description: path: "../../../serious_python_darwin" relative: true source: path - version: "1.0.1" + version: "2.0.0" serious_python_linux: dependency: transitive description: path: "../../../serious_python_linux" relative: true source: path - version: "1.0.1" + version: "2.0.0" serious_python_platform_interface: dependency: transitive description: path: "../../../serious_python_platform_interface" relative: true source: path - version: "1.0.1" + version: "2.0.0" serious_python_windows: dependency: transitive description: path: "../../../serious_python_windows" relative: true source: path - version: "1.0.1" + version: "2.0.0" + share_plus: + dependency: transitive + description: + name: share_plus + sha256: "223873d106614442ea6f20db5a038685cc5b32a2fba81cdecaefbbae0523f7fa" + url: "https://pub.dev" + source: hosted + version: "12.0.2" + share_plus_platform_interface: + dependency: transitive + description: + name: share_plus_platform_interface + sha256: "88023e53a13429bd65d8e85e11a9b484f49d4c190abbd96c7932b74d6927cc9a" + url: "https://pub.dev" + source: hosted + version: "6.1.0" shared_preferences: dependency: transitive description: name: shared_preferences - sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" + sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.5.5" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e" + sha256: "93ae5884a9df5d3bb696825bceb3a17590754548b5d740eba51500afc8d088f5" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.26" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.6" shared_preferences_linux: dependency: transitive description: @@ -634,18 +851,18 @@ packages: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + sha256: "649dc798a33931919ea356c4305c2d1f81619ea6e92244070b520187b5140ef9" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.3" shared_preferences_windows: dependency: transitive description: @@ -658,10 +875,18 @@ packages: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" + shimmer: + dependency: transitive + description: + name: shimmer + sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9" + url: "https://pub.dev" + source: hosted + version: "3.0.0" sky_engine: dependency: transitive description: flutter @@ -671,10 +896,10 @@ packages: dependency: transitive description: name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.10.2" stack_trace: dependency: transitive description: @@ -719,10 +944,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.11" toml: dependency: transitive description: @@ -731,54 +956,70 @@ packages: url: "https://pub.dev" source: hosted version: "0.15.0" + tuple: + dependency: transitive + description: + name: tuple + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.dev" + source: hosted + version: "2.0.2" typed_data: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" + upower: + dependency: transitive + description: + name: upower + sha256: cf042403154751180affa1d15614db7fa50234bc2373cd21c3db666c38543ebf + url: "https://pub.dev" + source: hosted + version: "0.7.0" url_launcher: dependency: transitive description: name: url_launcher - sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.3.2" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79 + sha256: b413d49b73867ac08dd2f9890efd3cc11f2a0e577618d50843440a1fb3776c32 url: "https://pub.dev" source: hosted - version: "6.3.9" + version: "6.3.32" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e + sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0" url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.4.1" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af + sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.2.2" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "769549c999acdb42b8bcfa7c43d72bf79a382ca7441ab18a808e101149daf672" + sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18" url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.2.5" url_launcher_platform_interface: dependency: transitive description: @@ -791,130 +1032,154 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" + sha256: "85c81589622fbc87c1c683aaea164d3604a7777495a79d91e39ffcdec39ddb34" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.4.3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" + sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f" url: "https://pub.dev" source: hosted - version: "3.1.2" - url_strategy: - dependency: "direct main" + version: "3.1.5" + uuid: + dependency: transitive description: - name: url_strategy - sha256: "42b68b42a9864c4d710401add17ad06e28f1c1d5500c93b98c431f6b0ea4ab87" + name: uuid + sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "4.5.3" vector_graphics: dependency: transitive description: name: vector_graphics - sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de" + sha256: "2306c03da2ba81724afeb589c351ebbc0aa7d86005925be8f8735856dbe5e42d" url: "https://pub.dev" source: hosted - version: "1.1.18" + version: "1.2.2" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.13" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" + sha256: "7ee12e6dffe0fc8e755179d6d91b3b34f5924223fc104d85572ef9180d73d172" url: "https://pub.dev" source: hosted - version: "1.1.16" + version: "1.2.5" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360" + url: "https://pub.dev" + source: hosted + version: "15.2.0" + wakelock_plus: + dependency: transitive + description: + name: wakelock_plus + sha256: ddf3db70eaa10c37558ff817519b85d527dbd21034fd5d8e1c2e85f31588f1c1 + url: "https://pub.dev" + source: hosted + version: "1.5.2" + wakelock_plus_platform_interface: + dependency: transitive + description: + name: wakelock_plus_platform_interface + sha256: b13f99e992e7ae6a152e16c5559d3c07ff445b13330192662494e614ca3e7d7b url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "1.5.1" web: dependency: transitive description: name: web - sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "3.0.3" webdriver: dependency: transitive description: name: webdriver - sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8" + sha256: "2f3a14ca026957870cfd9c635b83507e0e51d8091568e90129fbf805aba7cade" url: "https://pub.dev" source: hosted - version: "3.0.4" + version: "3.1.0" win32: dependency: transitive description: name: win32 - sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba" + sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e url: "https://pub.dev" source: hosted - version: "5.13.0" + version: "5.15.0" win32_registry: dependency: transitive description: name: win32_registry - sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852" + sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae" url: "https://pub.dev" source: hosted - version: "1.1.5" + version: "2.1.0" window_manager: dependency: transitive description: name: window_manager - sha256: "732896e1416297c63c9e3fb95aea72d0355f61390263982a47fd519169dc5059" + sha256: "7eb6d6c4164ec08e1bf978d6e733f3cebe792e2a23fb07cbca25c2872bfdbdcd" url: "https://pub.dev" source: hosted - version: "0.4.3" + version: "0.5.1" window_to_front: dependency: transitive description: name: window_to_front - sha256: "7aef379752b7190c10479e12b5fd7c0b9d92adc96817d9e96c59937929512aee" + sha256: "14fad8984db4415e2eeb30b04bb77140b180e260d6cb66b26de126a8657a9241" url: "https://pub.dev" source: hosted - version: "0.0.3" + version: "0.0.4" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.1.0" xml: dependency: transitive description: @@ -923,6 +1188,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" sdks: - dart: ">=3.7.0 <4.0.0" - flutter: ">=3.22.0" + dart: ">=3.12.0 <4.0.0" + flutter: ">=3.44.0" diff --git a/src/serious_python/example/flet_example/pubspec.yaml b/src/serious_python/example/flet_example/pubspec.yaml index 31425e65..d17c3e2c 100644 --- a/src/serious_python/example/flet_example/pubspec.yaml +++ b/src/serious_python/example/flet_example/pubspec.yaml @@ -1,5 +1,5 @@ name: flet_example -description: A new Flutter project. +description: Flet counter app running on the in-process dart_bridge FFI transport. # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev @@ -31,16 +31,25 @@ environment: dependencies: flutter: sdk: flutter + flutter_web_plugins: + sdk: flutter serious_python: path: ../../ - flet: ^0.28.3 + flet: + git: + url: https://github.com/flet-dev/flet.git + ref: dart-bridge + path: packages/flet path: ^1.8.3 - url_strategy: ^0.2.0 path_provider: ^2.1.4 - package_info_plus: ^8.0.2 + package_info_plus: ^9.0.0 + # msgpack_dart is the wire format Flet uses. _DartBridgeBackendChannel + # (in lib/main.dart) encodes outbound frames before handing them to + # PythonBridge.send. + msgpack_dart: ^1.0.1 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. diff --git a/src/serious_python/example/flet_example/web/index.html b/src/serious_python/example/flet_example/web/index.html index 41f4ced7..d1962549 100644 --- a/src/serious_python/example/flet_example/web/index.html +++ b/src/serious_python/example/flet_example/web/index.html @@ -21,7 +21,7 @@ - + @@ -31,29 +31,16 @@ flet_example - - - - - + + diff --git a/src/serious_python/example/flet_example/windows/CMakeLists.txt b/src/serious_python/example/flet_example/windows/CMakeLists.txt index cee1b1bd..6bb428e1 100644 --- a/src/serious_python/example/flet_example/windows/CMakeLists.txt +++ b/src/serious_python/example/flet_example/windows/CMakeLists.txt @@ -87,6 +87,12 @@ if(PLUGIN_BUNDLED_LIBRARIES) COMPONENT Runtime) endif() +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") diff --git a/src/serious_python/example/flet_example/windows/flutter/generated_plugin_registrant.cc b/src/serious_python/example/flet_example/windows/flutter/generated_plugin_registrant.cc index 3ed709b3..5280993c 100644 --- a/src/serious_python/example/flet_example/windows/flutter/generated_plugin_registrant.cc +++ b/src/serious_python/example/flet_example/windows/flutter/generated_plugin_registrant.cc @@ -6,17 +6,32 @@ #include "generated_plugin_registrant.h" +#include +#include +#include +#include #include #include +#include #include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + BatteryPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("BatteryPlusWindowsPlugin")); + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); + PasteboardPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("PasteboardPlugin")); + ScreenBrightnessWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ScreenBrightnessWindowsPlugin")); ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); SeriousPythonWindowsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("SeriousPythonWindowsPluginCApi")); + SharePlusWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); WindowManagerPluginRegisterWithRegistrar( diff --git a/src/serious_python/example/flet_example/windows/flutter/generated_plugins.cmake b/src/serious_python/example/flet_example/windows/flutter/generated_plugins.cmake index 571b9237..ec8b95fd 100644 --- a/src/serious_python/example/flet_example/windows/flutter/generated_plugins.cmake +++ b/src/serious_python/example/flet_example/windows/flutter/generated_plugins.cmake @@ -3,14 +3,20 @@ # list(APPEND FLUTTER_PLUGIN_LIST + battery_plus + connectivity_plus + pasteboard + screen_brightness_windows screen_retriever_windows serious_python_windows + share_plus url_launcher_windows window_manager window_to_front ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/src/serious_python/example/flet_example/windows/runner/Runner.rc b/src/serious_python/example/flet_example/windows/runner/Runner.rc index 320618d6..45fe4e1b 100644 --- a/src/serious_python/example/flet_example/windows/runner/Runner.rc +++ b/src/serious_python/example/flet_example/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "flet_example" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "flet_example" "\0" - VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "flet_example.exe" "\0" VALUE "ProductName", "flet_example" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/src/serious_python/example/flet_example/windows/runner/runner.exe.manifest b/src/serious_python/example/flet_example/windows/runner/runner.exe.manifest index a42ea768..153653e8 100644 --- a/src/serious_python/example/flet_example/windows/runner/runner.exe.manifest +++ b/src/serious_python/example/flet_example/windows/runner/runner.exe.manifest @@ -9,12 +9,6 @@ - - - - - - diff --git a/src/serious_python/example/flet_example/windows/runner/utils.cpp b/src/serious_python/example/flet_example/windows/runner/utils.cpp index b2b08734..3a0b4651 100644 --- a/src/serious_python/example/flet_example/windows/runner/utils.cpp +++ b/src/serious_python/example/flet_example/windows/runner/utils.cpp @@ -45,13 +45,13 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } - int target_length = ::WideCharToMultiByte( + unsigned int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, nullptr, 0, nullptr, nullptr) -1; // remove the trailing null character int input_length = (int)wcslen(utf16_string); std::string utf8_string; - if (target_length <= 0 || target_length > utf8_string.max_size()) { + if (target_length == 0 || target_length > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length); diff --git a/src/serious_python/example/run_example/.metadata b/src/serious_python/example/run_example/.metadata index 44c50848..d3f20b97 100644 --- a/src/serious_python/example/run_example/.metadata +++ b/src/serious_python/example/run_example/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "ead455963c12b453cdb2358cad34969c76daf180" + revision: "c9a6c484230f8b5e408ec57be1ef71dee1e77020" channel: "stable" project_type: app @@ -13,23 +13,23 @@ project_type: app migration: platforms: - platform: root - create_revision: ead455963c12b453cdb2358cad34969c76daf180 - base_revision: ead455963c12b453cdb2358cad34969c76daf180 + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 - platform: android - create_revision: ead455963c12b453cdb2358cad34969c76daf180 - base_revision: ead455963c12b453cdb2358cad34969c76daf180 + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 - platform: ios - create_revision: ead455963c12b453cdb2358cad34969c76daf180 - base_revision: ead455963c12b453cdb2358cad34969c76daf180 + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 - platform: linux - create_revision: ead455963c12b453cdb2358cad34969c76daf180 - base_revision: ead455963c12b453cdb2358cad34969c76daf180 + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 - platform: macos - create_revision: ead455963c12b453cdb2358cad34969c76daf180 - base_revision: ead455963c12b453cdb2358cad34969c76daf180 + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 - platform: windows - create_revision: ead455963c12b453cdb2358cad34969c76daf180 - base_revision: ead455963c12b453cdb2358cad34969c76daf180 + create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 + base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020 # User provided section diff --git a/src/serious_python/example/run_example/README.md b/src/serious_python/example/run_example/README.md index 333e8df6..463f3765 100644 --- a/src/serious_python/example/run_example/README.md +++ b/src/serious_python/example/run_example/README.md @@ -43,25 +43,23 @@ For Pyodide: dart run serious_python:main package app/src -p Emscripten -r -r -r app/src/requirements.txt ``` -For Android: +For Android, no special native-library packaging config is required. serious_python +relocates Python extension modules into `jniLibs` and loads them directly from the APK +(memory-mapped, no extraction), and ships pure Python in stored asset zips read via +`zipimport`. Just use a `minSdk` of 23+ so native libs stay uncompressed/page-aligned in +the APK: -In `android/app/build.gradle`: +In `android/app/build.gradle.kts`: -``` +```kotlin android { - ndkVersion "25.1.8937393" - - packagingOptions { - jniLibs { - useLegacyPackaging true - } - } - - packagingOptions { - doNotStrip "*/arm64-v8a/libpython*.so" - doNotStrip "*/armeabi-v7a/libpython*.so" - doNotStrip "*/x86/libpython*.so" - doNotStrip "*/x86_64/libpython*.so" + defaultConfig { + minSdk = 23 } } -``` \ No newline at end of file +``` + +To ship a path-hungry package **extracted to disk** instead of inside the zip — for +packages that read bundled data via `__file__` / `pkg_resources` rather than +`importlib.resources` — set `SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES` to a comma-separated +list of relative package paths before building. \ No newline at end of file diff --git a/src/serious_python/example/run_example/android/.gitignore b/src/serious_python/example/run_example/android/.gitignore index b776a2ff..be3943c9 100644 --- a/src/serious_python/example/run_example/android/.gitignore +++ b/src/serious_python/example/run_example/android/.gitignore @@ -5,10 +5,10 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java -**/.cxx/ +.cxx/ # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/src/serious_python/example/run_example/android/app/build.gradle b/src/serious_python/example/run_example/android/app/build.gradle deleted file mode 100644 index 8a335a44..00000000 --- a/src/serious_python/example/run_example/android/app/build.gradle +++ /dev/null @@ -1,76 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" - id "dev.flutter.flutter-gradle-plugin" -} - -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -android { - namespace "com.example.run_example" - compileSdkVersion flutter.compileSdkVersion - ndkVersion "25.1.8937393" - - packagingOptions { - jniLibs { - useLegacyPackaging true - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - applicationId "com.example.run_example" - minSdkVersion 23 - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } - - packagingOptions { - doNotStrip "*/arm64-v8a/libpython*.so" - doNotStrip "*/armeabi-v7a/libpython*.so" - doNotStrip "*/x86/libpython*.so" - doNotStrip "*/x86_64/libpython*.so" - } -} - -flutter { - source '../..' -} - -dependencies {} diff --git a/src/serious_python/example/run_example/android/app/build.gradle.kts b/src/serious_python/example/run_example/android/app/build.gradle.kts new file mode 100644 index 00000000..f1d3f07b --- /dev/null +++ b/src/serious_python/example/run_example/android/app/build.gradle.kts @@ -0,0 +1,51 @@ +plugins { + id("com.android.application") + // Kotlin is provided by the Flutter Gradle Plugin (Built-in Kotlin), so the + // app no longer applies the Kotlin Gradle Plugin itself. + // The Flutter Gradle Plugin must be applied after the Android Gradle plugin. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.run_example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + // No special native-library packaging is needed: serious_python loads extension + // modules directly from the APK (mmap) via its finder. Modern packaging + // (useLegacyPackaging=false) is AGP's default at minSdk 23+. + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.run_example" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + +flutter { + source = "../.." +} diff --git a/src/serious_python/example/run_example/android/app/src/main/AndroidManifest.xml b/src/serious_python/example/run_example/android/app/src/main/AndroidManifest.xml index bc6c6a0b..c4f8743d 100644 --- a/src/serious_python/example/run_example/android/app/src/main/AndroidManifest.xml +++ b/src/serious_python/example/run_example/android/app/src/main/AndroidManifest.xml @@ -7,6 +7,7 @@ android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" + android:taskAffinity="" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" @@ -30,4 +31,15 @@ android:name="flutterEmbedding" android:value="2" /> + + + + + + + diff --git a/src/serious_python/example/run_example/android/app/src/main/kotlin/com/example/run_example/MainActivity.kt b/src/serious_python/example/run_example/android/app/src/main/kotlin/com/example/run_example/MainActivity.kt index 6f431aff..a5ed6181 100644 --- a/src/serious_python/example/run_example/android/app/src/main/kotlin/com/example/run_example/MainActivity.kt +++ b/src/serious_python/example/run_example/android/app/src/main/kotlin/com/example/run_example/MainActivity.kt @@ -2,5 +2,4 @@ package com.example.run_example import io.flutter.embedding.android.FlutterActivity -class MainActivity: FlutterActivity() { -} +class MainActivity : FlutterActivity() diff --git a/src/serious_python/example/run_example/android/build.gradle b/src/serious_python/example/run_example/android/build.gradle deleted file mode 100644 index 52d31f37..00000000 --- a/src/serious_python/example/run_example/android/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -buildscript { - ext.kotlin_version = '1.9.24' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/src/serious_python/example/run_example/android/build.gradle.kts b/src/serious_python/example/run_example/android/build.gradle.kts new file mode 100644 index 00000000..dbee657b --- /dev/null +++ b/src/serious_python/example/run_example/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/src/serious_python/example/run_example/android/gradle.properties b/src/serious_python/example/run_example/android/gradle.properties index 94adc3a3..d5da7278 100644 --- a/src/serious_python/example/run_example/android/gradle.properties +++ b/src/serious_python/example/run_example/android/gradle.properties @@ -1,3 +1,6 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true +# This builtInKotlin flag was added automatically by Flutter migrator +android.builtInKotlin=false +# This newDsl flag was added automatically by Flutter migrator +android.newDsl=false diff --git a/src/serious_python/example/run_example/android/gradle/wrapper/gradle-wrapper.properties b/src/serious_python/example/run_example/android/gradle/wrapper/gradle-wrapper.properties index a10c8212..e4ef43fb 100644 --- a/src/serious_python/example/run_example/android/gradle/wrapper/gradle-wrapper.properties +++ b/src/serious_python/example/run_example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/src/serious_python/example/run_example/android/settings.gradle b/src/serious_python/example/run_example/android/settings.gradle deleted file mode 100644 index b64b2eb7..00000000 --- a/src/serious_python/example/run_example/android/settings.gradle +++ /dev/null @@ -1,29 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - } - settings.ext.flutterSdkPath = flutterSdkPath() - - includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } - - plugins { - id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.3.1" apply false -} - -include ":app" diff --git a/src/serious_python/example/run_example/android/settings.gradle.kts b/src/serious_python/example/run_example/android/settings.gradle.kts new file mode 100644 index 00000000..ca1f8f00 --- /dev/null +++ b/src/serious_python/example/run_example/android/settings.gradle.kts @@ -0,0 +1,28 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + // Declared (but not applied) so Built-in Kotlin — where the Flutter Gradle + // Plugin applies kotlin-android for us — uses this KGP version. + id("org.jetbrains.kotlin.android") version "2.2.20" apply false +} + +include(":app") diff --git a/src/serious_python/example/run_example/ios/Flutter/AppFrameworkInfo.plist b/src/serious_python/example/run_example/ios/Flutter/AppFrameworkInfo.plist index 7c569640..391a902b 100644 --- a/src/serious_python/example/run_example/ios/Flutter/AppFrameworkInfo.plist +++ b/src/serious_python/example/run_example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/src/serious_python/example/run_example/ios/Podfile b/src/serious_python/example/run_example/ios/Podfile index 3e44f9c6..e51a31d9 100644 --- a/src/serious_python/example/run_example/ios/Podfile +++ b/src/serious_python/example/run_example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '13.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/src/serious_python/example/run_example/ios/Podfile.lock b/src/serious_python/example/run_example/ios/Podfile.lock index a6e178aa..9bae2c46 100644 --- a/src/serious_python/example/run_example/ios/Podfile.lock +++ b/src/serious_python/example/run_example/ios/Podfile.lock @@ -1,36 +1,23 @@ PODS: - Flutter (1.0.0) - - integration_test (0.0.1): - - Flutter - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - serious_python_darwin (0.9.0): + - serious_python_darwin (2.0.0): - Flutter - FlutterMacOS DEPENDENCIES: - Flutter (from `Flutter`) - - integration_test (from `.symlinks/plugins/integration_test/ios`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - serious_python_darwin (from `.symlinks/plugins/serious_python_darwin/darwin`) EXTERNAL SOURCES: Flutter: :path: Flutter - integration_test: - :path: ".symlinks/plugins/integration_test/ios" - path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/darwin" serious_python_darwin: :path: ".symlinks/plugins/serious_python_darwin/darwin" SPEC CHECKSUMS: - Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573 - path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 - serious_python_darwin: f9c5bd0dc6fbe536075be8606baaf5eebae61ea8 + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 + serious_python_darwin: 6d58c9837595683a71e20114bdd4607568c98e84 -PODFILE CHECKSUM: a57f30d18f102dd3ce366b1d62a55ecbef2158e5 +PODFILE CHECKSUM: 4f1c12611da7338d21589c0b2ecd6bd20b109694 COCOAPODS: 1.14.3 diff --git a/src/serious_python/example/run_example/ios/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/run_example/ios/Runner.xcodeproj/project.pbxproj index 10450bff..0ac1996c 100644 --- a/src/serious_python/example/run_example/ios/Runner.xcodeproj/project.pbxproj +++ b/src/serious_python/example/run_example/ios/Runner.xcodeproj/project.pbxproj @@ -7,15 +7,17 @@ objects = { /* Begin PBXBuildFile section */ - 0ECD75C89334B57BDC8D90DC /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC9102B96DB1483340228979 /* Pods_Runner.framework */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - F3B4C2EDB0698819E36294C5 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C47F63012DFB4F35FF209FB9 /* Pods_RunnerTests.framework */; }; + CF84F7C589098D0D53F29EA5 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E49AE308051092F5430F53CA /* Pods_RunnerTests.framework */; }; + F30244A3211D5E427A78417D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62522B64782DFA6C89DF9AD7 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -44,14 +46,19 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 1841A8366E682B7A1DD4DA5C /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 399AB64EF1EB6528E754BE1D /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 554EB723AFF3B5087EF64DD5 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 62522B64782DFA6C89DF9AD7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6F2541DBDC3C124074F83922 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 8BF8669BA338C5B46090EC79 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 89AEA4B6F9B230A55D5C72EB /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -59,12 +66,9 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BCF9E5BC78A2EA746E6B84C4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - C47F63012DFB4F35FF209FB9 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D379499903D98867C36E25EA /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - E4710682EF613043A76CB7D1 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - EC9102B96DB1483340228979 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F97D0BAFF74D61300512E0B1 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + DC483BFC8E634B1A5EC721CF /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + E49AE308051092F5430F53CA /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E8D211C06EECAAA50D928D30 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -72,46 +76,57 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 0ECD75C89334B57BDC8D90DC /* Pods_Runner.framework in Frameworks */, + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, + F30244A3211D5E427A78417D /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - E39EF68C436C117B0971FD3C /* Frameworks */ = { + E7FF40BA447253FD9E843BD3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F3B4C2EDB0698819E36294C5 /* Pods_RunnerTests.framework in Frameworks */, + CF84F7C589098D0D53F29EA5 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 331C8082294A63A400263BE5 /* RunnerTests */ = { + 221C24505F531D50849A1B61 /* Pods */ = { isa = PBXGroup; children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, + 6F2541DBDC3C124074F83922 /* Pods-Runner.debug.xcconfig */, + E8D211C06EECAAA50D928D30 /* Pods-Runner.release.xcconfig */, + 399AB64EF1EB6528E754BE1D /* Pods-Runner.profile.xcconfig */, + 554EB723AFF3B5087EF64DD5 /* Pods-RunnerTests.debug.xcconfig */, + 89AEA4B6F9B230A55D5C72EB /* Pods-RunnerTests.release.xcconfig */, + DC483BFC8E634B1A5EC721CF /* Pods-RunnerTests.profile.xcconfig */, ); - path = RunnerTests; + name = Pods; + path = Pods; sourceTree = ""; }; - 458CDDF0180A3495894DE30C /* Pods */ = { + 225F4D43375C96033CFFB13C /* Frameworks */ = { isa = PBXGroup; children = ( - D379499903D98867C36E25EA /* Pods-Runner.debug.xcconfig */, - 8BF8669BA338C5B46090EC79 /* Pods-Runner.release.xcconfig */, - BCF9E5BC78A2EA746E6B84C4 /* Pods-Runner.profile.xcconfig */, - 1841A8366E682B7A1DD4DA5C /* Pods-RunnerTests.debug.xcconfig */, - F97D0BAFF74D61300512E0B1 /* Pods-RunnerTests.release.xcconfig */, - E4710682EF613043A76CB7D1 /* Pods-RunnerTests.profile.xcconfig */, + 62522B64782DFA6C89DF9AD7 /* Pods_Runner.framework */, + E49AE308051092F5430F53CA /* Pods_RunnerTests.framework */, ); - name = Pods; - path = Pods; + name = Frameworks; + sourceTree = ""; + }; + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; sourceTree = ""; }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -127,8 +142,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, - 458CDDF0180A3495894DE30C /* Pods */, - E41C5AD26036F4028C7CEFA3 /* Frameworks */, + 221C24505F531D50849A1B61 /* Pods */, + 225F4D43375C96033CFFB13C /* Frameworks */, ); sourceTree = ""; }; @@ -151,20 +166,12 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; - E41C5AD26036F4028C7CEFA3 /* Frameworks */ = { - isa = PBXGroup; - children = ( - EC9102B96DB1483340228979 /* Pods_Runner.framework */, - C47F63012DFB4F35FF209FB9 /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -172,10 +179,10 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 26D00038C892F3CE540EAA65 /* [CP] Check Pods Manifest.lock */, + C234C0FA752886C45FD765ED /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, - E39EF68C436C117B0971FD3C /* Frameworks */, + E7FF40BA447253FD9E843BD3 /* Frameworks */, ); buildRules = ( ); @@ -191,20 +198,24 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - C3AB7694CD38576DCB2BFAF8 /* [CP] Check Pods Manifest.lock */, + B35D7424D749C89CB3E981BE /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - B372FAA83F7FA6B86E511DBD /* [CP] Embed Pods Frameworks */, + 9C2BD3DE6890171FCDB2C70D /* [CP] Embed Pods Frameworks */, + 6071F178056A40A19D0FD492 /* [CP] Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -238,6 +249,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -270,43 +284,38 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 26D00038C892F3CE540EAA65 /* [CP] Check Pods Manifest.lock */ = { + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); + name = "Thin Binary"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 6071F178056A40A19D0FD492 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "Thin Binary"; - outputPaths = ( + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; @@ -323,7 +332,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - B372FAA83F7FA6B86E511DBD /* [CP] Embed Pods Frameworks */ = { + 9C2BD3DE6890171FCDB2C70D /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -340,7 +349,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - C3AB7694CD38576DCB2BFAF8 /* [CP] Check Pods Manifest.lock */ = { + B35D7424D749C89CB3E981BE /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -362,6 +371,28 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + C234C0FA752886C45FD765ED /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -379,6 +410,7 @@ files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -416,6 +448,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -445,6 +478,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -453,7 +487,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -485,7 +519,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1841A8366E682B7A1DD4DA5C /* Pods-RunnerTests.debug.xcconfig */; + baseConfigurationReference = 554EB723AFF3B5087EF64DD5 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -503,7 +537,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F97D0BAFF74D61300512E0B1 /* Pods-RunnerTests.release.xcconfig */; + baseConfigurationReference = 89AEA4B6F9B230A55D5C72EB /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -519,7 +553,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E4710682EF613043A76CB7D1 /* Pods-RunnerTests.profile.xcconfig */; + baseConfigurationReference = DC483BFC8E634B1A5EC721CF /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -537,6 +571,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -566,6 +601,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -580,7 +616,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -592,6 +628,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -621,6 +658,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -629,7 +667,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -717,6 +755,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/src/serious_python/example/run_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/serious_python/example/run_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5df..c3fedb29 100644 --- a/src/serious_python/example/run_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/src/serious_python/example/run_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + diff --git a/src/serious_python/example/run_example/ios/Runner/AppDelegate.swift b/src/serious_python/example/run_example/ios/Runner/AppDelegate.swift index b6363034..c30b367e 100644 --- a/src/serious_python/example/run_example/ios/Runner/AppDelegate.swift +++ b/src/serious_python/example/run_example/ios/Runner/AppDelegate.swift @@ -1,13 +1,16 @@ -import UIKit import Flutter +import UIKit @main -@objc class AppDelegate: FlutterAppDelegate { +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/src/serious_python/example/run_example/ios/Runner/Info.plist b/src/serious_python/example/run_example/ios/Runner/Info.plist index 235b9830..ba514518 100644 --- a/src/serious_python/example/run_example/ios/Runner/Info.plist +++ b/src/serious_python/example/run_example/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,29 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,9 +66,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - diff --git a/src/serious_python/example/run_example/ios/Runner/SceneDelegate.swift b/src/serious_python/example/run_example/ios/Runner/SceneDelegate.swift new file mode 100644 index 00000000..b9ce8ea2 --- /dev/null +++ b/src/serious_python/example/run_example/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/src/serious_python/example/run_example/linux/CMakeLists.txt b/src/serious_python/example/run_example/linux/CMakeLists.txt index 45eb4503..d3f4ba4b 100644 --- a/src/serious_python/example/run_example/linux/CMakeLists.txt +++ b/src/serious_python/example/run_example/linux/CMakeLists.txt @@ -1,5 +1,5 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change @@ -54,25 +54,8 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Define the application target. To change its name, change BINARY_NAME above, -# not the value here, or `flutter run` will no longer work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) @@ -123,6 +106,12 @@ foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) COMPONENT Runtime) endforeach(bundled_library) +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") diff --git a/src/serious_python/example/run_example/linux/flutter/generated_plugins.cmake b/src/serious_python/example/run_example/linux/flutter/generated_plugins.cmake index 6d77107e..ab50859e 100644 --- a/src/serious_python/example/run_example/linux/flutter/generated_plugins.cmake +++ b/src/serious_python/example/run_example/linux/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/src/serious_python/example/run_example/linux/runner/CMakeLists.txt b/src/serious_python/example/run_example/linux/runner/CMakeLists.txt new file mode 100644 index 00000000..e97dabc7 --- /dev/null +++ b/src/serious_python/example/run_example/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/src/serious_python/example/run_example/linux/runner/main.cc b/src/serious_python/example/run_example/linux/runner/main.cc new file mode 100644 index 00000000..e7c5c543 --- /dev/null +++ b/src/serious_python/example/run_example/linux/runner/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/src/serious_python/example/run_example/linux/my_application.cc b/src/serious_python/example/run_example/linux/runner/my_application.cc similarity index 59% rename from src/serious_python/example/run_example/linux/my_application.cc rename to src/serious_python/example/run_example/linux/runner/my_application.cc index 07c0c106..1ed5d6e9 100644 --- a/src/serious_python/example/run_example/linux/my_application.cc +++ b/src/serious_python/example/run_example/linux/runner/my_application.cc @@ -14,6 +14,11 @@ struct _MyApplication { G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + // Implements GApplication::activate. static void my_application_activate(GApplication* application) { MyApplication* self = MY_APPLICATION(application); @@ -48,31 +53,44 @@ static void my_application_activate(GApplication* application) { } gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); gtk_widget_show(GTK_WIDGET(view)); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); gtk_widget_grab_focus(GTK_WIDGET(view)); } // Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { MyApplication* self = MY_APPLICATION(application); // Strip out the first argument as it is the binary name. self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); g_autoptr(GError) error = nullptr; if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; } g_application_activate(application); @@ -81,6 +99,24 @@ static gboolean my_application_local_command_line(GApplication* application, gch return TRUE; } +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + // Implements GObject::dispose. static void my_application_dispose(GObject* object) { MyApplication* self = MY_APPLICATION(object); @@ -90,15 +126,23 @@ static void my_application_dispose(GObject* object) { static void my_application_class_init(MyApplicationClass* klass) { G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; G_OBJECT_CLASS(klass)->dispose = my_application_dispose; } static void my_application_init(MyApplication* self) {} MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); } diff --git a/src/serious_python/example/run_example/linux/runner/my_application.h b/src/serious_python/example/run_example/linux/runner/my_application.h new file mode 100644 index 00000000..db16367a --- /dev/null +++ b/src/serious_python/example/run_example/linux/runner/my_application.h @@ -0,0 +1,21 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/src/serious_python/example/run_example/macos/Flutter/GeneratedPluginRegistrant.swift b/src/serious_python/example/run_example/macos/Flutter/GeneratedPluginRegistrant.swift index 6bcae484..7ef3a6c2 100644 --- a/src/serious_python/example/run_example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/src/serious_python/example/run_example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,10 +5,8 @@ import FlutterMacOS import Foundation -import path_provider_foundation import serious_python_darwin func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SeriousPythonPlugin.register(with: registry.registrar(forPlugin: "SeriousPythonPlugin")) } diff --git a/src/serious_python/example/run_example/macos/Podfile.lock b/src/serious_python/example/run_example/macos/Podfile.lock index 6ee684c8..f59e9b47 100644 --- a/src/serious_python/example/run_example/macos/Podfile.lock +++ b/src/serious_python/example/run_example/macos/Podfile.lock @@ -1,29 +1,22 @@ PODS: - FlutterMacOS (1.0.0) - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - serious_python_darwin (0.9.2): + - serious_python_darwin (2.0.0): - Flutter - FlutterMacOS DEPENDENCIES: - FlutterMacOS (from `Flutter/ephemeral`) - - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - serious_python_darwin (from `Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin`) EXTERNAL SOURCES: FlutterMacOS: :path: Flutter/ephemeral - path_provider_foundation: - :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin serious_python_darwin: :path: Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin SPEC CHECKSUMS: - FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 - serious_python_darwin: 5e7e55250432119e32b7605144da0d592d39f3cc + FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 + serious_python_darwin: 6d58c9837595683a71e20114bdd4607568c98e84 PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3 diff --git a/src/serious_python/example/run_example/macos/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/run_example/macos/Runner.xcodeproj/project.pbxproj index 4eac939f..769f37a0 100644 --- a/src/serious_python/example/run_example/macos/Runner.xcodeproj/project.pbxproj +++ b/src/serious_python/example/run_example/macos/Runner.xcodeproj/project.pbxproj @@ -27,8 +27,8 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 381D3A43A4DCB5E84EB5B553 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F59CC062D29D173B37B760E /* Pods_RunnerTests.framework */; }; - 386AE86EAE4E58B10CF59C89 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6C216A7A8AB7E5B2C660AF7 /* Pods_Runner.framework */; }; + 60F575BBFB05ECB5BC731F3A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBCD7A366CFB6AA3F26FB79B /* Pods_Runner.framework */; }; + 9A45524B786DA102A205EB20 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D27FB6937DE38CBCB05E2AB /* Pods_RunnerTests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -62,9 +62,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 1AA4B1F42A9761CAE6E497E8 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - 1AA56634FBFA9C118760D530 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 1F59CC062D29D173B37B760E /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 0BA9260A942C6E356B438163 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 23619C2850A7CB4DD832FA9E /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; @@ -81,13 +80,14 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 3AA9059D78CE7A3AC615A3B2 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 8299D3315FCBC8C0435D08B4 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 8D27FB6937DE38CBCB05E2AB /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - 9B5D5BE9E2D6FB3E0D60C9CC /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - B6C216A7A8AB7E5B2C660AF7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - BFF2A0270ACBFC22CF4B2E2A /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - F4B50254D7BFC1D34C17E1E6 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + AA5179947CAC375732FD65A1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + BA9E178CC85319DB5063AD2A /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + CBCD7A366CFB6AA3F26FB79B /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F67D3A95F20A1A89B671545F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -95,7 +95,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 381D3A43A4DCB5E84EB5B553 /* Pods_RunnerTests.framework in Frameworks */, + 9A45524B786DA102A205EB20 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -103,13 +103,27 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 386AE86EAE4E58B10CF59C89 /* Pods_Runner.framework in Frameworks */, + 60F575BBFB05ECB5BC731F3A /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2838B11037D083B9C3FA026F /* Pods */ = { + isa = PBXGroup; + children = ( + 3AA9059D78CE7A3AC615A3B2 /* Pods-Runner.debug.xcconfig */, + AA5179947CAC375732FD65A1 /* Pods-Runner.release.xcconfig */, + F67D3A95F20A1A89B671545F /* Pods-Runner.profile.xcconfig */, + 0BA9260A942C6E356B438163 /* Pods-RunnerTests.debug.xcconfig */, + BA9E178CC85319DB5063AD2A /* Pods-RunnerTests.release.xcconfig */, + 23619C2850A7CB4DD832FA9E /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 331C80D6294CF71000263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( @@ -137,7 +151,7 @@ 331C80D6294CF71000263BE5 /* RunnerTests */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - 4F482484045CE84A88119B79 /* Pods */, + 2838B11037D083B9C3FA026F /* Pods */, ); sourceTree = ""; }; @@ -185,25 +199,11 @@ path = Runner; sourceTree = ""; }; - 4F482484045CE84A88119B79 /* Pods */ = { - isa = PBXGroup; - children = ( - 8299D3315FCBC8C0435D08B4 /* Pods-Runner.debug.xcconfig */, - 1AA56634FBFA9C118760D530 /* Pods-Runner.release.xcconfig */, - 9B5D5BE9E2D6FB3E0D60C9CC /* Pods-Runner.profile.xcconfig */, - F4B50254D7BFC1D34C17E1E6 /* Pods-RunnerTests.debug.xcconfig */, - 1AA4B1F42A9761CAE6E497E8 /* Pods-RunnerTests.release.xcconfig */, - BFF2A0270ACBFC22CF4B2E2A /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - B6C216A7A8AB7E5B2C660AF7 /* Pods_Runner.framework */, - 1F59CC062D29D173B37B760E /* Pods_RunnerTests.framework */, + CBCD7A366CFB6AA3F26FB79B /* Pods_Runner.framework */, + 8D27FB6937DE38CBCB05E2AB /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -215,7 +215,7 @@ isa = PBXNativeTarget; buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 214AA595C9EEB7AC3063D2BE /* [CP] Check Pods Manifest.lock */, + BAF9ECAC5469ED3242173EBB /* [CP] Check Pods Manifest.lock */, 331C80D1294CF70F00263BE5 /* Sources */, 331C80D2294CF70F00263BE5 /* Frameworks */, 331C80D3294CF70F00263BE5 /* Resources */, @@ -234,13 +234,14 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 3FE72586F90C485D67A2EB9B /* [CP] Check Pods Manifest.lock */, + DC6E30DB7C03C90D6695EB76 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - C4A6FCD43E8738D6785662D3 /* [CP] Embed Pods Frameworks */, + 0D22FFDAE571FF7D9AE2FDA7 /* [CP] Embed Pods Frameworks */, + 319F254C714166AC17D0BA17 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -258,6 +259,7 @@ 33CC10E52044A3C60003C045 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 0920; LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; @@ -322,26 +324,38 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 214AA595C9EEB7AC3063D2BE /* [CP] Check Pods Manifest.lock */ = { + 0D22FFDAE571FF7D9AE2FDA7 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 319F254C714166AC17D0BA17 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; 3399D490228B24CF009A79C7 /* ShellScript */ = { @@ -382,7 +396,7 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 3FE72586F90C485D67A2EB9B /* [CP] Check Pods Manifest.lock */ = { + BAF9ECAC5469ED3242173EBB /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -397,28 +411,33 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - C4A6FCD43E8738D6785662D3 /* [CP] Embed Pods Frameworks */ = { + DC6E30DB7C03C90D6695EB76 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -472,7 +491,7 @@ /* Begin XCBuildConfiguration section */ 331C80DB294CF71000263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F4B50254D7BFC1D34C17E1E6 /* Pods-RunnerTests.debug.xcconfig */; + baseConfigurationReference = 0BA9260A942C6E356B438163 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -487,7 +506,7 @@ }; 331C80DC294CF71000263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1AA4B1F42A9761CAE6E497E8 /* Pods-RunnerTests.release.xcconfig */; + baseConfigurationReference = BA9E178CC85319DB5063AD2A /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -502,7 +521,7 @@ }; 331C80DD294CF71000263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BFF2A0270ACBFC22CF4B2E2A /* Pods-RunnerTests.profile.xcconfig */; + baseConfigurationReference = 23619C2850A7CB4DD832FA9E /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -520,6 +539,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -543,9 +563,11 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -593,6 +615,7 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -616,9 +639,11 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -646,6 +671,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -669,9 +695,11 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/src/serious_python/example/run_example/macos/Runner/Configs/AppInfo.xcconfig b/src/serious_python/example/run_example/macos/Runner/Configs/AppInfo.xcconfig index 532b6b72..f2d73e5a 100644 --- a/src/serious_python/example/run_example/macos/Runner/Configs/AppInfo.xcconfig +++ b/src/serious_python/example/run_example/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = run_example PRODUCT_BUNDLE_IDENTIFIER = com.example.runExample // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2026 com.example. All rights reserved. diff --git a/src/serious_python/example/run_example/macos/Runner/DebugProfile.entitlements b/src/serious_python/example/run_example/macos/Runner/DebugProfile.entitlements index cf2172f7..9f56413f 100644 --- a/src/serious_python/example/run_example/macos/Runner/DebugProfile.entitlements +++ b/src/serious_python/example/run_example/macos/Runner/DebugProfile.entitlements @@ -1,12 +1,12 @@ - - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.network.server - - - \ No newline at end of file + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/src/serious_python/example/run_example/macos/Runner/Release.entitlements b/src/serious_python/example/run_example/macos/Runner/Release.entitlements index 781649c8..e89b7f32 100644 --- a/src/serious_python/example/run_example/macos/Runner/Release.entitlements +++ b/src/serious_python/example/run_example/macos/Runner/Release.entitlements @@ -1,8 +1,8 @@ - - com.apple.security.app-sandbox - - - \ No newline at end of file + + com.apple.security.app-sandbox + + + diff --git a/src/serious_python/example/run_example/macos/RunnerTests/RunnerTests.swift b/src/serious_python/example/run_example/macos/RunnerTests/RunnerTests.swift index 5418c9f5..61f3bd1f 100644 --- a/src/serious_python/example/run_example/macos/RunnerTests/RunnerTests.swift +++ b/src/serious_python/example/run_example/macos/RunnerTests/RunnerTests.swift @@ -1,5 +1,5 @@ -import FlutterMacOS import Cocoa +import FlutterMacOS import XCTest class RunnerTests: XCTestCase { diff --git a/src/serious_python/example/run_example/pubspec.lock b/src/serious_python/example/run_example/pubspec.lock index 99555a02..3b9666fe 100644 --- a/src/serious_python/example/run_example/pubspec.lock +++ b/src/serious_python/example/run_example/pubspec.lock @@ -5,26 +5,26 @@ packages: dependency: transitive description: name: archive - sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff url: "https://pub.dev" source: hosted - version: "4.0.7" + version: "4.0.9" args: dependency: transitive description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.7.0" async: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.1" boolean_selector: dependency: transitive description: @@ -49,6 +49,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 + url: "https://pub.dev" + source: hosted + version: "1.2.1" collection: dependency: transitive description: @@ -61,18 +69,18 @@ packages: dependency: transitive description: name: crypto - sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.7" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" url: "https://pub.dev" source: hosted - version: "1.0.8" + version: "1.0.9" fake_async: dependency: transitive description: @@ -85,10 +93,10 @@ packages: dependency: transitive description: name: ffi - sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.2.0" file: dependency: transitive description: @@ -133,27 +141,51 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" + hooks: + dependency: transitive + description: + name: hooks + sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" + url: "https://pub.dev" + source: hosted + version: "2.0.2" http: dependency: transitive description: name: http - sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.6.0" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.2" integration_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + jni: + dependency: transitive + description: + name: jni + sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f + url: "https://pub.dev" + source: hosted + version: "1.0.0" + jni_flutter: + dependency: transitive + description: + name: jni_flutter + sha256: "8b59e590786050b1cd866677dddaf76b1ade5e7bc751abe04b86e84d379d3ba6" + url: "https://pub.dev" + source: hosted + version: "1.0.1" leak_tracker: dependency: transitive description: @@ -186,6 +218,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" matcher: dependency: transitive description: @@ -206,10 +246,26 @@ packages: dependency: transitive description: name: meta - sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" + url: "https://pub.dev" + source: hosted + version: "1.18.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "6cb691c686fa2838c6deb34980d426145c2a5d537491cb83d463c33cdbc726ed" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "9.4.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" path: dependency: "direct main" description: @@ -222,26 +278,26 @@ packages: dependency: "direct main" description: name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" + sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd" url: "https://pub.dev" source: hosted - version: "2.2.10" + version: "2.3.1" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.6.0" path_provider_linux: dependency: transitive description: @@ -270,10 +326,10 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.1.0" platform: dependency: transitive description: @@ -294,68 +350,84 @@ packages: dependency: transitive description: name: posix - sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07" url: "https://pub.dev" source: hosted - version: "6.0.3" + version: "6.5.0" process: dependency: transitive description: name: process - sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d" + sha256: c6248e4526673988586e8c00bb22a49210c258dc91df5227d5da9748ecf79744 + url: "https://pub.dev" + source: hosted + version: "5.0.5" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + record_use: + dependency: transitive + description: + name: record_use + sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed" url: "https://pub.dev" source: hosted - version: "5.0.3" + version: "0.6.0" serious_python: dependency: "direct main" description: path: "../.." relative: true source: path - version: "1.0.1" + version: "2.0.0" serious_python_android: dependency: transitive description: path: "../../../serious_python_android" relative: true source: path - version: "1.0.1" + version: "2.0.0" serious_python_darwin: dependency: transitive description: path: "../../../serious_python_darwin" relative: true source: path - version: "1.0.1" + version: "2.0.0" serious_python_linux: dependency: transitive description: path: "../../../serious_python_linux" relative: true source: path - version: "1.0.1" + version: "2.0.0" serious_python_platform_interface: dependency: transitive description: path: "../../../serious_python_platform_interface" relative: true source: path - version: "1.0.1" + version: "2.0.0" serious_python_windows: dependency: transitive description: path: "../../../serious_python_windows" relative: true source: path - version: "1.0.1" + version: "2.0.0" shelf: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" sky_engine: dependency: transitive description: flutter @@ -365,10 +437,10 @@ packages: dependency: transitive description: name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.10.2" stack_trace: dependency: transitive description: @@ -413,10 +485,10 @@ packages: dependency: transitive description: name: test_api - sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.10" + version: "0.7.11" toml: dependency: transitive description: @@ -429,10 +501,10 @@ packages: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" vector_math: dependency: transitive description: @@ -445,34 +517,42 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360" url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.2.0" web: dependency: transitive description: name: web - sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" webdriver: dependency: transitive description: name: webdriver - sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8" + sha256: "2f3a14ca026957870cfd9c635b83507e0e51d8091568e90129fbf805aba7cade" url: "https://pub.dev" source: hosted - version: "3.0.4" + version: "3.1.0" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "3.1.3" sdks: - dart: ">=3.9.0-0 <4.0.0" - flutter: ">=3.22.0" + dart: ">=3.10.3 <4.0.0" + flutter: ">=3.38.4" diff --git a/src/serious_python/example/run_example/windows/CMakeLists.txt b/src/serious_python/example/run_example/windows/CMakeLists.txt index 4dcd8dd3..619b57d2 100644 --- a/src/serious_python/example/run_example/windows/CMakeLists.txt +++ b/src/serious_python/example/run_example/windows/CMakeLists.txt @@ -87,6 +87,12 @@ if(PLUGIN_BUNDLED_LIBRARIES) COMPONENT Runtime) endif() +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") diff --git a/src/serious_python/example/run_example/windows/flutter/generated_plugins.cmake b/src/serious_python/example/run_example/windows/flutter/generated_plugins.cmake index 159536d6..f2f58d64 100644 --- a/src/serious_python/example/run_example/windows/flutter/generated_plugins.cmake +++ b/src/serious_python/example/run_example/windows/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/src/serious_python/example/run_example/windows/runner/Runner.rc b/src/serious_python/example/run_example/windows/runner/Runner.rc index 7814ed45..6065c87b 100644 --- a/src/serious_python/example/run_example/windows/runner/Runner.rc +++ b/src/serious_python/example/run_example/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "run_example" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "run_example" "\0" - VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "run_example.exe" "\0" VALUE "ProductName", "run_example" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/src/serious_python/example/run_example/windows/runner/runner.exe.manifest b/src/serious_python/example/run_example/windows/runner/runner.exe.manifest index a42ea768..153653e8 100644 --- a/src/serious_python/example/run_example/windows/runner/runner.exe.manifest +++ b/src/serious_python/example/run_example/windows/runner/runner.exe.manifest @@ -9,12 +9,6 @@ - - - - - - diff --git a/src/serious_python/example/run_example/windows/runner/utils.cpp b/src/serious_python/example/run_example/windows/runner/utils.cpp index b2b08734..3a0b4651 100644 --- a/src/serious_python/example/run_example/windows/runner/utils.cpp +++ b/src/serious_python/example/run_example/windows/runner/utils.cpp @@ -45,13 +45,13 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } - int target_length = ::WideCharToMultiByte( + unsigned int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, nullptr, 0, nullptr, nullptr) -1; // remove the trailing null character int input_length = (int)wcslen(utf16_string); std::string utf8_string; - if (target_length <= 0 || target_length > utf8_string.max_size()) { + if (target_length == 0 || target_length > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length); diff --git a/src/serious_python/lib/bridge.dart b/src/serious_python/lib/bridge.dart new file mode 100644 index 00000000..b1e4b51c --- /dev/null +++ b/src/serious_python/lib/bridge.dart @@ -0,0 +1,11 @@ +/// In-process Dart ↔ Python byte channel. +/// +/// See [PythonBridge] for the per-channel API. The lower-level [DartBridge] +/// singleton (from the platform-interface package) is re-exported here for +/// embedders that need the process-reuse / session-restart hooks added in +/// libdart_bridge 1.3.0 — `isPythonInitialized` and `signalDartSession`. +library; + +export 'package:serious_python_platform_interface/src/dart_bridge_ffi.dart' + show DartBridge; +export 'src/python_bridge.dart' show PythonBridge; diff --git a/src/serious_python/lib/serious_python.dart b/src/serious_python/lib/serious_python.dart index 968d35f3..1cf29d41 100644 --- a/src/serious_python/lib/serious_python.dart +++ b/src/serious_python/lib/serious_python.dart @@ -9,11 +9,6 @@ export 'package:serious_python_platform_interface/src/utils.dart'; class SeriousPython { SeriousPython._(); - /// Returns the current name and version of the operating system. - static Future getPlatformVersion() { - return SeriousPythonPlatform.instance.getPlatformVersion(); - } - /// Runs Python program from an asset. /// /// [assetPath] is the path to an asset which is a zip archive @@ -64,7 +59,6 @@ class SeriousPython { return runProgram(appPath, modulePaths: modulePaths, environmentVariables: environmentVariables, - script: Platform.isWindows ? "" : null, sync: sync); } diff --git a/src/serious_python/lib/src/python_bridge.dart b/src/serious_python/lib/src/python_bridge.dart new file mode 100644 index 00000000..5c69d6e7 --- /dev/null +++ b/src/serious_python/lib/src/python_bridge.dart @@ -0,0 +1,108 @@ +import 'dart:async'; +import 'dart:ffi'; +import 'dart:isolate'; +import 'dart:typed_data'; + +import 'package:ffi/ffi.dart'; +import 'package:serious_python_platform_interface/serious_python_platform_interface.dart'; + +/// An in-process Dart ↔ Python byte channel, backed by the `dart_bridge` +/// native library. +/// +/// Each [PythonBridge] owns a [ReceivePort] whose native port doubles as the +/// channel key in both directions: +/// +/// - Python → Dart: when Python calls `dart_bridge.send_bytes(port, payload)`, +/// the payload arrives on this bridge's [messages] stream. +/// - Dart → Python: [send] hands bytes to the Python handler registered for +/// this port via `dart_bridge.set_enqueue_handler_func(port, handler)`. +/// +/// Multiple bridges (UI channel, logging channel, future camera-stream +/// channel, ...) can coexist in a single app — each bridge has its own port +/// and its own Python-side handler. +/// +/// Typical use: +/// +/// ```dart +/// final ui = PythonBridge(); +/// final logs = PythonBridge(); +/// +/// ui.messages.listen((Uint8List bytes) { /* UI events */ }); +/// logs.messages.listen((Uint8List bytes) { /* log lines */ }); +/// +/// await SeriousPython.run('app/main.py', environmentVariables: { +/// 'MY_APP_UI_PORT': '${ui.port}', +/// 'MY_APP_LOGS_PORT': '${logs.port}', +/// }); +/// +/// ui.send(Uint8List.fromList([1, 2, 3])); +/// ``` +/// +/// The Python side reads the chosen env-var names to discover its port +/// numbers — no convention is baked in here. +class PythonBridge { + PythonBridge() { + _bridge = DartBridge.instance; + _bridge.initDartApiDL(); + _rx.listen(_onMessage); + } + + final ReceivePort _rx = ReceivePort(); + final StreamController _messages = + StreamController.broadcast(); + late final DartBridge _bridge; + bool _closed = false; + + /// Dart native port acting as this channel's key. Pass it to the Python + /// program (typically via an environment variable) so Python knows where + /// to send messages and which port to register its handler under. + int get port => _rx.sendPort.nativePort; + + /// Bytes pushed by Python via `dart_bridge.send_bytes(port, payload)`. + Stream get messages => _messages.stream; + + /// Send [bytes] to the Python handler registered for this bridge's [port]. + /// + /// Returns `true` on successful delivery, `false` if delivery isn't yet + /// possible: either the Python interpreter hasn't finished `Py_Initialize` + /// yet, or Python hasn't called `dart_bridge.set_enqueue_handler_func` + /// for this port. Both states are transient on app startup — the caller + /// typically retries until `true`. + bool send(Uint8List bytes) { + if (_closed) { + throw StateError('PythonBridge is closed'); + } + final len = bytes.length; + final buf = malloc(len == 0 ? 1 : len); + try { + if (len > 0) { + buf.asTypedList(len).setAll(0, bytes); + } + // rc: 0=delivered, -1=no handler yet, -2=Py_Initialize not finished. + // Both negative cases are transient retry signals on app startup. + final rc = _bridge.enqueueMessage(port, buf, len); + return rc == 0; + } finally { + malloc.free(buf); + } + } + + /// Release this bridge's ReceivePort. After closing, [send] throws and the + /// [messages] stream emits done. + void close() { + if (_closed) return; + _closed = true; + _rx.close(); + _messages.close(); + } + + void _onMessage(dynamic message) { + if (message is Uint8List) { + _messages.add(message); + } else if (message is List) { + _messages.add(Uint8List.fromList(message)); + } + // Drop unexpected message shapes silently — the Python side only ever + // posts typed-data via Dart_PostCObject_DL. + } +} diff --git a/src/serious_python/lib/src/python_versions.dart b/src/serious_python/lib/src/python_versions.dart new file mode 100644 index 00000000..eac66b3b --- /dev/null +++ b/src/serious_python/lib/src/python_versions.dart @@ -0,0 +1,55 @@ +// GENERATED by `dart run serious_python:gen_version_tables` from python-build's +// manifest.json (release 20260614). Do not edit by hand — edit python-build's +// manifest.json, cut a release, bump `pythonReleaseDate`, and regenerate. + +const pythonVersionEnvironmentVariable = "SERIOUS_PYTHON_VERSION"; +const pythonFullVersionEnvironmentVariable = "SERIOUS_PYTHON_FULL_VERSION"; +const pythonDistReleaseEnvironmentVariable = "SERIOUS_PYTHON_DIST_RELEASE"; +const pythonBuildDateEnvironmentVariable = "SERIOUS_PYTHON_BUILD_DATE"; +const pyodideVersionEnvironmentVariable = "SERIOUS_PYTHON_PYODIDE_VERSION"; +const dartBridgeVersionEnvironmentVariable = "DART_BRIDGE_VERSION"; + +/// python-build release the bundled runtimes come from (YYYYMMDD). +const pythonReleaseDate = "20260614"; +const dartBridgeVersion = "1.4.0"; +const defaultPythonVersion = "3.14"; + +class PythonRelease { + const PythonRelease({ + required this.standaloneVersion, + required this.standaloneReleaseDate, + required this.pyodideVersion, + required this.pyodidePlatformTag, + required this.prerelease, + }); + + final String standaloneVersion; + final String standaloneReleaseDate; + final String pyodideVersion; + final String pyodidePlatformTag; + final bool prerelease; +} + +const pythonReleases = { + "3.12": PythonRelease( + standaloneVersion: "3.12.13", + standaloneReleaseDate: "20260610", + pyodideVersion: "0.27.7", + pyodidePlatformTag: "pyodide-2024.0-wasm32", + prerelease: false, + ), + "3.13": PythonRelease( + standaloneVersion: "3.13.14", + standaloneReleaseDate: "20260610", + pyodideVersion: "0.29.4", + pyodidePlatformTag: "pyemscripten-2025.0-wasm32", + prerelease: false, + ), + "3.14": PythonRelease( + standaloneVersion: "3.14.6", + standaloneReleaseDate: "20260610", + pyodideVersion: "314.0.0", + pyodidePlatformTag: "pyemscripten-2026.0-wasm32", + prerelease: false, + ), +}; diff --git a/src/serious_python/pubspec.yaml b/src/serious_python/pubspec.yaml index 84671715..610c1ca7 100644 --- a/src/serious_python/pubspec.yaml +++ b/src/serious_python/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python description: A cross-platform plugin for adding embedded Python runtime to your Flutter apps. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 2.0.0 +version: 3.0.0 platforms: ios: @@ -52,6 +52,8 @@ dependencies: shelf: ^1.4.1 crypto: ^3.0.5 glob: ^2.1.3 + ffi: ^2.1.2 + package_config: ^2.1.0 dev_dependencies: flutter_test: diff --git a/src/serious_python_android/CHANGELOG.md b/src/serious_python_android/CHANGELOG.md index 3c8afb96..2476b774 100644 --- a/src/serious_python_android/CHANGELOG.md +++ b/src/serious_python_android/CHANGELOG.md @@ -1,3 +1,12 @@ +## 3.0.0 + +* **In-process Python (dart_bridge FFI).** The Python lifecycle now runs through `libdart_bridge.so` (from `flet-dev/dart-bridge` **1.4.0**) instead of a socket transport. +* **Native modules are memory-mapped from the APK — no more `useLegacyPackaging`.** Python extension modules (stdlib `lib-dynload` and site-packages) are relocated into `jniLibs//lib.so` and loaded directly from the APK by a custom `sys.meta_path` finder that resolves them from `.soref` markers — no extraction to disk, still ABI-split by the Play Store. Pure Python ships in **stored, ABI-common asset zips** read via `zipimport`, so the stdlib is no longer duplicated per ABI. This replaces the previous scheme of zipping stdlib/site-packages into fake `lib*.so` files (which required `useLegacyPackaging`). The dart-bridge Android binary now uses the full CPython API (`PyConfig`) to install the finder before `site` runs. Set **`SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES`** (comma-separated relative paths) to ship path-hungry packages extracted to disk instead. +* **Breaking change:** requires Flutter **3.44.2**. Moves to AGP **8.11.1**, Gradle 8.11.1, `compileSdk` **36**, Java **17**, and the **Kotlin-DSL** Gradle build (`build.gradle.kts`). +* `build.gradle` resolves the Python version from the generated `python_versions.properties` (a snapshot of python-build's `manifest.json`): `SERIOUS_PYTHON_VERSION` selects the version; the full version, build date and `dart_bridge` version derive from the table, with `SERIOUS_PYTHON_FULL_VERSION` / `SERIOUS_PYTHON_BUILD_DATE` / `DART_BRIDGE_VERSION` left as escape hatches. Downloads continue to use python-build's date-keyed release scheme. +* Drop the `x86` (32-bit Intel) ABI — Flutter no longer produces it. ABIs are `arm64-v8a` + `x86_64` (plus `armeabi-v7a` on Python 3.12). +* Remove the scaffold `getPlatformVersion` method. + ## 2.0.0 * **Breaking change:** default bundled Python version is now 3.14 (was 3.12). Apps built without an explicit `SERIOUS_PYTHON_VERSION` env var pull the 3.14 python-build distribution and ship `libpython3.14.so`. Set `SERIOUS_PYTHON_VERSION=3.12` (typically threaded through `flet build`) to preserve the previous default. diff --git a/src/serious_python_android/android/.gitignore b/src/serious_python_android/android/.gitignore index a4f3c175..642cbe42 100644 --- a/src/serious_python_android/android/.gitignore +++ b/src/serious_python_android/android/.gitignore @@ -8,3 +8,4 @@ /captures .cxx /src/main/jniLibs +/src/main/assets diff --git a/src/serious_python_android/android/build.gradle b/src/serious_python_android/android/build.gradle deleted file mode 100644 index edcaef5c..00000000 --- a/src/serious_python_android/android/build.gradle +++ /dev/null @@ -1,148 +0,0 @@ -group 'com.flet.serious_python_android' -version '2.0.0' - -def python_version = System.getenv('SERIOUS_PYTHON_VERSION') ?: '3.14' - -buildscript { - repositories { - google() - mavenCentral() - } - - dependencies { - // The Android Gradle Plugin knows how to build native code with the NDK. - classpath 'com.android.tools.build:gradle:7.3.0' - classpath 'de.undercouch:gradle-download-task:4.1.2' - } -} - -rootProject.allprojects { - repositories { - google() - mavenCentral() - } -} - -apply plugin: 'com.android.library' -apply plugin: 'de.undercouch.download' - -android { - namespace "com.flet.serious_python_android" - - // Bumping the plugin compileSdkVersion requires all clients of this plugin - // to bump the version in their app. - compileSdkVersion 31 - - // Invoke the shared CMake build with the Android Gradle Plugin. - externalNativeBuild { - cmake { - path "../src/CMakeLists.txt" - - // The default CMake version for the Android Gradle Plugin is 3.10.2. - // https://developer.android.com/studio/projects/install-ndk#vanilla_cmake - // - // The Flutter tooling requires that developers have CMake 3.10 or later - // installed. You should not increase this version, as doing so will cause - // the plugin to fail to compile for some customers of the plugin. - // version "3.10.2" - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion 21 - - ndk { - // python-build dropped 32-bit Android in 3.13 (PEP 738), so the - // python-android-dart--armeabi-v7a tarball only exists for 3.12. - if (python_version == '3.12') { - abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64' - } else { - abiFilters 'arm64-v8a', 'x86_64' - } - } - } - - packagingOptions { - doNotStrip "*/arm64-v8a/libpython*.so" - doNotStrip "*/armeabi-v7a/libpython*.so" - doNotStrip "*/x86/libpython*.so" - doNotStrip "*/x86_64/libpython*.so" - } -} - -import de.undercouch.gradle.tasks.download.Download - -def fletCacheRoot = System.getenv('FLET_CACHE_DIR') -def pythonCacheDir = new File( - fletCacheRoot ? new File(fletCacheRoot) : new File(System.getProperty('user.home'), '.flet/cache'), - "python-build/v${python_version}" -) - -task copyBuildDist(type: Copy) { - def srcDir = System.getenv('SERIOUS_PYTHON_BUILD_DIST') - if (srcDir != null) { - from srcDir - into 'src/main/jniLibs' - } -} - -// Loop through abiFilters -def packageTasks = [] -android.defaultConfig.ndk.abiFilters.each { abi -> - - def srcDir = System.getenv('SERIOUS_PYTHON_SITE_PACKAGES') - if (srcDir == null || srcDir.allWhitespace) { - throw new InvalidUserDataException("SERIOUS_PYTHON_SITE_PACKAGES environment variable is not set.") - } - - packageTasks.add("zipSitePackages_$abi") - packageTasks.add("copyOpt_$abi") - - tasks.register("jniCleanUp_$abi", Delete) { - delete "src/main/jniLibs/$abi" - } - - tasks.register("downloadDistArchive_$abi", Download) { - src "https://github.com/flet-dev/python-build/releases/download/v${python_version}/python-android-dart-${python_version}-${abi}.tar.gz" - dest new File(pythonCacheDir, "python-android-dart-${python_version}-${abi}.tar.gz") - onlyIfModified true - useETag "all" - tempAndMove true - doFirst { dest.parentFile.mkdirs() } - } - tasks.register("untarFile_$abi", Copy) { - from tarTree(tasks.named("downloadDistArchive_$abi").get().dest) - into "src/main/jniLibs/$abi" - dependsOn "jniCleanUp_$abi", "downloadDistArchive_$abi" - } - - tasks.register("copyOpt_$abi", Copy) { - from fileTree(dir: "$srcDir/$abi/opt", include: ["**/*.so"]) - into "src/main/jniLibs/$abi" - eachFile { - path = name - } - includeEmptyDirs = false - dependsOn "jniCleanUp_$abi" - } - - tasks.register("zipSitePackages_$abi", Zip) { - from fileTree(dir: "$srcDir/$abi") - archiveFileName = "libpythonsitepackages.so" - destinationDirectory = file("src/main/jniLibs/$abi") - dependsOn "jniCleanUp_$abi", "untarFile_$abi" - } -} - -if (System.getenv('SERIOUS_PYTHON_BUILD_DIST')) { - task copyOrUntar(dependsOn: 'copyBuildDist') -} else { - task copyOrUntar(dependsOn: packageTasks) -} - -preBuild.dependsOn copyOrUntar diff --git a/src/serious_python_android/android/build.gradle.kts b/src/serious_python_android/android/build.gradle.kts new file mode 100644 index 00000000..f50a6f80 --- /dev/null +++ b/src/serious_python_android/android/build.gradle.kts @@ -0,0 +1,326 @@ +import com.android.build.gradle.LibraryExtension +import de.undercouch.gradle.tasks.download.Download +import org.gradle.api.InvalidUserDataException +import java.io.File +import java.util.Properties +import java.util.zip.CRC32 +import java.util.zip.ZipEntry +import java.util.zip.ZipFile +import java.util.zip.ZipOutputStream + +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + // The Android Gradle Plugin knows how to build native code with the NDK. + classpath("com.android.tools.build:gradle:8.11.1") + classpath("de.undercouch:gradle-download-task:5.6.0") + } +} + +group = "com.flet.serious_python_android" +version = "3.0.0" + +rootProject.allprojects { + repositories { + google() + mavenCentral() + } +} + +apply(plugin = "com.android.library") +apply(plugin = "de.undercouch.download") + +// Python runtime versions come from the generated python_versions.properties +// (a snapshot of python-build's manifest.json — see serious_python's +// `gen_version_tables`). SERIOUS_PYTHON_VERSION selects the version; everything +// else derives from the table. The per-field env vars are escape hatches. +val pv = Properties().apply { + file("python_versions.properties").inputStream().use { load(it) } +} +val pythonVersion: String = System.getenv("SERIOUS_PYTHON_VERSION") ?: pv.getProperty("default_python_version") +val pythonFullVersion: String? = System.getenv("SERIOUS_PYTHON_FULL_VERSION") ?: pv.getProperty("$pythonVersion.full_version") +val pythonBuildDate: String = System.getenv("SERIOUS_PYTHON_BUILD_DATE") ?: pv.getProperty("python_build_release_date") +val dartBridgeVersion: String = System.getenv("DART_BRIDGE_VERSION") ?: pv.getProperty("dart_bridge_version") +if (pythonFullVersion == null) { + val known = pv.keys.map { it.toString() }.filter { it.endsWith(".full_version") }.map { it.removeSuffix(".full_version") } + throw GradleException("serious_python: unknown SERIOUS_PYTHON_VERSION '$pythonVersion'. Supported: ${known.joinToString(", ")}") +} + +// python-build dropped 32-bit Android in 3.13 (PEP 738), so the +// python-android-dart--armeabi-v7a tarball only exists for 3.12. +val abis: List = if (pythonVersion == "3.12") + listOf("arm64-v8a", "armeabi-v7a", "x86_64") +else + listOf("arm64-v8a", "x86_64") + +configure { + namespace = "com.flet.serious_python_android" + + // Bumping the plugin compileSdk requires all clients of this plugin to bump too. + compileSdk = 36 + + // No native code is compiled here — libdart_bridge.so is downloaded as a + // pre-built artifact from flet-dev/dart-bridge releases (see the + // downloadDartBridge_$abi tasks below) and dropped into jniLibs. + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + defaultConfig { + minSdk = 21 + ndk { + abiFilters.addAll(abis) + } + } + + // No jniLibs packaging config needed: the native modules are real ELF .so that + // land in the consuming app's jniLibs (relocated by the split tasks) and are + // loaded memory-mapped from the APK — modern packaging (minSdk 23+) is all that + // is required. (The old keepDebugSymbols rules were only needed for the previous + // fake-.so-zip scheme.) + + // Keep the stdlib/sitepackages/extract zips stored (uncompressed) in the APK so + // zipimport can read members without zlib. + androidResources { + noCompress.add("zip") + } +} + +val fletCacheRoot: String? = System.getenv("FLET_CACHE_DIR") +val cacheBase: File = if (fletCacheRoot != null) File(fletCacheRoot) else File(System.getProperty("user.home"), ".flet/cache") +val pythonCacheDir = File(cacheBase, "python-build/v$pythonFullVersion") +val dartBridgeCacheDir = File(cacheBase, "dart-bridge/v$dartBridgeVersion") + +tasks.register("copyBuildDist") { + val srcDir = System.getenv("SERIOUS_PYTHON_BUILD_DIST") + if (srcDir != null) { + from(srcDir) + into("src/main/jniLibs") + } +} + +val siteSrcDir: String? = System.getenv("SERIOUS_PYTHON_SITE_PACKAGES") + +// ---- native split ----------------------------------------------------------- +// Relocate CPython extension modules to jniLibs//lib.so (loaded by +// basename via the linker namespace), leaving a .soref marker (content = the lib +// name) at each module's path in the pure zip. Pure code ships in ABI-common +// stored zips; path-hungry packages from SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES +// are moved whole into extract.zip and excluded from sitepackages.zip. +val extractPackages: List = (System.getenv("SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES") ?: "") + .split(",").map { it.trim() }.filter { it.isNotEmpty() } +val primaryAbi = abis.first() // pure zips are ABI-common: build once +val assetsDir = file("src/main/assets") +val bootstrapPy = file("../python/_sp_bootstrap.py") + +val extTag = Regex("""\.(cpython-[^/]+|abi3)\.so$""") // tagged extension module +fun isExtModule(name: String) = extTag.containsMatchIn(name) +fun extDottedName(rel: String): String { // slash-rel path -> dotted import name + val dir = rel.substringBeforeLast('/', "") + val mod = rel.substringAfterLast('/').replace(extTag, "") + return (if (dir.isEmpty()) "" else dir.replace('/', '.') + ".") + mod +} +fun mangledLib(dotted: String) = "lib" + dotted.replace('.', '-') + ".so" +fun sorefPath(rel: String) = rel.replace(extTag, ".soref") +fun isAllowlisted(rel: String) = extractPackages.any { rel == it || rel.startsWith("$it/") } + +// Minimal STORED (uncompressed) zip so members stay readable via zipimport.get_data +// with no zlib at runtime. +class StoredZip(val out: ZipOutputStream) { + fun add(name: String, data: ByteArray) { + val e = ZipEntry(name).apply { + method = ZipEntry.STORED + size = data.size.toLong() + compressedSize = data.size.toLong() + crc = CRC32().apply { update(data) }.value + } + out.putNextEntry(e); out.write(data); out.closeEntry() + } + fun close() = out.close() +} +fun storedZip(f: File): StoredZip { + f.parentFile.mkdirs() + return StoredZip(ZipOutputStream(f.outputStream()).apply { setMethod(ZipOutputStream.STORED) }) +} + +// Loop through abiFilters +val packageTasks = mutableListOf() + +// Remove jniLibs/ dirs for ABIs not in the current set (e.g. stale armeabi-v7a +// 3.12 leftovers when building 3.14) so they aren't packaged into the APK/AAB. +val jniLibsRoot = file("src/main/jniLibs") +tasks.register("cleanStaleAbis") { + doLast { + jniLibsRoot.listFiles()?.forEach { d -> + if (d.isDirectory && d.name !in abis) d.deleteRecursively() + } + } +} +packageTasks.add("cleanStaleAbis") + +for (abi in abis) { + if (siteSrcDir == null || siteSrcDir.isBlank()) { + throw InvalidUserDataException("SERIOUS_PYTHON_SITE_PACKAGES environment variable is not set.") + } + + packageTasks.add("splitStdlib_$abi") + packageTasks.add("splitSitePackages_$abi") + packageTasks.add("copyOpt_$abi") + + tasks.register("jniCleanUp_$abi") { + delete("src/main/jniLibs/$abi") + } + + val distFile = File(pythonCacheDir, "python-android-dart-$pythonFullVersion-$abi.tar.gz") + tasks.register("downloadDistArchive_$abi") { + src("https://github.com/flet-dev/python-build/releases/download/$pythonBuildDate/python-android-dart-$pythonFullVersion-$abi.tar.gz") + dest(distFile) + onlyIfModified(true) + useETag("all") + tempAndMove(true) + doFirst { distFile.parentFile.mkdirs() } + } + tasks.register("untarFile_$abi") { + from(tarTree(distFile)) + into("src/main/jniLibs/$abi") + dependsOn("jniCleanUp_$abi", "downloadDistArchive_$abi") + } + + tasks.register("copyOpt_$abi") { + from(fileTree("$siteSrcDir/$abi/opt") { include("**/*.so") }) + into("src/main/jniLibs/$abi") + eachFile { path = name } + includeEmptyDirs = false + dependsOn("jniCleanUp_$abi") + } + + val jniDir = file("src/main/jniLibs/$abi") + val abiSiteDir = file("$siteSrcDir/$abi") + val bundleFile = File(jniDir, "libpythonbundle.so") + val isPrimary = abi == primaryAbi + + // Crack the stdlib bundle (libpythonbundle.so): modules/*.so -> mangled jniLibs + // (+ .soref markers in stdlib.zip), stdlib/* -> stdlib.zip root, then delete it. + tasks.register("splitStdlib_$abi") { + dependsOn("untarFile_$abi") + // The doLast rewrites jniLibs/ (mangled libs in, bundle out); declare it as a + // tracked output and always re-run so AGP's native-libs merge re-packages. + outputs.dir(jniDir) + outputs.dir(assetsDir) + outputs.upToDateWhen { false } + doLast { + if (!bundleFile.exists()) throw GradleException("libpythonbundle.so missing in jniLibs/$abi") + val zip = if (isPrimary) storedZip(File(assetsDir, "stdlib.zip")) else null + ZipFile(bundleFile).use { zf -> + val en = zf.entries() + while (en.hasMoreElements()) { + val e = en.nextElement() + if (e.isDirectory) continue + val data = zf.getInputStream(e).readBytes() + val name = e.name + when { + name.startsWith("modules/") -> { + val rel = name.removePrefix("modules/") // top-level module file + when { + isExtModule(rel) -> { + val lib = mangledLib(extDottedName(rel)) + File(jniDir, lib).writeBytes(data) + zip?.add(sorefPath(rel), lib.toByteArray()) + } + rel.endsWith(".so") -> File(jniDir, File(rel).name).writeBytes(data) + else -> zip?.add(rel, data) + } + } + name.startsWith("stdlib/") -> zip?.add(name.removePrefix("stdlib/"), data) + else -> zip?.add(name, data) + } + } + } + zip?.add("_sp_bootstrap.py", bootstrapPy.readBytes()) // finder at zip root + // The dart-bridge Android shim (F) installs the finder before `site`. A + // sitecustomize fallback can be re-enabled for bridges without that shim: + // zip?.add("sitecustomize.py", "import _sp_bootstrap\n_sp_bootstrap.install()\n".toByteArray()) + zip?.close() + bundleFile.delete() // fake-zip must not ship + } + } + + // Site-packages tree: tagged .so -> mangled jniLibs (+ .soref markers), pure -> + // sitepackages.zip (or extract.zip if allowlisted); opt/ is left to copyOpt. + tasks.register("splitSitePackages_$abi") { + dependsOn("untarFile_$abi") + mustRunAfter("copyOpt_$abi", "splitStdlib_$abi") + outputs.dir(jniDir) + outputs.dir(assetsDir) + outputs.upToDateWhen { false } + doLast { + jniDir.mkdirs() + val siteZip = if (isPrimary) storedZip(File(assetsDir, "sitepackages.zip")) else null + val extractZip = if (isPrimary) storedZip(File(assetsDir, "extract.zip")) else null + abiSiteDir.walkTopDown().filter { it.isFile }.forEach { f -> + val rel = f.relativeTo(abiSiteDir).path.replace(File.separatorChar, '/') + if (rel == "opt" || rel.startsWith("opt/")) return@forEach // dep libs -> copyOpt + val zip = if (isAllowlisted(rel)) extractZip else siteZip + when { + isExtModule(rel) -> { + val lib = mangledLib(extDottedName(rel)) + f.copyTo(File(jniDir, lib), overwrite = true) + zip?.add(sorefPath(rel), lib.toByteArray()) + } + rel.endsWith(".so") -> f.copyTo(File(jniDir, f.name), overwrite = true) // untagged -> dep + else -> zip?.add(rel, f.readBytes()) + } + } + siteZip?.close() + extractZip?.close() + } + } + + // dart-bridge ships a per-(abi × Python-minor-version) prebuilt .so. The + // binary's DT_NEEDED is libpython3.X.so (version-specific), so the bridge + // .so MUST match the libpython bundled in the same APK. We download from + // the pinned dart_bridge_version release into a cache shared across + // builds, then drop it as `libdart_bridge.so` (no version suffix) so the + // Dart side can DynamicLibrary.open by a stable short name. + // SERIOUS_PYTHON_DART_BRIDGE_DIST: local-dev override pointing at a dir of + // freshly cross-compiled libdart_bridge-android--py.so, bypassing the + // GitHub release download (mirrors the SERIOUS_PYTHON_BUILD_DIST escape hatch). + val dartBridgeDist = System.getenv("SERIOUS_PYTHON_DART_BRIDGE_DIST") + val bridgeFile = if (dartBridgeDist != null) + File(dartBridgeDist, "libdart_bridge-android-$abi-py$pythonVersion.so") + else + File(dartBridgeCacheDir, "libdart_bridge-android-$abi-py$pythonVersion.so") + tasks.register("downloadDartBridge_$abi") { + src("https://github.com/flet-dev/dart-bridge/releases/download/v$dartBridgeVersion/libdart_bridge-android-$abi-py$pythonVersion.so") + dest(bridgeFile) + onlyIfModified(true) + useETag("all") + tempAndMove(true) + doFirst { bridgeFile.parentFile.mkdirs() } + } + tasks.register("copyDartBridge_$abi") { + from(bridgeFile) + into("src/main/jniLibs/$abi") + rename(".*", "libdart_bridge.so") + if (dartBridgeDist == null) dependsOn("downloadDartBridge_$abi") + dependsOn("jniCleanUp_$abi") + } + packageTasks.add("copyDartBridge_$abi") +} + +val copyOrUntar = tasks.register("copyOrUntar") { + if (System.getenv("SERIOUS_PYTHON_BUILD_DIST") != null) { + dependsOn("copyBuildDist") + } else { + dependsOn(packageTasks) + } +} + +tasks.named("preBuild") { + dependsOn(copyOrUntar) +} diff --git a/src/serious_python_android/android/python_versions.properties b/src/serious_python_android/android/python_versions.properties new file mode 100644 index 00000000..7cc4bbe2 --- /dev/null +++ b/src/serious_python_android/android/python_versions.properties @@ -0,0 +1,8 @@ +# GENERATED by `dart run serious_python:gen_version_tables` from +# python-build manifest.json (release 20260614). Do not edit by hand. +default_python_version=3.14 +dart_bridge_version=1.4.0 +python_build_release_date=20260614 +3.12.full_version=3.12.13 +3.13.full_version=3.13.14 +3.14.full_version=3.14.6 diff --git a/src/serious_python_android/android/src/main/java/com/flet/serious_python_android/AndroidPlugin.java b/src/serious_python_android/android/src/main/java/com/flet/serious_python_android/AndroidPlugin.java index 1f573921..54ba8f80 100644 --- a/src/serious_python_android/android/src/main/java/com/flet/serious_python_android/AndroidPlugin.java +++ b/src/serious_python_android/android/src/main/java/com/flet/serious_python_android/AndroidPlugin.java @@ -16,19 +16,18 @@ import com.flet.serious_python_android.PythonActivity; -/** AndroidPlugin */ +/** + * Thin Flutter plugin: surfaces nativeLibraryDir and app version to Dart and + * exposes a few process-wide env vars Python code may read. All Python + * lifecycle now lives in libdart_bridge.so (downloaded from + * flet-dev/dart-bridge), invoked from Dart via FFI. + */ public class AndroidPlugin implements FlutterPlugin, MethodCallHandler, ActivityAware { public static final String MAIN_ACTIVITY_HOST_CLASS_NAME = "MAIN_ACTIVITY_HOST_CLASS_NAME"; public static final String MAIN_ACTIVITY_CLASS_NAME = "MAIN_ACTIVITY_CLASS_NAME"; public static final String ANDROID_NATIVE_LIBRARY_DIR = "ANDROID_NATIVE_LIBRARY_DIR"; - /// The MethodChannel that will the communication between Flutter and native - /// Android - /// - /// This local reference serves to register the plugin with the Flutter Engine - /// and unregister it - /// when the Flutter Engine is detached from the Activity private MethodChannel channel; private Context context; @@ -39,12 +38,47 @@ public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBindin channel.setMethodCallHandler(this); this.context = flutterPluginBinding.getApplicationContext(); try { - Os.setenv(ANDROID_NATIVE_LIBRARY_DIR, new ContextWrapper(this.context).getApplicationInfo().nativeLibraryDir, true); + android.content.pm.ApplicationInfo ai = + new ContextWrapper(this.context).getApplicationInfo(); + Os.setenv(ANDROID_NATIVE_LIBRARY_DIR, ai.nativeLibraryDir, true); + // Under modern packaging (useLegacyPackaging=false) native libs are NOT extracted + // to nativeLibraryDir; they live uncompressed/page-aligned inside the APK and are + // loadable via Bionic's zip-path (apk!/lib//). Export that prefix so + // the finder can dlopen them directly from the APK (mmap, no extraction). For Play + // Store AAB installs the libs are in a per-ABI config split, not base.apk, so pick + // whichever installed APK actually contains lib//. + String abi = (android.os.Build.SUPPORTED_ABIS != null + && android.os.Build.SUPPORTED_ABIS.length > 0) + ? android.os.Build.SUPPORTED_ABIS[0] : ""; + Os.setenv("ANDROID_APK_NATIVE_PREFIX", apkNativePrefix(ai, abi), true); } catch (Exception e) { // nothing to do } } + // Bionic zip-path prefix (!/lib//) of the installed APK that holds the + // native libs. Single-APK builds -> base.apk; Play Store AAB installs -> the + // per-ABI config split (base.apk has no libs then). Detected by probing for the + // always-present libdart_bridge.so. + private static String apkNativePrefix(android.content.pm.ApplicationInfo ai, String abi) { + java.util.List apks = new java.util.ArrayList<>(); + if (ai.sourceDir != null) apks.add(ai.sourceDir); + if (ai.splitSourceDirs != null) { + java.util.Collections.addAll(apks, ai.splitSourceDirs); + } + String member = "lib/" + abi + "/libdart_bridge.so"; + for (String apk : apks) { + try (java.util.zip.ZipFile zf = new java.util.zip.ZipFile(apk)) { + if (zf.getEntry(member) != null) { + return apk + "!/lib/" + abi + "/"; + } + } catch (Exception e) { + // unreadable apk — skip + } + } + return (ai.sourceDir != null ? ai.sourceDir : "") + "!/lib/" + abi + "/"; + } + @Override public void onAttachedToActivity(@NonNull ActivityPluginBinding activityPluginBinding) { PythonActivity.mActivity = activityPluginBinding.getActivity(); @@ -58,9 +92,7 @@ public void onAttachedToActivity(@NonNull ActivityPluginBinding activityPluginBi @Override public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { - if (call.method.equals("getPlatformVersion")) { - result.success("Android " + android.os.Build.VERSION.RELEASE); - } else if (call.method.equals("getAppVersion")) { + if (call.method.equals("getAppVersion")) { try { String packageName = context.getPackageName(); android.content.pm.PackageManager pm = context.getPackageManager(); @@ -71,25 +103,51 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { } catch (Exception e) { result.error("Error", e.getMessage(), null); } - } else if (call.method.equals("getNativeLibraryDir")) { - ContextWrapper contextWrapper = new ContextWrapper(context); - String nativeLibraryDir = contextWrapper.getApplicationInfo().nativeLibraryDir; - result.success(nativeLibraryDir); - } else if (call.method.equals("loadLibrary")) { + } else if (call.method.equals("getFilesDir")) { + result.success(context.getFilesDir().getAbsolutePath()); + } else if (call.method.equals("extractAsset")) { + // Stream an APK asset to disk as one whole file (e.g. stdlib.zip). try { - System.loadLibrary(call.argument("libname")); - result.success(null); - } catch (Throwable e) { - result.error("Error", e.getMessage(), null); + String asset = call.argument("asset"); + String dest = call.argument("dest"); + java.io.File destFile = new java.io.File(dest); + if (destFile.getParentFile() != null) destFile.getParentFile().mkdirs(); + byte[] buf = new byte[1 << 16]; + try (java.io.InputStream in = context.getAssets().open(asset); + java.io.OutputStream out = new java.io.FileOutputStream(destFile)) { + int n; + while ((n = in.read(buf)) > 0) out.write(buf, 0, n); + } + result.success(dest); + } catch (Exception e) { + result.error("extractAsset", e.getMessage(), null); } - } else if (call.method.equals("setEnvironmentVariable")) { - String name = call.argument("name"); - String value = call.argument("value"); + } else if (call.method.equals("unzipAsset")) { + // Unpack an APK asset zip (e.g. extract.zip) into a directory tree. try { - Os.setenv(name, value, true); - result.success(null); + String asset = call.argument("asset"); + String destDir = call.argument("dest"); + java.io.File root = new java.io.File(destDir); + byte[] buf = new byte[1 << 16]; + try (java.io.InputStream in = context.getAssets().open(asset); + java.util.zip.ZipInputStream zis = new java.util.zip.ZipInputStream(in)) { + java.util.zip.ZipEntry e; + while ((e = zis.getNextEntry()) != null) { + java.io.File f = new java.io.File(root, e.getName()); + if (e.isDirectory()) { + f.mkdirs(); + } else { + if (f.getParentFile() != null) f.getParentFile().mkdirs(); + try (java.io.OutputStream out = new java.io.FileOutputStream(f)) { + int n; + while ((n = zis.read(buf)) > 0) out.write(buf, 0, n); + } + } + } + } + result.success(destDir); } catch (Exception e) { - result.error("Error", e.getMessage(), null); + result.error("unzipAsset", e.getMessage(), null); } } else { result.notImplemented(); diff --git a/src/serious_python_android/lib/serious_python_android.dart b/src/serious_python_android/lib/serious_python_android.dart index 61b7eaf2..7c7d4997 100644 --- a/src/serious_python_android/lib/serious_python_android.dart +++ b/src/serious_python_android/lib/serious_python_android.dart @@ -1,145 +1,111 @@ -import 'dart:async'; import 'dart:io'; -import 'package:ffi/ffi.dart'; import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:path/path.dart' as p; import 'package:serious_python_platform_interface/serious_python_platform_interface.dart'; -import 'src/cpython.dart'; -import 'src/log.dart'; - -/// An implementation of [SeriousPythonPlatform] that uses method channels. +/// Android implementation of [SeriousPythonPlatform]. +/// +/// Python lifecycle (env, sys.path, Py_Initialize, run, finalize, sync/async) +/// lives in `serious_python_run`, packaged as `libdart_bridge.so` and bundled +/// into the APK by the plugin's gradle pipeline (see `android/build.gradle`'s +/// `downloadDartBridge_` tasks). +/// +/// This class: +/// 1. Pulls the python.bundle (zipped stdlib + dynload .so files) out of the +/// APK's nativeLibraryDir into a writable app-support directory, since +/// CPython can't import from inside the .apk. +/// 2. Builds env vars + sys.path entries and hands them to `serious_python_run` +/// in a single FFI call. class SeriousPythonAndroid extends SeriousPythonPlatform { - /// The method channel used to interact with the native platform. @visibleForTesting final methodChannel = const MethodChannel('android_plugin'); - /// Registers this class as the default instance of [SeriousPythonPlatform] static void registerWith() { SeriousPythonPlatform.instance = SeriousPythonAndroid(); } - @override - Future getPlatformVersion() async { - final version = - await methodChannel.invokeMethod('getPlatformVersion'); - return version; - } - @override Future run(String appPath, {String? script, List? modulePaths, Map? environmentVariables, bool? sync}) async { - Future setenv(String key, String value) => - methodChannel.invokeMethod( - 'setEnvironmentVariable', {'name': key, 'value': value}); - - // load libpyjni.so to get JNI reference - try { - await methodChannel - .invokeMethod('loadLibrary', {'libname': 'pyjni'}); - await setenv("FLET_JNI_READY", "1"); - } catch (e) { - spDebug("Unable to load libpyjni.so library: $e"); - } - - // unpack python bundle - final nativeLibraryDir = - await methodChannel.invokeMethod('getNativeLibraryDir'); - spDebug("getNativeLibraryDir: $nativeLibraryDir"); - - // The bundled libpython filename moves with the Python version - // (e.g. libpython3.12.so vs libpython3.13.so), so resolve it by - // scanning nativeLibraryDir rather than hardcoding a constant — the - // plugin only ever bundles one libpython per build. - final libpythonRe = RegExp(r'^libpython3\.\d+\.so$'); - final pythonSharedLib = Directory(nativeLibraryDir!) - .listSync() - .map((e) => p.basename(e.path)) - .firstWhere( - libpythonRe.hasMatch, - orElse: () => throw Exception( - "No libpython3.*.so found in $nativeLibraryDir"), - ); - spDebug("Resolved Python shared library: $pythonSharedLib"); - - String? getPythonFullVersion() { - try { - final cpython = getCPython(pythonSharedLib); - final versionPtr = cpython.Py_GetVersion(); - return versionPtr.cast().toDartString(); - } catch (e) { - spDebug("Unable to read Python version for invalidation: $e"); - return null; - } + // Native extension modules now live in jniLibs (loaded by basename via the + // finder); pure code ships in stored Android-asset zips. Copy the zips to disk + // once (version-keyed) and unpack the allowlist payload; PYTHONPATH points at + // the zips so zipimport serves pure modules in place. + final filesDir = await methodChannel.invokeMethod('getFilesDir'); + if (filesDir == null) { + throw StateError('serious_python: failed to resolve files dir'); } - - Future getAppVersion() async { - try { - return await methodChannel.invokeMethod('getAppVersion'); - } catch (e) { - spDebug("Unable to get app version for invalidation: $e"); - return null; + final base = p.join(filesDir, 'flet', 'py'); + final stdlibZip = p.join(base, 'stdlib.zip'); + final siteZip = p.join(base, 'sitepackages.zip'); + final extractDir = p.join(base, 'extract'); + + final appVersion = await _appVersion(); + final key = appVersion != null ? 'app:$appVersion' : 'app:dev'; + final marker = File(p.join(base, '.key')); + final upToDate = + await marker.exists() && (await marker.readAsString()) == key; + if (!upToDate) { + await Directory(base).create(recursive: true); + if (await Directory(extractDir).exists()) { + await Directory(extractDir).delete(recursive: true); } + await methodChannel.invokeMethod( + 'extractAsset', {'asset': 'stdlib.zip', 'dest': stdlibZip}); + await methodChannel.invokeMethod( + 'extractAsset', {'asset': 'sitepackages.zip', 'dest': siteZip}); + await methodChannel.invokeMethod( + 'unzipAsset', {'asset': 'extract.zip', 'dest': extractDir}); + await marker.writeAsString(key); } - var bundlePath = "$nativeLibraryDir/libpythonbundle.so"; - var sitePackagesZipPath = "$nativeLibraryDir/libpythonsitepackages.so"; - - if (!await File(bundlePath).exists()) { - throw Exception("Python bundle not found: $bundlePath"); - } - final pythonVersion = getPythonFullVersion(); - spDebug("Python version: $pythonVersion"); - final pythonInvalidateKey = pythonVersion != null - ? "python:$pythonVersion" - : "python:$pythonSharedLib"; - var pythonLibPath = await extractFileZip(bundlePath, - targetPath: "python_bundle", invalidateKey: pythonInvalidateKey); - spDebug("pythonLibPath: $pythonLibPath"); - - var programDirPath = p.dirname(appPath); - - var moduleSearchPaths = [ - programDirPath, + final programDir = p.dirname(appPath); + // Highest -> lowest precedence. site-packages before stdlib so pip backports + // can override; extract-dir before sitepackages.zip. Natives resolve via the + // finder, not a sys.path entry. + final pythonPaths = [ ...?modulePaths, - "$pythonLibPath/modules", - "$pythonLibPath/stdlib" + programDir, + extractDir, + siteZip, + stdlibZip, ]; - if (await File(sitePackagesZipPath).exists()) { - final appVersion = await getAppVersion(); - spDebug("App version: $appVersion"); - final sitePackagesInvalidateKey = - appVersion != null ? "app:$appVersion" : null; - var sitePackagesPath = await extractFileZip(sitePackagesZipPath, - targetPath: "python_site_packages", - invalidateKey: sitePackagesInvalidateKey); - spDebug("sitePackagesPath: $sitePackagesPath"); - moduleSearchPaths.add(sitePackagesPath); - } - - await setenv("PYTHONINSPECT", "1"); - await setenv("PYTHONDONTWRITEBYTECODE", "1"); - await setenv("PYTHONNOUSERSITE", "1"); - await setenv("PYTHONUNBUFFERED", "1"); - await setenv("LC_CTYPE", "UTF-8"); - await setenv("PYTHONHOME", pythonLibPath); - await setenv("PYTHONPATH", moduleSearchPaths.join(":")); + final env = { + 'PYTHONINSPECT': '1', + 'PYTHONDONTWRITEBYTECODE': '1', + 'PYTHONNOUSERSITE': '1', + 'PYTHONUNBUFFERED': '1', + 'LC_CTYPE': 'UTF-8', + 'PYTHONHOME': base, + 'PYTHONPATH': pythonPaths.join(':'), + ...?environmentVariables, + }; + + final rc = runPython( + bridge: DartBridge.instance, + appPath: script == null ? appPath : null, + script: script, + modulePaths: pythonPaths, + environmentVariables: env, + sync: sync ?? false, + ); + + // sync=true: rc is the Python exit code. sync=false: rc is the spawn + // result (0 = worker thread started successfully). + return rc != 0 ? 'Python exited with code $rc' : null; + } - // set environment variables - if (environmentVariables != null) { - for (var v in environmentVariables.entries) { - await setenv(v.key, v.value); - } + Future _appVersion() async { + try { + return await methodChannel.invokeMethod('getAppVersion'); + } catch (_) { + return null; } - - return runPythonProgramFFI( - sync ?? false, pythonSharedLib, appPath, script ?? ""); } } diff --git a/src/serious_python_android/lib/src/cpython.dart b/src/serious_python_android/lib/src/cpython.dart deleted file mode 100644 index 9182eb6a..00000000 --- a/src/serious_python_android/lib/src/cpython.dart +++ /dev/null @@ -1,244 +0,0 @@ -import 'dart:async'; -import 'dart:ffi'; -import 'dart:isolate'; - -import 'package:ffi/ffi.dart'; -import 'package:path/path.dart' as p; - -import 'gen.dart'; -import 'log.dart'; - -export 'gen.dart'; - -CPython? _cpython; -String? _logcatForwardingError; -Future _pythonRunQueue = Future.value(); - -Future _enqueuePythonRun(Future Function() action) { - final completer = Completer(); - _pythonRunQueue = _pythonRunQueue.then((_) async { - try { - completer.complete(await action()); - } catch (e, st) { - completer.completeError(e, st); - } - }); - return completer.future; -} - -const _logcatInitScript = r''' -import logging,sys - -# Make this init idempotent across Dart isolate restarts. -if not getattr(sys, "__serious_python_logcat_configured__", False): - sys.__serious_python_logcat_configured__ = True - - from ctypes import cdll, c_int, c_char_p - liblog = cdll.LoadLibrary("liblog.so") - ANDROID_LOG_INFO = 4 - liblog.__android_log_write.argtypes = [c_int, c_char_p, c_char_p] - liblog.__android_log_write.restype = c_int - - def _log_to_logcat(msg, level=ANDROID_LOG_INFO): - if not msg: - return - if isinstance(msg, bytes): - msg = msg.decode("utf-8", errors="replace") - liblog.__android_log_write(level, b"serious_python", msg.encode("utf-8")) - - class _LogcatWriter: - def write(self, msg): - _log_to_logcat(msg.strip()) - def flush(self): - pass - - sys.stdout = sys.stderr = _LogcatWriter() - handler = logging.StreamHandler(sys.stderr) - handler.setFormatter(logging.Formatter("%(levelname)s %(message)s")) - root = logging.getLogger() - root.handlers[:] = [handler] - root.setLevel(logging.ERROR) -'''; - -CPython getCPython(String dynamicLibPath) { - return _cpython ??= _cpython = CPython(DynamicLibrary.open(dynamicLibPath)); -} - -Future runPythonProgramFFI(bool sync, String dynamicLibPath, - String pythonProgramPath, String script) async { - return _enqueuePythonRun(() async { - spDebug( - "Python run start (sync=$sync, script=${script.isNotEmpty}, program=$pythonProgramPath)"); - if (sync) { - // Sync run: do not involve ports (avoids GC/close races). - final result = - _runPythonProgram(dynamicLibPath, pythonProgramPath, script); - spDebug("Python run done (resultLength=${result.length})"); - return result; - } else { - // Async run: use Isolate.run() to avoid manual port lifecycle issues. - try { - final result = await Isolate.run( - () => _runPythonProgram(dynamicLibPath, pythonProgramPath, script)); - spDebug("Python run done (resultLength=${result.length})"); - return result; - } catch (e, st) { - final message = "Dart error running Python: $e\n$st"; - spDebug(message); - return message; - } - } - }); -} - -String _runPythonProgram( - String dynamicLibPath, String pythonProgramPath, String script) { - var programDirPath = p.dirname(pythonProgramPath); - var programModuleName = p.basenameWithoutExtension(pythonProgramPath); - - spDebug("dynamicLibPath: $dynamicLibPath"); - spDebug("programDirPath: $programDirPath"); - spDebug("programModuleName: $programModuleName"); - - final cpython = getCPython(dynamicLibPath); - spDebug("CPython loaded"); - if (cpython.Py_IsInitialized() != 0) { - spDebug( - "Python already initialized and another program is running, skipping execution."); - return ""; - } - - cpython.Py_Initialize(); - spDebug("after Py_Initialize()"); - - var result = ""; - - final logcatSetupError = _setupLogcatForwarding(cpython); - if (logcatSetupError != null) { - cpython.Py_Finalize(); - return logcatSetupError; - } - - if (script != "") { - // run script - final scriptPtr = script.toNativeUtf8(); - int sr = cpython.PyRun_SimpleString(scriptPtr.cast()); - spDebug("PyRun_SimpleString for script result: $sr"); - malloc.free(scriptPtr); - if (sr != 0) { - result = getPythonError(cpython); - } - } else { - // run program - final moduleNamePtr = programModuleName.toNativeUtf8(); - var modulePtr = cpython.PyImport_ImportModule(moduleNamePtr.cast()); - if (modulePtr == nullptr) { - result = getPythonError(cpython); - } - malloc.free(moduleNamePtr); - } - - cpython.Py_Finalize(); - spDebug("after Py_Finalize()"); - - return result; -} - -String getPythonError(CPython cpython) { - final exPtr = cpython.PyErr_GetRaisedException(); - if (exPtr == nullptr) return "Unknown Python error (no exception set)."; - - try { - final formatted = _formatPythonException(cpython, exPtr); - if (formatted != null && formatted.isNotEmpty) return formatted; - - final fallback = _pyObjectToDartString(cpython, exPtr); - return fallback ?? "Unknown Python error (failed to stringify exception)."; - } finally { - cpython.Py_DecRef(exPtr); - // Defensive: formatting can set a new Python error. - cpython.PyErr_Clear(); - } -} - -String? _formatPythonException( - CPython cpython, Pointer exceptionPtr) { - // Uses `traceback.format_exception(exc)` (Python 3.10+ signature). - final tracebackModuleNamePtr = "traceback".toNativeUtf8(); - final tracebackModulePtr = - cpython.PyImport_ImportModule(tracebackModuleNamePtr.cast()); - malloc.free(tracebackModuleNamePtr); - if (tracebackModulePtr == nullptr) return null; - - try { - final formatFuncNamePtr = "format_exception".toNativeUtf8(); - final formatFuncPtr = cpython.PyObject_GetAttrString( - tracebackModulePtr, formatFuncNamePtr.cast()); - malloc.free(formatFuncNamePtr); - if (formatFuncPtr == nullptr) return null; - - try { - if (cpython.PyCallable_Check(formatFuncPtr) == 0) return null; - - final listPtr = cpython.PyObject_CallOneArg(formatFuncPtr, exceptionPtr); - if (listPtr == nullptr) return null; - - try { - final listSize = cpython.PyList_Size(listPtr); - if (listSize < 0) return null; - - final buffer = StringBuffer(); - for (var i = 0; i < listSize; i++) { - final itemObj = cpython.PyList_GetItem(listPtr, i); // borrowed ref - if (itemObj == nullptr) continue; - - final line = _pyUnicodeToDartString(cpython, itemObj) ?? - _pyObjectToDartString(cpython, itemObj); - if (line == null) continue; - buffer.write(line); - } - return buffer.toString(); - } finally { - cpython.Py_DecRef(listPtr); - } - } finally { - cpython.Py_DecRef(formatFuncPtr); - } - } finally { - cpython.Py_DecRef(tracebackModulePtr); - } -} - -String? _pyUnicodeToDartString( - CPython cpython, Pointer unicodeObjPtr) { - final cStr = cpython.PyUnicode_AsUTF8(unicodeObjPtr); - if (cStr == nullptr) return null; - return cStr.cast().toDartString(); -} - -String? _pyObjectToDartString(CPython cpython, Pointer objPtr) { - final strObj = cpython.PyObject_Str(objPtr); - if (strObj == nullptr) return null; - try { - return _pyUnicodeToDartString(cpython, strObj); - } finally { - cpython.Py_DecRef(strObj); - } -} - -String? _setupLogcatForwarding(CPython cpython) { - if (_logcatForwardingError != null) { - return _logcatForwardingError; - } - - final setupPtr = _logcatInitScript.toNativeUtf8(); - final result = cpython.PyRun_SimpleString(setupPtr.cast()); - malloc.free(setupPtr); - - if (result != 0) { - _logcatForwardingError = getPythonError(cpython); - return _logcatForwardingError; - } - - return null; -} diff --git a/src/serious_python_android/lib/src/gen.dart b/src/serious_python_android/lib/src/gen.dart deleted file mode 100644 index 43c7b1de..00000000 --- a/src/serious_python_android/lib/src/gen.dart +++ /dev/null @@ -1,27219 +0,0 @@ -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -// ignore_for_file: type=lint -import 'dart:ffi' as ffi; - -/// Bindings to Python C interface -/// ignore_for_file: unused_field, unused_element -/// -class CPython { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - CPython(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - CPython.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - ffi.Pointer PyMem_Malloc( - int size, - ) { - return _PyMem_Malloc( - size, - ); - } - - late final _PyMem_MallocPtr = - _lookup Function(ffi.Size)>>( - 'PyMem_Malloc'); - late final _PyMem_Malloc = - _PyMem_MallocPtr.asFunction Function(int)>(); - - ffi.Pointer PyMem_Calloc( - int nelem, - int elsize, - ) { - return _PyMem_Calloc( - nelem, - elsize, - ); - } - - late final _PyMem_CallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Size, ffi.Size)>>('PyMem_Calloc'); - late final _PyMem_Calloc = - _PyMem_CallocPtr.asFunction Function(int, int)>(); - - ffi.Pointer PyMem_Realloc( - ffi.Pointer ptr, - int new_size, - ) { - return _PyMem_Realloc( - ptr, - new_size, - ); - } - - late final _PyMem_ReallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('PyMem_Realloc'); - late final _PyMem_Realloc = _PyMem_ReallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - void PyMem_Free( - ffi.Pointer ptr, - ) { - return _PyMem_Free( - ptr, - ); - } - - late final _PyMem_FreePtr = - _lookup)>>( - 'PyMem_Free'); - late final _PyMem_Free = - _PyMem_FreePtr.asFunction)>(); - - ffi.Pointer PyMem_RawMalloc( - int size, - ) { - return _PyMem_RawMalloc( - size, - ); - } - - late final _PyMem_RawMallocPtr = - _lookup Function(ffi.Size)>>( - 'PyMem_RawMalloc'); - late final _PyMem_RawMalloc = - _PyMem_RawMallocPtr.asFunction Function(int)>(); - - ffi.Pointer PyMem_RawCalloc( - int nelem, - int elsize, - ) { - return _PyMem_RawCalloc( - nelem, - elsize, - ); - } - - late final _PyMem_RawCallocPtr = _lookup< - ffi - .NativeFunction Function(ffi.Size, ffi.Size)>>( - 'PyMem_RawCalloc'); - late final _PyMem_RawCalloc = _PyMem_RawCallocPtr.asFunction< - ffi.Pointer Function(int, int)>(); - - ffi.Pointer PyMem_RawRealloc( - ffi.Pointer ptr, - int new_size, - ) { - return _PyMem_RawRealloc( - ptr, - new_size, - ); - } - - late final _PyMem_RawReallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('PyMem_RawRealloc'); - late final _PyMem_RawRealloc = _PyMem_RawReallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - void PyMem_RawFree( - ffi.Pointer ptr, - ) { - return _PyMem_RawFree( - ptr, - ); - } - - late final _PyMem_RawFreePtr = - _lookup)>>( - 'PyMem_RawFree'); - late final _PyMem_RawFree = - _PyMem_RawFreePtr.asFunction)>(); - - ffi.Pointer _PyMem_GetCurrentAllocatorName() { - return __PyMem_GetCurrentAllocatorName(); - } - - late final __PyMem_GetCurrentAllocatorNamePtr = - _lookup Function()>>( - '_PyMem_GetCurrentAllocatorName'); - late final __PyMem_GetCurrentAllocatorName = - __PyMem_GetCurrentAllocatorNamePtr - .asFunction Function()>(); - - ffi.Pointer _PyMem_RawStrdup( - ffi.Pointer str, - ) { - return __PyMem_RawStrdup( - str, - ); - } - - late final __PyMem_RawStrdupPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyMem_RawStrdup'); - late final __PyMem_RawStrdup = __PyMem_RawStrdupPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _PyMem_Strdup( - ffi.Pointer str, - ) { - return __PyMem_Strdup( - str, - ); - } - - late final __PyMem_StrdupPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyMem_Strdup'); - late final __PyMem_Strdup = __PyMem_StrdupPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _PyMem_RawWcsdup( - ffi.Pointer str, - ) { - return __PyMem_RawWcsdup( - str, - ); - } - - late final __PyMem_RawWcsdupPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyMem_RawWcsdup'); - late final __PyMem_RawWcsdup = __PyMem_RawWcsdupPtr - .asFunction Function(ffi.Pointer)>(); - - void PyMem_GetAllocator( - int domain, - ffi.Pointer allocator, - ) { - return _PyMem_GetAllocator( - domain, - allocator, - ); - } - - late final _PyMem_GetAllocatorPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int32, ffi.Pointer)>>('PyMem_GetAllocator'); - late final _PyMem_GetAllocator = _PyMem_GetAllocatorPtr.asFunction< - void Function(int, ffi.Pointer)>(); - - void PyMem_SetAllocator( - int domain, - ffi.Pointer allocator, - ) { - return _PyMem_SetAllocator( - domain, - allocator, - ); - } - - late final _PyMem_SetAllocatorPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int32, ffi.Pointer)>>('PyMem_SetAllocator'); - late final _PyMem_SetAllocator = _PyMem_SetAllocatorPtr.asFunction< - void Function(int, ffi.Pointer)>(); - - void PyMem_SetupDebugHooks() { - return _PyMem_SetupDebugHooks(); - } - - late final _PyMem_SetupDebugHooksPtr = - _lookup>('PyMem_SetupDebugHooks'); - late final _PyMem_SetupDebugHooks = - _PyMem_SetupDebugHooksPtr.asFunction(); - - int PyObject_CheckBuffer( - ffi.Pointer obj, - ) { - return _PyObject_CheckBuffer( - obj, - ); - } - - late final _PyObject_CheckBufferPtr = - _lookup)>>( - 'PyObject_CheckBuffer'); - late final _PyObject_CheckBuffer = _PyObject_CheckBufferPtr.asFunction< - int Function(ffi.Pointer)>(); - - int PyObject_GetBuffer( - ffi.Pointer obj, - ffi.Pointer view, - int flags, - ) { - return _PyObject_GetBuffer( - obj, - view, - flags, - ); - } - - late final _PyObject_GetBufferPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('PyObject_GetBuffer'); - late final _PyObject_GetBuffer = _PyObject_GetBufferPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer PyBuffer_GetPointer( - ffi.Pointer view, - ffi.Pointer indices, - ) { - return _PyBuffer_GetPointer( - view, - indices, - ); - } - - late final _PyBuffer_GetPointerPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyBuffer_GetPointer'); - late final _PyBuffer_GetPointer = _PyBuffer_GetPointerPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyBuffer_SizeFromFormat( - ffi.Pointer format, - ) { - return _PyBuffer_SizeFromFormat( - format, - ); - } - - late final _PyBuffer_SizeFromFormatPtr = - _lookup)>>( - 'PyBuffer_SizeFromFormat'); - late final _PyBuffer_SizeFromFormat = _PyBuffer_SizeFromFormatPtr.asFunction< - int Function(ffi.Pointer)>(); - - int PyBuffer_ToContiguous( - ffi.Pointer buf, - ffi.Pointer view, - int len, - int order, - ) { - return _PyBuffer_ToContiguous( - buf, - view, - len, - order, - ); - } - - late final _PyBuffer_ToContiguousPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - Py_ssize_t, ffi.Char)>>('PyBuffer_ToContiguous'); - late final _PyBuffer_ToContiguous = _PyBuffer_ToContiguousPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - int PyBuffer_FromContiguous( - ffi.Pointer view, - ffi.Pointer buf, - int len, - int order, - ) { - return _PyBuffer_FromContiguous( - view, - buf, - len, - order, - ); - } - - late final _PyBuffer_FromContiguousPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - Py_ssize_t, ffi.Char)>>('PyBuffer_FromContiguous'); - late final _PyBuffer_FromContiguous = _PyBuffer_FromContiguousPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - int PyObject_CopyData( - ffi.Pointer dest, - ffi.Pointer src, - ) { - return _PyObject_CopyData( - dest, - src, - ); - } - - late final _PyObject_CopyDataPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_CopyData'); - late final _PyObject_CopyData = _PyObject_CopyDataPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyBuffer_IsContiguous( - ffi.Pointer view, - int fort, - ) { - return _PyBuffer_IsContiguous( - view, - fort, - ); - } - - late final _PyBuffer_IsContiguousPtr = _lookup< - ffi - .NativeFunction, ffi.Char)>>( - 'PyBuffer_IsContiguous'); - late final _PyBuffer_IsContiguous = _PyBuffer_IsContiguousPtr.asFunction< - int Function(ffi.Pointer, int)>(); - - void PyBuffer_FillContiguousStrides( - int ndims, - ffi.Pointer shape, - ffi.Pointer strides, - int itemsize, - int fort, - ) { - return _PyBuffer_FillContiguousStrides( - ndims, - shape, - strides, - itemsize, - fort, - ); - } - - late final _PyBuffer_FillContiguousStridesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Char)>>('PyBuffer_FillContiguousStrides'); - late final _PyBuffer_FillContiguousStrides = - _PyBuffer_FillContiguousStridesPtr.asFunction< - void Function(int, ffi.Pointer, ffi.Pointer, - int, int)>(); - - int PyBuffer_FillInfo( - ffi.Pointer view, - ffi.Pointer o, - ffi.Pointer buf, - int len, - int readonly, - int flags, - ) { - return _PyBuffer_FillInfo( - view, - o, - buf, - len, - readonly, - flags, - ); - } - - late final _PyBuffer_FillInfoPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - Py_ssize_t, - ffi.Int, - ffi.Int)>>('PyBuffer_FillInfo'); - late final _PyBuffer_FillInfo = _PyBuffer_FillInfoPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, int)>(); - - void PyBuffer_Release( - ffi.Pointer view, - ) { - return _PyBuffer_Release( - view, - ); - } - - late final _PyBuffer_ReleasePtr = - _lookup)>>( - 'PyBuffer_Release'); - late final _PyBuffer_Release = - _PyBuffer_ReleasePtr.asFunction)>(); - - int Py_Is( - ffi.Pointer x, - ffi.Pointer y, - ) { - return _Py_Is( - x, - y, - ); - } - - late final _Py_IsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('Py_Is'); - late final _Py_Is = _Py_IsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _PyLong_Type = - _lookup('PyLong_Type'); - - PyTypeObject get PyLong_Type => _PyLong_Type.ref; - - late final ffi.Pointer _PyBool_Type = - _lookup('PyBool_Type'); - - PyTypeObject get PyBool_Type => _PyBool_Type.ref; - - ffi.Pointer PyType_FromSpec( - ffi.Pointer arg0, - ) { - return _PyType_FromSpec( - arg0, - ); - } - - late final _PyType_FromSpecPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyType_FromSpec'); - late final _PyType_FromSpec = _PyType_FromSpecPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyType_FromSpecWithBases( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyType_FromSpecWithBases( - arg0, - arg1, - ); - } - - late final _PyType_FromSpecWithBasesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyType_FromSpecWithBases'); - late final _PyType_FromSpecWithBases = - _PyType_FromSpecWithBasesPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyType_GetSlot( - ffi.Pointer arg0, - int arg1, - ) { - return _PyType_GetSlot( - arg0, - arg1, - ); - } - - late final _PyType_GetSlotPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyType_GetSlot'); - late final _PyType_GetSlot = _PyType_GetSlotPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer PyType_FromModuleAndSpec( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyType_FromModuleAndSpec( - arg0, - arg1, - arg2, - ); - } - - late final _PyType_FromModuleAndSpecPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyType_FromModuleAndSpec'); - late final _PyType_FromModuleAndSpec = - _PyType_FromModuleAndSpecPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyType_GetModule( - ffi.Pointer arg0, - ) { - return _PyType_GetModule( - arg0, - ); - } - - late final _PyType_GetModulePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyType_GetModule'); - late final _PyType_GetModule = _PyType_GetModulePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyType_GetModuleState( - ffi.Pointer arg0, - ) { - return _PyType_GetModuleState( - arg0, - ); - } - - late final _PyType_GetModuleStatePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyType_GetModuleState'); - late final _PyType_GetModuleState = _PyType_GetModuleStatePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyType_GetName( - ffi.Pointer arg0, - ) { - return _PyType_GetName( - arg0, - ); - } - - late final _PyType_GetNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyType_GetName'); - late final _PyType_GetName = _PyType_GetNamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyType_GetQualName( - ffi.Pointer arg0, - ) { - return _PyType_GetQualName( - arg0, - ); - } - - late final _PyType_GetQualNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyType_GetQualName'); - late final _PyType_GetQualName = _PyType_GetQualNamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyType_FromMetaclass( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) { - return _PyType_FromMetaclass( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final _PyType_FromMetaclassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyType_FromMetaclass'); - late final _PyType_FromMetaclass = _PyType_FromMetaclassPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyObject_GetTypeData( - ffi.Pointer obj, - ffi.Pointer cls, - ) { - return _PyObject_GetTypeData( - obj, - cls, - ); - } - - late final _PyObject_GetTypeDataPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_GetTypeData'); - late final _PyObject_GetTypeData = _PyObject_GetTypeDataPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyType_GetTypeDataSize( - ffi.Pointer cls, - ) { - return _PyType_GetTypeDataSize( - cls, - ); - } - - late final _PyType_GetTypeDataSizePtr = _lookup< - ffi.NativeFunction)>>( - 'PyType_GetTypeDataSize'); - late final _PyType_GetTypeDataSize = _PyType_GetTypeDataSizePtr.asFunction< - int Function(ffi.Pointer)>(); - - int PyType_IsSubtype( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyType_IsSubtype( - arg0, - arg1, - ); - } - - late final _PyType_IsSubtypePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyType_IsSubtype'); - late final _PyType_IsSubtype = _PyType_IsSubtypePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _PyType_Type = - _lookup('PyType_Type'); - - PyTypeObject get PyType_Type => _PyType_Type.ref; - - late final ffi.Pointer _PyBaseObject_Type = - _lookup('PyBaseObject_Type'); - - PyTypeObject get PyBaseObject_Type => _PyBaseObject_Type.ref; - - late final ffi.Pointer _PySuper_Type = - _lookup('PySuper_Type'); - - PyTypeObject get PySuper_Type => _PySuper_Type.ref; - - int PyType_GetFlags( - ffi.Pointer arg0, - ) { - return _PyType_GetFlags( - arg0, - ); - } - - late final _PyType_GetFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>('PyType_GetFlags'); - late final _PyType_GetFlags = - _PyType_GetFlagsPtr.asFunction)>(); - - int PyType_Ready( - ffi.Pointer arg0, - ) { - return _PyType_Ready( - arg0, - ); - } - - late final _PyType_ReadyPtr = - _lookup)>>( - 'PyType_Ready'); - late final _PyType_Ready = - _PyType_ReadyPtr.asFunction)>(); - - ffi.Pointer PyType_GenericAlloc( - ffi.Pointer arg0, - int arg1, - ) { - return _PyType_GenericAlloc( - arg0, - arg1, - ); - } - - late final _PyType_GenericAllocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('PyType_GenericAlloc'); - late final _PyType_GenericAlloc = _PyType_GenericAllocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer PyType_GenericNew( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyType_GenericNew( - arg0, - arg1, - arg2, - ); - } - - late final _PyType_GenericNewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyType_GenericNew'); - late final _PyType_GenericNew = _PyType_GenericNewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - int PyType_ClearCache() { - return _PyType_ClearCache(); - } - - late final _PyType_ClearCachePtr = - _lookup>( - 'PyType_ClearCache'); - late final _PyType_ClearCache = - _PyType_ClearCachePtr.asFunction(); - - void PyType_Modified( - ffi.Pointer arg0, - ) { - return _PyType_Modified( - arg0, - ); - } - - late final _PyType_ModifiedPtr = - _lookup)>>( - 'PyType_Modified'); - late final _PyType_Modified = _PyType_ModifiedPtr.asFunction< - void Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_Repr( - ffi.Pointer arg0, - ) { - return _PyObject_Repr( - arg0, - ); - } - - late final _PyObject_ReprPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_Repr'); - late final _PyObject_Repr = _PyObject_ReprPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_Str( - ffi.Pointer arg0, - ) { - return _PyObject_Str( - arg0, - ); - } - - late final _PyObject_StrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_Str'); - late final _PyObject_Str = _PyObject_StrPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_ASCII( - ffi.Pointer arg0, - ) { - return _PyObject_ASCII( - arg0, - ); - } - - late final _PyObject_ASCIIPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_ASCII'); - late final _PyObject_ASCII = _PyObject_ASCIIPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_Bytes( - ffi.Pointer arg0, - ) { - return _PyObject_Bytes( - arg0, - ); - } - - late final _PyObject_BytesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_Bytes'); - late final _PyObject_Bytes = _PyObject_BytesPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_RichCompare( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return _PyObject_RichCompare( - arg0, - arg1, - arg2, - ); - } - - late final _PyObject_RichComparePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('PyObject_RichCompare'); - late final _PyObject_RichCompare = _PyObject_RichComparePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - int PyObject_RichCompareBool( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return _PyObject_RichCompareBool( - arg0, - arg1, - arg2, - ); - } - - late final _PyObject_RichCompareBoolPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('PyObject_RichCompareBool'); - late final _PyObject_RichCompareBool = - _PyObject_RichCompareBoolPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer PyObject_GetAttrString( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyObject_GetAttrString( - arg0, - arg1, - ); - } - - late final _PyObject_GetAttrStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_GetAttrString'); - late final _PyObject_GetAttrString = _PyObject_GetAttrStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyObject_SetAttrString( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyObject_SetAttrString( - arg0, - arg1, - arg2, - ); - } - - late final _PyObject_SetAttrStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyObject_SetAttrString'); - late final _PyObject_SetAttrString = _PyObject_SetAttrStringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyObject_HasAttrString( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyObject_HasAttrString( - arg0, - arg1, - ); - } - - late final _PyObject_HasAttrStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_HasAttrString'); - late final _PyObject_HasAttrString = _PyObject_HasAttrStringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_GetAttr( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyObject_GetAttr( - arg0, - arg1, - ); - } - - late final _PyObject_GetAttrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_GetAttr'); - late final _PyObject_GetAttr = _PyObject_GetAttrPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyObject_SetAttr( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyObject_SetAttr( - arg0, - arg1, - arg2, - ); - } - - late final _PyObject_SetAttrPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyObject_SetAttr'); - late final _PyObject_SetAttr = _PyObject_SetAttrPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyObject_HasAttr( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyObject_HasAttr( - arg0, - arg1, - ); - } - - late final _PyObject_HasAttrPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_HasAttr'); - late final _PyObject_HasAttr = _PyObject_HasAttrPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_SelfIter( - ffi.Pointer arg0, - ) { - return _PyObject_SelfIter( - arg0, - ); - } - - late final _PyObject_SelfIterPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_SelfIter'); - late final _PyObject_SelfIter = _PyObject_SelfIterPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_GenericGetAttr( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyObject_GenericGetAttr( - arg0, - arg1, - ); - } - - late final _PyObject_GenericGetAttrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_GenericGetAttr'); - late final _PyObject_GenericGetAttr = _PyObject_GenericGetAttrPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyObject_GenericSetAttr( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyObject_GenericSetAttr( - arg0, - arg1, - arg2, - ); - } - - late final _PyObject_GenericSetAttrPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyObject_GenericSetAttr'); - late final _PyObject_GenericSetAttr = _PyObject_GenericSetAttrPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyObject_GenericSetDict( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyObject_GenericSetDict( - arg0, - arg1, - arg2, - ); - } - - late final _PyObject_GenericSetDictPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyObject_GenericSetDict'); - late final _PyObject_GenericSetDict = _PyObject_GenericSetDictPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyObject_Hash( - ffi.Pointer arg0, - ) { - return _PyObject_Hash( - arg0, - ); - } - - late final _PyObject_HashPtr = - _lookup)>>( - 'PyObject_Hash'); - late final _PyObject_Hash = - _PyObject_HashPtr.asFunction)>(); - - int PyObject_HashNotImplemented( - ffi.Pointer arg0, - ) { - return _PyObject_HashNotImplemented( - arg0, - ); - } - - late final _PyObject_HashNotImplementedPtr = - _lookup)>>( - 'PyObject_HashNotImplemented'); - late final _PyObject_HashNotImplemented = _PyObject_HashNotImplementedPtr - .asFunction)>(); - - int PyObject_IsTrue( - ffi.Pointer arg0, - ) { - return _PyObject_IsTrue( - arg0, - ); - } - - late final _PyObject_IsTruePtr = - _lookup)>>( - 'PyObject_IsTrue'); - late final _PyObject_IsTrue = - _PyObject_IsTruePtr.asFunction)>(); - - int PyObject_Not( - ffi.Pointer arg0, - ) { - return _PyObject_Not( - arg0, - ); - } - - late final _PyObject_NotPtr = - _lookup)>>( - 'PyObject_Not'); - late final _PyObject_Not = - _PyObject_NotPtr.asFunction)>(); - - int PyCallable_Check( - ffi.Pointer arg0, - ) { - return _PyCallable_Check( - arg0, - ); - } - - late final _PyCallable_CheckPtr = - _lookup)>>( - 'PyCallable_Check'); - late final _PyCallable_Check = - _PyCallable_CheckPtr.asFunction)>(); - - void PyObject_ClearWeakRefs( - ffi.Pointer arg0, - ) { - return _PyObject_ClearWeakRefs( - arg0, - ); - } - - late final _PyObject_ClearWeakRefsPtr = - _lookup)>>( - 'PyObject_ClearWeakRefs'); - late final _PyObject_ClearWeakRefs = _PyObject_ClearWeakRefsPtr.asFunction< - void Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_Dir( - ffi.Pointer arg0, - ) { - return _PyObject_Dir( - arg0, - ); - } - - late final _PyObject_DirPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_Dir'); - late final _PyObject_Dir = _PyObject_DirPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer _PyObject_GetState( - ffi.Pointer arg0, - ) { - return __PyObject_GetState( - arg0, - ); - } - - late final __PyObject_GetStatePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyObject_GetState'); - late final __PyObject_GetState = __PyObject_GetStatePtr - .asFunction Function(ffi.Pointer)>(); - - int Py_ReprEnter( - ffi.Pointer arg0, - ) { - return _Py_ReprEnter( - arg0, - ); - } - - late final _Py_ReprEnterPtr = - _lookup)>>( - 'Py_ReprEnter'); - late final _Py_ReprEnter = - _Py_ReprEnterPtr.asFunction)>(); - - void Py_ReprLeave( - ffi.Pointer arg0, - ) { - return _Py_ReprLeave( - arg0, - ); - } - - late final _Py_ReprLeavePtr = - _lookup)>>( - 'Py_ReprLeave'); - late final _Py_ReprLeave = - _Py_ReprLeavePtr.asFunction)>(); - - void _Py_Dealloc( - ffi.Pointer arg0, - ) { - return __Py_Dealloc( - arg0, - ); - } - - late final __Py_DeallocPtr = - _lookup)>>( - '_Py_Dealloc'); - late final __Py_Dealloc = - __Py_DeallocPtr.asFunction)>(); - - void Py_IncRef( - ffi.Pointer arg0, - ) { - return _Py_IncRef1( - arg0, - ); - } - - late final _Py_IncRefPtr = - _lookup)>>( - 'Py_IncRef'); - late final _Py_IncRef1 = - _Py_IncRefPtr.asFunction)>(); - - void Py_DecRef( - ffi.Pointer arg0, - ) { - return _Py_DecRef1( - arg0, - ); - } - - late final _Py_DecRefPtr = - _lookup)>>( - 'Py_DecRef'); - late final _Py_DecRef1 = - _Py_DecRefPtr.asFunction)>(); - - void _Py_IncRef( - ffi.Pointer arg0, - ) { - return __Py_IncRef( - arg0, - ); - } - - late final __Py_IncRefPtr = - _lookup)>>( - '_Py_IncRef'); - late final __Py_IncRef = - __Py_IncRefPtr.asFunction)>(); - - void _Py_DecRef( - ffi.Pointer arg0, - ) { - return __Py_DecRef( - arg0, - ); - } - - late final __Py_DecRefPtr = - _lookup)>>( - '_Py_DecRef'); - late final __Py_DecRef = - __Py_DecRefPtr.asFunction)>(); - - ffi.Pointer Py_NewRef( - ffi.Pointer obj, - ) { - return _Py_NewRef( - obj, - ); - } - - late final _Py_NewRefPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('Py_NewRef'); - late final _Py_NewRef = _Py_NewRefPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer Py_XNewRef( - ffi.Pointer obj, - ) { - return _Py_XNewRef( - obj, - ); - } - - late final _Py_XNewRefPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('Py_XNewRef'); - late final _Py_XNewRef = _Py_XNewRefPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer __Py_NoneStruct = - _lookup('_Py_NoneStruct'); - - PyObject get _Py_NoneStruct => __Py_NoneStruct.ref; - - int Py_IsNone( - ffi.Pointer x, - ) { - return _Py_IsNone( - x, - ); - } - - late final _Py_IsNonePtr = - _lookup)>>( - 'Py_IsNone'); - late final _Py_IsNone = - _Py_IsNonePtr.asFunction)>(); - - late final ffi.Pointer __Py_NotImplementedStruct = - _lookup('_Py_NotImplementedStruct'); - - PyObject get _Py_NotImplementedStruct => __Py_NotImplementedStruct.ref; - - void _Py_NewReference( - ffi.Pointer op, - ) { - return __Py_NewReference( - op, - ); - } - - late final __Py_NewReferencePtr = - _lookup)>>( - '_Py_NewReference'); - late final __Py_NewReference = - __Py_NewReferencePtr.asFunction)>(); - - void _Py_NewReferenceNoTotal( - ffi.Pointer op, - ) { - return __Py_NewReferenceNoTotal( - op, - ); - } - - late final __Py_NewReferenceNoTotalPtr = - _lookup)>>( - '_Py_NewReferenceNoTotal'); - late final __Py_NewReferenceNoTotal = __Py_NewReferenceNoTotalPtr - .asFunction)>(); - - ffi.Pointer _PyType_Name( - ffi.Pointer arg0, - ) { - return __PyType_Name( - arg0, - ); - } - - late final __PyType_NamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyType_Name'); - late final __PyType_Name = __PyType_NamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _PyType_Lookup( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyType_Lookup( - arg0, - arg1, - ); - } - - late final __PyType_LookupPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyType_Lookup'); - late final __PyType_Lookup = __PyType_LookupPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyType_LookupId( - ffi.Pointer arg0, - ffi.Pointer<_Py_Identifier> arg1, - ) { - return __PyType_LookupId( - arg0, - arg1, - ); - } - - late final __PyType_LookupIdPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer<_Py_Identifier>)>>('_PyType_LookupId'); - late final __PyType_LookupId = __PyType_LookupIdPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer<_Py_Identifier>)>(); - - ffi.Pointer _PyObject_LookupSpecialId( - ffi.Pointer arg0, - ffi.Pointer<_Py_Identifier> arg1, - ) { - return __PyObject_LookupSpecialId( - arg0, - arg1, - ); - } - - late final __PyObject_LookupSpecialIdPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer<_Py_Identifier>)>>('_PyObject_LookupSpecialId'); - late final __PyObject_LookupSpecialId = - __PyObject_LookupSpecialIdPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer<_Py_Identifier>)>(); - - ffi.Pointer _PyType_CalculateMetaclass( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyType_CalculateMetaclass( - arg0, - arg1, - ); - } - - late final __PyType_CalculateMetaclassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyType_CalculateMetaclass'); - late final __PyType_CalculateMetaclass = - __PyType_CalculateMetaclassPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyType_GetDocFromInternalDoc( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyType_GetDocFromInternalDoc( - arg0, - arg1, - ); - } - - late final __PyType_GetDocFromInternalDocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyType_GetDocFromInternalDoc'); - late final __PyType_GetDocFromInternalDoc = - __PyType_GetDocFromInternalDocPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyType_GetTextSignatureFromInternalDoc( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyType_GetTextSignatureFromInternalDoc( - arg0, - arg1, - ); - } - - late final __PyType_GetTextSignatureFromInternalDocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>( - '_PyType_GetTextSignatureFromInternalDoc'); - late final __PyType_GetTextSignatureFromInternalDoc = - __PyType_GetTextSignatureFromInternalDocPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyType_GetModuleByDef( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyType_GetModuleByDef( - arg0, - arg1, - ); - } - - late final _PyType_GetModuleByDefPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyType_GetModuleByDef'); - late final _PyType_GetModuleByDef = _PyType_GetModuleByDefPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyType_GetDict( - ffi.Pointer arg0, - ) { - return _PyType_GetDict( - arg0, - ); - } - - late final _PyType_GetDictPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyType_GetDict'); - late final _PyType_GetDict = _PyType_GetDictPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyObject_Print( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return _PyObject_Print( - arg0, - arg1, - arg2, - ); - } - - late final _PyObject_PrintPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('PyObject_Print'); - late final _PyObject_Print = _PyObject_PrintPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - void _Py_BreakPoint() { - return __Py_BreakPoint(); - } - - late final __Py_BreakPointPtr = - _lookup>('_Py_BreakPoint'); - late final __Py_BreakPoint = __Py_BreakPointPtr.asFunction(); - - void _PyObject_Dump( - ffi.Pointer arg0, - ) { - return __PyObject_Dump( - arg0, - ); - } - - late final __PyObject_DumpPtr = - _lookup)>>( - '_PyObject_Dump'); - late final __PyObject_Dump = - __PyObject_DumpPtr.asFunction)>(); - - int _PyObject_IsFreed( - ffi.Pointer arg0, - ) { - return __PyObject_IsFreed( - arg0, - ); - } - - late final __PyObject_IsFreedPtr = - _lookup)>>( - '_PyObject_IsFreed'); - late final __PyObject_IsFreed = - __PyObject_IsFreedPtr.asFunction)>(); - - int _PyObject_IsAbstract( - ffi.Pointer arg0, - ) { - return __PyObject_IsAbstract( - arg0, - ); - } - - late final __PyObject_IsAbstractPtr = - _lookup)>>( - '_PyObject_IsAbstract'); - late final __PyObject_IsAbstract = __PyObject_IsAbstractPtr - .asFunction)>(); - - ffi.Pointer _PyObject_GetAttrId( - ffi.Pointer arg0, - ffi.Pointer<_Py_Identifier> arg1, - ) { - return __PyObject_GetAttrId( - arg0, - arg1, - ); - } - - late final __PyObject_GetAttrIdPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer<_Py_Identifier>)>>('_PyObject_GetAttrId'); - late final __PyObject_GetAttrId = __PyObject_GetAttrIdPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer<_Py_Identifier>)>(); - - int _PyObject_SetAttrId( - ffi.Pointer arg0, - ffi.Pointer<_Py_Identifier> arg1, - ffi.Pointer arg2, - ) { - return __PyObject_SetAttrId( - arg0, - arg1, - arg2, - ); - } - - late final __PyObject_SetAttrIdPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer<_Py_Identifier>, - ffi.Pointer)>>('_PyObject_SetAttrId'); - late final __PyObject_SetAttrId = __PyObject_SetAttrIdPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer<_Py_Identifier>, - ffi.Pointer)>(); - - int _PyObject_LookupAttr( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, - ) { - return __PyObject_LookupAttr( - arg0, - arg1, - arg2, - ); - } - - late final __PyObject_LookupAttrPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>('_PyObject_LookupAttr'); - late final __PyObject_LookupAttr = __PyObject_LookupAttrPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); - - int _PyObject_LookupAttrId( - ffi.Pointer arg0, - ffi.Pointer<_Py_Identifier> arg1, - ffi.Pointer> arg2, - ) { - return __PyObject_LookupAttrId( - arg0, - arg1, - arg2, - ); - } - - late final __PyObject_LookupAttrIdPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer<_Py_Identifier>, - ffi.Pointer>)>>('_PyObject_LookupAttrId'); - late final __PyObject_LookupAttrId = __PyObject_LookupAttrIdPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer<_Py_Identifier>, - ffi.Pointer>)>(); - - int _PyObject_GetMethod( - ffi.Pointer obj, - ffi.Pointer name, - ffi.Pointer> method, - ) { - return __PyObject_GetMethod( - obj, - name, - method, - ); - } - - late final __PyObject_GetMethodPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>('_PyObject_GetMethod'); - late final __PyObject_GetMethod = __PyObject_GetMethodPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); - - ffi.Pointer> _PyObject_GetDictPtr( - ffi.Pointer arg0, - ) { - return __PyObject_GetDictPtr( - arg0, - ); - } - - late final __PyObject_GetDictPtrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Pointer)>>('_PyObject_GetDictPtr'); - late final __PyObject_GetDictPtr = __PyObject_GetDictPtrPtr.asFunction< - ffi.Pointer> Function(ffi.Pointer)>(); - - ffi.Pointer _PyObject_NextNotImplemented( - ffi.Pointer arg0, - ) { - return __PyObject_NextNotImplemented( - arg0, - ); - } - - late final __PyObject_NextNotImplementedPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyObject_NextNotImplemented'); - late final __PyObject_NextNotImplemented = __PyObject_NextNotImplementedPtr - .asFunction Function(ffi.Pointer)>(); - - void PyObject_CallFinalizer( - ffi.Pointer arg0, - ) { - return _PyObject_CallFinalizer( - arg0, - ); - } - - late final _PyObject_CallFinalizerPtr = - _lookup)>>( - 'PyObject_CallFinalizer'); - late final _PyObject_CallFinalizer = _PyObject_CallFinalizerPtr.asFunction< - void Function(ffi.Pointer)>(); - - int PyObject_CallFinalizerFromDealloc( - ffi.Pointer arg0, - ) { - return _PyObject_CallFinalizerFromDealloc( - arg0, - ); - } - - late final _PyObject_CallFinalizerFromDeallocPtr = - _lookup)>>( - 'PyObject_CallFinalizerFromDealloc'); - late final _PyObject_CallFinalizerFromDealloc = - _PyObject_CallFinalizerFromDeallocPtr.asFunction< - int Function(ffi.Pointer)>(); - - ffi.Pointer _PyObject_GenericGetAttrWithDict( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ) { - return __PyObject_GenericGetAttrWithDict( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final __PyObject_GenericGetAttrWithDictPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('_PyObject_GenericGetAttrWithDict'); - late final __PyObject_GenericGetAttrWithDict = - __PyObject_GenericGetAttrWithDictPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - int _PyObject_GenericSetAttrWithDict( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) { - return __PyObject_GenericSetAttrWithDict( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final __PyObject_GenericSetAttrWithDictPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_PyObject_GenericSetAttrWithDict'); - late final __PyObject_GenericSetAttrWithDict = - __PyObject_GenericSetAttrWithDictPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyObject_FunctionStr( - ffi.Pointer arg0, - ) { - return __PyObject_FunctionStr( - arg0, - ); - } - - late final __PyObject_FunctionStrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyObject_FunctionStr'); - late final __PyObject_FunctionStr = __PyObject_FunctionStrPtr - .asFunction Function(ffi.Pointer)>(); - - late final ffi.Pointer __PyNone_Type = - _lookup('_PyNone_Type'); - - PyTypeObject get _PyNone_Type => __PyNone_Type.ref; - - late final ffi.Pointer __PyNotImplemented_Type = - _lookup('_PyNotImplemented_Type'); - - PyTypeObject get _PyNotImplemented_Type => __PyNotImplemented_Type.ref; - - late final ffi.Pointer> __Py_SwappedOp = - _lookup>('_Py_SwappedOp'); - - ffi.Pointer get _Py_SwappedOp => __Py_SwappedOp.value; - - set _Py_SwappedOp(ffi.Pointer value) => __Py_SwappedOp.value = value; - - void _PyDebugAllocatorStats( - ffi.Pointer out, - ffi.Pointer block_name, - int num_blocks, - int sizeof_block, - ) { - return __PyDebugAllocatorStats( - out, - block_name, - num_blocks, - sizeof_block, - ); - } - - late final __PyDebugAllocatorStatsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int, - ffi.Size)>>('_PyDebugAllocatorStats'); - late final __PyDebugAllocatorStats = __PyDebugAllocatorStatsPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - void _PyObject_DebugTypeStats( - ffi.Pointer out, - ) { - return __PyObject_DebugTypeStats( - out, - ); - } - - late final __PyObject_DebugTypeStatsPtr = - _lookup)>>( - '_PyObject_DebugTypeStats'); - late final __PyObject_DebugTypeStats = __PyObject_DebugTypeStatsPtr - .asFunction)>(); - - void _PyObject_AssertFailed( - ffi.Pointer obj, - ffi.Pointer expr, - ffi.Pointer msg, - ffi.Pointer file, - int line, - ffi.Pointer function, - ) { - return __PyObject_AssertFailed( - obj, - expr, - msg, - file, - line, - function, - ); - } - - late final __PyObject_AssertFailedPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer)>>('_PyObject_AssertFailed'); - late final __PyObject_AssertFailed = __PyObject_AssertFailedPtr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - int _PyObject_CheckConsistency( - ffi.Pointer op, - int check_content, - ) { - return __PyObject_CheckConsistency( - op, - check_content, - ); - } - - late final __PyObject_CheckConsistencyPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - '_PyObject_CheckConsistency'); - late final __PyObject_CheckConsistency = __PyObject_CheckConsistencyPtr - .asFunction, int)>(); - - int _PyTrash_begin( - ffi.Pointer tstate, - ffi.Pointer op, - ) { - return __PyTrash_begin( - tstate, - op, - ); - } - - late final __PyTrash_beginPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyTrash_begin'); - late final __PyTrash_begin = __PyTrash_beginPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void _PyTrash_end( - ffi.Pointer tstate, - ) { - return __PyTrash_end( - tstate, - ); - } - - late final __PyTrash_endPtr = _lookup< - ffi.NativeFunction)>>( - '_PyTrash_end'); - late final __PyTrash_end = - __PyTrash_endPtr.asFunction)>(); - - int _PyTrash_cond( - ffi.Pointer op, - destructor dealloc, - ) { - return __PyTrash_cond( - op, - dealloc, - ); - } - - late final __PyTrash_condPtr = _lookup< - ffi - .NativeFunction, destructor)>>( - '_PyTrash_cond'); - late final __PyTrash_cond = __PyTrash_condPtr - .asFunction, destructor)>(); - - ffi.Pointer PyObject_GetItemData( - ffi.Pointer obj, - ) { - return _PyObject_GetItemData( - obj, - ); - } - - late final _PyObject_GetItemDataPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_GetItemData'); - late final _PyObject_GetItemData = _PyObject_GetItemDataPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int _PyObject_VisitManagedDict( - ffi.Pointer obj, - visitproc visit, - ffi.Pointer arg, - ) { - return __PyObject_VisitManagedDict( - obj, - visit, - arg, - ); - } - - late final __PyObject_VisitManagedDictPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, visitproc, - ffi.Pointer)>>('_PyObject_VisitManagedDict'); - late final __PyObject_VisitManagedDict = - __PyObject_VisitManagedDictPtr.asFunction< - int Function( - ffi.Pointer, visitproc, ffi.Pointer)>(); - - void _PyObject_ClearManagedDict( - ffi.Pointer obj, - ) { - return __PyObject_ClearManagedDict( - obj, - ); - } - - late final __PyObject_ClearManagedDictPtr = - _lookup)>>( - '_PyObject_ClearManagedDict'); - late final __PyObject_ClearManagedDict = __PyObject_ClearManagedDictPtr - .asFunction)>(); - - int PyType_AddWatcher( - PyType_WatchCallback callback, - ) { - return _PyType_AddWatcher( - callback, - ); - } - - late final _PyType_AddWatcherPtr = - _lookup>( - 'PyType_AddWatcher'); - late final _PyType_AddWatcher = - _PyType_AddWatcherPtr.asFunction(); - - int PyType_ClearWatcher( - int watcher_id, - ) { - return _PyType_ClearWatcher( - watcher_id, - ); - } - - late final _PyType_ClearWatcherPtr = - _lookup>( - 'PyType_ClearWatcher'); - late final _PyType_ClearWatcher = - _PyType_ClearWatcherPtr.asFunction(); - - int PyType_Watch( - int watcher_id, - ffi.Pointer type, - ) { - return _PyType_Watch( - watcher_id, - type, - ); - } - - late final _PyType_WatchPtr = _lookup< - ffi.NativeFunction)>>( - 'PyType_Watch'); - late final _PyType_Watch = - _PyType_WatchPtr.asFunction)>(); - - int PyType_Unwatch( - int watcher_id, - ffi.Pointer type, - ) { - return _PyType_Unwatch( - watcher_id, - type, - ); - } - - late final _PyType_UnwatchPtr = _lookup< - ffi.NativeFunction)>>( - 'PyType_Unwatch'); - late final _PyType_Unwatch = - _PyType_UnwatchPtr.asFunction)>(); - - int PyUnstable_Type_AssignVersionTag( - ffi.Pointer type, - ) { - return _PyUnstable_Type_AssignVersionTag( - type, - ); - } - - late final _PyUnstable_Type_AssignVersionTagPtr = - _lookup)>>( - 'PyUnstable_Type_AssignVersionTag'); - late final _PyUnstable_Type_AssignVersionTag = - _PyUnstable_Type_AssignVersionTagPtr.asFunction< - int Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_Malloc( - int size, - ) { - return _PyObject_Malloc( - size, - ); - } - - late final _PyObject_MallocPtr = - _lookup Function(ffi.Size)>>( - 'PyObject_Malloc'); - late final _PyObject_Malloc = - _PyObject_MallocPtr.asFunction Function(int)>(); - - ffi.Pointer PyObject_Calloc( - int nelem, - int elsize, - ) { - return _PyObject_Calloc( - nelem, - elsize, - ); - } - - late final _PyObject_CallocPtr = _lookup< - ffi - .NativeFunction Function(ffi.Size, ffi.Size)>>( - 'PyObject_Calloc'); - late final _PyObject_Calloc = _PyObject_CallocPtr.asFunction< - ffi.Pointer Function(int, int)>(); - - ffi.Pointer PyObject_Realloc( - ffi.Pointer ptr, - int new_size, - ) { - return _PyObject_Realloc( - ptr, - new_size, - ); - } - - late final _PyObject_ReallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('PyObject_Realloc'); - late final _PyObject_Realloc = _PyObject_ReallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - void PyObject_Free( - ffi.Pointer ptr, - ) { - return _PyObject_Free( - ptr, - ); - } - - late final _PyObject_FreePtr = - _lookup)>>( - 'PyObject_Free'); - late final _PyObject_Free = - _PyObject_FreePtr.asFunction)>(); - - ffi.Pointer PyObject_Init( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyObject_Init( - arg0, - arg1, - ); - } - - late final _PyObject_InitPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_Init'); - late final _PyObject_Init = _PyObject_InitPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_InitVar( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return _PyObject_InitVar( - arg0, - arg1, - arg2, - ); - } - - late final _PyObject_InitVarPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, Py_ssize_t)>>('PyObject_InitVar'); - late final _PyObject_InitVar = _PyObject_InitVarPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _PyObject_New( - ffi.Pointer arg0, - ) { - return __PyObject_New( - arg0, - ); - } - - late final __PyObject_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyObject_New'); - late final __PyObject_New = __PyObject_NewPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _PyObject_NewVar( - ffi.Pointer arg0, - int arg1, - ) { - return __PyObject_NewVar( - arg0, - arg1, - ); - } - - late final __PyObject_NewVarPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('_PyObject_NewVar'); - late final __PyObject_NewVar = __PyObject_NewVarPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - int PyGC_Collect() { - return _PyGC_Collect(); - } - - late final _PyGC_CollectPtr = - _lookup>('PyGC_Collect'); - late final _PyGC_Collect = _PyGC_CollectPtr.asFunction(); - - int PyGC_Enable() { - return _PyGC_Enable(); - } - - late final _PyGC_EnablePtr = - _lookup>('PyGC_Enable'); - late final _PyGC_Enable = _PyGC_EnablePtr.asFunction(); - - int PyGC_Disable() { - return _PyGC_Disable(); - } - - late final _PyGC_DisablePtr = - _lookup>('PyGC_Disable'); - late final _PyGC_Disable = _PyGC_DisablePtr.asFunction(); - - int PyGC_IsEnabled() { - return _PyGC_IsEnabled(); - } - - late final _PyGC_IsEnabledPtr = - _lookup>('PyGC_IsEnabled'); - late final _PyGC_IsEnabled = _PyGC_IsEnabledPtr.asFunction(); - - void PyUnstable_GC_VisitObjects( - gcvisitobjects_t callback, - ffi.Pointer arg, - ) { - return _PyUnstable_GC_VisitObjects( - callback, - arg, - ); - } - - late final _PyUnstable_GC_VisitObjectsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(gcvisitobjects_t, - ffi.Pointer)>>('PyUnstable_GC_VisitObjects'); - late final _PyUnstable_GC_VisitObjects = _PyUnstable_GC_VisitObjectsPtr - .asFunction)>(); - - ffi.Pointer _PyObject_GC_Resize( - ffi.Pointer arg0, - int arg1, - ) { - return __PyObject_GC_Resize( - arg0, - arg1, - ); - } - - late final __PyObject_GC_ResizePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('_PyObject_GC_Resize'); - late final __PyObject_GC_Resize = __PyObject_GC_ResizePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer _PyObject_GC_New( - ffi.Pointer arg0, - ) { - return __PyObject_GC_New( - arg0, - ); - } - - late final __PyObject_GC_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyObject_GC_New'); - late final __PyObject_GC_New = __PyObject_GC_NewPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _PyObject_GC_NewVar( - ffi.Pointer arg0, - int arg1, - ) { - return __PyObject_GC_NewVar( - arg0, - arg1, - ); - } - - late final __PyObject_GC_NewVarPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('_PyObject_GC_NewVar'); - late final __PyObject_GC_NewVar = __PyObject_GC_NewVarPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - void PyObject_GC_Track( - ffi.Pointer arg0, - ) { - return _PyObject_GC_Track( - arg0, - ); - } - - late final _PyObject_GC_TrackPtr = - _lookup)>>( - 'PyObject_GC_Track'); - late final _PyObject_GC_Track = - _PyObject_GC_TrackPtr.asFunction)>(); - - void PyObject_GC_UnTrack( - ffi.Pointer arg0, - ) { - return _PyObject_GC_UnTrack( - arg0, - ); - } - - late final _PyObject_GC_UnTrackPtr = - _lookup)>>( - 'PyObject_GC_UnTrack'); - late final _PyObject_GC_UnTrack = _PyObject_GC_UnTrackPtr.asFunction< - void Function(ffi.Pointer)>(); - - void PyObject_GC_Del( - ffi.Pointer arg0, - ) { - return _PyObject_GC_Del( - arg0, - ); - } - - late final _PyObject_GC_DelPtr = - _lookup)>>( - 'PyObject_GC_Del'); - late final _PyObject_GC_Del = - _PyObject_GC_DelPtr.asFunction)>(); - - int PyObject_GC_IsTracked( - ffi.Pointer arg0, - ) { - return _PyObject_GC_IsTracked( - arg0, - ); - } - - late final _PyObject_GC_IsTrackedPtr = - _lookup)>>( - 'PyObject_GC_IsTracked'); - late final _PyObject_GC_IsTracked = _PyObject_GC_IsTrackedPtr.asFunction< - int Function(ffi.Pointer)>(); - - int PyObject_GC_IsFinalized( - ffi.Pointer arg0, - ) { - return _PyObject_GC_IsFinalized( - arg0, - ); - } - - late final _PyObject_GC_IsFinalizedPtr = - _lookup)>>( - 'PyObject_GC_IsFinalized'); - late final _PyObject_GC_IsFinalized = _PyObject_GC_IsFinalizedPtr.asFunction< - int Function(ffi.Pointer)>(); - - void PyObject_GetArenaAllocator( - ffi.Pointer allocator, - ) { - return _PyObject_GetArenaAllocator( - allocator, - ); - } - - late final _PyObject_GetArenaAllocatorPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>( - 'PyObject_GetArenaAllocator'); - late final _PyObject_GetArenaAllocator = _PyObject_GetArenaAllocatorPtr - .asFunction)>(); - - void PyObject_SetArenaAllocator( - ffi.Pointer allocator, - ) { - return _PyObject_SetArenaAllocator( - allocator, - ); - } - - late final _PyObject_SetArenaAllocatorPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>( - 'PyObject_SetArenaAllocator'); - late final _PyObject_SetArenaAllocator = _PyObject_SetArenaAllocatorPtr - .asFunction)>(); - - int PyObject_IS_GC( - ffi.Pointer obj, - ) { - return _PyObject_IS_GC( - obj, - ); - } - - late final _PyObject_IS_GCPtr = - _lookup)>>( - 'PyObject_IS_GC'); - late final _PyObject_IS_GC = - _PyObject_IS_GCPtr.asFunction)>(); - - int PyType_SUPPORTS_WEAKREFS( - ffi.Pointer type, - ) { - return _PyType_SUPPORTS_WEAKREFS( - type, - ); - } - - late final _PyType_SUPPORTS_WEAKREFSPtr = - _lookup)>>( - 'PyType_SUPPORTS_WEAKREFS'); - late final _PyType_SUPPORTS_WEAKREFS = _PyType_SUPPORTS_WEAKREFSPtr - .asFunction)>(); - - ffi.Pointer> PyObject_GET_WEAKREFS_LISTPTR( - ffi.Pointer op, - ) { - return _PyObject_GET_WEAKREFS_LISTPTR( - op, - ); - } - - late final _PyObject_GET_WEAKREFS_LISTPTRPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Pointer)>>('PyObject_GET_WEAKREFS_LISTPTR'); - late final _PyObject_GET_WEAKREFS_LISTPTR = - _PyObject_GET_WEAKREFS_LISTPTRPtr.asFunction< - ffi.Pointer> Function(ffi.Pointer)>(); - - ffi.Pointer PyUnstable_Object_GC_NewWithExtraData( - ffi.Pointer arg0, - int arg1, - ) { - return _PyUnstable_Object_GC_NewWithExtraData( - arg0, - arg1, - ); - } - - late final _PyUnstable_Object_GC_NewWithExtraDataPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Size)>>('PyUnstable_Object_GC_NewWithExtraData'); - late final _PyUnstable_Object_GC_NewWithExtraData = - _PyUnstable_Object_GC_NewWithExtraDataPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - int _Py_HashDouble( - ffi.Pointer arg0, - double arg1, - ) { - return __Py_HashDouble( - arg0, - arg1, - ); - } - - late final __Py_HashDoublePtr = _lookup< - ffi.NativeFunction< - Py_hash_t Function( - ffi.Pointer, ffi.Double)>>('_Py_HashDouble'); - late final __Py_HashDouble = __Py_HashDoublePtr - .asFunction, double)>(); - - int _Py_HashPointer( - ffi.Pointer arg0, - ) { - return __Py_HashPointer( - arg0, - ); - } - - late final __Py_HashPointerPtr = - _lookup)>>( - '_Py_HashPointer'); - late final __Py_HashPointer = - __Py_HashPointerPtr.asFunction)>(); - - int _Py_HashPointerRaw( - ffi.Pointer arg0, - ) { - return __Py_HashPointerRaw( - arg0, - ); - } - - late final __Py_HashPointerRawPtr = - _lookup)>>( - '_Py_HashPointerRaw'); - late final __Py_HashPointerRaw = - __Py_HashPointerRawPtr.asFunction)>(); - - int _Py_HashBytes( - ffi.Pointer arg0, - int arg1, - ) { - return __Py_HashBytes( - arg0, - arg1, - ); - } - - late final __Py_HashBytesPtr = _lookup< - ffi.NativeFunction< - Py_hash_t Function( - ffi.Pointer, Py_ssize_t)>>('_Py_HashBytes'); - late final __Py_HashBytes = - __Py_HashBytesPtr.asFunction, int)>(); - - late final ffi.Pointer<_Py_HashSecret_t> __Py_HashSecret = - _lookup<_Py_HashSecret_t>('_Py_HashSecret'); - - _Py_HashSecret_t get _Py_HashSecret => __Py_HashSecret.ref; - - ffi.Pointer PyHash_GetFuncDef() { - return _PyHash_GetFuncDef(); - } - - late final _PyHash_GetFuncDefPtr = - _lookup Function()>>( - 'PyHash_GetFuncDef'); - late final _PyHash_GetFuncDef = _PyHash_GetFuncDefPtr.asFunction< - ffi.Pointer Function()>(); - - late final ffi.Pointer _Py_DebugFlag = - _lookup('Py_DebugFlag'); - - int get Py_DebugFlag => _Py_DebugFlag.value; - - set Py_DebugFlag(int value) => _Py_DebugFlag.value = value; - - late final ffi.Pointer _Py_VerboseFlag = - _lookup('Py_VerboseFlag'); - - int get Py_VerboseFlag => _Py_VerboseFlag.value; - - set Py_VerboseFlag(int value) => _Py_VerboseFlag.value = value; - - late final ffi.Pointer _Py_QuietFlag = - _lookup('Py_QuietFlag'); - - int get Py_QuietFlag => _Py_QuietFlag.value; - - set Py_QuietFlag(int value) => _Py_QuietFlag.value = value; - - late final ffi.Pointer _Py_InteractiveFlag = - _lookup('Py_InteractiveFlag'); - - int get Py_InteractiveFlag => _Py_InteractiveFlag.value; - - set Py_InteractiveFlag(int value) => _Py_InteractiveFlag.value = value; - - late final ffi.Pointer _Py_InspectFlag = - _lookup('Py_InspectFlag'); - - int get Py_InspectFlag => _Py_InspectFlag.value; - - set Py_InspectFlag(int value) => _Py_InspectFlag.value = value; - - late final ffi.Pointer _Py_OptimizeFlag = - _lookup('Py_OptimizeFlag'); - - int get Py_OptimizeFlag => _Py_OptimizeFlag.value; - - set Py_OptimizeFlag(int value) => _Py_OptimizeFlag.value = value; - - late final ffi.Pointer _Py_NoSiteFlag = - _lookup('Py_NoSiteFlag'); - - int get Py_NoSiteFlag => _Py_NoSiteFlag.value; - - set Py_NoSiteFlag(int value) => _Py_NoSiteFlag.value = value; - - late final ffi.Pointer _Py_BytesWarningFlag = - _lookup('Py_BytesWarningFlag'); - - int get Py_BytesWarningFlag => _Py_BytesWarningFlag.value; - - set Py_BytesWarningFlag(int value) => _Py_BytesWarningFlag.value = value; - - late final ffi.Pointer _Py_FrozenFlag = - _lookup('Py_FrozenFlag'); - - int get Py_FrozenFlag => _Py_FrozenFlag.value; - - set Py_FrozenFlag(int value) => _Py_FrozenFlag.value = value; - - late final ffi.Pointer _Py_IgnoreEnvironmentFlag = - _lookup('Py_IgnoreEnvironmentFlag'); - - int get Py_IgnoreEnvironmentFlag => _Py_IgnoreEnvironmentFlag.value; - - set Py_IgnoreEnvironmentFlag(int value) => - _Py_IgnoreEnvironmentFlag.value = value; - - late final ffi.Pointer _Py_DontWriteBytecodeFlag = - _lookup('Py_DontWriteBytecodeFlag'); - - int get Py_DontWriteBytecodeFlag => _Py_DontWriteBytecodeFlag.value; - - set Py_DontWriteBytecodeFlag(int value) => - _Py_DontWriteBytecodeFlag.value = value; - - late final ffi.Pointer _Py_NoUserSiteDirectory = - _lookup('Py_NoUserSiteDirectory'); - - int get Py_NoUserSiteDirectory => _Py_NoUserSiteDirectory.value; - - set Py_NoUserSiteDirectory(int value) => - _Py_NoUserSiteDirectory.value = value; - - late final ffi.Pointer _Py_UnbufferedStdioFlag = - _lookup('Py_UnbufferedStdioFlag'); - - int get Py_UnbufferedStdioFlag => _Py_UnbufferedStdioFlag.value; - - set Py_UnbufferedStdioFlag(int value) => - _Py_UnbufferedStdioFlag.value = value; - - late final ffi.Pointer _Py_HashRandomizationFlag = - _lookup('Py_HashRandomizationFlag'); - - int get Py_HashRandomizationFlag => _Py_HashRandomizationFlag.value; - - set Py_HashRandomizationFlag(int value) => - _Py_HashRandomizationFlag.value = value; - - late final ffi.Pointer _Py_IsolatedFlag = - _lookup('Py_IsolatedFlag'); - - int get Py_IsolatedFlag => _Py_IsolatedFlag.value; - - set Py_IsolatedFlag(int value) => _Py_IsolatedFlag.value = value; - - ffi.Pointer Py_GETENV( - ffi.Pointer name, - ) { - return _Py_GETENV( - name, - ); - } - - late final _Py_GETENVPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('Py_GETENV'); - late final _Py_GETENV = _Py_GETENVPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _PyByteArray_Type = - _lookup('PyByteArray_Type'); - - PyTypeObject get PyByteArray_Type => _PyByteArray_Type.ref; - - late final ffi.Pointer _PyByteArrayIter_Type = - _lookup('PyByteArrayIter_Type'); - - PyTypeObject get PyByteArrayIter_Type => _PyByteArrayIter_Type.ref; - - ffi.Pointer PyByteArray_FromObject( - ffi.Pointer arg0, - ) { - return _PyByteArray_FromObject( - arg0, - ); - } - - late final _PyByteArray_FromObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyByteArray_FromObject'); - late final _PyByteArray_FromObject = _PyByteArray_FromObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyByteArray_Concat( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyByteArray_Concat( - arg0, - arg1, - ); - } - - late final _PyByteArray_ConcatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyByteArray_Concat'); - late final _PyByteArray_Concat = _PyByteArray_ConcatPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyByteArray_FromStringAndSize( - ffi.Pointer arg0, - int arg1, - ) { - return _PyByteArray_FromStringAndSize( - arg0, - arg1, - ); - } - - late final _PyByteArray_FromStringAndSizePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - Py_ssize_t)>>('PyByteArray_FromStringAndSize'); - late final _PyByteArray_FromStringAndSize = _PyByteArray_FromStringAndSizePtr - .asFunction Function(ffi.Pointer, int)>(); - - int PyByteArray_Size( - ffi.Pointer arg0, - ) { - return _PyByteArray_Size( - arg0, - ); - } - - late final _PyByteArray_SizePtr = - _lookup)>>( - 'PyByteArray_Size'); - late final _PyByteArray_Size = - _PyByteArray_SizePtr.asFunction)>(); - - ffi.Pointer PyByteArray_AsString( - ffi.Pointer arg0, - ) { - return _PyByteArray_AsString( - arg0, - ); - } - - late final _PyByteArray_AsStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyByteArray_AsString'); - late final _PyByteArray_AsString = _PyByteArray_AsStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyByteArray_Resize( - ffi.Pointer arg0, - int arg1, - ) { - return _PyByteArray_Resize( - arg0, - arg1, - ); - } - - late final _PyByteArray_ResizePtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - 'PyByteArray_Resize'); - late final _PyByteArray_Resize = _PyByteArray_ResizePtr.asFunction< - int Function(ffi.Pointer, int)>(); - - late final ffi.Pointer> __PyByteArray_empty_string = - _lookup>('_PyByteArray_empty_string'); - - ffi.Pointer get _PyByteArray_empty_string => - __PyByteArray_empty_string.value; - - set _PyByteArray_empty_string(ffi.Pointer value) => - __PyByteArray_empty_string.value = value; - - late final ffi.Pointer _PyBytes_Type = - _lookup('PyBytes_Type'); - - PyTypeObject get PyBytes_Type => _PyBytes_Type.ref; - - late final ffi.Pointer _PyBytesIter_Type = - _lookup('PyBytesIter_Type'); - - PyTypeObject get PyBytesIter_Type => _PyBytesIter_Type.ref; - - ffi.Pointer PyBytes_FromStringAndSize( - ffi.Pointer arg0, - int arg1, - ) { - return _PyBytes_FromStringAndSize( - arg0, - arg1, - ); - } - - late final _PyBytes_FromStringAndSizePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('PyBytes_FromStringAndSize'); - late final _PyBytes_FromStringAndSize = _PyBytes_FromStringAndSizePtr - .asFunction Function(ffi.Pointer, int)>(); - - ffi.Pointer PyBytes_FromString( - ffi.Pointer arg0, - ) { - return _PyBytes_FromString( - arg0, - ); - } - - late final _PyBytes_FromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyBytes_FromString'); - late final _PyBytes_FromString = _PyBytes_FromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyBytes_FromObject( - ffi.Pointer arg0, - ) { - return _PyBytes_FromObject( - arg0, - ); - } - - late final _PyBytes_FromObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyBytes_FromObject'); - late final _PyBytes_FromObject = _PyBytes_FromObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyBytes_FromFormatV( - ffi.Pointer arg0, - va_list arg1, - ) { - return _PyBytes_FromFormatV( - arg0, - arg1, - ); - } - - late final _PyBytes_FromFormatVPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, va_list)>>('PyBytes_FromFormatV'); - late final _PyBytes_FromFormatV = _PyBytes_FromFormatVPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, va_list)>(); - - ffi.Pointer PyBytes_FromFormat( - ffi.Pointer arg0, - ) { - return _PyBytes_FromFormat( - arg0, - ); - } - - late final _PyBytes_FromFormatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyBytes_FromFormat'); - late final _PyBytes_FromFormat = _PyBytes_FromFormatPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyBytes_Size( - ffi.Pointer arg0, - ) { - return _PyBytes_Size( - arg0, - ); - } - - late final _PyBytes_SizePtr = - _lookup)>>( - 'PyBytes_Size'); - late final _PyBytes_Size = - _PyBytes_SizePtr.asFunction)>(); - - ffi.Pointer PyBytes_AsString( - ffi.Pointer arg0, - ) { - return _PyBytes_AsString( - arg0, - ); - } - - late final _PyBytes_AsStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyBytes_AsString'); - late final _PyBytes_AsString = _PyBytes_AsStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyBytes_Repr( - ffi.Pointer arg0, - int arg1, - ) { - return _PyBytes_Repr( - arg0, - arg1, - ); - } - - late final _PyBytes_ReprPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyBytes_Repr'); - late final _PyBytes_Repr = _PyBytes_ReprPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - void PyBytes_Concat( - ffi.Pointer> arg0, - ffi.Pointer arg1, - ) { - return _PyBytes_Concat( - arg0, - arg1, - ); - } - - late final _PyBytes_ConcatPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer>, - ffi.Pointer)>>('PyBytes_Concat'); - late final _PyBytes_Concat = _PyBytes_ConcatPtr.asFunction< - void Function( - ffi.Pointer>, ffi.Pointer)>(); - - void PyBytes_ConcatAndDel( - ffi.Pointer> arg0, - ffi.Pointer arg1, - ) { - return _PyBytes_ConcatAndDel( - arg0, - arg1, - ); - } - - late final _PyBytes_ConcatAndDelPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer>, - ffi.Pointer)>>('PyBytes_ConcatAndDel'); - late final _PyBytes_ConcatAndDel = _PyBytes_ConcatAndDelPtr.asFunction< - void Function( - ffi.Pointer>, ffi.Pointer)>(); - - ffi.Pointer PyBytes_DecodeEscape( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, - ) { - return _PyBytes_DecodeEscape1( - arg0, - arg1, - arg2, - arg3, - arg4, - ); - } - - late final _PyBytes_DecodeEscapePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - Py_ssize_t, - ffi.Pointer)>>('PyBytes_DecodeEscape'); - late final _PyBytes_DecodeEscape1 = _PyBytes_DecodeEscapePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, int, ffi.Pointer)>(); - - int PyBytes_AsStringAndSize( - ffi.Pointer obj, - ffi.Pointer> s, - ffi.Pointer len, - ) { - return _PyBytes_AsStringAndSize( - obj, - s, - len, - ); - } - - late final _PyBytes_AsStringAndSizePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('PyBytes_AsStringAndSize'); - late final _PyBytes_AsStringAndSize = _PyBytes_AsStringAndSizePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - ffi.Pointer)>(); - - int _PyBytes_Resize( - ffi.Pointer> arg0, - int arg1, - ) { - return __PyBytes_Resize( - arg0, - arg1, - ); - } - - late final __PyBytes_ResizePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - Py_ssize_t)>>('_PyBytes_Resize'); - late final __PyBytes_Resize = __PyBytes_ResizePtr - .asFunction>, int)>(); - - ffi.Pointer _PyBytes_FormatEx( - ffi.Pointer format, - int format_len, - ffi.Pointer args, - int use_bytearray, - ) { - return __PyBytes_FormatEx( - format, - format_len, - args, - use_bytearray, - ); - } - - late final __PyBytes_FormatExPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer, ffi.Int)>>('_PyBytes_FormatEx'); - late final __PyBytes_FormatEx = __PyBytes_FormatExPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer, int)>(); - - ffi.Pointer _PyBytes_FromHex( - ffi.Pointer string, - int use_bytearray, - ) { - return __PyBytes_FromHex( - string, - use_bytearray, - ); - } - - late final __PyBytes_FromHexPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('_PyBytes_FromHex'); - late final __PyBytes_FromHex = __PyBytes_FromHexPtr - .asFunction Function(ffi.Pointer, int)>(); - - ffi.Pointer _PyBytes_DecodeEscape( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - ) { - return __PyBytes_DecodeEscape( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final __PyBytes_DecodeEscapePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer>)>>('_PyBytes_DecodeEscape'); - late final __PyBytes_DecodeEscape = __PyBytes_DecodeEscapePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer>)>(); - - ffi.Pointer _PyBytes_Join( - ffi.Pointer sep, - ffi.Pointer x, - ) { - return __PyBytes_Join( - sep, - x, - ); - } - - late final __PyBytes_JoinPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('_PyBytes_Join'); - late final __PyBytes_Join = __PyBytes_JoinPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - void _PyBytesWriter_Init( - ffi.Pointer<_PyBytesWriter> writer, - ) { - return __PyBytesWriter_Init( - writer, - ); - } - - late final __PyBytesWriter_InitPtr = _lookup< - ffi.NativeFunction)>>( - '_PyBytesWriter_Init'); - late final __PyBytesWriter_Init = __PyBytesWriter_InitPtr - .asFunction)>(); - - ffi.Pointer _PyBytesWriter_Finish( - ffi.Pointer<_PyBytesWriter> writer, - ffi.Pointer str, - ) { - return __PyBytesWriter_Finish( - writer, - str, - ); - } - - late final __PyBytesWriter_FinishPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer<_PyBytesWriter>, - ffi.Pointer)>>('_PyBytesWriter_Finish'); - late final __PyBytesWriter_Finish = __PyBytesWriter_FinishPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer<_PyBytesWriter>, ffi.Pointer)>(); - - void _PyBytesWriter_Dealloc( - ffi.Pointer<_PyBytesWriter> writer, - ) { - return __PyBytesWriter_Dealloc( - writer, - ); - } - - late final __PyBytesWriter_DeallocPtr = _lookup< - ffi.NativeFunction)>>( - '_PyBytesWriter_Dealloc'); - late final __PyBytesWriter_Dealloc = __PyBytesWriter_DeallocPtr - .asFunction)>(); - - ffi.Pointer _PyBytesWriter_Alloc( - ffi.Pointer<_PyBytesWriter> writer, - int size, - ) { - return __PyBytesWriter_Alloc( - writer, - size, - ); - } - - late final __PyBytesWriter_AllocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer<_PyBytesWriter>, - Py_ssize_t)>>('_PyBytesWriter_Alloc'); - late final __PyBytesWriter_Alloc = __PyBytesWriter_AllocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer<_PyBytesWriter>, int)>(); - - ffi.Pointer _PyBytesWriter_Prepare( - ffi.Pointer<_PyBytesWriter> writer, - ffi.Pointer str, - int size, - ) { - return __PyBytesWriter_Prepare( - writer, - str, - size, - ); - } - - late final __PyBytesWriter_PreparePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer<_PyBytesWriter>, - ffi.Pointer, Py_ssize_t)>>('_PyBytesWriter_Prepare'); - late final __PyBytesWriter_Prepare = __PyBytesWriter_PreparePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer<_PyBytesWriter>, ffi.Pointer, int)>(); - - ffi.Pointer _PyBytesWriter_Resize( - ffi.Pointer<_PyBytesWriter> writer, - ffi.Pointer str, - int size, - ) { - return __PyBytesWriter_Resize( - writer, - str, - size, - ); - } - - late final __PyBytesWriter_ResizePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer<_PyBytesWriter>, - ffi.Pointer, Py_ssize_t)>>('_PyBytesWriter_Resize'); - late final __PyBytesWriter_Resize = __PyBytesWriter_ResizePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer<_PyBytesWriter>, ffi.Pointer, int)>(); - - ffi.Pointer _PyBytesWriter_WriteBytes( - ffi.Pointer<_PyBytesWriter> writer, - ffi.Pointer str, - ffi.Pointer bytes, - int size, - ) { - return __PyBytesWriter_WriteBytes( - writer, - str, - bytes, - size, - ); - } - - late final __PyBytesWriter_WriteBytesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_PyBytesWriter>, - ffi.Pointer, - ffi.Pointer, - Py_ssize_t)>>('_PyBytesWriter_WriteBytes'); - late final __PyBytesWriter_WriteBytes = - __PyBytesWriter_WriteBytesPtr.asFunction< - ffi.Pointer Function(ffi.Pointer<_PyBytesWriter>, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _PyUnicode_Type = - _lookup('PyUnicode_Type'); - - PyTypeObject get PyUnicode_Type => _PyUnicode_Type.ref; - - late final ffi.Pointer _PyUnicodeIter_Type = - _lookup('PyUnicodeIter_Type'); - - PyTypeObject get PyUnicodeIter_Type => _PyUnicodeIter_Type.ref; - - ffi.Pointer PyUnicode_FromStringAndSize( - ffi.Pointer u, - int size, - ) { - return _PyUnicode_FromStringAndSize( - u, - size, - ); - } - - late final _PyUnicode_FromStringAndSizePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - Py_ssize_t)>>('PyUnicode_FromStringAndSize'); - late final _PyUnicode_FromStringAndSize = _PyUnicode_FromStringAndSizePtr - .asFunction Function(ffi.Pointer, int)>(); - - ffi.Pointer PyUnicode_FromString( - ffi.Pointer u, - ) { - return _PyUnicode_FromString( - u, - ); - } - - late final _PyUnicode_FromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_FromString'); - late final _PyUnicode_FromString = _PyUnicode_FromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_Substring( - ffi.Pointer str, - int start, - int end, - ) { - return _PyUnicode_Substring( - str, - start, - end, - ); - } - - late final _PyUnicode_SubstringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - Py_ssize_t)>>('PyUnicode_Substring'); - late final _PyUnicode_Substring = _PyUnicode_SubstringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - ffi.Pointer PyUnicode_AsUCS4( - ffi.Pointer unicode, - ffi.Pointer buffer, - int buflen, - int copy_null, - ) { - return _PyUnicode_AsUCS4( - unicode, - buffer, - buflen, - copy_null, - ); - } - - late final _PyUnicode_AsUCS4Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, Py_ssize_t, ffi.Int)>>('PyUnicode_AsUCS4'); - late final _PyUnicode_AsUCS4 = _PyUnicode_AsUCS4Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int, int)>(); - - ffi.Pointer PyUnicode_AsUCS4Copy( - ffi.Pointer unicode, - ) { - return _PyUnicode_AsUCS4Copy( - unicode, - ); - } - - late final _PyUnicode_AsUCS4CopyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_AsUCS4Copy'); - late final _PyUnicode_AsUCS4Copy = _PyUnicode_AsUCS4CopyPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyUnicode_GetLength( - ffi.Pointer unicode, - ) { - return _PyUnicode_GetLength( - unicode, - ); - } - - late final _PyUnicode_GetLengthPtr = - _lookup)>>( - 'PyUnicode_GetLength'); - late final _PyUnicode_GetLength = - _PyUnicode_GetLengthPtr.asFunction)>(); - - int PyUnicode_ReadChar( - ffi.Pointer unicode, - int index, - ) { - return _PyUnicode_ReadChar( - unicode, - index, - ); - } - - late final _PyUnicode_ReadCharPtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - 'PyUnicode_ReadChar'); - late final _PyUnicode_ReadChar = _PyUnicode_ReadCharPtr.asFunction< - int Function(ffi.Pointer, int)>(); - - int PyUnicode_WriteChar( - ffi.Pointer unicode, - int index, - int character, - ) { - return _PyUnicode_WriteChar( - unicode, - index, - character, - ); - } - - late final _PyUnicode_WriteCharPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, - Py_UCS4)>>('PyUnicode_WriteChar'); - late final _PyUnicode_WriteChar = _PyUnicode_WriteCharPtr.asFunction< - int Function(ffi.Pointer, int, int)>(); - - int PyUnicode_Resize( - ffi.Pointer> unicode, - int length, - ) { - return _PyUnicode_Resize( - unicode, - length, - ); - } - - late final _PyUnicode_ResizePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - Py_ssize_t)>>('PyUnicode_Resize'); - late final _PyUnicode_Resize = _PyUnicode_ResizePtr.asFunction< - int Function(ffi.Pointer>, int)>(); - - ffi.Pointer PyUnicode_FromEncodedObject( - ffi.Pointer obj, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyUnicode_FromEncodedObject( - obj, - encoding, - errors, - ); - } - - late final _PyUnicode_FromEncodedObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_FromEncodedObject'); - late final _PyUnicode_FromEncodedObject = - _PyUnicode_FromEncodedObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_FromObject( - ffi.Pointer obj, - ) { - return _PyUnicode_FromObject( - obj, - ); - } - - late final _PyUnicode_FromObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_FromObject'); - late final _PyUnicode_FromObject = _PyUnicode_FromObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_FromFormatV( - ffi.Pointer format, - va_list vargs, - ) { - return _PyUnicode_FromFormatV( - format, - vargs, - ); - } - - late final _PyUnicode_FromFormatVPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, va_list)>>('PyUnicode_FromFormatV'); - late final _PyUnicode_FromFormatV = _PyUnicode_FromFormatVPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, va_list)>(); - - ffi.Pointer PyUnicode_FromFormat( - ffi.Pointer format, - ) { - return _PyUnicode_FromFormat( - format, - ); - } - - late final _PyUnicode_FromFormatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_FromFormat'); - late final _PyUnicode_FromFormat = _PyUnicode_FromFormatPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - void PyUnicode_InternInPlace( - ffi.Pointer> arg0, - ) { - return _PyUnicode_InternInPlace( - arg0, - ); - } - - late final _PyUnicode_InternInPlacePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer>)>>('PyUnicode_InternInPlace'); - late final _PyUnicode_InternInPlace = _PyUnicode_InternInPlacePtr.asFunction< - void Function(ffi.Pointer>)>(); - - ffi.Pointer PyUnicode_InternFromString( - ffi.Pointer u, - ) { - return _PyUnicode_InternFromString( - u, - ); - } - - late final _PyUnicode_InternFromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_InternFromString'); - late final _PyUnicode_InternFromString = _PyUnicode_InternFromStringPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_FromWideChar( - ffi.Pointer w, - int size, - ) { - return _PyUnicode_FromWideChar( - w, - size, - ); - } - - late final _PyUnicode_FromWideCharPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('PyUnicode_FromWideChar'); - late final _PyUnicode_FromWideChar = _PyUnicode_FromWideCharPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - int PyUnicode_AsWideChar( - ffi.Pointer unicode, - ffi.Pointer w, - int size, - ) { - return _PyUnicode_AsWideChar( - unicode, - w, - size, - ); - } - - late final _PyUnicode_AsWideCharPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(ffi.Pointer, ffi.Pointer, - Py_ssize_t)>>('PyUnicode_AsWideChar'); - late final _PyUnicode_AsWideChar = _PyUnicode_AsWideCharPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer PyUnicode_AsWideCharString( - ffi.Pointer unicode, - ffi.Pointer size, - ) { - return _PyUnicode_AsWideCharString( - unicode, - size, - ); - } - - late final _PyUnicode_AsWideCharStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_AsWideCharString'); - late final _PyUnicode_AsWideCharString = - _PyUnicode_AsWideCharStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_FromOrdinal( - int ordinal, - ) { - return _PyUnicode_FromOrdinal( - ordinal, - ); - } - - late final _PyUnicode_FromOrdinalPtr = - _lookup Function(ffi.Int)>>( - 'PyUnicode_FromOrdinal'); - late final _PyUnicode_FromOrdinal = _PyUnicode_FromOrdinalPtr.asFunction< - ffi.Pointer Function(int)>(); - - ffi.Pointer PyUnicode_GetDefaultEncoding() { - return _PyUnicode_GetDefaultEncoding(); - } - - late final _PyUnicode_GetDefaultEncodingPtr = - _lookup Function()>>( - 'PyUnicode_GetDefaultEncoding'); - late final _PyUnicode_GetDefaultEncoding = _PyUnicode_GetDefaultEncodingPtr - .asFunction Function()>(); - - ffi.Pointer PyUnicode_Decode( - ffi.Pointer s, - int size, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyUnicode_Decode( - s, - size, - encoding, - errors, - ); - } - - late final _PyUnicode_DecodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_Decode'); - late final _PyUnicode_Decode = _PyUnicode_DecodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsDecodedObject( - ffi.Pointer unicode, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyUnicode_AsDecodedObject( - unicode, - encoding, - errors, - ); - } - - late final _PyUnicode_AsDecodedObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_AsDecodedObject'); - late final _PyUnicode_AsDecodedObject = - _PyUnicode_AsDecodedObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsDecodedUnicode( - ffi.Pointer unicode, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyUnicode_AsDecodedUnicode( - unicode, - encoding, - errors, - ); - } - - late final _PyUnicode_AsDecodedUnicodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_AsDecodedUnicode'); - late final _PyUnicode_AsDecodedUnicode = - _PyUnicode_AsDecodedUnicodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsEncodedObject( - ffi.Pointer unicode, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyUnicode_AsEncodedObject( - unicode, - encoding, - errors, - ); - } - - late final _PyUnicode_AsEncodedObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_AsEncodedObject'); - late final _PyUnicode_AsEncodedObject = - _PyUnicode_AsEncodedObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsEncodedString( - ffi.Pointer unicode, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyUnicode_AsEncodedString( - unicode, - encoding, - errors, - ); - } - - late final _PyUnicode_AsEncodedStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_AsEncodedString'); - late final _PyUnicode_AsEncodedString = - _PyUnicode_AsEncodedStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsEncodedUnicode( - ffi.Pointer unicode, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyUnicode_AsEncodedUnicode( - unicode, - encoding, - errors, - ); - } - - late final _PyUnicode_AsEncodedUnicodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_AsEncodedUnicode'); - late final _PyUnicode_AsEncodedUnicode = - _PyUnicode_AsEncodedUnicodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_BuildEncodingMap( - ffi.Pointer string, - ) { - return _PyUnicode_BuildEncodingMap( - string, - ); - } - - late final _PyUnicode_BuildEncodingMapPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_BuildEncodingMap'); - late final _PyUnicode_BuildEncodingMap = _PyUnicode_BuildEncodingMapPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeUTF7( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ) { - return _PyUnicode_DecodeUTF7( - string, - length, - errors, - ); - } - - late final _PyUnicode_DecodeUTF7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyUnicode_DecodeUTF7'); - late final _PyUnicode_DecodeUTF7 = _PyUnicode_DecodeUTF7Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeUTF7Stateful( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ffi.Pointer consumed, - ) { - return _PyUnicode_DecodeUTF7Stateful( - string, - length, - errors, - consumed, - ); - } - - late final _PyUnicode_DecodeUTF7StatefulPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_DecodeUTF7Stateful'); - late final _PyUnicode_DecodeUTF7Stateful = - _PyUnicode_DecodeUTF7StatefulPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeUTF8( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ) { - return _PyUnicode_DecodeUTF8( - string, - length, - errors, - ); - } - - late final _PyUnicode_DecodeUTF8Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyUnicode_DecodeUTF8'); - late final _PyUnicode_DecodeUTF8 = _PyUnicode_DecodeUTF8Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeUTF8Stateful( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ffi.Pointer consumed, - ) { - return _PyUnicode_DecodeUTF8Stateful( - string, - length, - errors, - consumed, - ); - } - - late final _PyUnicode_DecodeUTF8StatefulPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_DecodeUTF8Stateful'); - late final _PyUnicode_DecodeUTF8Stateful = - _PyUnicode_DecodeUTF8StatefulPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsUTF8String( - ffi.Pointer unicode, - ) { - return _PyUnicode_AsUTF8String1( - unicode, - ); - } - - late final _PyUnicode_AsUTF8StringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_AsUTF8String'); - late final _PyUnicode_AsUTF8String1 = _PyUnicode_AsUTF8StringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsUTF8AndSize( - ffi.Pointer unicode, - ffi.Pointer size, - ) { - return _PyUnicode_AsUTF8AndSize( - unicode, - size, - ); - } - - late final _PyUnicode_AsUTF8AndSizePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_AsUTF8AndSize'); - late final _PyUnicode_AsUTF8AndSize = _PyUnicode_AsUTF8AndSizePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeUTF32( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ffi.Pointer byteorder, - ) { - return _PyUnicode_DecodeUTF32( - string, - length, - errors, - byteorder, - ); - } - - late final _PyUnicode_DecodeUTF32Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_DecodeUTF32'); - late final _PyUnicode_DecodeUTF32 = _PyUnicode_DecodeUTF32Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeUTF32Stateful( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ffi.Pointer byteorder, - ffi.Pointer consumed, - ) { - return _PyUnicode_DecodeUTF32Stateful( - string, - length, - errors, - byteorder, - consumed, - ); - } - - late final _PyUnicode_DecodeUTF32StatefulPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_DecodeUTF32Stateful'); - late final _PyUnicode_DecodeUTF32Stateful = - _PyUnicode_DecodeUTF32StatefulPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsUTF32String( - ffi.Pointer unicode, - ) { - return _PyUnicode_AsUTF32String( - unicode, - ); - } - - late final _PyUnicode_AsUTF32StringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_AsUTF32String'); - late final _PyUnicode_AsUTF32String = _PyUnicode_AsUTF32StringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeUTF16( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ffi.Pointer byteorder, - ) { - return _PyUnicode_DecodeUTF16( - string, - length, - errors, - byteorder, - ); - } - - late final _PyUnicode_DecodeUTF16Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_DecodeUTF16'); - late final _PyUnicode_DecodeUTF16 = _PyUnicode_DecodeUTF16Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeUTF16Stateful( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ffi.Pointer byteorder, - ffi.Pointer consumed, - ) { - return _PyUnicode_DecodeUTF16Stateful( - string, - length, - errors, - byteorder, - consumed, - ); - } - - late final _PyUnicode_DecodeUTF16StatefulPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_DecodeUTF16Stateful'); - late final _PyUnicode_DecodeUTF16Stateful = - _PyUnicode_DecodeUTF16StatefulPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsUTF16String( - ffi.Pointer unicode, - ) { - return _PyUnicode_AsUTF16String( - unicode, - ); - } - - late final _PyUnicode_AsUTF16StringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_AsUTF16String'); - late final _PyUnicode_AsUTF16String = _PyUnicode_AsUTF16StringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeUnicodeEscape( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ) { - return _PyUnicode_DecodeUnicodeEscape( - string, - length, - errors, - ); - } - - late final _PyUnicode_DecodeUnicodeEscapePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyUnicode_DecodeUnicodeEscape'); - late final _PyUnicode_DecodeUnicodeEscape = - _PyUnicode_DecodeUnicodeEscapePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsUnicodeEscapeString( - ffi.Pointer unicode, - ) { - return _PyUnicode_AsUnicodeEscapeString( - unicode, - ); - } - - late final _PyUnicode_AsUnicodeEscapeStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_AsUnicodeEscapeString'); - late final _PyUnicode_AsUnicodeEscapeString = - _PyUnicode_AsUnicodeEscapeStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeRawUnicodeEscape( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ) { - return _PyUnicode_DecodeRawUnicodeEscape( - string, - length, - errors, - ); - } - - late final _PyUnicode_DecodeRawUnicodeEscapePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyUnicode_DecodeRawUnicodeEscape'); - late final _PyUnicode_DecodeRawUnicodeEscape = - _PyUnicode_DecodeRawUnicodeEscapePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsRawUnicodeEscapeString( - ffi.Pointer unicode, - ) { - return _PyUnicode_AsRawUnicodeEscapeString( - unicode, - ); - } - - late final _PyUnicode_AsRawUnicodeEscapeStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_AsRawUnicodeEscapeString'); - late final _PyUnicode_AsRawUnicodeEscapeString = - _PyUnicode_AsRawUnicodeEscapeStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeLatin1( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ) { - return _PyUnicode_DecodeLatin1( - string, - length, - errors, - ); - } - - late final _PyUnicode_DecodeLatin1Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyUnicode_DecodeLatin1'); - late final _PyUnicode_DecodeLatin1 = _PyUnicode_DecodeLatin1Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsLatin1String( - ffi.Pointer unicode, - ) { - return _PyUnicode_AsLatin1String1( - unicode, - ); - } - - late final _PyUnicode_AsLatin1StringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_AsLatin1String'); - late final _PyUnicode_AsLatin1String1 = _PyUnicode_AsLatin1StringPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeASCII( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ) { - return _PyUnicode_DecodeASCII( - string, - length, - errors, - ); - } - - late final _PyUnicode_DecodeASCIIPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyUnicode_DecodeASCII'); - late final _PyUnicode_DecodeASCII = _PyUnicode_DecodeASCIIPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsASCIIString( - ffi.Pointer unicode, - ) { - return _PyUnicode_AsASCIIString1( - unicode, - ); - } - - late final _PyUnicode_AsASCIIStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_AsASCIIString'); - late final _PyUnicode_AsASCIIString1 = _PyUnicode_AsASCIIStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeCharmap( - ffi.Pointer string, - int length, - ffi.Pointer mapping, - ffi.Pointer errors, - ) { - return _PyUnicode_DecodeCharmap( - string, - length, - mapping, - errors, - ); - } - - late final _PyUnicode_DecodeCharmapPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_DecodeCharmap'); - late final _PyUnicode_DecodeCharmap = _PyUnicode_DecodeCharmapPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_AsCharmapString( - ffi.Pointer unicode, - ffi.Pointer mapping, - ) { - return _PyUnicode_AsCharmapString( - unicode, - mapping, - ); - } - - late final _PyUnicode_AsCharmapStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_AsCharmapString'); - late final _PyUnicode_AsCharmapString = - _PyUnicode_AsCharmapStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeLocaleAndSize( - ffi.Pointer str, - int len, - ffi.Pointer errors, - ) { - return _PyUnicode_DecodeLocaleAndSize( - str, - len, - errors, - ); - } - - late final _PyUnicode_DecodeLocaleAndSizePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyUnicode_DecodeLocaleAndSize'); - late final _PyUnicode_DecodeLocaleAndSize = - _PyUnicode_DecodeLocaleAndSizePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeLocale( - ffi.Pointer str, - ffi.Pointer errors, - ) { - return _PyUnicode_DecodeLocale( - str, - errors, - ); - } - - late final _PyUnicode_DecodeLocalePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_DecodeLocale'); - late final _PyUnicode_DecodeLocale = _PyUnicode_DecodeLocalePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_EncodeLocale( - ffi.Pointer unicode, - ffi.Pointer errors, - ) { - return _PyUnicode_EncodeLocale( - unicode, - errors, - ); - } - - late final _PyUnicode_EncodeLocalePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_EncodeLocale'); - late final _PyUnicode_EncodeLocale = _PyUnicode_EncodeLocalePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyUnicode_FSConverter( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyUnicode_FSConverter( - arg0, - arg1, - ); - } - - late final _PyUnicode_FSConverterPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_FSConverter'); - late final _PyUnicode_FSConverter = _PyUnicode_FSConverterPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicode_FSDecoder( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyUnicode_FSDecoder( - arg0, - arg1, - ); - } - - late final _PyUnicode_FSDecoderPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_FSDecoder'); - late final _PyUnicode_FSDecoder = _PyUnicode_FSDecoderPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeFSDefault( - ffi.Pointer s, - ) { - return _PyUnicode_DecodeFSDefault( - s, - ); - } - - late final _PyUnicode_DecodeFSDefaultPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_DecodeFSDefault'); - late final _PyUnicode_DecodeFSDefault = _PyUnicode_DecodeFSDefaultPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_DecodeFSDefaultAndSize( - ffi.Pointer s, - int size, - ) { - return _PyUnicode_DecodeFSDefaultAndSize( - s, - size, - ); - } - - late final _PyUnicode_DecodeFSDefaultAndSizePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - Py_ssize_t)>>('PyUnicode_DecodeFSDefaultAndSize'); - late final _PyUnicode_DecodeFSDefaultAndSize = - _PyUnicode_DecodeFSDefaultAndSizePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer PyUnicode_EncodeFSDefault( - ffi.Pointer unicode, - ) { - return _PyUnicode_EncodeFSDefault( - unicode, - ); - } - - late final _PyUnicode_EncodeFSDefaultPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_EncodeFSDefault'); - late final _PyUnicode_EncodeFSDefault = _PyUnicode_EncodeFSDefaultPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicode_Concat( - ffi.Pointer left, - ffi.Pointer right, - ) { - return _PyUnicode_Concat( - left, - right, - ); - } - - late final _PyUnicode_ConcatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_Concat'); - late final _PyUnicode_Concat = _PyUnicode_ConcatPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - void PyUnicode_Append( - ffi.Pointer> pleft, - ffi.Pointer right, - ) { - return _PyUnicode_Append( - pleft, - right, - ); - } - - late final _PyUnicode_AppendPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer>, - ffi.Pointer)>>('PyUnicode_Append'); - late final _PyUnicode_Append = _PyUnicode_AppendPtr.asFunction< - void Function( - ffi.Pointer>, ffi.Pointer)>(); - - void PyUnicode_AppendAndDel( - ffi.Pointer> pleft, - ffi.Pointer right, - ) { - return _PyUnicode_AppendAndDel( - pleft, - right, - ); - } - - late final _PyUnicode_AppendAndDelPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer>, - ffi.Pointer)>>('PyUnicode_AppendAndDel'); - late final _PyUnicode_AppendAndDel = _PyUnicode_AppendAndDelPtr.asFunction< - void Function( - ffi.Pointer>, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_Split( - ffi.Pointer s, - ffi.Pointer sep, - int maxsplit, - ) { - return _PyUnicode_Split( - s, - sep, - maxsplit, - ); - } - - late final _PyUnicode_SplitPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, Py_ssize_t)>>('PyUnicode_Split'); - late final _PyUnicode_Split = _PyUnicode_SplitPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer PyUnicode_Splitlines( - ffi.Pointer s, - int keepends, - ) { - return _PyUnicode_Splitlines( - s, - keepends, - ); - } - - late final _PyUnicode_SplitlinesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyUnicode_Splitlines'); - late final _PyUnicode_Splitlines = _PyUnicode_SplitlinesPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer PyUnicode_Partition( - ffi.Pointer s, - ffi.Pointer sep, - ) { - return _PyUnicode_Partition( - s, - sep, - ); - } - - late final _PyUnicode_PartitionPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_Partition'); - late final _PyUnicode_Partition = _PyUnicode_PartitionPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_RPartition( - ffi.Pointer s, - ffi.Pointer sep, - ) { - return _PyUnicode_RPartition( - s, - sep, - ); - } - - late final _PyUnicode_RPartitionPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_RPartition'); - late final _PyUnicode_RPartition = _PyUnicode_RPartitionPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_RSplit( - ffi.Pointer s, - ffi.Pointer sep, - int maxsplit, - ) { - return _PyUnicode_RSplit( - s, - sep, - maxsplit, - ); - } - - late final _PyUnicode_RSplitPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, Py_ssize_t)>>('PyUnicode_RSplit'); - late final _PyUnicode_RSplit = _PyUnicode_RSplitPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer PyUnicode_Translate( - ffi.Pointer str, - ffi.Pointer table, - ffi.Pointer errors, - ) { - return _PyUnicode_Translate( - str, - table, - errors, - ); - } - - late final _PyUnicode_TranslatePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyUnicode_Translate'); - late final _PyUnicode_Translate = _PyUnicode_TranslatePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_Join( - ffi.Pointer separator, - ffi.Pointer seq, - ) { - return _PyUnicode_Join( - separator, - seq, - ); - } - - late final _PyUnicode_JoinPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyUnicode_Join'); - late final _PyUnicode_Join = _PyUnicode_JoinPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyUnicode_Tailmatch( - ffi.Pointer str, - ffi.Pointer substr, - int start, - int end, - int direction, - ) { - return _PyUnicode_Tailmatch( - str, - substr, - start, - end, - direction, - ); - } - - late final _PyUnicode_TailmatchPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(ffi.Pointer, ffi.Pointer, - Py_ssize_t, Py_ssize_t, ffi.Int)>>('PyUnicode_Tailmatch'); - late final _PyUnicode_Tailmatch = _PyUnicode_TailmatchPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int, int, int)>(); - - int PyUnicode_Find( - ffi.Pointer str, - ffi.Pointer substr, - int start, - int end, - int direction, - ) { - return _PyUnicode_Find( - str, - substr, - start, - end, - direction, - ); - } - - late final _PyUnicode_FindPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(ffi.Pointer, ffi.Pointer, - Py_ssize_t, Py_ssize_t, ffi.Int)>>('PyUnicode_Find'); - late final _PyUnicode_Find = _PyUnicode_FindPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int, int, int)>(); - - int PyUnicode_FindChar( - ffi.Pointer str, - int ch, - int start, - int end, - int direction, - ) { - return _PyUnicode_FindChar( - str, - ch, - start, - end, - direction, - ); - } - - late final _PyUnicode_FindCharPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(ffi.Pointer, Py_UCS4, Py_ssize_t, - Py_ssize_t, ffi.Int)>>('PyUnicode_FindChar'); - late final _PyUnicode_FindChar = _PyUnicode_FindCharPtr.asFunction< - int Function(ffi.Pointer, int, int, int, int)>(); - - int PyUnicode_Count( - ffi.Pointer str, - ffi.Pointer substr, - int start, - int end, - ) { - return _PyUnicode_Count( - str, - substr, - start, - end, - ); - } - - late final _PyUnicode_CountPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(ffi.Pointer, ffi.Pointer, - Py_ssize_t, Py_ssize_t)>>('PyUnicode_Count'); - late final _PyUnicode_Count = _PyUnicode_CountPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - ffi.Pointer PyUnicode_Replace( - ffi.Pointer str, - ffi.Pointer substr, - ffi.Pointer replstr, - int maxcount, - ) { - return _PyUnicode_Replace( - str, - substr, - replstr, - maxcount, - ); - } - - late final _PyUnicode_ReplacePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - Py_ssize_t)>>('PyUnicode_Replace'); - late final _PyUnicode_Replace = _PyUnicode_ReplacePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - int PyUnicode_Compare( - ffi.Pointer left, - ffi.Pointer right, - ) { - return _PyUnicode_Compare( - left, - right, - ); - } - - late final _PyUnicode_ComparePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_Compare'); - late final _PyUnicode_Compare = _PyUnicode_ComparePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicode_CompareWithASCIIString( - ffi.Pointer left, - ffi.Pointer right, - ) { - return _PyUnicode_CompareWithASCIIString( - left, - right, - ); - } - - late final _PyUnicode_CompareWithASCIIStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_CompareWithASCIIString'); - late final _PyUnicode_CompareWithASCIIString = - _PyUnicode_CompareWithASCIIStringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnicode_RichCompare( - ffi.Pointer left, - ffi.Pointer right, - int op, - ) { - return _PyUnicode_RichCompare( - left, - right, - op, - ); - } - - late final _PyUnicode_RichComparePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('PyUnicode_RichCompare'); - late final _PyUnicode_RichCompare = _PyUnicode_RichComparePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer PyUnicode_Format( - ffi.Pointer format, - ffi.Pointer args, - ) { - return _PyUnicode_Format( - format, - args, - ); - } - - late final _PyUnicode_FormatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_Format'); - late final _PyUnicode_Format = _PyUnicode_FormatPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyUnicode_Contains( - ffi.Pointer container, - ffi.Pointer element, - ) { - return _PyUnicode_Contains( - container, - element, - ); - } - - late final _PyUnicode_ContainsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicode_Contains'); - late final _PyUnicode_Contains = _PyUnicode_ContainsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicode_IsIdentifier( - ffi.Pointer s, - ) { - return _PyUnicode_IsIdentifier( - s, - ); - } - - late final _PyUnicode_IsIdentifierPtr = - _lookup)>>( - 'PyUnicode_IsIdentifier'); - late final _PyUnicode_IsIdentifier = _PyUnicode_IsIdentifierPtr.asFunction< - int Function(ffi.Pointer)>(); - - int _PyUnicode_CheckConsistency( - ffi.Pointer op, - int check_content, - ) { - return __PyUnicode_CheckConsistency( - op, - check_content, - ); - } - - late final __PyUnicode_CheckConsistencyPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - '_PyUnicode_CheckConsistency'); - late final __PyUnicode_CheckConsistency = __PyUnicode_CheckConsistencyPtr - .asFunction, int)>(); - - ffi.Pointer PyUnicode_New( - int size, - int maxchar, - ) { - return _PyUnicode_New( - size, - maxchar, - ); - } - - late final _PyUnicode_NewPtr = _lookup< - ffi - .NativeFunction Function(Py_ssize_t, Py_UCS4)>>( - 'PyUnicode_New'); - late final _PyUnicode_New = - _PyUnicode_NewPtr.asFunction Function(int, int)>(); - - ffi.Pointer _PyUnicode_Copy( - ffi.Pointer unicode, - ) { - return __PyUnicode_Copy( - unicode, - ); - } - - late final __PyUnicode_CopyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyUnicode_Copy'); - late final __PyUnicode_Copy = __PyUnicode_CopyPtr - .asFunction Function(ffi.Pointer)>(); - - int PyUnicode_CopyCharacters( - ffi.Pointer to, - int to_start, - ffi.Pointer from, - int from_start, - int how_many, - ) { - return _PyUnicode_CopyCharacters( - to, - to_start, - from, - from_start, - how_many, - ); - } - - late final _PyUnicode_CopyCharactersPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - Py_ssize_t, - Py_ssize_t)>>('PyUnicode_CopyCharacters'); - late final _PyUnicode_CopyCharacters = - _PyUnicode_CopyCharactersPtr.asFunction< - int Function( - ffi.Pointer, int, ffi.Pointer, int, int)>(); - - void _PyUnicode_FastCopyCharacters( - ffi.Pointer to, - int to_start, - ffi.Pointer from, - int from_start, - int how_many, - ) { - return __PyUnicode_FastCopyCharacters( - to, - to_start, - from, - from_start, - how_many, - ); - } - - late final __PyUnicode_FastCopyCharactersPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - Py_ssize_t, - Py_ssize_t)>>('_PyUnicode_FastCopyCharacters'); - late final __PyUnicode_FastCopyCharacters = - __PyUnicode_FastCopyCharactersPtr.asFunction< - void Function( - ffi.Pointer, int, ffi.Pointer, int, int)>(); - - int PyUnicode_Fill( - ffi.Pointer unicode, - int start, - int length, - int fill_char, - ) { - return _PyUnicode_Fill( - unicode, - start, - length, - fill_char, - ); - } - - late final _PyUnicode_FillPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(ffi.Pointer, Py_ssize_t, Py_ssize_t, - Py_UCS4)>>('PyUnicode_Fill'); - late final _PyUnicode_Fill = _PyUnicode_FillPtr.asFunction< - int Function(ffi.Pointer, int, int, int)>(); - - void _PyUnicode_FastFill( - ffi.Pointer unicode, - int start, - int length, - int fill_char, - ) { - return __PyUnicode_FastFill( - unicode, - start, - length, - fill_char, - ); - } - - late final __PyUnicode_FastFillPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, Py_ssize_t, Py_ssize_t, - Py_UCS4)>>('_PyUnicode_FastFill'); - late final __PyUnicode_FastFill = __PyUnicode_FastFillPtr - .asFunction, int, int, int)>(); - - ffi.Pointer PyUnicode_FromKindAndData( - int kind, - ffi.Pointer buffer, - int size, - ) { - return _PyUnicode_FromKindAndData( - kind, - buffer, - size, - ); - } - - late final _PyUnicode_FromKindAndDataPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Int, ffi.Pointer, - Py_ssize_t)>>('PyUnicode_FromKindAndData'); - late final _PyUnicode_FromKindAndData = - _PyUnicode_FromKindAndDataPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - ffi.Pointer _PyUnicode_FromASCII( - ffi.Pointer buffer, - int size, - ) { - return __PyUnicode_FromASCII( - buffer, - size, - ); - } - - late final __PyUnicode_FromASCIIPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('_PyUnicode_FromASCII'); - late final __PyUnicode_FromASCII = __PyUnicode_FromASCIIPtr - .asFunction Function(ffi.Pointer, int)>(); - - int _PyUnicode_FindMaxChar( - ffi.Pointer unicode, - int start, - int end, - ) { - return __PyUnicode_FindMaxChar( - unicode, - start, - end, - ); - } - - late final __PyUnicode_FindMaxCharPtr = _lookup< - ffi.NativeFunction< - Py_UCS4 Function(ffi.Pointer, Py_ssize_t, - Py_ssize_t)>>('_PyUnicode_FindMaxChar'); - late final __PyUnicode_FindMaxChar = __PyUnicode_FindMaxCharPtr - .asFunction, int, int)>(); - - void _PyUnicodeWriter_Init( - ffi.Pointer<_PyUnicodeWriter> writer, - ) { - return __PyUnicodeWriter_Init( - writer, - ); - } - - late final __PyUnicodeWriter_InitPtr = _lookup< - ffi.NativeFunction)>>( - '_PyUnicodeWriter_Init'); - late final __PyUnicodeWriter_Init = __PyUnicodeWriter_InitPtr - .asFunction)>(); - - int _PyUnicodeWriter_PrepareInternal( - ffi.Pointer<_PyUnicodeWriter> writer, - int length, - int maxchar, - ) { - return __PyUnicodeWriter_PrepareInternal( - writer, - length, - maxchar, - ); - } - - late final __PyUnicodeWriter_PrepareInternalPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyUnicodeWriter>, Py_ssize_t, - Py_UCS4)>>('_PyUnicodeWriter_PrepareInternal'); - late final __PyUnicodeWriter_PrepareInternal = - __PyUnicodeWriter_PrepareInternalPtr - .asFunction, int, int)>(); - - int _PyUnicodeWriter_PrepareKindInternal( - ffi.Pointer<_PyUnicodeWriter> writer, - int kind, - ) { - return __PyUnicodeWriter_PrepareKindInternal( - writer, - kind, - ); - } - - late final __PyUnicodeWriter_PrepareKindInternalPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyUnicodeWriter>, - ffi.Int)>>('_PyUnicodeWriter_PrepareKindInternal'); - late final __PyUnicodeWriter_PrepareKindInternal = - __PyUnicodeWriter_PrepareKindInternalPtr - .asFunction, int)>(); - - int _PyUnicodeWriter_WriteChar( - ffi.Pointer<_PyUnicodeWriter> writer, - int ch, - ) { - return __PyUnicodeWriter_WriteChar( - writer, - ch, - ); - } - - late final __PyUnicodeWriter_WriteCharPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyUnicodeWriter>, - Py_UCS4)>>('_PyUnicodeWriter_WriteChar'); - late final __PyUnicodeWriter_WriteChar = __PyUnicodeWriter_WriteCharPtr - .asFunction, int)>(); - - int _PyUnicodeWriter_WriteStr( - ffi.Pointer<_PyUnicodeWriter> writer, - ffi.Pointer str, - ) { - return __PyUnicodeWriter_WriteStr( - writer, - str, - ); - } - - late final __PyUnicodeWriter_WriteStrPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyUnicodeWriter>, - ffi.Pointer)>>('_PyUnicodeWriter_WriteStr'); - late final __PyUnicodeWriter_WriteStr = - __PyUnicodeWriter_WriteStrPtr.asFunction< - int Function(ffi.Pointer<_PyUnicodeWriter>, ffi.Pointer)>(); - - int _PyUnicodeWriter_WriteSubstring( - ffi.Pointer<_PyUnicodeWriter> writer, - ffi.Pointer str, - int start, - int end, - ) { - return __PyUnicodeWriter_WriteSubstring( - writer, - str, - start, - end, - ); - } - - late final __PyUnicodeWriter_WriteSubstringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyUnicodeWriter>, ffi.Pointer, - Py_ssize_t, Py_ssize_t)>>('_PyUnicodeWriter_WriteSubstring'); - late final __PyUnicodeWriter_WriteSubstring = - __PyUnicodeWriter_WriteSubstringPtr.asFunction< - int Function(ffi.Pointer<_PyUnicodeWriter>, ffi.Pointer, - int, int)>(); - - int _PyUnicodeWriter_WriteASCIIString( - ffi.Pointer<_PyUnicodeWriter> writer, - ffi.Pointer str, - int len, - ) { - return __PyUnicodeWriter_WriteASCIIString( - writer, - str, - len, - ); - } - - late final __PyUnicodeWriter_WriteASCIIStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyUnicodeWriter>, ffi.Pointer, - Py_ssize_t)>>('_PyUnicodeWriter_WriteASCIIString'); - late final __PyUnicodeWriter_WriteASCIIString = - __PyUnicodeWriter_WriteASCIIStringPtr.asFunction< - int Function( - ffi.Pointer<_PyUnicodeWriter>, ffi.Pointer, int)>(); - - int _PyUnicodeWriter_WriteLatin1String( - ffi.Pointer<_PyUnicodeWriter> writer, - ffi.Pointer str, - int len, - ) { - return __PyUnicodeWriter_WriteLatin1String( - writer, - str, - len, - ); - } - - late final __PyUnicodeWriter_WriteLatin1StringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyUnicodeWriter>, ffi.Pointer, - Py_ssize_t)>>('_PyUnicodeWriter_WriteLatin1String'); - late final __PyUnicodeWriter_WriteLatin1String = - __PyUnicodeWriter_WriteLatin1StringPtr.asFunction< - int Function( - ffi.Pointer<_PyUnicodeWriter>, ffi.Pointer, int)>(); - - ffi.Pointer _PyUnicodeWriter_Finish( - ffi.Pointer<_PyUnicodeWriter> writer, - ) { - return __PyUnicodeWriter_Finish( - writer, - ); - } - - late final __PyUnicodeWriter_FinishPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_PyUnicodeWriter>)>>('_PyUnicodeWriter_Finish'); - late final __PyUnicodeWriter_Finish = __PyUnicodeWriter_FinishPtr.asFunction< - ffi.Pointer Function(ffi.Pointer<_PyUnicodeWriter>)>(); - - void _PyUnicodeWriter_Dealloc( - ffi.Pointer<_PyUnicodeWriter> writer, - ) { - return __PyUnicodeWriter_Dealloc( - writer, - ); - } - - late final __PyUnicodeWriter_DeallocPtr = _lookup< - ffi.NativeFunction)>>( - '_PyUnicodeWriter_Dealloc'); - late final __PyUnicodeWriter_Dealloc = __PyUnicodeWriter_DeallocPtr - .asFunction)>(); - - int _PyUnicode_FormatAdvancedWriter( - ffi.Pointer<_PyUnicodeWriter> writer, - ffi.Pointer obj, - ffi.Pointer format_spec, - int start, - int end, - ) { - return __PyUnicode_FormatAdvancedWriter( - writer, - obj, - format_spec, - start, - end, - ); - } - - late final __PyUnicode_FormatAdvancedWriterPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer<_PyUnicodeWriter>, - ffi.Pointer, - ffi.Pointer, - Py_ssize_t, - Py_ssize_t)>>('_PyUnicode_FormatAdvancedWriter'); - late final __PyUnicode_FormatAdvancedWriter = - __PyUnicode_FormatAdvancedWriterPtr.asFunction< - int Function(ffi.Pointer<_PyUnicodeWriter>, ffi.Pointer, - ffi.Pointer, int, int)>(); - - ffi.Pointer PyUnicode_AsUTF8( - ffi.Pointer unicode, - ) { - return _PyUnicode_AsUTF8( - unicode, - ); - } - - late final _PyUnicode_AsUTF8Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicode_AsUTF8'); - late final _PyUnicode_AsUTF8 = _PyUnicode_AsUTF8Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer _PyUnicode_EncodeUTF7( - ffi.Pointer unicode, - int base64SetO, - int base64WhiteSpace, - ffi.Pointer errors, - ) { - return __PyUnicode_EncodeUTF7( - unicode, - base64SetO, - base64WhiteSpace, - errors, - ); - } - - late final __PyUnicode_EncodeUTF7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Int, - ffi.Int, ffi.Pointer)>>('_PyUnicode_EncodeUTF7'); - late final __PyUnicode_EncodeUTF7 = __PyUnicode_EncodeUTF7Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, int, ffi.Pointer)>(); - - ffi.Pointer _PyUnicode_AsUTF8String( - ffi.Pointer unicode, - ffi.Pointer errors, - ) { - return __PyUnicode_AsUTF8String( - unicode, - errors, - ); - } - - late final __PyUnicode_AsUTF8StringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyUnicode_AsUTF8String'); - late final __PyUnicode_AsUTF8String = __PyUnicode_AsUTF8StringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyUnicode_EncodeUTF32( - ffi.Pointer object, - ffi.Pointer errors, - int byteorder, - ) { - return __PyUnicode_EncodeUTF32( - object, - errors, - byteorder, - ); - } - - late final __PyUnicode_EncodeUTF32Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('_PyUnicode_EncodeUTF32'); - late final __PyUnicode_EncodeUTF32 = __PyUnicode_EncodeUTF32Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _PyUnicode_EncodeUTF16( - ffi.Pointer unicode, - ffi.Pointer errors, - int byteorder, - ) { - return __PyUnicode_EncodeUTF16( - unicode, - errors, - byteorder, - ); - } - - late final __PyUnicode_EncodeUTF16Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('_PyUnicode_EncodeUTF16'); - late final __PyUnicode_EncodeUTF16 = __PyUnicode_EncodeUTF16Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _PyUnicode_DecodeUnicodeEscapeStateful( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ffi.Pointer consumed, - ) { - return __PyUnicode_DecodeUnicodeEscapeStateful( - string, - length, - errors, - consumed, - ); - } - - late final __PyUnicode_DecodeUnicodeEscapeStatefulPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer, ffi.Pointer)>>( - '_PyUnicode_DecodeUnicodeEscapeStateful'); - late final __PyUnicode_DecodeUnicodeEscapeStateful = - __PyUnicode_DecodeUnicodeEscapeStatefulPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyUnicode_DecodeUnicodeEscapeInternal( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ffi.Pointer consumed, - ffi.Pointer> first_invalid_escape, - ) { - return __PyUnicode_DecodeUnicodeEscapeInternal( - string, - length, - errors, - consumed, - first_invalid_escape, - ); - } - - late final __PyUnicode_DecodeUnicodeEscapeInternalPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>( - '_PyUnicode_DecodeUnicodeEscapeInternal'); - late final __PyUnicode_DecodeUnicodeEscapeInternal = - __PyUnicode_DecodeUnicodeEscapeInternalPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - ffi.Pointer _PyUnicode_DecodeRawUnicodeEscapeStateful( - ffi.Pointer string, - int length, - ffi.Pointer errors, - ffi.Pointer consumed, - ) { - return __PyUnicode_DecodeRawUnicodeEscapeStateful( - string, - length, - errors, - consumed, - ); - } - - late final __PyUnicode_DecodeRawUnicodeEscapeStatefulPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer, ffi.Pointer)>>( - '_PyUnicode_DecodeRawUnicodeEscapeStateful'); - late final __PyUnicode_DecodeRawUnicodeEscapeStateful = - __PyUnicode_DecodeRawUnicodeEscapeStatefulPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyUnicode_AsLatin1String( - ffi.Pointer unicode, - ffi.Pointer errors, - ) { - return __PyUnicode_AsLatin1String( - unicode, - errors, - ); - } - - late final __PyUnicode_AsLatin1StringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyUnicode_AsLatin1String'); - late final __PyUnicode_AsLatin1String = - __PyUnicode_AsLatin1StringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyUnicode_AsASCIIString( - ffi.Pointer unicode, - ffi.Pointer errors, - ) { - return __PyUnicode_AsASCIIString( - unicode, - errors, - ); - } - - late final __PyUnicode_AsASCIIStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyUnicode_AsASCIIString'); - late final __PyUnicode_AsASCIIString = - __PyUnicode_AsASCIIStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyUnicode_EncodeCharmap( - ffi.Pointer unicode, - ffi.Pointer mapping, - ffi.Pointer errors, - ) { - return __PyUnicode_EncodeCharmap( - unicode, - mapping, - errors, - ); - } - - late final __PyUnicode_EncodeCharmapPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_PyUnicode_EncodeCharmap'); - late final __PyUnicode_EncodeCharmap = - __PyUnicode_EncodeCharmapPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyUnicode_TransformDecimalAndSpaceToASCII( - ffi.Pointer unicode, - ) { - return __PyUnicode_TransformDecimalAndSpaceToASCII( - unicode, - ); - } - - late final __PyUnicode_TransformDecimalAndSpaceToASCIIPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>( - '_PyUnicode_TransformDecimalAndSpaceToASCII'); - late final __PyUnicode_TransformDecimalAndSpaceToASCII = - __PyUnicode_TransformDecimalAndSpaceToASCIIPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _PyUnicode_JoinArray( - ffi.Pointer separator, - ffi.Pointer> items, - int seqlen, - ) { - return __PyUnicode_JoinArray( - separator, - items, - seqlen, - ); - } - - late final __PyUnicode_JoinArrayPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, - Py_ssize_t)>>('_PyUnicode_JoinArray'); - late final __PyUnicode_JoinArray = __PyUnicode_JoinArrayPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int _PyUnicode_EqualToASCIIId( - ffi.Pointer left, - ffi.Pointer<_Py_Identifier> right, - ) { - return __PyUnicode_EqualToASCIIId( - left, - right, - ); - } - - late final __PyUnicode_EqualToASCIIIdPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer<_Py_Identifier>)>>('_PyUnicode_EqualToASCIIId'); - late final __PyUnicode_EqualToASCIIId = - __PyUnicode_EqualToASCIIIdPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer<_Py_Identifier>)>(); - - int _PyUnicode_EqualToASCIIString( - ffi.Pointer left, - ffi.Pointer right, - ) { - return __PyUnicode_EqualToASCIIString( - left, - right, - ); - } - - late final __PyUnicode_EqualToASCIIStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyUnicode_EqualToASCIIString'); - late final __PyUnicode_EqualToASCIIString = __PyUnicode_EqualToASCIIStringPtr - .asFunction, ffi.Pointer)>(); - - ffi.Pointer _PyUnicode_XStrip( - ffi.Pointer self, - int striptype, - ffi.Pointer sepobj, - ) { - return __PyUnicode_XStrip( - self, - striptype, - sepobj, - ); - } - - late final __PyUnicode_XStripPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Int, - ffi.Pointer)>>('_PyUnicode_XStrip'); - late final __PyUnicode_XStrip = __PyUnicode_XStripPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - int _PyUnicode_InsertThousandsGrouping( - ffi.Pointer<_PyUnicodeWriter> writer, - int n_buffer, - ffi.Pointer digits, - int d_pos, - int n_digits, - int min_width, - ffi.Pointer grouping, - ffi.Pointer thousands_sep, - ffi.Pointer maxchar, - ) { - return __PyUnicode_InsertThousandsGrouping( - writer, - n_buffer, - digits, - d_pos, - n_digits, - min_width, - grouping, - thousands_sep, - maxchar, - ); - } - - late final __PyUnicode_InsertThousandsGroupingPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function( - ffi.Pointer<_PyUnicodeWriter>, - Py_ssize_t, - ffi.Pointer, - Py_ssize_t, - Py_ssize_t, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_PyUnicode_InsertThousandsGrouping'); - late final __PyUnicode_InsertThousandsGrouping = - __PyUnicode_InsertThousandsGroupingPtr.asFunction< - int Function( - ffi.Pointer<_PyUnicodeWriter>, - int, - ffi.Pointer, - int, - int, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - int _PyUnicode_IsLowercase( - int ch, - ) { - return __PyUnicode_IsLowercase( - ch, - ); - } - - late final __PyUnicode_IsLowercasePtr = - _lookup>( - '_PyUnicode_IsLowercase'); - late final __PyUnicode_IsLowercase = - __PyUnicode_IsLowercasePtr.asFunction(); - - int _PyUnicode_IsUppercase( - int ch, - ) { - return __PyUnicode_IsUppercase( - ch, - ); - } - - late final __PyUnicode_IsUppercasePtr = - _lookup>( - '_PyUnicode_IsUppercase'); - late final __PyUnicode_IsUppercase = - __PyUnicode_IsUppercasePtr.asFunction(); - - int _PyUnicode_IsTitlecase( - int ch, - ) { - return __PyUnicode_IsTitlecase( - ch, - ); - } - - late final __PyUnicode_IsTitlecasePtr = - _lookup>( - '_PyUnicode_IsTitlecase'); - late final __PyUnicode_IsTitlecase = - __PyUnicode_IsTitlecasePtr.asFunction(); - - int _PyUnicode_IsXidStart( - int ch, - ) { - return __PyUnicode_IsXidStart( - ch, - ); - } - - late final __PyUnicode_IsXidStartPtr = - _lookup>( - '_PyUnicode_IsXidStart'); - late final __PyUnicode_IsXidStart = - __PyUnicode_IsXidStartPtr.asFunction(); - - int _PyUnicode_IsXidContinue( - int ch, - ) { - return __PyUnicode_IsXidContinue( - ch, - ); - } - - late final __PyUnicode_IsXidContinuePtr = - _lookup>( - '_PyUnicode_IsXidContinue'); - late final __PyUnicode_IsXidContinue = - __PyUnicode_IsXidContinuePtr.asFunction(); - - int _PyUnicode_IsWhitespace( - int ch, - ) { - return __PyUnicode_IsWhitespace( - ch, - ); - } - - late final __PyUnicode_IsWhitespacePtr = - _lookup>( - '_PyUnicode_IsWhitespace'); - late final __PyUnicode_IsWhitespace = - __PyUnicode_IsWhitespacePtr.asFunction(); - - int _PyUnicode_IsLinebreak( - int ch, - ) { - return __PyUnicode_IsLinebreak( - ch, - ); - } - - late final __PyUnicode_IsLinebreakPtr = - _lookup>( - '_PyUnicode_IsLinebreak'); - late final __PyUnicode_IsLinebreak = - __PyUnicode_IsLinebreakPtr.asFunction(); - - int _PyUnicode_ToLowercase( - int ch, - ) { - return __PyUnicode_ToLowercase( - ch, - ); - } - - late final __PyUnicode_ToLowercasePtr = - _lookup>( - '_PyUnicode_ToLowercase'); - late final __PyUnicode_ToLowercase = - __PyUnicode_ToLowercasePtr.asFunction(); - - int _PyUnicode_ToUppercase( - int ch, - ) { - return __PyUnicode_ToUppercase( - ch, - ); - } - - late final __PyUnicode_ToUppercasePtr = - _lookup>( - '_PyUnicode_ToUppercase'); - late final __PyUnicode_ToUppercase = - __PyUnicode_ToUppercasePtr.asFunction(); - - int _PyUnicode_ToTitlecase( - int ch, - ) { - return __PyUnicode_ToTitlecase( - ch, - ); - } - - late final __PyUnicode_ToTitlecasePtr = - _lookup>( - '_PyUnicode_ToTitlecase'); - late final __PyUnicode_ToTitlecase = - __PyUnicode_ToTitlecasePtr.asFunction(); - - int _PyUnicode_ToLowerFull( - int ch, - ffi.Pointer res, - ) { - return __PyUnicode_ToLowerFull( - ch, - res, - ); - } - - late final __PyUnicode_ToLowerFullPtr = _lookup< - ffi.NativeFunction)>>( - '_PyUnicode_ToLowerFull'); - late final __PyUnicode_ToLowerFull = __PyUnicode_ToLowerFullPtr - .asFunction)>(); - - int _PyUnicode_ToTitleFull( - int ch, - ffi.Pointer res, - ) { - return __PyUnicode_ToTitleFull( - ch, - res, - ); - } - - late final __PyUnicode_ToTitleFullPtr = _lookup< - ffi.NativeFunction)>>( - '_PyUnicode_ToTitleFull'); - late final __PyUnicode_ToTitleFull = __PyUnicode_ToTitleFullPtr - .asFunction)>(); - - int _PyUnicode_ToUpperFull( - int ch, - ffi.Pointer res, - ) { - return __PyUnicode_ToUpperFull( - ch, - res, - ); - } - - late final __PyUnicode_ToUpperFullPtr = _lookup< - ffi.NativeFunction)>>( - '_PyUnicode_ToUpperFull'); - late final __PyUnicode_ToUpperFull = __PyUnicode_ToUpperFullPtr - .asFunction)>(); - - int _PyUnicode_ToFoldedFull( - int ch, - ffi.Pointer res, - ) { - return __PyUnicode_ToFoldedFull( - ch, - res, - ); - } - - late final __PyUnicode_ToFoldedFullPtr = _lookup< - ffi.NativeFunction)>>( - '_PyUnicode_ToFoldedFull'); - late final __PyUnicode_ToFoldedFull = __PyUnicode_ToFoldedFullPtr - .asFunction)>(); - - int _PyUnicode_IsCaseIgnorable( - int ch, - ) { - return __PyUnicode_IsCaseIgnorable( - ch, - ); - } - - late final __PyUnicode_IsCaseIgnorablePtr = - _lookup>( - '_PyUnicode_IsCaseIgnorable'); - late final __PyUnicode_IsCaseIgnorable = - __PyUnicode_IsCaseIgnorablePtr.asFunction(); - - int _PyUnicode_IsCased( - int ch, - ) { - return __PyUnicode_IsCased( - ch, - ); - } - - late final __PyUnicode_IsCasedPtr = - _lookup>( - '_PyUnicode_IsCased'); - late final __PyUnicode_IsCased = - __PyUnicode_IsCasedPtr.asFunction(); - - int _PyUnicode_ToDecimalDigit( - int ch, - ) { - return __PyUnicode_ToDecimalDigit( - ch, - ); - } - - late final __PyUnicode_ToDecimalDigitPtr = - _lookup>( - '_PyUnicode_ToDecimalDigit'); - late final __PyUnicode_ToDecimalDigit = - __PyUnicode_ToDecimalDigitPtr.asFunction(); - - int _PyUnicode_ToDigit( - int ch, - ) { - return __PyUnicode_ToDigit( - ch, - ); - } - - late final __PyUnicode_ToDigitPtr = - _lookup>( - '_PyUnicode_ToDigit'); - late final __PyUnicode_ToDigit = - __PyUnicode_ToDigitPtr.asFunction(); - - double _PyUnicode_ToNumeric( - int ch, - ) { - return __PyUnicode_ToNumeric( - ch, - ); - } - - late final __PyUnicode_ToNumericPtr = - _lookup>( - '_PyUnicode_ToNumeric'); - late final __PyUnicode_ToNumeric = - __PyUnicode_ToNumericPtr.asFunction(); - - int _PyUnicode_IsDecimalDigit( - int ch, - ) { - return __PyUnicode_IsDecimalDigit( - ch, - ); - } - - late final __PyUnicode_IsDecimalDigitPtr = - _lookup>( - '_PyUnicode_IsDecimalDigit'); - late final __PyUnicode_IsDecimalDigit = - __PyUnicode_IsDecimalDigitPtr.asFunction(); - - int _PyUnicode_IsDigit( - int ch, - ) { - return __PyUnicode_IsDigit( - ch, - ); - } - - late final __PyUnicode_IsDigitPtr = - _lookup>( - '_PyUnicode_IsDigit'); - late final __PyUnicode_IsDigit = - __PyUnicode_IsDigitPtr.asFunction(); - - int _PyUnicode_IsNumeric( - int ch, - ) { - return __PyUnicode_IsNumeric( - ch, - ); - } - - late final __PyUnicode_IsNumericPtr = - _lookup>( - '_PyUnicode_IsNumeric'); - late final __PyUnicode_IsNumeric = - __PyUnicode_IsNumericPtr.asFunction(); - - int _PyUnicode_IsPrintable( - int ch, - ) { - return __PyUnicode_IsPrintable( - ch, - ); - } - - late final __PyUnicode_IsPrintablePtr = - _lookup>( - '_PyUnicode_IsPrintable'); - late final __PyUnicode_IsPrintable = - __PyUnicode_IsPrintablePtr.asFunction(); - - int _PyUnicode_IsAlpha( - int ch, - ) { - return __PyUnicode_IsAlpha( - ch, - ); - } - - late final __PyUnicode_IsAlphaPtr = - _lookup>( - '_PyUnicode_IsAlpha'); - late final __PyUnicode_IsAlpha = - __PyUnicode_IsAlphaPtr.asFunction(); - - late final ffi.Pointer> __Py_ascii_whitespace = - _lookup>('_Py_ascii_whitespace'); - - ffi.Pointer get _Py_ascii_whitespace => - __Py_ascii_whitespace.value; - - set _Py_ascii_whitespace(ffi.Pointer value) => - __Py_ascii_whitespace.value = value; - - ffi.Pointer _PyUnicode_FormatLong( - ffi.Pointer arg0, - int arg1, - int arg2, - int arg3, - ) { - return __PyUnicode_FormatLong( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final __PyUnicode_FormatLongPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Int, - ffi.Int, ffi.Int)>>('_PyUnicode_FormatLong'); - late final __PyUnicode_FormatLong = __PyUnicode_FormatLongPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int, int)>(); - - ffi.Pointer _PyUnicode_FromId( - ffi.Pointer<_Py_Identifier> arg0, - ) { - return __PyUnicode_FromId( - arg0, - ); - } - - late final __PyUnicode_FromIdPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_Py_Identifier>)>>('_PyUnicode_FromId'); - late final __PyUnicode_FromId = __PyUnicode_FromIdPtr.asFunction< - ffi.Pointer Function(ffi.Pointer<_Py_Identifier>)>(); - - int _PyUnicode_EQ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyUnicode_EQ( - arg0, - arg1, - ); - } - - late final __PyUnicode_EQPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('_PyUnicode_EQ'); - late final __PyUnicode_EQ = __PyUnicode_EQPtr - .asFunction, ffi.Pointer)>(); - - int _PyUnicode_Equal( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyUnicode_Equal( - arg0, - arg1, - ); - } - - late final __PyUnicode_EqualPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyUnicode_Equal'); - late final __PyUnicode_Equal = __PyUnicode_EqualPtr - .asFunction, ffi.Pointer)>(); - - int _PyUnicode_WideCharString_Converter( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyUnicode_WideCharString_Converter( - arg0, - arg1, - ); - } - - late final __PyUnicode_WideCharString_ConverterPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyUnicode_WideCharString_Converter'); - late final __PyUnicode_WideCharString_Converter = - __PyUnicode_WideCharString_ConverterPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _PyUnicode_WideCharString_Opt_Converter( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyUnicode_WideCharString_Opt_Converter( - arg0, - arg1, - ); - } - - late final __PyUnicode_WideCharString_Opt_ConverterPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>( - '_PyUnicode_WideCharString_Opt_Converter'); - late final __PyUnicode_WideCharString_Opt_Converter = - __PyUnicode_WideCharString_Opt_ConverterPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _PyUnicode_ScanIdentifier( - ffi.Pointer arg0, - ) { - return __PyUnicode_ScanIdentifier( - arg0, - ); - } - - late final __PyUnicode_ScanIdentifierPtr = - _lookup)>>( - '_PyUnicode_ScanIdentifier'); - late final __PyUnicode_ScanIdentifier = __PyUnicode_ScanIdentifierPtr - .asFunction)>(); - - PyStatus PyStatus_Ok() { - return _PyStatus_Ok(); - } - - late final _PyStatus_OkPtr = - _lookup>('PyStatus_Ok'); - late final _PyStatus_Ok = _PyStatus_OkPtr.asFunction(); - - PyStatus PyStatus_Error( - ffi.Pointer err_msg, - ) { - return _PyStatus_Error( - err_msg, - ); - } - - late final _PyStatus_ErrorPtr = - _lookup)>>( - 'PyStatus_Error'); - late final _PyStatus_Error = - _PyStatus_ErrorPtr.asFunction)>(); - - PyStatus PyStatus_NoMemory() { - return _PyStatus_NoMemory(); - } - - late final _PyStatus_NoMemoryPtr = - _lookup>('PyStatus_NoMemory'); - late final _PyStatus_NoMemory = - _PyStatus_NoMemoryPtr.asFunction(); - - PyStatus PyStatus_Exit( - int exitcode, - ) { - return _PyStatus_Exit( - exitcode, - ); - } - - late final _PyStatus_ExitPtr = - _lookup>('PyStatus_Exit'); - late final _PyStatus_Exit = - _PyStatus_ExitPtr.asFunction(); - - int PyStatus_IsError( - PyStatus err, - ) { - return _PyStatus_IsError( - err, - ); - } - - late final _PyStatus_IsErrorPtr = - _lookup>( - 'PyStatus_IsError'); - late final _PyStatus_IsError = - _PyStatus_IsErrorPtr.asFunction(); - - int PyStatus_IsExit( - PyStatus err, - ) { - return _PyStatus_IsExit( - err, - ); - } - - late final _PyStatus_IsExitPtr = - _lookup>( - 'PyStatus_IsExit'); - late final _PyStatus_IsExit = - _PyStatus_IsExitPtr.asFunction(); - - int PyStatus_Exception( - PyStatus err, - ) { - return _PyStatus_Exception( - err, - ); - } - - late final _PyStatus_ExceptionPtr = - _lookup>( - 'PyStatus_Exception'); - late final _PyStatus_Exception = - _PyStatus_ExceptionPtr.asFunction(); - - ffi.Pointer _PyErr_SetFromPyStatus( - PyStatus status, - ) { - return __PyErr_SetFromPyStatus( - status, - ); - } - - late final __PyErr_SetFromPyStatusPtr = - _lookup Function(PyStatus)>>( - '_PyErr_SetFromPyStatus'); - late final __PyErr_SetFromPyStatus = __PyErr_SetFromPyStatusPtr - .asFunction Function(PyStatus)>(); - - PyStatus PyWideStringList_Append( - ffi.Pointer list, - ffi.Pointer item, - ) { - return _PyWideStringList_Append( - list, - item, - ); - } - - late final _PyWideStringList_AppendPtr = _lookup< - ffi.NativeFunction< - PyStatus Function(ffi.Pointer, - ffi.Pointer)>>('PyWideStringList_Append'); - late final _PyWideStringList_Append = _PyWideStringList_AppendPtr.asFunction< - PyStatus Function( - ffi.Pointer, ffi.Pointer)>(); - - PyStatus PyWideStringList_Insert( - ffi.Pointer list, - int index, - ffi.Pointer item, - ) { - return _PyWideStringList_Insert( - list, - index, - item, - ); - } - - late final _PyWideStringList_InsertPtr = _lookup< - ffi.NativeFunction< - PyStatus Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyWideStringList_Insert'); - late final _PyWideStringList_Insert = _PyWideStringList_InsertPtr.asFunction< - PyStatus Function( - ffi.Pointer, int, ffi.Pointer)>(); - - void PyPreConfig_InitPythonConfig( - ffi.Pointer config, - ) { - return _PyPreConfig_InitPythonConfig( - config, - ); - } - - late final _PyPreConfig_InitPythonConfigPtr = - _lookup)>>( - 'PyPreConfig_InitPythonConfig'); - late final _PyPreConfig_InitPythonConfig = _PyPreConfig_InitPythonConfigPtr - .asFunction)>(); - - void PyPreConfig_InitIsolatedConfig( - ffi.Pointer config, - ) { - return _PyPreConfig_InitIsolatedConfig( - config, - ); - } - - late final _PyPreConfig_InitIsolatedConfigPtr = - _lookup)>>( - 'PyPreConfig_InitIsolatedConfig'); - late final _PyPreConfig_InitIsolatedConfig = - _PyPreConfig_InitIsolatedConfigPtr.asFunction< - void Function(ffi.Pointer)>(); - - void PyConfig_InitPythonConfig( - ffi.Pointer config, - ) { - return _PyConfig_InitPythonConfig( - config, - ); - } - - late final _PyConfig_InitPythonConfigPtr = - _lookup)>>( - 'PyConfig_InitPythonConfig'); - late final _PyConfig_InitPythonConfig = _PyConfig_InitPythonConfigPtr - .asFunction)>(); - - void PyConfig_InitIsolatedConfig( - ffi.Pointer config, - ) { - return _PyConfig_InitIsolatedConfig( - config, - ); - } - - late final _PyConfig_InitIsolatedConfigPtr = - _lookup)>>( - 'PyConfig_InitIsolatedConfig'); - late final _PyConfig_InitIsolatedConfig = _PyConfig_InitIsolatedConfigPtr - .asFunction)>(); - - void PyConfig_Clear( - ffi.Pointer arg0, - ) { - return _PyConfig_Clear( - arg0, - ); - } - - late final _PyConfig_ClearPtr = - _lookup)>>( - 'PyConfig_Clear'); - late final _PyConfig_Clear = - _PyConfig_ClearPtr.asFunction)>(); - - PyStatus PyConfig_SetString( - ffi.Pointer config, - ffi.Pointer> config_str, - ffi.Pointer str, - ) { - return _PyConfig_SetString( - config, - config_str, - str, - ); - } - - late final _PyConfig_SetStringPtr = _lookup< - ffi.NativeFunction< - PyStatus Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('PyConfig_SetString'); - late final _PyConfig_SetString = _PyConfig_SetStringPtr.asFunction< - PyStatus Function(ffi.Pointer, - ffi.Pointer>, ffi.Pointer)>(); - - PyStatus PyConfig_SetBytesString( - ffi.Pointer config, - ffi.Pointer> config_str, - ffi.Pointer str, - ) { - return _PyConfig_SetBytesString( - config, - config_str, - str, - ); - } - - late final _PyConfig_SetBytesStringPtr = _lookup< - ffi.NativeFunction< - PyStatus Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('PyConfig_SetBytesString'); - late final _PyConfig_SetBytesString = _PyConfig_SetBytesStringPtr.asFunction< - PyStatus Function(ffi.Pointer, - ffi.Pointer>, ffi.Pointer)>(); - - PyStatus PyConfig_Read( - ffi.Pointer config, - ) { - return _PyConfig_Read( - config, - ); - } - - late final _PyConfig_ReadPtr = - _lookup)>>( - 'PyConfig_Read'); - late final _PyConfig_Read = - _PyConfig_ReadPtr.asFunction)>(); - - PyStatus PyConfig_SetBytesArgv( - ffi.Pointer config, - int argc, - ffi.Pointer> argv, - ) { - return _PyConfig_SetBytesArgv( - config, - argc, - argv, - ); - } - - late final _PyConfig_SetBytesArgvPtr = _lookup< - ffi.NativeFunction< - PyStatus Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer>)>>('PyConfig_SetBytesArgv'); - late final _PyConfig_SetBytesArgv = _PyConfig_SetBytesArgvPtr.asFunction< - PyStatus Function( - ffi.Pointer, int, ffi.Pointer>)>(); - - PyStatus PyConfig_SetArgv( - ffi.Pointer config, - int argc, - ffi.Pointer> argv, - ) { - return _PyConfig_SetArgv( - config, - argc, - argv, - ); - } - - late final _PyConfig_SetArgvPtr = _lookup< - ffi.NativeFunction< - PyStatus Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer>)>>('PyConfig_SetArgv'); - late final _PyConfig_SetArgv = _PyConfig_SetArgvPtr.asFunction< - PyStatus Function( - ffi.Pointer, int, ffi.Pointer>)>(); - - PyStatus PyConfig_SetWideStringList( - ffi.Pointer config, - ffi.Pointer list, - int length, - ffi.Pointer> items, - ) { - return _PyConfig_SetWideStringList( - config, - list, - length, - items, - ); - } - - late final _PyConfig_SetWideStringListPtr = _lookup< - ffi.NativeFunction< - PyStatus Function( - ffi.Pointer, - ffi.Pointer, - Py_ssize_t, - ffi.Pointer>)>>( - 'PyConfig_SetWideStringList'); - late final _PyConfig_SetWideStringList = - _PyConfig_SetWideStringListPtr.asFunction< - PyStatus Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - void Py_GetArgcArgv( - ffi.Pointer argc, - ffi.Pointer>> argv, - ) { - return _Py_GetArgcArgv( - argc, - argv, - ); - } - - late final _Py_GetArgcArgvPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer>>)>>( - 'Py_GetArgcArgv'); - late final _Py_GetArgcArgv = _Py_GetArgcArgvPtr.asFunction< - void Function(ffi.Pointer, - ffi.Pointer>>)>(); - - ffi.Pointer PyInterpreterState_New() { - return _PyInterpreterState_New(); - } - - late final _PyInterpreterState_NewPtr = - _lookup Function()>>( - 'PyInterpreterState_New'); - late final _PyInterpreterState_New = _PyInterpreterState_NewPtr.asFunction< - ffi.Pointer Function()>(); - - void PyInterpreterState_Clear( - ffi.Pointer arg0, - ) { - return _PyInterpreterState_Clear( - arg0, - ); - } - - late final _PyInterpreterState_ClearPtr = _lookup< - ffi - .NativeFunction)>>( - 'PyInterpreterState_Clear'); - late final _PyInterpreterState_Clear = _PyInterpreterState_ClearPtr - .asFunction)>(); - - void PyInterpreterState_Delete( - ffi.Pointer arg0, - ) { - return _PyInterpreterState_Delete( - arg0, - ); - } - - late final _PyInterpreterState_DeletePtr = _lookup< - ffi - .NativeFunction)>>( - 'PyInterpreterState_Delete'); - late final _PyInterpreterState_Delete = _PyInterpreterState_DeletePtr - .asFunction)>(); - - ffi.Pointer PyInterpreterState_Get() { - return _PyInterpreterState_Get(); - } - - late final _PyInterpreterState_GetPtr = - _lookup Function()>>( - 'PyInterpreterState_Get'); - late final _PyInterpreterState_Get = _PyInterpreterState_GetPtr.asFunction< - ffi.Pointer Function()>(); - - ffi.Pointer PyInterpreterState_GetDict( - ffi.Pointer arg0, - ) { - return _PyInterpreterState_GetDict( - arg0, - ); - } - - late final _PyInterpreterState_GetDictPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyInterpreterState_GetDict'); - late final _PyInterpreterState_GetDict = - _PyInterpreterState_GetDictPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyInterpreterState_GetID( - ffi.Pointer arg0, - ) { - return _PyInterpreterState_GetID( - arg0, - ); - } - - late final _PyInterpreterState_GetIDPtr = _lookup< - ffi - .NativeFunction)>>( - 'PyInterpreterState_GetID'); - late final _PyInterpreterState_GetID = _PyInterpreterState_GetIDPtr - .asFunction)>(); - - int PyState_AddModule( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyState_AddModule( - arg0, - arg1, - ); - } - - late final _PyState_AddModulePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyState_AddModule'); - late final _PyState_AddModule = _PyState_AddModulePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyState_RemoveModule( - ffi.Pointer arg0, - ) { - return _PyState_RemoveModule( - arg0, - ); - } - - late final _PyState_RemoveModulePtr = - _lookup)>>( - 'PyState_RemoveModule'); - late final _PyState_RemoveModule = _PyState_RemoveModulePtr.asFunction< - int Function(ffi.Pointer)>(); - - ffi.Pointer PyState_FindModule( - ffi.Pointer arg0, - ) { - return _PyState_FindModule( - arg0, - ); - } - - late final _PyState_FindModulePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyState_FindModule'); - late final _PyState_FindModule = _PyState_FindModulePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyThreadState_New( - ffi.Pointer arg0, - ) { - return _PyThreadState_New( - arg0, - ); - } - - late final _PyThreadState_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyThreadState_New'); - late final _PyThreadState_New = _PyThreadState_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - void PyThreadState_Clear( - ffi.Pointer arg0, - ) { - return _PyThreadState_Clear( - arg0, - ); - } - - late final _PyThreadState_ClearPtr = _lookup< - ffi.NativeFunction)>>( - 'PyThreadState_Clear'); - late final _PyThreadState_Clear = _PyThreadState_ClearPtr.asFunction< - void Function(ffi.Pointer)>(); - - void PyThreadState_Delete( - ffi.Pointer arg0, - ) { - return _PyThreadState_Delete( - arg0, - ); - } - - late final _PyThreadState_DeletePtr = _lookup< - ffi.NativeFunction)>>( - 'PyThreadState_Delete'); - late final _PyThreadState_Delete = _PyThreadState_DeletePtr.asFunction< - void Function(ffi.Pointer)>(); - - ffi.Pointer PyThreadState_Get() { - return _PyThreadState_Get(); - } - - late final _PyThreadState_GetPtr = - _lookup Function()>>( - 'PyThreadState_Get'); - late final _PyThreadState_Get = - _PyThreadState_GetPtr.asFunction Function()>(); - - ffi.Pointer PyThreadState_Swap( - ffi.Pointer arg0, - ) { - return _PyThreadState_Swap( - arg0, - ); - } - - late final _PyThreadState_SwapPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyThreadState_Swap'); - late final _PyThreadState_Swap = _PyThreadState_SwapPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyThreadState_GetDict() { - return _PyThreadState_GetDict1(); - } - - late final _PyThreadState_GetDictPtr = - _lookup Function()>>( - 'PyThreadState_GetDict'); - late final _PyThreadState_GetDict1 = - _PyThreadState_GetDictPtr.asFunction Function()>(); - - int PyThreadState_SetAsyncExc( - int arg0, - ffi.Pointer arg1, - ) { - return _PyThreadState_SetAsyncExc( - arg0, - arg1, - ); - } - - late final _PyThreadState_SetAsyncExcPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.UnsignedLong, - ffi.Pointer)>>('PyThreadState_SetAsyncExc'); - late final _PyThreadState_SetAsyncExc = _PyThreadState_SetAsyncExcPtr - .asFunction)>(); - - ffi.Pointer PyThreadState_GetInterpreter( - ffi.Pointer tstate, - ) { - return _PyThreadState_GetInterpreter( - tstate, - ); - } - - late final _PyThreadState_GetInterpreterPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyThreadState_GetInterpreter'); - late final _PyThreadState_GetInterpreter = - _PyThreadState_GetInterpreterPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); - - ffi.Pointer PyThreadState_GetFrame( - ffi.Pointer tstate, - ) { - return _PyThreadState_GetFrame( - tstate, - ); - } - - late final _PyThreadState_GetFramePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyThreadState_GetFrame'); - late final _PyThreadState_GetFrame = _PyThreadState_GetFramePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyThreadState_GetID( - ffi.Pointer tstate, - ) { - return _PyThreadState_GetID( - tstate, - ); - } - - late final _PyThreadState_GetIDPtr = _lookup< - ffi.NativeFunction)>>( - 'PyThreadState_GetID'); - late final _PyThreadState_GetID = _PyThreadState_GetIDPtr.asFunction< - int Function(ffi.Pointer)>(); - - int PyGILState_Ensure() { - return _PyGILState_Ensure(); - } - - late final _PyGILState_EnsurePtr = - _lookup>('PyGILState_Ensure'); - late final _PyGILState_Ensure = - _PyGILState_EnsurePtr.asFunction(); - - void PyGILState_Release( - int arg0, - ) { - return _PyGILState_Release( - arg0, - ); - } - - late final _PyGILState_ReleasePtr = - _lookup>( - 'PyGILState_Release'); - late final _PyGILState_Release = - _PyGILState_ReleasePtr.asFunction(); - - ffi.Pointer PyGILState_GetThisThreadState() { - return _PyGILState_GetThisThreadState(); - } - - late final _PyGILState_GetThisThreadStatePtr = - _lookup Function()>>( - 'PyGILState_GetThisThreadState'); - late final _PyGILState_GetThisThreadState = _PyGILState_GetThisThreadStatePtr - .asFunction Function()>(); - - int _PyInterpreterState_HasFeature( - ffi.Pointer interp, - int feature, - ) { - return __PyInterpreterState_HasFeature( - interp, - feature, - ); - } - - late final __PyInterpreterState_HasFeaturePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedLong)>>('_PyInterpreterState_HasFeature'); - late final __PyInterpreterState_HasFeature = - __PyInterpreterState_HasFeaturePtr - .asFunction, int)>(); - - int _PyInterpreterState_RequiresIDRef( - ffi.Pointer arg0, - ) { - return __PyInterpreterState_RequiresIDRef( - arg0, - ); - } - - late final __PyInterpreterState_RequiresIDRefPtr = _lookup< - ffi - .NativeFunction)>>( - '_PyInterpreterState_RequiresIDRef'); - late final __PyInterpreterState_RequiresIDRef = - __PyInterpreterState_RequiresIDRefPtr - .asFunction)>(); - - void _PyInterpreterState_RequireIDRef( - ffi.Pointer arg0, - int arg1, - ) { - return __PyInterpreterState_RequireIDRef( - arg0, - arg1, - ); - } - - late final __PyInterpreterState_RequireIDRefPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Int)>>('_PyInterpreterState_RequireIDRef'); - late final __PyInterpreterState_RequireIDRef = - __PyInterpreterState_RequireIDRefPtr - .asFunction, int)>(); - - ffi.Pointer _PyInterpreterState_GetMainModule( - ffi.Pointer arg0, - ) { - return __PyInterpreterState_GetMainModule( - arg0, - ); - } - - late final __PyInterpreterState_GetMainModulePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>( - '_PyInterpreterState_GetMainModule'); - late final __PyInterpreterState_GetMainModule = - __PyInterpreterState_GetMainModulePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer _PyThreadState_Prealloc( - ffi.Pointer arg0, - ) { - return __PyThreadState_Prealloc( - arg0, - ); - } - - late final __PyThreadState_PreallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyThreadState_Prealloc'); - late final __PyThreadState_Prealloc = __PyThreadState_PreallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer _PyThreadState_UncheckedGet() { - return __PyThreadState_UncheckedGet(); - } - - late final __PyThreadState_UncheckedGetPtr = - _lookup Function()>>( - '_PyThreadState_UncheckedGet'); - late final __PyThreadState_UncheckedGet = __PyThreadState_UncheckedGetPtr - .asFunction Function()>(); - - ffi.Pointer _PyThreadState_GetDict( - ffi.Pointer tstate, - ) { - return __PyThreadState_GetDict( - tstate, - ); - } - - late final __PyThreadState_GetDictPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyThreadState_GetDict'); - late final __PyThreadState_GetDict = __PyThreadState_GetDictPtr - .asFunction Function(ffi.Pointer)>(); - - void PyThreadState_EnterTracing( - ffi.Pointer tstate, - ) { - return _PyThreadState_EnterTracing( - tstate, - ); - } - - late final _PyThreadState_EnterTracingPtr = _lookup< - ffi.NativeFunction)>>( - 'PyThreadState_EnterTracing'); - late final _PyThreadState_EnterTracing = _PyThreadState_EnterTracingPtr - .asFunction)>(); - - void PyThreadState_LeaveTracing( - ffi.Pointer tstate, - ) { - return _PyThreadState_LeaveTracing( - tstate, - ); - } - - late final _PyThreadState_LeaveTracingPtr = _lookup< - ffi.NativeFunction)>>( - 'PyThreadState_LeaveTracing'); - late final _PyThreadState_LeaveTracing = _PyThreadState_LeaveTracingPtr - .asFunction)>(); - - int PyGILState_Check() { - return _PyGILState_Check(); - } - - late final _PyGILState_CheckPtr = - _lookup>('PyGILState_Check'); - late final _PyGILState_Check = - _PyGILState_CheckPtr.asFunction(); - - ffi.Pointer _PyGILState_GetInterpreterStateUnsafe() { - return __PyGILState_GetInterpreterStateUnsafe(); - } - - late final __PyGILState_GetInterpreterStateUnsafePtr = - _lookup Function()>>( - '_PyGILState_GetInterpreterStateUnsafe'); - late final __PyGILState_GetInterpreterStateUnsafe = - __PyGILState_GetInterpreterStateUnsafePtr - .asFunction Function()>(); - - ffi.Pointer _PyThread_CurrentFrames() { - return __PyThread_CurrentFrames(); - } - - late final __PyThread_CurrentFramesPtr = - _lookup Function()>>( - '_PyThread_CurrentFrames'); - late final __PyThread_CurrentFrames = __PyThread_CurrentFramesPtr - .asFunction Function()>(); - - ffi.Pointer _PyThread_CurrentExceptions() { - return __PyThread_CurrentExceptions(); - } - - late final __PyThread_CurrentExceptionsPtr = - _lookup Function()>>( - '_PyThread_CurrentExceptions'); - late final __PyThread_CurrentExceptions = __PyThread_CurrentExceptionsPtr - .asFunction Function()>(); - - ffi.Pointer PyInterpreterState_Main() { - return _PyInterpreterState_Main(); - } - - late final _PyInterpreterState_MainPtr = - _lookup Function()>>( - 'PyInterpreterState_Main'); - late final _PyInterpreterState_Main = _PyInterpreterState_MainPtr.asFunction< - ffi.Pointer Function()>(); - - ffi.Pointer PyInterpreterState_Head() { - return _PyInterpreterState_Head(); - } - - late final _PyInterpreterState_HeadPtr = - _lookup Function()>>( - 'PyInterpreterState_Head'); - late final _PyInterpreterState_Head = _PyInterpreterState_HeadPtr.asFunction< - ffi.Pointer Function()>(); - - ffi.Pointer PyInterpreterState_Next( - ffi.Pointer arg0, - ) { - return _PyInterpreterState_Next( - arg0, - ); - } - - late final _PyInterpreterState_NextPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyInterpreterState_Next'); - late final _PyInterpreterState_Next = _PyInterpreterState_NextPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); - - ffi.Pointer PyInterpreterState_ThreadHead( - ffi.Pointer arg0, - ) { - return _PyInterpreterState_ThreadHead( - arg0, - ); - } - - late final _PyInterpreterState_ThreadHeadPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>( - 'PyInterpreterState_ThreadHead'); - late final _PyInterpreterState_ThreadHead = - _PyInterpreterState_ThreadHeadPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); - - ffi.Pointer PyThreadState_Next( - ffi.Pointer arg0, - ) { - return _PyThreadState_Next( - arg0, - ); - } - - late final _PyThreadState_NextPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyThreadState_Next'); - late final _PyThreadState_Next = _PyThreadState_NextPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - void PyThreadState_DeleteCurrent() { - return _PyThreadState_DeleteCurrent(); - } - - late final _PyThreadState_DeleteCurrentPtr = - _lookup>( - 'PyThreadState_DeleteCurrent'); - late final _PyThreadState_DeleteCurrent = - _PyThreadState_DeleteCurrentPtr.asFunction(); - - _PyFrameEvalFunction _PyInterpreterState_GetEvalFrameFunc( - ffi.Pointer interp, - ) { - return __PyInterpreterState_GetEvalFrameFunc( - interp, - ); - } - - late final __PyInterpreterState_GetEvalFrameFuncPtr = _lookup< - ffi.NativeFunction< - _PyFrameEvalFunction Function(ffi.Pointer)>>( - '_PyInterpreterState_GetEvalFrameFunc'); - late final __PyInterpreterState_GetEvalFrameFunc = - __PyInterpreterState_GetEvalFrameFuncPtr.asFunction< - _PyFrameEvalFunction Function(ffi.Pointer)>(); - - void _PyInterpreterState_SetEvalFrameFunc( - ffi.Pointer interp, - _PyFrameEvalFunction eval_frame, - ) { - return __PyInterpreterState_SetEvalFrameFunc( - interp, - eval_frame, - ); - } - - late final __PyInterpreterState_SetEvalFrameFuncPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - _PyFrameEvalFunction)>>('_PyInterpreterState_SetEvalFrameFunc'); - late final __PyInterpreterState_SetEvalFrameFunc = - __PyInterpreterState_SetEvalFrameFuncPtr.asFunction< - void Function( - ffi.Pointer, _PyFrameEvalFunction)>(); - - ffi.Pointer _PyInterpreterState_GetConfig( - ffi.Pointer interp, - ) { - return __PyInterpreterState_GetConfig( - interp, - ); - } - - late final __PyInterpreterState_GetConfigPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>( - '_PyInterpreterState_GetConfig'); - late final __PyInterpreterState_GetConfig = - __PyInterpreterState_GetConfigPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int _PyInterpreterState_GetConfigCopy( - ffi.Pointer config, - ) { - return __PyInterpreterState_GetConfigCopy( - config, - ); - } - - late final __PyInterpreterState_GetConfigCopyPtr = - _lookup)>>( - '_PyInterpreterState_GetConfigCopy'); - late final __PyInterpreterState_GetConfigCopy = - __PyInterpreterState_GetConfigCopyPtr - .asFunction)>(); - - int _PyInterpreterState_SetConfig( - ffi.Pointer config, - ) { - return __PyInterpreterState_SetConfig( - config, - ); - } - - late final __PyInterpreterState_SetConfigPtr = - _lookup)>>( - '_PyInterpreterState_SetConfig'); - late final __PyInterpreterState_SetConfig = __PyInterpreterState_SetConfigPtr - .asFunction)>(); - - ffi.Pointer _Py_GetConfig() { - return __Py_GetConfig(); - } - - late final __Py_GetConfigPtr = - _lookup Function()>>( - '_Py_GetConfig'); - late final __Py_GetConfig = - __Py_GetConfigPtr.asFunction Function()>(); - - void _PyCrossInterpreterData_Init( - ffi.Pointer<_PyCrossInterpreterData> data, - ffi.Pointer interp, - ffi.Pointer shared, - ffi.Pointer obj, - xid_newobjectfunc new_object, - ) { - return __PyCrossInterpreterData_Init( - data, - interp, - shared, - obj, - new_object, - ); - } - - late final __PyCrossInterpreterData_InitPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_PyCrossInterpreterData>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - xid_newobjectfunc)>>('_PyCrossInterpreterData_Init'); - late final __PyCrossInterpreterData_Init = - __PyCrossInterpreterData_InitPtr.asFunction< - void Function( - ffi.Pointer<_PyCrossInterpreterData>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - xid_newobjectfunc)>(); - - int _PyCrossInterpreterData_InitWithSize( - ffi.Pointer<_PyCrossInterpreterData> arg0, - ffi.Pointer interp, - int arg2, - ffi.Pointer arg3, - xid_newobjectfunc arg4, - ) { - return __PyCrossInterpreterData_InitWithSize( - arg0, - interp, - arg2, - arg3, - arg4, - ); - } - - late final __PyCrossInterpreterData_InitWithSizePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer<_PyCrossInterpreterData>, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - xid_newobjectfunc)>>('_PyCrossInterpreterData_InitWithSize'); - late final __PyCrossInterpreterData_InitWithSize = - __PyCrossInterpreterData_InitWithSizePtr.asFunction< - int Function( - ffi.Pointer<_PyCrossInterpreterData>, - ffi.Pointer, - int, - ffi.Pointer, - xid_newobjectfunc)>(); - - void _PyCrossInterpreterData_Clear( - ffi.Pointer arg0, - ffi.Pointer<_PyCrossInterpreterData> arg1, - ) { - return __PyCrossInterpreterData_Clear( - arg0, - arg1, - ); - } - - late final __PyCrossInterpreterData_ClearPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer<_PyCrossInterpreterData>)>>( - '_PyCrossInterpreterData_Clear'); - late final __PyCrossInterpreterData_Clear = - __PyCrossInterpreterData_ClearPtr.asFunction< - void Function(ffi.Pointer, - ffi.Pointer<_PyCrossInterpreterData>)>(); - - int _PyObject_GetCrossInterpreterData( - ffi.Pointer arg0, - ffi.Pointer<_PyCrossInterpreterData> arg1, - ) { - return __PyObject_GetCrossInterpreterData( - arg0, - arg1, - ); - } - - late final __PyObject_GetCrossInterpreterDataPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer<_PyCrossInterpreterData>)>>( - '_PyObject_GetCrossInterpreterData'); - late final __PyObject_GetCrossInterpreterData = - __PyObject_GetCrossInterpreterDataPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer<_PyCrossInterpreterData>)>(); - - ffi.Pointer _PyCrossInterpreterData_NewObject( - ffi.Pointer<_PyCrossInterpreterData> arg0, - ) { - return __PyCrossInterpreterData_NewObject( - arg0, - ); - } - - late final __PyCrossInterpreterData_NewObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_PyCrossInterpreterData>)>>( - '_PyCrossInterpreterData_NewObject'); - late final __PyCrossInterpreterData_NewObject = - __PyCrossInterpreterData_NewObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer<_PyCrossInterpreterData>)>(); - - int _PyCrossInterpreterData_Release( - ffi.Pointer<_PyCrossInterpreterData> arg0, - ) { - return __PyCrossInterpreterData_Release( - arg0, - ); - } - - late final __PyCrossInterpreterData_ReleasePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyCrossInterpreterData>)>>( - '_PyCrossInterpreterData_Release'); - late final __PyCrossInterpreterData_Release = - __PyCrossInterpreterData_ReleasePtr - .asFunction)>(); - - int _PyObject_CheckCrossInterpreterData( - ffi.Pointer arg0, - ) { - return __PyObject_CheckCrossInterpreterData( - arg0, - ); - } - - late final __PyObject_CheckCrossInterpreterDataPtr = - _lookup)>>( - '_PyObject_CheckCrossInterpreterData'); - late final __PyObject_CheckCrossInterpreterData = - __PyObject_CheckCrossInterpreterDataPtr - .asFunction)>(); - - int _PyCrossInterpreterData_RegisterClass( - ffi.Pointer arg0, - crossinterpdatafunc arg1, - ) { - return __PyCrossInterpreterData_RegisterClass( - arg0, - arg1, - ); - } - - late final __PyCrossInterpreterData_RegisterClassPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - crossinterpdatafunc)>>('_PyCrossInterpreterData_RegisterClass'); - late final __PyCrossInterpreterData_RegisterClass = - __PyCrossInterpreterData_RegisterClassPtr.asFunction< - int Function(ffi.Pointer, crossinterpdatafunc)>(); - - int _PyCrossInterpreterData_UnregisterClass( - ffi.Pointer arg0, - ) { - return __PyCrossInterpreterData_UnregisterClass( - arg0, - ); - } - - late final __PyCrossInterpreterData_UnregisterClassPtr = - _lookup)>>( - '_PyCrossInterpreterData_UnregisterClass'); - late final __PyCrossInterpreterData_UnregisterClass = - __PyCrossInterpreterData_UnregisterClassPtr - .asFunction)>(); - - crossinterpdatafunc _PyCrossInterpreterData_Lookup( - ffi.Pointer arg0, - ) { - return __PyCrossInterpreterData_Lookup( - arg0, - ); - } - - late final __PyCrossInterpreterData_LookupPtr = _lookup< - ffi - .NativeFunction)>>( - '_PyCrossInterpreterData_Lookup'); - late final __PyCrossInterpreterData_Lookup = - __PyCrossInterpreterData_LookupPtr - .asFunction)>(); - - void PyErr_SetNone( - ffi.Pointer arg0, - ) { - return _PyErr_SetNone( - arg0, - ); - } - - late final _PyErr_SetNonePtr = - _lookup)>>( - 'PyErr_SetNone'); - late final _PyErr_SetNone = - _PyErr_SetNonePtr.asFunction)>(); - - void PyErr_SetObject( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyErr_SetObject( - arg0, - arg1, - ); - } - - late final _PyErr_SetObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('PyErr_SetObject'); - late final _PyErr_SetObject = _PyErr_SetObjectPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - void PyErr_SetString( - ffi.Pointer exception, - ffi.Pointer string, - ) { - return _PyErr_SetString( - exception, - string, - ); - } - - late final _PyErr_SetStringPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('PyErr_SetString'); - late final _PyErr_SetString = _PyErr_SetStringPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyErr_Occurred() { - return _PyErr_Occurred(); - } - - late final _PyErr_OccurredPtr = - _lookup Function()>>( - 'PyErr_Occurred'); - late final _PyErr_Occurred = - _PyErr_OccurredPtr.asFunction Function()>(); - - void PyErr_Clear() { - return _PyErr_Clear(); - } - - late final _PyErr_ClearPtr = - _lookup>('PyErr_Clear'); - late final _PyErr_Clear = _PyErr_ClearPtr.asFunction(); - - void PyErr_Fetch( - ffi.Pointer> arg0, - ffi.Pointer> arg1, - ffi.Pointer> arg2, - ) { - return _PyErr_Fetch( - arg0, - arg1, - arg2, - ); - } - - late final _PyErr_FetchPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>>('PyErr_Fetch'); - late final _PyErr_Fetch = _PyErr_FetchPtr.asFunction< - void Function( - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>(); - - void PyErr_Restore( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyErr_Restore( - arg0, - arg1, - arg2, - ); - } - - late final _PyErr_RestorePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyErr_Restore'); - late final _PyErr_Restore = _PyErr_RestorePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyErr_GetRaisedException() { - return _PyErr_GetRaisedException(); - } - - late final _PyErr_GetRaisedExceptionPtr = - _lookup Function()>>( - 'PyErr_GetRaisedException'); - late final _PyErr_GetRaisedException = _PyErr_GetRaisedExceptionPtr - .asFunction Function()>(); - - void PyErr_SetRaisedException( - ffi.Pointer arg0, - ) { - return _PyErr_SetRaisedException( - arg0, - ); - } - - late final _PyErr_SetRaisedExceptionPtr = - _lookup)>>( - 'PyErr_SetRaisedException'); - late final _PyErr_SetRaisedException = _PyErr_SetRaisedExceptionPtr - .asFunction)>(); - - ffi.Pointer PyErr_GetHandledException() { - return _PyErr_GetHandledException1(); - } - - late final _PyErr_GetHandledExceptionPtr = - _lookup Function()>>( - 'PyErr_GetHandledException'); - late final _PyErr_GetHandledException1 = _PyErr_GetHandledExceptionPtr - .asFunction Function()>(); - - void PyErr_SetHandledException( - ffi.Pointer arg0, - ) { - return _PyErr_SetHandledException1( - arg0, - ); - } - - late final _PyErr_SetHandledExceptionPtr = - _lookup)>>( - 'PyErr_SetHandledException'); - late final _PyErr_SetHandledException1 = _PyErr_SetHandledExceptionPtr - .asFunction)>(); - - void PyErr_GetExcInfo( - ffi.Pointer> arg0, - ffi.Pointer> arg1, - ffi.Pointer> arg2, - ) { - return _PyErr_GetExcInfo1( - arg0, - arg1, - arg2, - ); - } - - late final _PyErr_GetExcInfoPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>>('PyErr_GetExcInfo'); - late final _PyErr_GetExcInfo1 = _PyErr_GetExcInfoPtr.asFunction< - void Function( - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>(); - - void PyErr_SetExcInfo( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyErr_SetExcInfo( - arg0, - arg1, - arg2, - ); - } - - late final _PyErr_SetExcInfoPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyErr_SetExcInfo'); - late final _PyErr_SetExcInfo = _PyErr_SetExcInfoPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void Py_FatalError( - ffi.Pointer message, - ) { - return _Py_FatalError( - message, - ); - } - - late final _Py_FatalErrorPtr = - _lookup)>>( - 'Py_FatalError'); - late final _Py_FatalError = - _Py_FatalErrorPtr.asFunction)>(); - - int PyErr_GivenExceptionMatches( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyErr_GivenExceptionMatches( - arg0, - arg1, - ); - } - - late final _PyErr_GivenExceptionMatchesPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyErr_GivenExceptionMatches'); - late final _PyErr_GivenExceptionMatches = _PyErr_GivenExceptionMatchesPtr - .asFunction, ffi.Pointer)>(); - - int PyErr_ExceptionMatches( - ffi.Pointer arg0, - ) { - return _PyErr_ExceptionMatches( - arg0, - ); - } - - late final _PyErr_ExceptionMatchesPtr = - _lookup)>>( - 'PyErr_ExceptionMatches'); - late final _PyErr_ExceptionMatches = _PyErr_ExceptionMatchesPtr.asFunction< - int Function(ffi.Pointer)>(); - - void PyErr_NormalizeException( - ffi.Pointer> arg0, - ffi.Pointer> arg1, - ffi.Pointer> arg2, - ) { - return _PyErr_NormalizeException( - arg0, - arg1, - arg2, - ); - } - - late final _PyErr_NormalizeExceptionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>>('PyErr_NormalizeException'); - late final _PyErr_NormalizeException = - _PyErr_NormalizeExceptionPtr.asFunction< - void Function( - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>(); - - int PyException_SetTraceback( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyException_SetTraceback( - arg0, - arg1, - ); - } - - late final _PyException_SetTracebackPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyException_SetTraceback'); - late final _PyException_SetTraceback = _PyException_SetTracebackPtr - .asFunction, ffi.Pointer)>(); - - ffi.Pointer PyException_GetTraceback( - ffi.Pointer arg0, - ) { - return _PyException_GetTraceback( - arg0, - ); - } - - late final _PyException_GetTracebackPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyException_GetTraceback'); - late final _PyException_GetTraceback = _PyException_GetTracebackPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyException_GetCause( - ffi.Pointer arg0, - ) { - return _PyException_GetCause( - arg0, - ); - } - - late final _PyException_GetCausePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyException_GetCause'); - late final _PyException_GetCause = _PyException_GetCausePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - void PyException_SetCause( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyException_SetCause( - arg0, - arg1, - ); - } - - late final _PyException_SetCausePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('PyException_SetCause'); - late final _PyException_SetCause = _PyException_SetCausePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyException_GetContext( - ffi.Pointer arg0, - ) { - return _PyException_GetContext( - arg0, - ); - } - - late final _PyException_GetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyException_GetContext'); - late final _PyException_GetContext = _PyException_GetContextPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - void PyException_SetContext( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyException_SetContext( - arg0, - arg1, - ); - } - - late final _PyException_SetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('PyException_SetContext'); - late final _PyException_SetContext = _PyException_SetContextPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyException_GetArgs( - ffi.Pointer arg0, - ) { - return _PyException_GetArgs( - arg0, - ); - } - - late final _PyException_GetArgsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyException_GetArgs'); - late final _PyException_GetArgs = _PyException_GetArgsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - void PyException_SetArgs( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyException_SetArgs( - arg0, - arg1, - ); - } - - late final _PyException_SetArgsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('PyException_SetArgs'); - late final _PyException_SetArgs = _PyException_SetArgsPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyExceptionClass_Name( - ffi.Pointer arg0, - ) { - return _PyExceptionClass_Name( - arg0, - ); - } - - late final _PyExceptionClass_NamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyExceptionClass_Name'); - late final _PyExceptionClass_Name = _PyExceptionClass_NamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer> _PyExc_BaseException = - _lookup>('PyExc_BaseException'); - - ffi.Pointer get PyExc_BaseException => _PyExc_BaseException.value; - - set PyExc_BaseException(ffi.Pointer value) => - _PyExc_BaseException.value = value; - - late final ffi.Pointer> _PyExc_Exception = - _lookup>('PyExc_Exception'); - - ffi.Pointer get PyExc_Exception => _PyExc_Exception.value; - - set PyExc_Exception(ffi.Pointer value) => - _PyExc_Exception.value = value; - - late final ffi.Pointer> _PyExc_BaseExceptionGroup = - _lookup>('PyExc_BaseExceptionGroup'); - - ffi.Pointer get PyExc_BaseExceptionGroup => - _PyExc_BaseExceptionGroup.value; - - set PyExc_BaseExceptionGroup(ffi.Pointer value) => - _PyExc_BaseExceptionGroup.value = value; - - late final ffi.Pointer> _PyExc_StopAsyncIteration = - _lookup>('PyExc_StopAsyncIteration'); - - ffi.Pointer get PyExc_StopAsyncIteration => - _PyExc_StopAsyncIteration.value; - - set PyExc_StopAsyncIteration(ffi.Pointer value) => - _PyExc_StopAsyncIteration.value = value; - - late final ffi.Pointer> _PyExc_StopIteration = - _lookup>('PyExc_StopIteration'); - - ffi.Pointer get PyExc_StopIteration => _PyExc_StopIteration.value; - - set PyExc_StopIteration(ffi.Pointer value) => - _PyExc_StopIteration.value = value; - - late final ffi.Pointer> _PyExc_GeneratorExit = - _lookup>('PyExc_GeneratorExit'); - - ffi.Pointer get PyExc_GeneratorExit => _PyExc_GeneratorExit.value; - - set PyExc_GeneratorExit(ffi.Pointer value) => - _PyExc_GeneratorExit.value = value; - - late final ffi.Pointer> _PyExc_ArithmeticError = - _lookup>('PyExc_ArithmeticError'); - - ffi.Pointer get PyExc_ArithmeticError => - _PyExc_ArithmeticError.value; - - set PyExc_ArithmeticError(ffi.Pointer value) => - _PyExc_ArithmeticError.value = value; - - late final ffi.Pointer> _PyExc_LookupError = - _lookup>('PyExc_LookupError'); - - ffi.Pointer get PyExc_LookupError => _PyExc_LookupError.value; - - set PyExc_LookupError(ffi.Pointer value) => - _PyExc_LookupError.value = value; - - late final ffi.Pointer> _PyExc_AssertionError = - _lookup>('PyExc_AssertionError'); - - ffi.Pointer get PyExc_AssertionError => _PyExc_AssertionError.value; - - set PyExc_AssertionError(ffi.Pointer value) => - _PyExc_AssertionError.value = value; - - late final ffi.Pointer> _PyExc_AttributeError = - _lookup>('PyExc_AttributeError'); - - ffi.Pointer get PyExc_AttributeError => _PyExc_AttributeError.value; - - set PyExc_AttributeError(ffi.Pointer value) => - _PyExc_AttributeError.value = value; - - late final ffi.Pointer> _PyExc_BufferError = - _lookup>('PyExc_BufferError'); - - ffi.Pointer get PyExc_BufferError => _PyExc_BufferError.value; - - set PyExc_BufferError(ffi.Pointer value) => - _PyExc_BufferError.value = value; - - late final ffi.Pointer> _PyExc_EOFError = - _lookup>('PyExc_EOFError'); - - ffi.Pointer get PyExc_EOFError => _PyExc_EOFError.value; - - set PyExc_EOFError(ffi.Pointer value) => - _PyExc_EOFError.value = value; - - late final ffi.Pointer> _PyExc_FloatingPointError = - _lookup>('PyExc_FloatingPointError'); - - ffi.Pointer get PyExc_FloatingPointError => - _PyExc_FloatingPointError.value; - - set PyExc_FloatingPointError(ffi.Pointer value) => - _PyExc_FloatingPointError.value = value; - - late final ffi.Pointer> _PyExc_OSError = - _lookup>('PyExc_OSError'); - - ffi.Pointer get PyExc_OSError => _PyExc_OSError.value; - - set PyExc_OSError(ffi.Pointer value) => - _PyExc_OSError.value = value; - - late final ffi.Pointer> _PyExc_ImportError = - _lookup>('PyExc_ImportError'); - - ffi.Pointer get PyExc_ImportError => _PyExc_ImportError.value; - - set PyExc_ImportError(ffi.Pointer value) => - _PyExc_ImportError.value = value; - - late final ffi.Pointer> _PyExc_ModuleNotFoundError = - _lookup>('PyExc_ModuleNotFoundError'); - - ffi.Pointer get PyExc_ModuleNotFoundError => - _PyExc_ModuleNotFoundError.value; - - set PyExc_ModuleNotFoundError(ffi.Pointer value) => - _PyExc_ModuleNotFoundError.value = value; - - late final ffi.Pointer> _PyExc_IndexError = - _lookup>('PyExc_IndexError'); - - ffi.Pointer get PyExc_IndexError => _PyExc_IndexError.value; - - set PyExc_IndexError(ffi.Pointer value) => - _PyExc_IndexError.value = value; - - late final ffi.Pointer> _PyExc_KeyError = - _lookup>('PyExc_KeyError'); - - ffi.Pointer get PyExc_KeyError => _PyExc_KeyError.value; - - set PyExc_KeyError(ffi.Pointer value) => - _PyExc_KeyError.value = value; - - late final ffi.Pointer> _PyExc_KeyboardInterrupt = - _lookup>('PyExc_KeyboardInterrupt'); - - ffi.Pointer get PyExc_KeyboardInterrupt => - _PyExc_KeyboardInterrupt.value; - - set PyExc_KeyboardInterrupt(ffi.Pointer value) => - _PyExc_KeyboardInterrupt.value = value; - - late final ffi.Pointer> _PyExc_MemoryError = - _lookup>('PyExc_MemoryError'); - - ffi.Pointer get PyExc_MemoryError => _PyExc_MemoryError.value; - - set PyExc_MemoryError(ffi.Pointer value) => - _PyExc_MemoryError.value = value; - - late final ffi.Pointer> _PyExc_NameError = - _lookup>('PyExc_NameError'); - - ffi.Pointer get PyExc_NameError => _PyExc_NameError.value; - - set PyExc_NameError(ffi.Pointer value) => - _PyExc_NameError.value = value; - - late final ffi.Pointer> _PyExc_OverflowError = - _lookup>('PyExc_OverflowError'); - - ffi.Pointer get PyExc_OverflowError => _PyExc_OverflowError.value; - - set PyExc_OverflowError(ffi.Pointer value) => - _PyExc_OverflowError.value = value; - - late final ffi.Pointer> _PyExc_RuntimeError = - _lookup>('PyExc_RuntimeError'); - - ffi.Pointer get PyExc_RuntimeError => _PyExc_RuntimeError.value; - - set PyExc_RuntimeError(ffi.Pointer value) => - _PyExc_RuntimeError.value = value; - - late final ffi.Pointer> _PyExc_RecursionError = - _lookup>('PyExc_RecursionError'); - - ffi.Pointer get PyExc_RecursionError => _PyExc_RecursionError.value; - - set PyExc_RecursionError(ffi.Pointer value) => - _PyExc_RecursionError.value = value; - - late final ffi.Pointer> _PyExc_NotImplementedError = - _lookup>('PyExc_NotImplementedError'); - - ffi.Pointer get PyExc_NotImplementedError => - _PyExc_NotImplementedError.value; - - set PyExc_NotImplementedError(ffi.Pointer value) => - _PyExc_NotImplementedError.value = value; - - late final ffi.Pointer> _PyExc_SyntaxError = - _lookup>('PyExc_SyntaxError'); - - ffi.Pointer get PyExc_SyntaxError => _PyExc_SyntaxError.value; - - set PyExc_SyntaxError(ffi.Pointer value) => - _PyExc_SyntaxError.value = value; - - late final ffi.Pointer> _PyExc_IndentationError = - _lookup>('PyExc_IndentationError'); - - ffi.Pointer get PyExc_IndentationError => - _PyExc_IndentationError.value; - - set PyExc_IndentationError(ffi.Pointer value) => - _PyExc_IndentationError.value = value; - - late final ffi.Pointer> _PyExc_TabError = - _lookup>('PyExc_TabError'); - - ffi.Pointer get PyExc_TabError => _PyExc_TabError.value; - - set PyExc_TabError(ffi.Pointer value) => - _PyExc_TabError.value = value; - - late final ffi.Pointer> _PyExc_ReferenceError = - _lookup>('PyExc_ReferenceError'); - - ffi.Pointer get PyExc_ReferenceError => _PyExc_ReferenceError.value; - - set PyExc_ReferenceError(ffi.Pointer value) => - _PyExc_ReferenceError.value = value; - - late final ffi.Pointer> _PyExc_SystemError = - _lookup>('PyExc_SystemError'); - - ffi.Pointer get PyExc_SystemError => _PyExc_SystemError.value; - - set PyExc_SystemError(ffi.Pointer value) => - _PyExc_SystemError.value = value; - - late final ffi.Pointer> _PyExc_SystemExit = - _lookup>('PyExc_SystemExit'); - - ffi.Pointer get PyExc_SystemExit => _PyExc_SystemExit.value; - - set PyExc_SystemExit(ffi.Pointer value) => - _PyExc_SystemExit.value = value; - - late final ffi.Pointer> _PyExc_TypeError = - _lookup>('PyExc_TypeError'); - - ffi.Pointer get PyExc_TypeError => _PyExc_TypeError.value; - - set PyExc_TypeError(ffi.Pointer value) => - _PyExc_TypeError.value = value; - - late final ffi.Pointer> _PyExc_UnboundLocalError = - _lookup>('PyExc_UnboundLocalError'); - - ffi.Pointer get PyExc_UnboundLocalError => - _PyExc_UnboundLocalError.value; - - set PyExc_UnboundLocalError(ffi.Pointer value) => - _PyExc_UnboundLocalError.value = value; - - late final ffi.Pointer> _PyExc_UnicodeError = - _lookup>('PyExc_UnicodeError'); - - ffi.Pointer get PyExc_UnicodeError => _PyExc_UnicodeError.value; - - set PyExc_UnicodeError(ffi.Pointer value) => - _PyExc_UnicodeError.value = value; - - late final ffi.Pointer> _PyExc_UnicodeEncodeError = - _lookup>('PyExc_UnicodeEncodeError'); - - ffi.Pointer get PyExc_UnicodeEncodeError => - _PyExc_UnicodeEncodeError.value; - - set PyExc_UnicodeEncodeError(ffi.Pointer value) => - _PyExc_UnicodeEncodeError.value = value; - - late final ffi.Pointer> _PyExc_UnicodeDecodeError = - _lookup>('PyExc_UnicodeDecodeError'); - - ffi.Pointer get PyExc_UnicodeDecodeError => - _PyExc_UnicodeDecodeError.value; - - set PyExc_UnicodeDecodeError(ffi.Pointer value) => - _PyExc_UnicodeDecodeError.value = value; - - late final ffi.Pointer> _PyExc_UnicodeTranslateError = - _lookup>('PyExc_UnicodeTranslateError'); - - ffi.Pointer get PyExc_UnicodeTranslateError => - _PyExc_UnicodeTranslateError.value; - - set PyExc_UnicodeTranslateError(ffi.Pointer value) => - _PyExc_UnicodeTranslateError.value = value; - - late final ffi.Pointer> _PyExc_ValueError = - _lookup>('PyExc_ValueError'); - - ffi.Pointer get PyExc_ValueError => _PyExc_ValueError.value; - - set PyExc_ValueError(ffi.Pointer value) => - _PyExc_ValueError.value = value; - - late final ffi.Pointer> _PyExc_ZeroDivisionError = - _lookup>('PyExc_ZeroDivisionError'); - - ffi.Pointer get PyExc_ZeroDivisionError => - _PyExc_ZeroDivisionError.value; - - set PyExc_ZeroDivisionError(ffi.Pointer value) => - _PyExc_ZeroDivisionError.value = value; - - late final ffi.Pointer> _PyExc_BlockingIOError = - _lookup>('PyExc_BlockingIOError'); - - ffi.Pointer get PyExc_BlockingIOError => - _PyExc_BlockingIOError.value; - - set PyExc_BlockingIOError(ffi.Pointer value) => - _PyExc_BlockingIOError.value = value; - - late final ffi.Pointer> _PyExc_BrokenPipeError = - _lookup>('PyExc_BrokenPipeError'); - - ffi.Pointer get PyExc_BrokenPipeError => - _PyExc_BrokenPipeError.value; - - set PyExc_BrokenPipeError(ffi.Pointer value) => - _PyExc_BrokenPipeError.value = value; - - late final ffi.Pointer> _PyExc_ChildProcessError = - _lookup>('PyExc_ChildProcessError'); - - ffi.Pointer get PyExc_ChildProcessError => - _PyExc_ChildProcessError.value; - - set PyExc_ChildProcessError(ffi.Pointer value) => - _PyExc_ChildProcessError.value = value; - - late final ffi.Pointer> _PyExc_ConnectionError = - _lookup>('PyExc_ConnectionError'); - - ffi.Pointer get PyExc_ConnectionError => - _PyExc_ConnectionError.value; - - set PyExc_ConnectionError(ffi.Pointer value) => - _PyExc_ConnectionError.value = value; - - late final ffi.Pointer> _PyExc_ConnectionAbortedError = - _lookup>('PyExc_ConnectionAbortedError'); - - ffi.Pointer get PyExc_ConnectionAbortedError => - _PyExc_ConnectionAbortedError.value; - - set PyExc_ConnectionAbortedError(ffi.Pointer value) => - _PyExc_ConnectionAbortedError.value = value; - - late final ffi.Pointer> _PyExc_ConnectionRefusedError = - _lookup>('PyExc_ConnectionRefusedError'); - - ffi.Pointer get PyExc_ConnectionRefusedError => - _PyExc_ConnectionRefusedError.value; - - set PyExc_ConnectionRefusedError(ffi.Pointer value) => - _PyExc_ConnectionRefusedError.value = value; - - late final ffi.Pointer> _PyExc_ConnectionResetError = - _lookup>('PyExc_ConnectionResetError'); - - ffi.Pointer get PyExc_ConnectionResetError => - _PyExc_ConnectionResetError.value; - - set PyExc_ConnectionResetError(ffi.Pointer value) => - _PyExc_ConnectionResetError.value = value; - - late final ffi.Pointer> _PyExc_FileExistsError = - _lookup>('PyExc_FileExistsError'); - - ffi.Pointer get PyExc_FileExistsError => - _PyExc_FileExistsError.value; - - set PyExc_FileExistsError(ffi.Pointer value) => - _PyExc_FileExistsError.value = value; - - late final ffi.Pointer> _PyExc_FileNotFoundError = - _lookup>('PyExc_FileNotFoundError'); - - ffi.Pointer get PyExc_FileNotFoundError => - _PyExc_FileNotFoundError.value; - - set PyExc_FileNotFoundError(ffi.Pointer value) => - _PyExc_FileNotFoundError.value = value; - - late final ffi.Pointer> _PyExc_InterruptedError = - _lookup>('PyExc_InterruptedError'); - - ffi.Pointer get PyExc_InterruptedError => - _PyExc_InterruptedError.value; - - set PyExc_InterruptedError(ffi.Pointer value) => - _PyExc_InterruptedError.value = value; - - late final ffi.Pointer> _PyExc_IsADirectoryError = - _lookup>('PyExc_IsADirectoryError'); - - ffi.Pointer get PyExc_IsADirectoryError => - _PyExc_IsADirectoryError.value; - - set PyExc_IsADirectoryError(ffi.Pointer value) => - _PyExc_IsADirectoryError.value = value; - - late final ffi.Pointer> _PyExc_NotADirectoryError = - _lookup>('PyExc_NotADirectoryError'); - - ffi.Pointer get PyExc_NotADirectoryError => - _PyExc_NotADirectoryError.value; - - set PyExc_NotADirectoryError(ffi.Pointer value) => - _PyExc_NotADirectoryError.value = value; - - late final ffi.Pointer> _PyExc_PermissionError = - _lookup>('PyExc_PermissionError'); - - ffi.Pointer get PyExc_PermissionError => - _PyExc_PermissionError.value; - - set PyExc_PermissionError(ffi.Pointer value) => - _PyExc_PermissionError.value = value; - - late final ffi.Pointer> _PyExc_ProcessLookupError = - _lookup>('PyExc_ProcessLookupError'); - - ffi.Pointer get PyExc_ProcessLookupError => - _PyExc_ProcessLookupError.value; - - set PyExc_ProcessLookupError(ffi.Pointer value) => - _PyExc_ProcessLookupError.value = value; - - late final ffi.Pointer> _PyExc_TimeoutError = - _lookup>('PyExc_TimeoutError'); - - ffi.Pointer get PyExc_TimeoutError => _PyExc_TimeoutError.value; - - set PyExc_TimeoutError(ffi.Pointer value) => - _PyExc_TimeoutError.value = value; - - late final ffi.Pointer> _PyExc_EnvironmentError = - _lookup>('PyExc_EnvironmentError'); - - ffi.Pointer get PyExc_EnvironmentError => - _PyExc_EnvironmentError.value; - - set PyExc_EnvironmentError(ffi.Pointer value) => - _PyExc_EnvironmentError.value = value; - - late final ffi.Pointer> _PyExc_IOError = - _lookup>('PyExc_IOError'); - - ffi.Pointer get PyExc_IOError => _PyExc_IOError.value; - - set PyExc_IOError(ffi.Pointer value) => - _PyExc_IOError.value = value; - - late final ffi.Pointer> _PyExc_Warning = - _lookup>('PyExc_Warning'); - - ffi.Pointer get PyExc_Warning => _PyExc_Warning.value; - - set PyExc_Warning(ffi.Pointer value) => - _PyExc_Warning.value = value; - - late final ffi.Pointer> _PyExc_UserWarning = - _lookup>('PyExc_UserWarning'); - - ffi.Pointer get PyExc_UserWarning => _PyExc_UserWarning.value; - - set PyExc_UserWarning(ffi.Pointer value) => - _PyExc_UserWarning.value = value; - - late final ffi.Pointer> _PyExc_DeprecationWarning = - _lookup>('PyExc_DeprecationWarning'); - - ffi.Pointer get PyExc_DeprecationWarning => - _PyExc_DeprecationWarning.value; - - set PyExc_DeprecationWarning(ffi.Pointer value) => - _PyExc_DeprecationWarning.value = value; - - late final ffi.Pointer> - _PyExc_PendingDeprecationWarning = - _lookup>('PyExc_PendingDeprecationWarning'); - - ffi.Pointer get PyExc_PendingDeprecationWarning => - _PyExc_PendingDeprecationWarning.value; - - set PyExc_PendingDeprecationWarning(ffi.Pointer value) => - _PyExc_PendingDeprecationWarning.value = value; - - late final ffi.Pointer> _PyExc_SyntaxWarning = - _lookup>('PyExc_SyntaxWarning'); - - ffi.Pointer get PyExc_SyntaxWarning => _PyExc_SyntaxWarning.value; - - set PyExc_SyntaxWarning(ffi.Pointer value) => - _PyExc_SyntaxWarning.value = value; - - late final ffi.Pointer> _PyExc_RuntimeWarning = - _lookup>('PyExc_RuntimeWarning'); - - ffi.Pointer get PyExc_RuntimeWarning => _PyExc_RuntimeWarning.value; - - set PyExc_RuntimeWarning(ffi.Pointer value) => - _PyExc_RuntimeWarning.value = value; - - late final ffi.Pointer> _PyExc_FutureWarning = - _lookup>('PyExc_FutureWarning'); - - ffi.Pointer get PyExc_FutureWarning => _PyExc_FutureWarning.value; - - set PyExc_FutureWarning(ffi.Pointer value) => - _PyExc_FutureWarning.value = value; - - late final ffi.Pointer> _PyExc_ImportWarning = - _lookup>('PyExc_ImportWarning'); - - ffi.Pointer get PyExc_ImportWarning => _PyExc_ImportWarning.value; - - set PyExc_ImportWarning(ffi.Pointer value) => - _PyExc_ImportWarning.value = value; - - late final ffi.Pointer> _PyExc_UnicodeWarning = - _lookup>('PyExc_UnicodeWarning'); - - ffi.Pointer get PyExc_UnicodeWarning => _PyExc_UnicodeWarning.value; - - set PyExc_UnicodeWarning(ffi.Pointer value) => - _PyExc_UnicodeWarning.value = value; - - late final ffi.Pointer> _PyExc_BytesWarning = - _lookup>('PyExc_BytesWarning'); - - ffi.Pointer get PyExc_BytesWarning => _PyExc_BytesWarning.value; - - set PyExc_BytesWarning(ffi.Pointer value) => - _PyExc_BytesWarning.value = value; - - late final ffi.Pointer> _PyExc_EncodingWarning = - _lookup>('PyExc_EncodingWarning'); - - ffi.Pointer get PyExc_EncodingWarning => - _PyExc_EncodingWarning.value; - - set PyExc_EncodingWarning(ffi.Pointer value) => - _PyExc_EncodingWarning.value = value; - - late final ffi.Pointer> _PyExc_ResourceWarning = - _lookup>('PyExc_ResourceWarning'); - - ffi.Pointer get PyExc_ResourceWarning => - _PyExc_ResourceWarning.value; - - set PyExc_ResourceWarning(ffi.Pointer value) => - _PyExc_ResourceWarning.value = value; - - int PyErr_BadArgument() { - return _PyErr_BadArgument(); - } - - late final _PyErr_BadArgumentPtr = - _lookup>('PyErr_BadArgument'); - late final _PyErr_BadArgument = - _PyErr_BadArgumentPtr.asFunction(); - - ffi.Pointer PyErr_NoMemory() { - return _PyErr_NoMemory(); - } - - late final _PyErr_NoMemoryPtr = - _lookup Function()>>( - 'PyErr_NoMemory'); - late final _PyErr_NoMemory = - _PyErr_NoMemoryPtr.asFunction Function()>(); - - ffi.Pointer PyErr_SetFromErrno( - ffi.Pointer arg0, - ) { - return _PyErr_SetFromErrno( - arg0, - ); - } - - late final _PyErr_SetFromErrnoPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyErr_SetFromErrno'); - late final _PyErr_SetFromErrno = _PyErr_SetFromErrnoPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyErr_SetFromErrnoWithFilenameObject( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyErr_SetFromErrnoWithFilenameObject( - arg0, - arg1, - ); - } - - late final _PyErr_SetFromErrnoWithFilenameObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyErr_SetFromErrnoWithFilenameObject'); - late final _PyErr_SetFromErrnoWithFilenameObject = - _PyErr_SetFromErrnoWithFilenameObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyErr_SetFromErrnoWithFilenameObjects( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyErr_SetFromErrnoWithFilenameObjects( - arg0, - arg1, - arg2, - ); - } - - late final _PyErr_SetFromErrnoWithFilenameObjectsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyErr_SetFromErrnoWithFilenameObjects'); - late final _PyErr_SetFromErrnoWithFilenameObjects = - _PyErr_SetFromErrnoWithFilenameObjectsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyErr_SetFromErrnoWithFilename( - ffi.Pointer exc, - ffi.Pointer filename, - ) { - return _PyErr_SetFromErrnoWithFilename( - exc, - filename, - ); - } - - late final _PyErr_SetFromErrnoWithFilenamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyErr_SetFromErrnoWithFilename'); - late final _PyErr_SetFromErrnoWithFilename = - _PyErr_SetFromErrnoWithFilenamePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyErr_Format( - ffi.Pointer exception, - ffi.Pointer format, - ) { - return _PyErr_Format( - exception, - format, - ); - } - - late final _PyErr_FormatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyErr_Format'); - late final _PyErr_Format = _PyErr_FormatPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyErr_FormatV( - ffi.Pointer exception, - ffi.Pointer format, - va_list vargs, - ) { - return _PyErr_FormatV( - exception, - format, - vargs, - ); - } - - late final _PyErr_FormatVPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, va_list)>>('PyErr_FormatV'); - late final _PyErr_FormatV = _PyErr_FormatVPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, va_list)>(); - - ffi.Pointer PyErr_SetImportErrorSubclass( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) { - return _PyErr_SetImportErrorSubclass( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final _PyErr_SetImportErrorSubclassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyErr_SetImportErrorSubclass'); - late final _PyErr_SetImportErrorSubclass = - _PyErr_SetImportErrorSubclassPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyErr_SetImportError( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyErr_SetImportError( - arg0, - arg1, - arg2, - ); - } - - late final _PyErr_SetImportErrorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyErr_SetImportError'); - late final _PyErr_SetImportError = _PyErr_SetImportErrorPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - void PyErr_BadInternalCall() { - return _PyErr_BadInternalCall1(); - } - - late final _PyErr_BadInternalCallPtr = - _lookup>('PyErr_BadInternalCall'); - late final _PyErr_BadInternalCall1 = - _PyErr_BadInternalCallPtr.asFunction(); - - void _PyErr_BadInternalCall( - ffi.Pointer filename, - int lineno, - ) { - return __PyErr_BadInternalCall( - filename, - lineno, - ); - } - - late final __PyErr_BadInternalCallPtr = _lookup< - ffi - .NativeFunction, ffi.Int)>>( - '_PyErr_BadInternalCall'); - late final __PyErr_BadInternalCall = __PyErr_BadInternalCallPtr - .asFunction, int)>(); - - ffi.Pointer PyErr_NewException( - ffi.Pointer name, - ffi.Pointer base, - ffi.Pointer dict, - ) { - return _PyErr_NewException( - name, - base, - dict, - ); - } - - late final _PyErr_NewExceptionPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyErr_NewException'); - late final _PyErr_NewException = _PyErr_NewExceptionPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyErr_NewExceptionWithDoc( - ffi.Pointer name, - ffi.Pointer doc, - ffi.Pointer base, - ffi.Pointer dict, - ) { - return _PyErr_NewExceptionWithDoc( - name, - doc, - base, - dict, - ); - } - - late final _PyErr_NewExceptionWithDocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyErr_NewExceptionWithDoc'); - late final _PyErr_NewExceptionWithDoc = - _PyErr_NewExceptionWithDocPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - void PyErr_WriteUnraisable( - ffi.Pointer arg0, - ) { - return _PyErr_WriteUnraisable( - arg0, - ); - } - - late final _PyErr_WriteUnraisablePtr = - _lookup)>>( - 'PyErr_WriteUnraisable'); - late final _PyErr_WriteUnraisable = _PyErr_WriteUnraisablePtr.asFunction< - void Function(ffi.Pointer)>(); - - int PyErr_CheckSignals() { - return _PyErr_CheckSignals1(); - } - - late final _PyErr_CheckSignalsPtr = - _lookup>('PyErr_CheckSignals'); - late final _PyErr_CheckSignals1 = - _PyErr_CheckSignalsPtr.asFunction(); - - void PyErr_SetInterrupt() { - return _PyErr_SetInterrupt(); - } - - late final _PyErr_SetInterruptPtr = - _lookup>('PyErr_SetInterrupt'); - late final _PyErr_SetInterrupt = - _PyErr_SetInterruptPtr.asFunction(); - - int PyErr_SetInterruptEx( - int signum, - ) { - return _PyErr_SetInterruptEx( - signum, - ); - } - - late final _PyErr_SetInterruptExPtr = - _lookup>( - 'PyErr_SetInterruptEx'); - late final _PyErr_SetInterruptEx = - _PyErr_SetInterruptExPtr.asFunction(); - - void PyErr_SyntaxLocation( - ffi.Pointer filename, - int lineno, - ) { - return _PyErr_SyntaxLocation( - filename, - lineno, - ); - } - - late final _PyErr_SyntaxLocationPtr = _lookup< - ffi - .NativeFunction, ffi.Int)>>( - 'PyErr_SyntaxLocation'); - late final _PyErr_SyntaxLocation = _PyErr_SyntaxLocationPtr.asFunction< - void Function(ffi.Pointer, int)>(); - - void PyErr_SyntaxLocationEx( - ffi.Pointer filename, - int lineno, - int col_offset, - ) { - return _PyErr_SyntaxLocationEx( - filename, - lineno, - col_offset, - ); - } - - late final _PyErr_SyntaxLocationExPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int, - ffi.Int)>>('PyErr_SyntaxLocationEx'); - late final _PyErr_SyntaxLocationEx = _PyErr_SyntaxLocationExPtr.asFunction< - void Function(ffi.Pointer, int, int)>(); - - ffi.Pointer PyErr_ProgramText( - ffi.Pointer filename, - int lineno, - ) { - return _PyErr_ProgramText( - filename, - lineno, - ); - } - - late final _PyErr_ProgramTextPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyErr_ProgramText'); - late final _PyErr_ProgramText = _PyErr_ProgramTextPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer PyUnicodeDecodeError_Create( - ffi.Pointer encoding, - ffi.Pointer object, - int length, - int start, - int end, - ffi.Pointer reason, - ) { - return _PyUnicodeDecodeError_Create( - encoding, - object, - length, - start, - end, - reason, - ); - } - - late final _PyUnicodeDecodeError_CreatePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - Py_ssize_t, - Py_ssize_t, - Py_ssize_t, - ffi.Pointer)>>('PyUnicodeDecodeError_Create'); - late final _PyUnicodeDecodeError_Create = - _PyUnicodeDecodeError_CreatePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int, int, ffi.Pointer)>(); - - ffi.Pointer PyUnicodeEncodeError_GetEncoding( - ffi.Pointer arg0, - ) { - return _PyUnicodeEncodeError_GetEncoding( - arg0, - ); - } - - late final _PyUnicodeEncodeError_GetEncodingPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicodeEncodeError_GetEncoding'); - late final _PyUnicodeEncodeError_GetEncoding = - _PyUnicodeEncodeError_GetEncodingPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicodeDecodeError_GetEncoding( - ffi.Pointer arg0, - ) { - return _PyUnicodeDecodeError_GetEncoding( - arg0, - ); - } - - late final _PyUnicodeDecodeError_GetEncodingPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicodeDecodeError_GetEncoding'); - late final _PyUnicodeDecodeError_GetEncoding = - _PyUnicodeDecodeError_GetEncodingPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicodeEncodeError_GetObject( - ffi.Pointer arg0, - ) { - return _PyUnicodeEncodeError_GetObject( - arg0, - ); - } - - late final _PyUnicodeEncodeError_GetObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicodeEncodeError_GetObject'); - late final _PyUnicodeEncodeError_GetObject = - _PyUnicodeEncodeError_GetObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicodeDecodeError_GetObject( - ffi.Pointer arg0, - ) { - return _PyUnicodeDecodeError_GetObject( - arg0, - ); - } - - late final _PyUnicodeDecodeError_GetObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicodeDecodeError_GetObject'); - late final _PyUnicodeDecodeError_GetObject = - _PyUnicodeDecodeError_GetObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicodeTranslateError_GetObject( - ffi.Pointer arg0, - ) { - return _PyUnicodeTranslateError_GetObject( - arg0, - ); - } - - late final _PyUnicodeTranslateError_GetObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicodeTranslateError_GetObject'); - late final _PyUnicodeTranslateError_GetObject = - _PyUnicodeTranslateError_GetObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyUnicodeEncodeError_GetStart( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyUnicodeEncodeError_GetStart( - arg0, - arg1, - ); - } - - late final _PyUnicodeEncodeError_GetStartPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicodeEncodeError_GetStart'); - late final _PyUnicodeEncodeError_GetStart = - _PyUnicodeEncodeError_GetStartPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicodeDecodeError_GetStart( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyUnicodeDecodeError_GetStart( - arg0, - arg1, - ); - } - - late final _PyUnicodeDecodeError_GetStartPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicodeDecodeError_GetStart'); - late final _PyUnicodeDecodeError_GetStart = - _PyUnicodeDecodeError_GetStartPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicodeTranslateError_GetStart( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyUnicodeTranslateError_GetStart( - arg0, - arg1, - ); - } - - late final _PyUnicodeTranslateError_GetStartPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicodeTranslateError_GetStart'); - late final _PyUnicodeTranslateError_GetStart = - _PyUnicodeTranslateError_GetStartPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicodeEncodeError_SetStart( - ffi.Pointer arg0, - int arg1, - ) { - return _PyUnicodeEncodeError_SetStart( - arg0, - arg1, - ); - } - - late final _PyUnicodeEncodeError_SetStartPtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - 'PyUnicodeEncodeError_SetStart'); - late final _PyUnicodeEncodeError_SetStart = _PyUnicodeEncodeError_SetStartPtr - .asFunction, int)>(); - - int PyUnicodeDecodeError_SetStart( - ffi.Pointer arg0, - int arg1, - ) { - return _PyUnicodeDecodeError_SetStart( - arg0, - arg1, - ); - } - - late final _PyUnicodeDecodeError_SetStartPtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - 'PyUnicodeDecodeError_SetStart'); - late final _PyUnicodeDecodeError_SetStart = _PyUnicodeDecodeError_SetStartPtr - .asFunction, int)>(); - - int PyUnicodeTranslateError_SetStart( - ffi.Pointer arg0, - int arg1, - ) { - return _PyUnicodeTranslateError_SetStart( - arg0, - arg1, - ); - } - - late final _PyUnicodeTranslateError_SetStartPtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - 'PyUnicodeTranslateError_SetStart'); - late final _PyUnicodeTranslateError_SetStart = - _PyUnicodeTranslateError_SetStartPtr.asFunction< - int Function(ffi.Pointer, int)>(); - - int PyUnicodeEncodeError_GetEnd( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyUnicodeEncodeError_GetEnd( - arg0, - arg1, - ); - } - - late final _PyUnicodeEncodeError_GetEndPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicodeEncodeError_GetEnd'); - late final _PyUnicodeEncodeError_GetEnd = - _PyUnicodeEncodeError_GetEndPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicodeDecodeError_GetEnd( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyUnicodeDecodeError_GetEnd( - arg0, - arg1, - ); - } - - late final _PyUnicodeDecodeError_GetEndPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicodeDecodeError_GetEnd'); - late final _PyUnicodeDecodeError_GetEnd = - _PyUnicodeDecodeError_GetEndPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicodeTranslateError_GetEnd( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyUnicodeTranslateError_GetEnd( - arg0, - arg1, - ); - } - - late final _PyUnicodeTranslateError_GetEndPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicodeTranslateError_GetEnd'); - late final _PyUnicodeTranslateError_GetEnd = - _PyUnicodeTranslateError_GetEndPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicodeEncodeError_SetEnd( - ffi.Pointer arg0, - int arg1, - ) { - return _PyUnicodeEncodeError_SetEnd( - arg0, - arg1, - ); - } - - late final _PyUnicodeEncodeError_SetEndPtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - 'PyUnicodeEncodeError_SetEnd'); - late final _PyUnicodeEncodeError_SetEnd = _PyUnicodeEncodeError_SetEndPtr - .asFunction, int)>(); - - int PyUnicodeDecodeError_SetEnd( - ffi.Pointer arg0, - int arg1, - ) { - return _PyUnicodeDecodeError_SetEnd( - arg0, - arg1, - ); - } - - late final _PyUnicodeDecodeError_SetEndPtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - 'PyUnicodeDecodeError_SetEnd'); - late final _PyUnicodeDecodeError_SetEnd = _PyUnicodeDecodeError_SetEndPtr - .asFunction, int)>(); - - int PyUnicodeTranslateError_SetEnd( - ffi.Pointer arg0, - int arg1, - ) { - return _PyUnicodeTranslateError_SetEnd( - arg0, - arg1, - ); - } - - late final _PyUnicodeTranslateError_SetEndPtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - 'PyUnicodeTranslateError_SetEnd'); - late final _PyUnicodeTranslateError_SetEnd = - _PyUnicodeTranslateError_SetEndPtr.asFunction< - int Function(ffi.Pointer, int)>(); - - ffi.Pointer PyUnicodeEncodeError_GetReason( - ffi.Pointer arg0, - ) { - return _PyUnicodeEncodeError_GetReason( - arg0, - ); - } - - late final _PyUnicodeEncodeError_GetReasonPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicodeEncodeError_GetReason'); - late final _PyUnicodeEncodeError_GetReason = - _PyUnicodeEncodeError_GetReasonPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicodeDecodeError_GetReason( - ffi.Pointer arg0, - ) { - return _PyUnicodeDecodeError_GetReason( - arg0, - ); - } - - late final _PyUnicodeDecodeError_GetReasonPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicodeDecodeError_GetReason'); - late final _PyUnicodeDecodeError_GetReason = - _PyUnicodeDecodeError_GetReasonPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyUnicodeTranslateError_GetReason( - ffi.Pointer arg0, - ) { - return _PyUnicodeTranslateError_GetReason( - arg0, - ); - } - - late final _PyUnicodeTranslateError_GetReasonPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyUnicodeTranslateError_GetReason'); - late final _PyUnicodeTranslateError_GetReason = - _PyUnicodeTranslateError_GetReasonPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyUnicodeEncodeError_SetReason( - ffi.Pointer exc, - ffi.Pointer reason, - ) { - return _PyUnicodeEncodeError_SetReason( - exc, - reason, - ); - } - - late final _PyUnicodeEncodeError_SetReasonPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicodeEncodeError_SetReason'); - late final _PyUnicodeEncodeError_SetReason = - _PyUnicodeEncodeError_SetReasonPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicodeDecodeError_SetReason( - ffi.Pointer exc, - ffi.Pointer reason, - ) { - return _PyUnicodeDecodeError_SetReason( - exc, - reason, - ); - } - - late final _PyUnicodeDecodeError_SetReasonPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicodeDecodeError_SetReason'); - late final _PyUnicodeDecodeError_SetReason = - _PyUnicodeDecodeError_SetReasonPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyUnicodeTranslateError_SetReason( - ffi.Pointer exc, - ffi.Pointer reason, - ) { - return _PyUnicodeTranslateError_SetReason( - exc, - reason, - ); - } - - late final _PyUnicodeTranslateError_SetReasonPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyUnicodeTranslateError_SetReason'); - late final _PyUnicodeTranslateError_SetReason = - _PyUnicodeTranslateError_SetReasonPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyOS_snprintf( - ffi.Pointer str, - int size, - ffi.Pointer format, - ) { - return _PyOS_snprintf( - str, - size, - format, - ); - } - - late final _PyOS_snprintfPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, - ffi.Pointer)>>('PyOS_snprintf'); - late final _PyOS_snprintf = _PyOS_snprintfPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); - - int PyOS_vsnprintf( - ffi.Pointer str, - int size, - ffi.Pointer format, - va_list va, - ) { - return _PyOS_vsnprintf( - str, - size, - format, - va, - ); - } - - late final _PyOS_vsnprintfPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, - ffi.Pointer, va_list)>>('PyOS_vsnprintf'); - late final _PyOS_vsnprintf = _PyOS_vsnprintfPtr.asFunction< - int Function( - ffi.Pointer, int, ffi.Pointer, va_list)>(); - - void _PyErr_SetKeyError( - ffi.Pointer arg0, - ) { - return __PyErr_SetKeyError( - arg0, - ); - } - - late final __PyErr_SetKeyErrorPtr = - _lookup)>>( - '_PyErr_SetKeyError'); - late final __PyErr_SetKeyError = - __PyErr_SetKeyErrorPtr.asFunction)>(); - - ffi.Pointer<_PyErr_StackItem> _PyErr_GetTopmostException( - ffi.Pointer tstate, - ) { - return __PyErr_GetTopmostException( - tstate, - ); - } - - late final __PyErr_GetTopmostExceptionPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer<_PyErr_StackItem> Function( - ffi.Pointer)>>('_PyErr_GetTopmostException'); - late final __PyErr_GetTopmostException = - __PyErr_GetTopmostExceptionPtr.asFunction< - ffi.Pointer<_PyErr_StackItem> Function(ffi.Pointer)>(); - - ffi.Pointer _PyErr_GetHandledException( - ffi.Pointer arg0, - ) { - return __PyErr_GetHandledException( - arg0, - ); - } - - late final __PyErr_GetHandledExceptionPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyErr_GetHandledException'); - late final __PyErr_GetHandledException = __PyErr_GetHandledExceptionPtr - .asFunction Function(ffi.Pointer)>(); - - void _PyErr_SetHandledException( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyErr_SetHandledException( - arg0, - arg1, - ); - } - - late final __PyErr_SetHandledExceptionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('_PyErr_SetHandledException'); - late final __PyErr_SetHandledException = - __PyErr_SetHandledExceptionPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - void _PyErr_GetExcInfo( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer> arg2, - ffi.Pointer> arg3, - ) { - return __PyErr_GetExcInfo( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final __PyErr_GetExcInfoPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>>('_PyErr_GetExcInfo'); - late final __PyErr_GetExcInfo = __PyErr_GetExcInfoPtr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>(); - - void _PyErr_ChainExceptions( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return __PyErr_ChainExceptions( - arg0, - arg1, - arg2, - ); - } - - late final __PyErr_ChainExceptionsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('_PyErr_ChainExceptions'); - late final __PyErr_ChainExceptions = __PyErr_ChainExceptionsPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _PyErr_ChainExceptions1( - ffi.Pointer arg0, - ) { - return __PyErr_ChainExceptions1( - arg0, - ); - } - - late final __PyErr_ChainExceptions1Ptr = - _lookup)>>( - '_PyErr_ChainExceptions1'); - late final __PyErr_ChainExceptions1 = __PyErr_ChainExceptions1Ptr - .asFunction)>(); - - ffi.Pointer _PyErr_FormatFromCause( - ffi.Pointer exception, - ffi.Pointer format, - ) { - return __PyErr_FormatFromCause( - exception, - format, - ); - } - - late final __PyErr_FormatFromCausePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyErr_FormatFromCause'); - late final __PyErr_FormatFromCause = __PyErr_FormatFromCausePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int _PyException_AddNote( - ffi.Pointer exc, - ffi.Pointer note, - ) { - return __PyException_AddNote( - exc, - note, - ); - } - - late final __PyException_AddNotePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyException_AddNote'); - late final __PyException_AddNote = __PyException_AddNotePtr - .asFunction, ffi.Pointer)>(); - - ffi.Pointer PyUnstable_Exc_PrepReraiseStar( - ffi.Pointer orig, - ffi.Pointer excs, - ) { - return _PyUnstable_Exc_PrepReraiseStar( - orig, - excs, - ); - } - - late final _PyUnstable_Exc_PrepReraiseStarPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyUnstable_Exc_PrepReraiseStar'); - late final _PyUnstable_Exc_PrepReraiseStar = - _PyUnstable_Exc_PrepReraiseStarPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PySignal_SetWakeupFd( - int fd, - ) { - return _PySignal_SetWakeupFd( - fd, - ); - } - - late final _PySignal_SetWakeupFdPtr = - _lookup>( - 'PySignal_SetWakeupFd'); - late final _PySignal_SetWakeupFd = - _PySignal_SetWakeupFdPtr.asFunction(); - - int _PyErr_CheckSignals() { - return __PyErr_CheckSignals(); - } - - late final __PyErr_CheckSignalsPtr = - _lookup>('_PyErr_CheckSignals'); - late final __PyErr_CheckSignals = - __PyErr_CheckSignalsPtr.asFunction(); - - void PyErr_SyntaxLocationObject( - ffi.Pointer filename, - int lineno, - int col_offset, - ) { - return _PyErr_SyntaxLocationObject( - filename, - lineno, - col_offset, - ); - } - - late final _PyErr_SyntaxLocationObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int, - ffi.Int)>>('PyErr_SyntaxLocationObject'); - late final _PyErr_SyntaxLocationObject = _PyErr_SyntaxLocationObjectPtr - .asFunction, int, int)>(); - - void PyErr_RangedSyntaxLocationObject( - ffi.Pointer filename, - int lineno, - int col_offset, - int end_lineno, - int end_col_offset, - ) { - return _PyErr_RangedSyntaxLocationObject( - filename, - lineno, - col_offset, - end_lineno, - end_col_offset, - ); - } - - late final _PyErr_RangedSyntaxLocationObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Int, ffi.Int, - ffi.Int)>>('PyErr_RangedSyntaxLocationObject'); - late final _PyErr_RangedSyntaxLocationObject = - _PyErr_RangedSyntaxLocationObjectPtr.asFunction< - void Function(ffi.Pointer, int, int, int, int)>(); - - ffi.Pointer PyErr_ProgramTextObject( - ffi.Pointer filename, - int lineno, - ) { - return _PyErr_ProgramTextObject( - filename, - lineno, - ); - } - - late final _PyErr_ProgramTextObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyErr_ProgramTextObject'); - late final _PyErr_ProgramTextObject = _PyErr_ProgramTextObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer _PyErr_ProgramDecodedTextObject( - ffi.Pointer filename, - int lineno, - ffi.Pointer encoding, - ) { - return __PyErr_ProgramDecodedTextObject( - filename, - lineno, - encoding, - ); - } - - late final __PyErr_ProgramDecodedTextObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Int, - ffi.Pointer)>>('_PyErr_ProgramDecodedTextObject'); - late final __PyErr_ProgramDecodedTextObject = - __PyErr_ProgramDecodedTextObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer _PyUnicodeTranslateError_Create( - ffi.Pointer object, - int start, - int end, - ffi.Pointer reason, - ) { - return __PyUnicodeTranslateError_Create( - object, - start, - end, - reason, - ); - } - - late final __PyUnicodeTranslateError_CreatePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - Py_ssize_t, - ffi.Pointer)>>('_PyUnicodeTranslateError_Create'); - late final __PyUnicodeTranslateError_Create = - __PyUnicodeTranslateError_CreatePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, int, ffi.Pointer)>(); - - void _PyErr_WriteUnraisableMsg( - ffi.Pointer err_msg, - ffi.Pointer obj, - ) { - return __PyErr_WriteUnraisableMsg( - err_msg, - obj, - ); - } - - late final __PyErr_WriteUnraisableMsgPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('_PyErr_WriteUnraisableMsg'); - late final __PyErr_WriteUnraisableMsg = - __PyErr_WriteUnraisableMsgPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - void _Py_FatalErrorFunc( - ffi.Pointer func, - ffi.Pointer message, - ) { - return __Py_FatalErrorFunc( - func, - message, - ); - } - - late final __Py_FatalErrorFuncPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('_Py_FatalErrorFunc'); - late final __Py_FatalErrorFunc = __Py_FatalErrorFuncPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - void _Py_FatalErrorFormat( - ffi.Pointer func, - ffi.Pointer format, - ) { - return __Py_FatalErrorFormat( - func, - format, - ); - } - - late final __Py_FatalErrorFormatPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('_Py_FatalErrorFormat'); - late final __Py_FatalErrorFormat = __Py_FatalErrorFormatPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyErr_SetImportErrorWithNameFrom( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) { - return __PyErr_SetImportErrorWithNameFrom( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final __PyErr_SetImportErrorWithNameFromPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_PyErr_SetImportErrorWithNameFrom'); - late final __PyErr_SetImportErrorWithNameFrom = - __PyErr_SetImportErrorWithNameFromPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyLong_FromLong( - int arg0, - ) { - return _PyLong_FromLong( - arg0, - ); - } - - late final _PyLong_FromLongPtr = - _lookup Function(ffi.Long)>>( - 'PyLong_FromLong'); - late final _PyLong_FromLong = - _PyLong_FromLongPtr.asFunction Function(int)>(); - - ffi.Pointer PyLong_FromUnsignedLong( - int arg0, - ) { - return _PyLong_FromUnsignedLong( - arg0, - ); - } - - late final _PyLong_FromUnsignedLongPtr = _lookup< - ffi.NativeFunction Function(ffi.UnsignedLong)>>( - 'PyLong_FromUnsignedLong'); - late final _PyLong_FromUnsignedLong = _PyLong_FromUnsignedLongPtr.asFunction< - ffi.Pointer Function(int)>(); - - ffi.Pointer PyLong_FromSize_t( - int arg0, - ) { - return _PyLong_FromSize_t( - arg0, - ); - } - - late final _PyLong_FromSize_tPtr = - _lookup Function(ffi.Size)>>( - 'PyLong_FromSize_t'); - late final _PyLong_FromSize_t = - _PyLong_FromSize_tPtr.asFunction Function(int)>(); - - ffi.Pointer PyLong_FromSsize_t( - int arg0, - ) { - return _PyLong_FromSsize_t( - arg0, - ); - } - - late final _PyLong_FromSsize_tPtr = - _lookup Function(Py_ssize_t)>>( - 'PyLong_FromSsize_t'); - late final _PyLong_FromSsize_t = - _PyLong_FromSsize_tPtr.asFunction Function(int)>(); - - ffi.Pointer PyLong_FromDouble( - double arg0, - ) { - return _PyLong_FromDouble( - arg0, - ); - } - - late final _PyLong_FromDoublePtr = - _lookup Function(ffi.Double)>>( - 'PyLong_FromDouble'); - late final _PyLong_FromDouble = _PyLong_FromDoublePtr.asFunction< - ffi.Pointer Function(double)>(); - - int PyLong_AsLong( - ffi.Pointer arg0, - ) { - return _PyLong_AsLong( - arg0, - ); - } - - late final _PyLong_AsLongPtr = - _lookup)>>( - 'PyLong_AsLong'); - late final _PyLong_AsLong = - _PyLong_AsLongPtr.asFunction)>(); - - int PyLong_AsLongAndOverflow( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyLong_AsLongAndOverflow( - arg0, - arg1, - ); - } - - late final _PyLong_AsLongAndOverflowPtr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>>('PyLong_AsLongAndOverflow'); - late final _PyLong_AsLongAndOverflow = _PyLong_AsLongAndOverflowPtr - .asFunction, ffi.Pointer)>(); - - int PyLong_AsSsize_t( - ffi.Pointer arg0, - ) { - return _PyLong_AsSsize_t( - arg0, - ); - } - - late final _PyLong_AsSsize_tPtr = - _lookup)>>( - 'PyLong_AsSsize_t'); - late final _PyLong_AsSsize_t = - _PyLong_AsSsize_tPtr.asFunction)>(); - - int PyLong_AsSize_t( - ffi.Pointer arg0, - ) { - return _PyLong_AsSize_t( - arg0, - ); - } - - late final _PyLong_AsSize_tPtr = - _lookup)>>( - 'PyLong_AsSize_t'); - late final _PyLong_AsSize_t = - _PyLong_AsSize_tPtr.asFunction)>(); - - int PyLong_AsUnsignedLong( - ffi.Pointer arg0, - ) { - return _PyLong_AsUnsignedLong( - arg0, - ); - } - - late final _PyLong_AsUnsignedLongPtr = _lookup< - ffi.NativeFunction)>>( - 'PyLong_AsUnsignedLong'); - late final _PyLong_AsUnsignedLong = _PyLong_AsUnsignedLongPtr.asFunction< - int Function(ffi.Pointer)>(); - - int PyLong_AsUnsignedLongMask( - ffi.Pointer arg0, - ) { - return _PyLong_AsUnsignedLongMask( - arg0, - ); - } - - late final _PyLong_AsUnsignedLongMaskPtr = _lookup< - ffi.NativeFunction)>>( - 'PyLong_AsUnsignedLongMask'); - late final _PyLong_AsUnsignedLongMask = _PyLong_AsUnsignedLongMaskPtr - .asFunction)>(); - - ffi.Pointer PyLong_GetInfo() { - return _PyLong_GetInfo(); - } - - late final _PyLong_GetInfoPtr = - _lookup Function()>>( - 'PyLong_GetInfo'); - late final _PyLong_GetInfo = - _PyLong_GetInfoPtr.asFunction Function()>(); - - double PyLong_AsDouble( - ffi.Pointer arg0, - ) { - return _PyLong_AsDouble( - arg0, - ); - } - - late final _PyLong_AsDoublePtr = - _lookup)>>( - 'PyLong_AsDouble'); - late final _PyLong_AsDouble = - _PyLong_AsDoublePtr.asFunction)>(); - - ffi.Pointer PyLong_FromVoidPtr( - ffi.Pointer arg0, - ) { - return _PyLong_FromVoidPtr( - arg0, - ); - } - - late final _PyLong_FromVoidPtrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyLong_FromVoidPtr'); - late final _PyLong_FromVoidPtr = _PyLong_FromVoidPtrPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyLong_AsVoidPtr( - ffi.Pointer arg0, - ) { - return _PyLong_AsVoidPtr( - arg0, - ); - } - - late final _PyLong_AsVoidPtrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyLong_AsVoidPtr'); - late final _PyLong_AsVoidPtr = _PyLong_AsVoidPtrPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyLong_FromLongLong( - int arg0, - ) { - return _PyLong_FromLongLong( - arg0, - ); - } - - late final _PyLong_FromLongLongPtr = - _lookup Function(ffi.LongLong)>>( - 'PyLong_FromLongLong'); - late final _PyLong_FromLongLong = - _PyLong_FromLongLongPtr.asFunction Function(int)>(); - - ffi.Pointer PyLong_FromUnsignedLongLong( - int arg0, - ) { - return _PyLong_FromUnsignedLongLong( - arg0, - ); - } - - late final _PyLong_FromUnsignedLongLongPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.UnsignedLongLong)>>('PyLong_FromUnsignedLongLong'); - late final _PyLong_FromUnsignedLongLong = _PyLong_FromUnsignedLongLongPtr - .asFunction Function(int)>(); - - int PyLong_AsLongLong( - ffi.Pointer arg0, - ) { - return _PyLong_AsLongLong( - arg0, - ); - } - - late final _PyLong_AsLongLongPtr = - _lookup)>>( - 'PyLong_AsLongLong'); - late final _PyLong_AsLongLong = - _PyLong_AsLongLongPtr.asFunction)>(); - - int PyLong_AsUnsignedLongLong( - ffi.Pointer arg0, - ) { - return _PyLong_AsUnsignedLongLong( - arg0, - ); - } - - late final _PyLong_AsUnsignedLongLongPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function( - ffi.Pointer)>>('PyLong_AsUnsignedLongLong'); - late final _PyLong_AsUnsignedLongLong = _PyLong_AsUnsignedLongLongPtr - .asFunction)>(); - - int PyLong_AsUnsignedLongLongMask( - ffi.Pointer arg0, - ) { - return _PyLong_AsUnsignedLongLongMask( - arg0, - ); - } - - late final _PyLong_AsUnsignedLongLongMaskPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function( - ffi.Pointer)>>('PyLong_AsUnsignedLongLongMask'); - late final _PyLong_AsUnsignedLongLongMask = _PyLong_AsUnsignedLongLongMaskPtr - .asFunction)>(); - - int PyLong_AsLongLongAndOverflow( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyLong_AsLongLongAndOverflow( - arg0, - arg1, - ); - } - - late final _PyLong_AsLongLongAndOverflowPtr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function(ffi.Pointer, - ffi.Pointer)>>('PyLong_AsLongLongAndOverflow'); - late final _PyLong_AsLongLongAndOverflow = _PyLong_AsLongLongAndOverflowPtr - .asFunction, ffi.Pointer)>(); - - ffi.Pointer PyLong_FromString( - ffi.Pointer arg0, - ffi.Pointer> arg1, - int arg2, - ) { - return _PyLong_FromString( - arg0, - arg1, - arg2, - ); - } - - late final _PyLong_FromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int)>>('PyLong_FromString'); - late final _PyLong_FromString = _PyLong_FromStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int PyOS_strtoul( - ffi.Pointer arg0, - ffi.Pointer> arg1, - int arg2, - ) { - return _PyOS_strtoul( - arg0, - arg1, - arg2, - ); - } - - late final _PyOS_strtoulPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('PyOS_strtoul'); - late final _PyOS_strtoul = _PyOS_strtoulPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int PyOS_strtol( - ffi.Pointer arg0, - ffi.Pointer> arg1, - int arg2, - ) { - return _PyOS_strtol( - arg0, - arg1, - arg2, - ); - } - - late final _PyOS_strtolPtr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('PyOS_strtol'); - late final _PyOS_strtol = _PyOS_strtolPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int _PyLong_AsInt( - ffi.Pointer arg0, - ) { - return __PyLong_AsInt( - arg0, - ); - } - - late final __PyLong_AsIntPtr = - _lookup)>>( - '_PyLong_AsInt'); - late final __PyLong_AsInt = - __PyLong_AsIntPtr.asFunction)>(); - - int _PyLong_UnsignedShort_Converter( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyLong_UnsignedShort_Converter( - arg0, - arg1, - ); - } - - late final __PyLong_UnsignedShort_ConverterPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyLong_UnsignedShort_Converter'); - late final __PyLong_UnsignedShort_Converter = - __PyLong_UnsignedShort_ConverterPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _PyLong_UnsignedInt_Converter( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyLong_UnsignedInt_Converter( - arg0, - arg1, - ); - } - - late final __PyLong_UnsignedInt_ConverterPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyLong_UnsignedInt_Converter'); - late final __PyLong_UnsignedInt_Converter = __PyLong_UnsignedInt_ConverterPtr - .asFunction, ffi.Pointer)>(); - - int _PyLong_UnsignedLong_Converter( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyLong_UnsignedLong_Converter( - arg0, - arg1, - ); - } - - late final __PyLong_UnsignedLong_ConverterPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyLong_UnsignedLong_Converter'); - late final __PyLong_UnsignedLong_Converter = - __PyLong_UnsignedLong_ConverterPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _PyLong_UnsignedLongLong_Converter( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyLong_UnsignedLongLong_Converter( - arg0, - arg1, - ); - } - - late final __PyLong_UnsignedLongLong_ConverterPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyLong_UnsignedLongLong_Converter'); - late final __PyLong_UnsignedLongLong_Converter = - __PyLong_UnsignedLongLong_ConverterPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _PyLong_Size_t_Converter( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyLong_Size_t_Converter( - arg0, - arg1, - ); - } - - late final __PyLong_Size_t_ConverterPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyLong_Size_t_Converter'); - late final __PyLong_Size_t_Converter = __PyLong_Size_t_ConverterPtr - .asFunction, ffi.Pointer)>(); - - double _PyLong_Frexp( - ffi.Pointer a, - ffi.Pointer e, - ) { - return __PyLong_Frexp( - a, - e, - ); - } - - late final __PyLong_FrexpPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer)>>('_PyLong_Frexp'); - late final __PyLong_Frexp = __PyLong_FrexpPtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyLong_FromUnicodeObject( - ffi.Pointer u, - int base, - ) { - return _PyLong_FromUnicodeObject( - u, - base, - ); - } - - late final _PyLong_FromUnicodeObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyLong_FromUnicodeObject'); - late final _PyLong_FromUnicodeObject = _PyLong_FromUnicodeObjectPtr - .asFunction Function(ffi.Pointer, int)>(); - - ffi.Pointer _PyLong_FromBytes( - ffi.Pointer arg0, - int arg1, - int arg2, - ) { - return __PyLong_FromBytes( - arg0, - arg1, - arg2, - ); - } - - late final __PyLong_FromBytesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Int)>>('_PyLong_FromBytes'); - late final __PyLong_FromBytes = __PyLong_FromBytesPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - int _PyLong_Sign( - ffi.Pointer v, - ) { - return __PyLong_Sign( - v, - ); - } - - late final __PyLong_SignPtr = - _lookup)>>( - '_PyLong_Sign'); - late final __PyLong_Sign = - __PyLong_SignPtr.asFunction)>(); - - int _PyLong_NumBits( - ffi.Pointer v, - ) { - return __PyLong_NumBits( - v, - ); - } - - late final __PyLong_NumBitsPtr = - _lookup)>>( - '_PyLong_NumBits'); - late final __PyLong_NumBits = - __PyLong_NumBitsPtr.asFunction)>(); - - ffi.Pointer _PyLong_DivmodNear( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyLong_DivmodNear( - arg0, - arg1, - ); - } - - late final __PyLong_DivmodNearPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyLong_DivmodNear'); - late final __PyLong_DivmodNear = __PyLong_DivmodNearPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyLong_FromByteArray( - ffi.Pointer bytes, - int n, - int little_endian, - int is_signed, - ) { - return __PyLong_FromByteArray( - bytes, - n, - little_endian, - is_signed, - ); - } - - late final __PyLong_FromByteArrayPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Size, ffi.Int, ffi.Int)>>('_PyLong_FromByteArray'); - late final __PyLong_FromByteArray = __PyLong_FromByteArrayPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, int, int)>(); - - int _PyLong_AsByteArray( - ffi.Pointer v, - ffi.Pointer bytes, - int n, - int little_endian, - int is_signed, - ) { - return __PyLong_AsByteArray( - v, - bytes, - n, - little_endian, - is_signed, - ); - } - - late final __PyLong_AsByteArrayPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Int, - ffi.Int)>>('_PyLong_AsByteArray'); - late final __PyLong_AsByteArray = __PyLong_AsByteArrayPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - int, int, int)>(); - - ffi.Pointer _PyLong_Format( - ffi.Pointer obj, - int base, - ) { - return __PyLong_Format( - obj, - base, - ); - } - - late final __PyLong_FormatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('_PyLong_Format'); - late final __PyLong_Format = __PyLong_FormatPtr - .asFunction Function(ffi.Pointer, int)>(); - - ffi.Pointer _PyLong_GCD( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyLong_GCD( - arg0, - arg1, - ); - } - - late final __PyLong_GCDPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('_PyLong_GCD'); - late final __PyLong_GCD = __PyLong_GCDPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyLong_Rshift( - ffi.Pointer arg0, - int arg1, - ) { - return __PyLong_Rshift( - arg0, - arg1, - ); - } - - late final __PyLong_RshiftPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('_PyLong_Rshift'); - late final __PyLong_Rshift = __PyLong_RshiftPtr - .asFunction Function(ffi.Pointer, int)>(); - - ffi.Pointer _PyLong_Lshift( - ffi.Pointer arg0, - int arg1, - ) { - return __PyLong_Lshift( - arg0, - arg1, - ); - } - - late final __PyLong_LshiftPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('_PyLong_Lshift'); - late final __PyLong_Lshift = __PyLong_LshiftPtr - .asFunction Function(ffi.Pointer, int)>(); - - int PyUnstable_Long_IsCompact( - ffi.Pointer op, - ) { - return _PyUnstable_Long_IsCompact( - op, - ); - } - - late final _PyUnstable_Long_IsCompactPtr = - _lookup)>>( - 'PyUnstable_Long_IsCompact'); - late final _PyUnstable_Long_IsCompact = _PyUnstable_Long_IsCompactPtr - .asFunction)>(); - - int PyUnstable_Long_CompactValue( - ffi.Pointer op, - ) { - return _PyUnstable_Long_CompactValue( - op, - ); - } - - late final _PyUnstable_Long_CompactValuePtr = _lookup< - ffi.NativeFunction)>>( - 'PyUnstable_Long_CompactValue'); - late final _PyUnstable_Long_CompactValue = _PyUnstable_Long_CompactValuePtr - .asFunction)>(); - - ffi.Pointer _PyLong_New( - int arg0, - ) { - return __PyLong_New( - arg0, - ); - } - - late final __PyLong_NewPtr = _lookup< - ffi.NativeFunction Function(Py_ssize_t)>>( - '_PyLong_New'); - late final __PyLong_New = - __PyLong_NewPtr.asFunction Function(int)>(); - - ffi.Pointer _PyLong_Copy( - ffi.Pointer src, - ) { - return __PyLong_Copy( - src, - ); - } - - late final __PyLong_CopyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyLong_Copy'); - late final __PyLong_Copy = __PyLong_CopyPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _PyLong_FromDigits( - int negative, - int digit_count, - ffi.Pointer digits, - ) { - return __PyLong_FromDigits( - negative, - digit_count, - digits, - ); - } - - late final __PyLong_FromDigitsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int, Py_ssize_t, ffi.Pointer)>>('_PyLong_FromDigits'); - late final __PyLong_FromDigits = __PyLong_FromDigitsPtr.asFunction< - ffi.Pointer Function(int, int, ffi.Pointer)>(); - - late final ffi.Pointer __Py_FalseStruct = - _lookup('_Py_FalseStruct'); - - PyLongObject get _Py_FalseStruct => __Py_FalseStruct.ref; - - late final ffi.Pointer __Py_TrueStruct = - _lookup('_Py_TrueStruct'); - - PyLongObject get _Py_TrueStruct => __Py_TrueStruct.ref; - - int Py_IsTrue( - ffi.Pointer x, - ) { - return _Py_IsTrue( - x, - ); - } - - late final _Py_IsTruePtr = - _lookup)>>( - 'Py_IsTrue'); - late final _Py_IsTrue = - _Py_IsTruePtr.asFunction)>(); - - int Py_IsFalse( - ffi.Pointer x, - ) { - return _Py_IsFalse( - x, - ); - } - - late final _Py_IsFalsePtr = - _lookup)>>( - 'Py_IsFalse'); - late final _Py_IsFalse = - _Py_IsFalsePtr.asFunction)>(); - - ffi.Pointer PyBool_FromLong( - int arg0, - ) { - return _PyBool_FromLong( - arg0, - ); - } - - late final _PyBool_FromLongPtr = - _lookup Function(ffi.Long)>>( - 'PyBool_FromLong'); - late final _PyBool_FromLong = - _PyBool_FromLongPtr.asFunction Function(int)>(); - - late final ffi.Pointer _PyFloat_Type = - _lookup('PyFloat_Type'); - - PyTypeObject get PyFloat_Type => _PyFloat_Type.ref; - - double PyFloat_GetMax() { - return _PyFloat_GetMax(); - } - - late final _PyFloat_GetMaxPtr = - _lookup>('PyFloat_GetMax'); - late final _PyFloat_GetMax = - _PyFloat_GetMaxPtr.asFunction(); - - double PyFloat_GetMin() { - return _PyFloat_GetMin(); - } - - late final _PyFloat_GetMinPtr = - _lookup>('PyFloat_GetMin'); - late final _PyFloat_GetMin = - _PyFloat_GetMinPtr.asFunction(); - - ffi.Pointer PyFloat_GetInfo() { - return _PyFloat_GetInfo(); - } - - late final _PyFloat_GetInfoPtr = - _lookup Function()>>( - 'PyFloat_GetInfo'); - late final _PyFloat_GetInfo = - _PyFloat_GetInfoPtr.asFunction Function()>(); - - ffi.Pointer PyFloat_FromString( - ffi.Pointer arg0, - ) { - return _PyFloat_FromString( - arg0, - ); - } - - late final _PyFloat_FromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFloat_FromString'); - late final _PyFloat_FromString = _PyFloat_FromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyFloat_FromDouble( - double arg0, - ) { - return _PyFloat_FromDouble( - arg0, - ); - } - - late final _PyFloat_FromDoublePtr = - _lookup Function(ffi.Double)>>( - 'PyFloat_FromDouble'); - late final _PyFloat_FromDouble = _PyFloat_FromDoublePtr.asFunction< - ffi.Pointer Function(double)>(); - - double PyFloat_AsDouble( - ffi.Pointer arg0, - ) { - return _PyFloat_AsDouble( - arg0, - ); - } - - late final _PyFloat_AsDoublePtr = - _lookup)>>( - 'PyFloat_AsDouble'); - late final _PyFloat_AsDouble = - _PyFloat_AsDoublePtr.asFunction)>(); - - int PyFloat_Pack2( - double x, - ffi.Pointer p, - int le, - ) { - return _PyFloat_Pack2( - x, - p, - le, - ); - } - - late final _PyFloat_Pack2Ptr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Double, ffi.Pointer, ffi.Int)>>('PyFloat_Pack2'); - late final _PyFloat_Pack2 = _PyFloat_Pack2Ptr.asFunction< - int Function(double, ffi.Pointer, int)>(); - - int PyFloat_Pack4( - double x, - ffi.Pointer p, - int le, - ) { - return _PyFloat_Pack4( - x, - p, - le, - ); - } - - late final _PyFloat_Pack4Ptr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Double, ffi.Pointer, ffi.Int)>>('PyFloat_Pack4'); - late final _PyFloat_Pack4 = _PyFloat_Pack4Ptr.asFunction< - int Function(double, ffi.Pointer, int)>(); - - int PyFloat_Pack8( - double x, - ffi.Pointer p, - int le, - ) { - return _PyFloat_Pack8( - x, - p, - le, - ); - } - - late final _PyFloat_Pack8Ptr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Double, ffi.Pointer, ffi.Int)>>('PyFloat_Pack8'); - late final _PyFloat_Pack8 = _PyFloat_Pack8Ptr.asFunction< - int Function(double, ffi.Pointer, int)>(); - - double PyFloat_Unpack2( - ffi.Pointer p, - int le, - ) { - return _PyFloat_Unpack2( - p, - le, - ); - } - - late final _PyFloat_Unpack2Ptr = _lookup< - ffi - .NativeFunction, ffi.Int)>>( - 'PyFloat_Unpack2'); - late final _PyFloat_Unpack2 = _PyFloat_Unpack2Ptr.asFunction< - double Function(ffi.Pointer, int)>(); - - double PyFloat_Unpack4( - ffi.Pointer p, - int le, - ) { - return _PyFloat_Unpack4( - p, - le, - ); - } - - late final _PyFloat_Unpack4Ptr = _lookup< - ffi - .NativeFunction, ffi.Int)>>( - 'PyFloat_Unpack4'); - late final _PyFloat_Unpack4 = _PyFloat_Unpack4Ptr.asFunction< - double Function(ffi.Pointer, int)>(); - - double PyFloat_Unpack8( - ffi.Pointer p, - int le, - ) { - return _PyFloat_Unpack8( - p, - le, - ); - } - - late final _PyFloat_Unpack8Ptr = _lookup< - ffi - .NativeFunction, ffi.Int)>>( - 'PyFloat_Unpack8'); - late final _PyFloat_Unpack8 = _PyFloat_Unpack8Ptr.asFunction< - double Function(ffi.Pointer, int)>(); - - late final ffi.Pointer _PyComplex_Type = - _lookup('PyComplex_Type'); - - PyTypeObject get PyComplex_Type => _PyComplex_Type.ref; - - ffi.Pointer PyComplex_FromDoubles( - double real, - double imag, - ) { - return _PyComplex_FromDoubles( - real, - imag, - ); - } - - late final _PyComplex_FromDoublesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Double, ffi.Double)>>('PyComplex_FromDoubles'); - late final _PyComplex_FromDoubles = _PyComplex_FromDoublesPtr.asFunction< - ffi.Pointer Function(double, double)>(); - - double PyComplex_RealAsDouble( - ffi.Pointer op, - ) { - return _PyComplex_RealAsDouble( - op, - ); - } - - late final _PyComplex_RealAsDoublePtr = - _lookup)>>( - 'PyComplex_RealAsDouble'); - late final _PyComplex_RealAsDouble = _PyComplex_RealAsDoublePtr.asFunction< - double Function(ffi.Pointer)>(); - - double PyComplex_ImagAsDouble( - ffi.Pointer op, - ) { - return _PyComplex_ImagAsDouble( - op, - ); - } - - late final _PyComplex_ImagAsDoublePtr = - _lookup)>>( - 'PyComplex_ImagAsDouble'); - late final _PyComplex_ImagAsDouble = _PyComplex_ImagAsDoublePtr.asFunction< - double Function(ffi.Pointer)>(); - - Py_complex _Py_c_sum( - Py_complex arg0, - Py_complex arg1, - ) { - return __Py_c_sum( - arg0, - arg1, - ); - } - - late final __Py_c_sumPtr = - _lookup>( - '_Py_c_sum'); - late final __Py_c_sum = - __Py_c_sumPtr.asFunction(); - - Py_complex _Py_c_diff( - Py_complex arg0, - Py_complex arg1, - ) { - return __Py_c_diff( - arg0, - arg1, - ); - } - - late final __Py_c_diffPtr = - _lookup>( - '_Py_c_diff'); - late final __Py_c_diff = - __Py_c_diffPtr.asFunction(); - - Py_complex _Py_c_neg( - Py_complex arg0, - ) { - return __Py_c_neg( - arg0, - ); - } - - late final __Py_c_negPtr = - _lookup>('_Py_c_neg'); - late final __Py_c_neg = - __Py_c_negPtr.asFunction(); - - Py_complex _Py_c_prod( - Py_complex arg0, - Py_complex arg1, - ) { - return __Py_c_prod( - arg0, - arg1, - ); - } - - late final __Py_c_prodPtr = - _lookup>( - '_Py_c_prod'); - late final __Py_c_prod = - __Py_c_prodPtr.asFunction(); - - Py_complex _Py_c_quot( - Py_complex arg0, - Py_complex arg1, - ) { - return __Py_c_quot( - arg0, - arg1, - ); - } - - late final __Py_c_quotPtr = - _lookup>( - '_Py_c_quot'); - late final __Py_c_quot = - __Py_c_quotPtr.asFunction(); - - Py_complex _Py_c_pow( - Py_complex arg0, - Py_complex arg1, - ) { - return __Py_c_pow( - arg0, - arg1, - ); - } - - late final __Py_c_powPtr = - _lookup>( - '_Py_c_pow'); - late final __Py_c_pow = - __Py_c_powPtr.asFunction(); - - double _Py_c_abs( - Py_complex arg0, - ) { - return __Py_c_abs( - arg0, - ); - } - - late final __Py_c_absPtr = - _lookup>('_Py_c_abs'); - late final __Py_c_abs = - __Py_c_absPtr.asFunction(); - - ffi.Pointer PyComplex_FromCComplex( - Py_complex arg0, - ) { - return _PyComplex_FromCComplex( - arg0, - ); - } - - late final _PyComplex_FromCComplexPtr = - _lookup Function(Py_complex)>>( - 'PyComplex_FromCComplex'); - late final _PyComplex_FromCComplex = _PyComplex_FromCComplexPtr.asFunction< - ffi.Pointer Function(Py_complex)>(); - - Py_complex PyComplex_AsCComplex( - ffi.Pointer op, - ) { - return _PyComplex_AsCComplex( - op, - ); - } - - late final _PyComplex_AsCComplexPtr = - _lookup)>>( - 'PyComplex_AsCComplex'); - late final _PyComplex_AsCComplex = _PyComplex_AsCComplexPtr.asFunction< - Py_complex Function(ffi.Pointer)>(); - - late final ffi.Pointer _PyRange_Type = - _lookup('PyRange_Type'); - - PyTypeObject get PyRange_Type => _PyRange_Type.ref; - - late final ffi.Pointer _PyRangeIter_Type = - _lookup('PyRangeIter_Type'); - - PyTypeObject get PyRangeIter_Type => _PyRangeIter_Type.ref; - - late final ffi.Pointer _PyLongRangeIter_Type = - _lookup('PyLongRangeIter_Type'); - - PyTypeObject get PyLongRangeIter_Type => _PyLongRangeIter_Type.ref; - - late final ffi.Pointer _PyMemoryView_Type = - _lookup('PyMemoryView_Type'); - - PyTypeObject get PyMemoryView_Type => _PyMemoryView_Type.ref; - - ffi.Pointer PyMemoryView_FromObject( - ffi.Pointer base, - ) { - return _PyMemoryView_FromObject( - base, - ); - } - - late final _PyMemoryView_FromObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyMemoryView_FromObject'); - late final _PyMemoryView_FromObject = _PyMemoryView_FromObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyMemoryView_FromMemory( - ffi.Pointer mem, - int size, - int flags, - ) { - return _PyMemoryView_FromMemory( - mem, - size, - flags, - ); - } - - late final _PyMemoryView_FromMemoryPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - ffi.Int)>>('PyMemoryView_FromMemory'); - late final _PyMemoryView_FromMemory = _PyMemoryView_FromMemoryPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - ffi.Pointer PyMemoryView_FromBuffer( - ffi.Pointer info, - ) { - return _PyMemoryView_FromBuffer( - info, - ); - } - - late final _PyMemoryView_FromBufferPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyMemoryView_FromBuffer'); - late final _PyMemoryView_FromBuffer = _PyMemoryView_FromBufferPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyMemoryView_GetContiguous( - ffi.Pointer base, - int buffertype, - int order, - ) { - return _PyMemoryView_GetContiguous( - base, - buffertype, - order, - ); - } - - late final _PyMemoryView_GetContiguousPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Int, - ffi.Char)>>('PyMemoryView_GetContiguous'); - late final _PyMemoryView_GetContiguous = - _PyMemoryView_GetContiguousPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - late final ffi.Pointer __PyManagedBuffer_Type = - _lookup('_PyManagedBuffer_Type'); - - PyTypeObject get _PyManagedBuffer_Type => __PyManagedBuffer_Type.ref; - - late final ffi.Pointer _PyTuple_Type = - _lookup('PyTuple_Type'); - - PyTypeObject get PyTuple_Type => _PyTuple_Type.ref; - - late final ffi.Pointer _PyTupleIter_Type = - _lookup('PyTupleIter_Type'); - - PyTypeObject get PyTupleIter_Type => _PyTupleIter_Type.ref; - - ffi.Pointer PyTuple_New( - int size, - ) { - return _PyTuple_New( - size, - ); - } - - late final _PyTuple_NewPtr = - _lookup Function(Py_ssize_t)>>( - 'PyTuple_New'); - late final _PyTuple_New = - _PyTuple_NewPtr.asFunction Function(int)>(); - - int PyTuple_Size( - ffi.Pointer arg0, - ) { - return _PyTuple_Size( - arg0, - ); - } - - late final _PyTuple_SizePtr = - _lookup)>>( - 'PyTuple_Size'); - late final _PyTuple_Size = - _PyTuple_SizePtr.asFunction)>(); - - ffi.Pointer PyTuple_GetItem( - ffi.Pointer arg0, - int arg1, - ) { - return _PyTuple_GetItem( - arg0, - arg1, - ); - } - - late final _PyTuple_GetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('PyTuple_GetItem'); - late final _PyTuple_GetItem = _PyTuple_GetItemPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - int PyTuple_SetItem( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ) { - return _PyTuple_SetItem( - arg0, - arg1, - arg2, - ); - } - - late final _PyTuple_SetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyTuple_SetItem'); - late final _PyTuple_SetItem = _PyTuple_SetItemPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer PyTuple_GetSlice( - ffi.Pointer arg0, - int arg1, - int arg2, - ) { - return _PyTuple_GetSlice( - arg0, - arg1, - arg2, - ); - } - - late final _PyTuple_GetSlicePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - Py_ssize_t)>>('PyTuple_GetSlice'); - late final _PyTuple_GetSlice = _PyTuple_GetSlicePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - ffi.Pointer PyTuple_Pack( - int arg0, - ) { - return _PyTuple_Pack( - arg0, - ); - } - - late final _PyTuple_PackPtr = - _lookup Function(Py_ssize_t)>>( - 'PyTuple_Pack'); - late final _PyTuple_Pack = - _PyTuple_PackPtr.asFunction Function(int)>(); - - int _PyTuple_Resize( - ffi.Pointer> arg0, - int arg1, - ) { - return __PyTuple_Resize( - arg0, - arg1, - ); - } - - late final __PyTuple_ResizePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - Py_ssize_t)>>('_PyTuple_Resize'); - late final __PyTuple_Resize = __PyTuple_ResizePtr - .asFunction>, int)>(); - - void _PyTuple_MaybeUntrack( - ffi.Pointer arg0, - ) { - return __PyTuple_MaybeUntrack( - arg0, - ); - } - - late final __PyTuple_MaybeUntrackPtr = - _lookup)>>( - '_PyTuple_MaybeUntrack'); - late final __PyTuple_MaybeUntrack = __PyTuple_MaybeUntrackPtr - .asFunction)>(); - - void _PyTuple_DebugMallocStats( - ffi.Pointer out, - ) { - return __PyTuple_DebugMallocStats( - out, - ); - } - - late final __PyTuple_DebugMallocStatsPtr = - _lookup)>>( - '_PyTuple_DebugMallocStats'); - late final __PyTuple_DebugMallocStats = __PyTuple_DebugMallocStatsPtr - .asFunction)>(); - - late final ffi.Pointer _PyList_Type = - _lookup('PyList_Type'); - - PyTypeObject get PyList_Type => _PyList_Type.ref; - - late final ffi.Pointer _PyListIter_Type = - _lookup('PyListIter_Type'); - - PyTypeObject get PyListIter_Type => _PyListIter_Type.ref; - - late final ffi.Pointer _PyListRevIter_Type = - _lookup('PyListRevIter_Type'); - - PyTypeObject get PyListRevIter_Type => _PyListRevIter_Type.ref; - - ffi.Pointer PyList_New( - int size, - ) { - return _PyList_New( - size, - ); - } - - late final _PyList_NewPtr = - _lookup Function(Py_ssize_t)>>( - 'PyList_New'); - late final _PyList_New = - _PyList_NewPtr.asFunction Function(int)>(); - - int PyList_Size( - ffi.Pointer arg0, - ) { - return _PyList_Size( - arg0, - ); - } - - late final _PyList_SizePtr = - _lookup)>>( - 'PyList_Size'); - late final _PyList_Size = - _PyList_SizePtr.asFunction)>(); - - ffi.Pointer PyList_GetItem( - ffi.Pointer arg0, - int arg1, - ) { - return _PyList_GetItem( - arg0, - arg1, - ); - } - - late final _PyList_GetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('PyList_GetItem'); - late final _PyList_GetItem = _PyList_GetItemPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - int PyList_SetItem( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ) { - return _PyList_SetItem( - arg0, - arg1, - arg2, - ); - } - - late final _PyList_SetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyList_SetItem'); - late final _PyList_SetItem = _PyList_SetItemPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); - - int PyList_Insert( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ) { - return _PyList_Insert( - arg0, - arg1, - arg2, - ); - } - - late final _PyList_InsertPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyList_Insert'); - late final _PyList_Insert = _PyList_InsertPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); - - int PyList_Append( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyList_Append( - arg0, - arg1, - ); - } - - late final _PyList_AppendPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PyList_Append'); - late final _PyList_Append = _PyList_AppendPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyList_GetSlice( - ffi.Pointer arg0, - int arg1, - int arg2, - ) { - return _PyList_GetSlice( - arg0, - arg1, - arg2, - ); - } - - late final _PyList_GetSlicePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - Py_ssize_t)>>('PyList_GetSlice'); - late final _PyList_GetSlice = _PyList_GetSlicePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - int PyList_SetSlice( - ffi.Pointer arg0, - int arg1, - int arg2, - ffi.Pointer arg3, - ) { - return _PyList_SetSlice( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final _PyList_SetSlicePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, Py_ssize_t, - ffi.Pointer)>>('PyList_SetSlice'); - late final _PyList_SetSlice = _PyList_SetSlicePtr.asFunction< - int Function(ffi.Pointer, int, int, ffi.Pointer)>(); - - int PyList_Sort( - ffi.Pointer arg0, - ) { - return _PyList_Sort( - arg0, - ); - } - - late final _PyList_SortPtr = - _lookup)>>( - 'PyList_Sort'); - late final _PyList_Sort = - _PyList_SortPtr.asFunction)>(); - - int PyList_Reverse( - ffi.Pointer arg0, - ) { - return _PyList_Reverse( - arg0, - ); - } - - late final _PyList_ReversePtr = - _lookup)>>( - 'PyList_Reverse'); - late final _PyList_Reverse = - _PyList_ReversePtr.asFunction)>(); - - ffi.Pointer PyList_AsTuple( - ffi.Pointer arg0, - ) { - return _PyList_AsTuple( - arg0, - ); - } - - late final _PyList_AsTuplePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyList_AsTuple'); - late final _PyList_AsTuple = _PyList_AsTuplePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer _PyList_Extend( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyList_Extend( - arg0, - arg1, - ); - } - - late final __PyList_ExtendPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyList_Extend'); - late final __PyList_Extend = __PyList_ExtendPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - void _PyList_DebugMallocStats( - ffi.Pointer out, - ) { - return __PyList_DebugMallocStats( - out, - ); - } - - late final __PyList_DebugMallocStatsPtr = - _lookup)>>( - '_PyList_DebugMallocStats'); - late final __PyList_DebugMallocStats = __PyList_DebugMallocStatsPtr - .asFunction)>(); - - late final ffi.Pointer _PyDict_Type = - _lookup('PyDict_Type'); - - PyTypeObject get PyDict_Type => _PyDict_Type.ref; - - ffi.Pointer PyDict_New() { - return _PyDict_New(); - } - - late final _PyDict_NewPtr = - _lookup Function()>>( - 'PyDict_New'); - late final _PyDict_New = - _PyDict_NewPtr.asFunction Function()>(); - - ffi.Pointer PyDict_GetItem( - ffi.Pointer mp, - ffi.Pointer key, - ) { - return _PyDict_GetItem( - mp, - key, - ); - } - - late final _PyDict_GetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyDict_GetItem'); - late final _PyDict_GetItem = _PyDict_GetItemPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyDict_GetItemWithError( - ffi.Pointer mp, - ffi.Pointer key, - ) { - return _PyDict_GetItemWithError1( - mp, - key, - ); - } - - late final _PyDict_GetItemWithErrorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyDict_GetItemWithError'); - late final _PyDict_GetItemWithError1 = _PyDict_GetItemWithErrorPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyDict_SetItem( - ffi.Pointer mp, - ffi.Pointer key, - ffi.Pointer item, - ) { - return _PyDict_SetItem( - mp, - key, - item, - ); - } - - late final _PyDict_SetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyDict_SetItem'); - late final _PyDict_SetItem = _PyDict_SetItemPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyDict_DelItem( - ffi.Pointer mp, - ffi.Pointer key, - ) { - return _PyDict_DelItem( - mp, - key, - ); - } - - late final _PyDict_DelItemPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PyDict_DelItem'); - late final _PyDict_DelItem = _PyDict_DelItemPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void PyDict_Clear( - ffi.Pointer mp, - ) { - return _PyDict_Clear( - mp, - ); - } - - late final _PyDict_ClearPtr = - _lookup)>>( - 'PyDict_Clear'); - late final _PyDict_Clear = - _PyDict_ClearPtr.asFunction)>(); - - int PyDict_Next( - ffi.Pointer mp, - ffi.Pointer pos, - ffi.Pointer> key, - ffi.Pointer> value, - ) { - return _PyDict_Next1( - mp, - pos, - key, - value, - ); - } - - late final _PyDict_NextPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>('PyDict_Next'); - late final _PyDict_Next1 = _PyDict_NextPtr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); - - ffi.Pointer PyDict_Keys( - ffi.Pointer mp, - ) { - return _PyDict_Keys( - mp, - ); - } - - late final _PyDict_KeysPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyDict_Keys'); - late final _PyDict_Keys = _PyDict_KeysPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyDict_Values( - ffi.Pointer mp, - ) { - return _PyDict_Values( - mp, - ); - } - - late final _PyDict_ValuesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyDict_Values'); - late final _PyDict_Values = _PyDict_ValuesPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyDict_Items( - ffi.Pointer mp, - ) { - return _PyDict_Items( - mp, - ); - } - - late final _PyDict_ItemsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyDict_Items'); - late final _PyDict_Items = _PyDict_ItemsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyDict_Size( - ffi.Pointer mp, - ) { - return _PyDict_Size( - mp, - ); - } - - late final _PyDict_SizePtr = - _lookup)>>( - 'PyDict_Size'); - late final _PyDict_Size = - _PyDict_SizePtr.asFunction)>(); - - ffi.Pointer PyDict_Copy( - ffi.Pointer mp, - ) { - return _PyDict_Copy( - mp, - ); - } - - late final _PyDict_CopyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyDict_Copy'); - late final _PyDict_Copy = _PyDict_CopyPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyDict_Contains( - ffi.Pointer mp, - ffi.Pointer key, - ) { - return _PyDict_Contains( - mp, - key, - ); - } - - late final _PyDict_ContainsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyDict_Contains'); - late final _PyDict_Contains = _PyDict_ContainsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyDict_Update( - ffi.Pointer mp, - ffi.Pointer other, - ) { - return _PyDict_Update( - mp, - other, - ); - } - - late final _PyDict_UpdatePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PyDict_Update'); - late final _PyDict_Update = _PyDict_UpdatePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyDict_Merge( - ffi.Pointer mp, - ffi.Pointer other, - int override, - ) { - return _PyDict_Merge( - mp, - other, - override, - ); - } - - late final _PyDict_MergePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('PyDict_Merge'); - late final _PyDict_Merge = _PyDict_MergePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int PyDict_MergeFromSeq2( - ffi.Pointer d, - ffi.Pointer seq2, - int override, - ) { - return _PyDict_MergeFromSeq2( - d, - seq2, - override, - ); - } - - late final _PyDict_MergeFromSeq2Ptr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('PyDict_MergeFromSeq2'); - late final _PyDict_MergeFromSeq2 = _PyDict_MergeFromSeq2Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer PyDict_GetItemString( - ffi.Pointer dp, - ffi.Pointer key, - ) { - return _PyDict_GetItemString( - dp, - key, - ); - } - - late final _PyDict_GetItemStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyDict_GetItemString'); - late final _PyDict_GetItemString = _PyDict_GetItemStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyDict_SetItemString( - ffi.Pointer dp, - ffi.Pointer key, - ffi.Pointer item, - ) { - return _PyDict_SetItemString( - dp, - key, - item, - ); - } - - late final _PyDict_SetItemStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyDict_SetItemString'); - late final _PyDict_SetItemString = _PyDict_SetItemStringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyDict_DelItemString( - ffi.Pointer dp, - ffi.Pointer key, - ) { - return _PyDict_DelItemString( - dp, - key, - ); - } - - late final _PyDict_DelItemStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyDict_DelItemString'); - late final _PyDict_DelItemString = _PyDict_DelItemStringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_GenericGetDict( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyObject_GenericGetDict( - arg0, - arg1, - ); - } - - late final _PyObject_GenericGetDictPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_GenericGetDict'); - late final _PyObject_GenericGetDict = _PyObject_GenericGetDictPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _PyDictKeys_Type = - _lookup('PyDictKeys_Type'); - - PyTypeObject get PyDictKeys_Type => _PyDictKeys_Type.ref; - - late final ffi.Pointer _PyDictValues_Type = - _lookup('PyDictValues_Type'); - - PyTypeObject get PyDictValues_Type => _PyDictValues_Type.ref; - - late final ffi.Pointer _PyDictItems_Type = - _lookup('PyDictItems_Type'); - - PyTypeObject get PyDictItems_Type => _PyDictItems_Type.ref; - - late final ffi.Pointer _PyDictIterKey_Type = - _lookup('PyDictIterKey_Type'); - - PyTypeObject get PyDictIterKey_Type => _PyDictIterKey_Type.ref; - - late final ffi.Pointer _PyDictIterValue_Type = - _lookup('PyDictIterValue_Type'); - - PyTypeObject get PyDictIterValue_Type => _PyDictIterValue_Type.ref; - - late final ffi.Pointer _PyDictIterItem_Type = - _lookup('PyDictIterItem_Type'); - - PyTypeObject get PyDictIterItem_Type => _PyDictIterItem_Type.ref; - - late final ffi.Pointer _PyDictRevIterKey_Type = - _lookup('PyDictRevIterKey_Type'); - - PyTypeObject get PyDictRevIterKey_Type => _PyDictRevIterKey_Type.ref; - - late final ffi.Pointer _PyDictRevIterItem_Type = - _lookup('PyDictRevIterItem_Type'); - - PyTypeObject get PyDictRevIterItem_Type => _PyDictRevIterItem_Type.ref; - - late final ffi.Pointer _PyDictRevIterValue_Type = - _lookup('PyDictRevIterValue_Type'); - - PyTypeObject get PyDictRevIterValue_Type => _PyDictRevIterValue_Type.ref; - - ffi.Pointer _PyDict_GetItem_KnownHash( - ffi.Pointer mp, - ffi.Pointer key, - int hash, - ) { - return __PyDict_GetItem_KnownHash( - mp, - key, - hash, - ); - } - - late final __PyDict_GetItem_KnownHashPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, Py_hash_t)>>('_PyDict_GetItem_KnownHash'); - late final __PyDict_GetItem_KnownHash = - __PyDict_GetItem_KnownHashPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _PyDict_GetItemWithError( - ffi.Pointer dp, - ffi.Pointer key, - ) { - return __PyDict_GetItemWithError( - dp, - key, - ); - } - - late final __PyDict_GetItemWithErrorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyDict_GetItemWithError'); - late final __PyDict_GetItemWithError = - __PyDict_GetItemWithErrorPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyDict_GetItemIdWithError( - ffi.Pointer dp, - ffi.Pointer<_Py_Identifier> key, - ) { - return __PyDict_GetItemIdWithError( - dp, - key, - ); - } - - late final __PyDict_GetItemIdWithErrorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer<_Py_Identifier>)>>('_PyDict_GetItemIdWithError'); - late final __PyDict_GetItemIdWithError = - __PyDict_GetItemIdWithErrorPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer<_Py_Identifier>)>(); - - ffi.Pointer _PyDict_GetItemStringWithError( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyDict_GetItemStringWithError( - arg0, - arg1, - ); - } - - late final __PyDict_GetItemStringWithErrorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyDict_GetItemStringWithError'); - late final __PyDict_GetItemStringWithError = - __PyDict_GetItemStringWithErrorPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyDict_SetDefault( - ffi.Pointer mp, - ffi.Pointer key, - ffi.Pointer defaultobj, - ) { - return _PyDict_SetDefault( - mp, - key, - defaultobj, - ); - } - - late final _PyDict_SetDefaultPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyDict_SetDefault'); - late final _PyDict_SetDefault = _PyDict_SetDefaultPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - int _PyDict_SetItem_KnownHash( - ffi.Pointer mp, - ffi.Pointer key, - ffi.Pointer item, - int hash, - ) { - return __PyDict_SetItem_KnownHash( - mp, - key, - item, - hash, - ); - } - - late final __PyDict_SetItem_KnownHashPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, Py_hash_t)>>('_PyDict_SetItem_KnownHash'); - late final __PyDict_SetItem_KnownHash = - __PyDict_SetItem_KnownHashPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - int _PyDict_DelItem_KnownHash( - ffi.Pointer mp, - ffi.Pointer key, - int hash, - ) { - return __PyDict_DelItem_KnownHash( - mp, - key, - hash, - ); - } - - late final __PyDict_DelItem_KnownHashPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - Py_hash_t)>>('_PyDict_DelItem_KnownHash'); - late final __PyDict_DelItem_KnownHash = - __PyDict_DelItem_KnownHashPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _PyDict_DelItemIf( - ffi.Pointer mp, - ffi.Pointer key, - ffi.Pointer< - ffi.NativeFunction value)>> - predicate, - ) { - return __PyDict_DelItemIf( - mp, - key, - predicate, - ); - } - - late final __PyDict_DelItemIfPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer value)>>)>>( - '_PyDict_DelItemIf'); - late final __PyDict_DelItemIf = __PyDict_DelItemIfPtr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer value)>>)>(); - - int _PyDict_Next( - ffi.Pointer mp, - ffi.Pointer pos, - ffi.Pointer> key, - ffi.Pointer> value, - ffi.Pointer hash, - ) { - return __PyDict_Next( - mp, - pos, - key, - value, - hash, - ); - } - - late final __PyDict_NextPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer)>>('_PyDict_Next'); - late final __PyDict_Next = __PyDict_NextPtr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer)>(); - - int _PyDict_Contains_KnownHash( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return __PyDict_Contains_KnownHash( - arg0, - arg1, - arg2, - ); - } - - late final __PyDict_Contains_KnownHashPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - Py_hash_t)>>('_PyDict_Contains_KnownHash'); - late final __PyDict_Contains_KnownHash = - __PyDict_Contains_KnownHashPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _PyDict_ContainsId( - ffi.Pointer arg0, - ffi.Pointer<_Py_Identifier> arg1, - ) { - return __PyDict_ContainsId( - arg0, - arg1, - ); - } - - late final __PyDict_ContainsIdPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer<_Py_Identifier>)>>('_PyDict_ContainsId'); - late final __PyDict_ContainsId = __PyDict_ContainsIdPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer<_Py_Identifier>)>(); - - ffi.Pointer _PyDict_NewPresized( - int minused, - ) { - return __PyDict_NewPresized( - minused, - ); - } - - late final __PyDict_NewPresizedPtr = - _lookup Function(Py_ssize_t)>>( - '_PyDict_NewPresized'); - late final __PyDict_NewPresized = - __PyDict_NewPresizedPtr.asFunction Function(int)>(); - - void _PyDict_MaybeUntrack( - ffi.Pointer mp, - ) { - return __PyDict_MaybeUntrack( - mp, - ); - } - - late final __PyDict_MaybeUntrackPtr = - _lookup)>>( - '_PyDict_MaybeUntrack'); - late final __PyDict_MaybeUntrack = __PyDict_MaybeUntrackPtr - .asFunction)>(); - - int _PyDict_HasOnlyStringKeys( - ffi.Pointer mp, - ) { - return __PyDict_HasOnlyStringKeys( - mp, - ); - } - - late final __PyDict_HasOnlyStringKeysPtr = - _lookup)>>( - '_PyDict_HasOnlyStringKeys'); - late final __PyDict_HasOnlyStringKeys = __PyDict_HasOnlyStringKeysPtr - .asFunction)>(); - - int _PyDict_SizeOf( - ffi.Pointer arg0, - ) { - return __PyDict_SizeOf( - arg0, - ); - } - - late final __PyDict_SizeOfPtr = _lookup< - ffi.NativeFunction)>>( - '_PyDict_SizeOf'); - late final __PyDict_SizeOf = - __PyDict_SizeOfPtr.asFunction)>(); - - ffi.Pointer _PyDict_Pop( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return __PyDict_Pop( - arg0, - arg1, - arg2, - ); - } - - late final __PyDict_PopPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('_PyDict_Pop'); - late final __PyDict_Pop = __PyDict_PopPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - int _PyDict_MergeEx( - ffi.Pointer mp, - ffi.Pointer other, - int override, - ) { - return __PyDict_MergeEx( - mp, - other, - override, - ); - } - - late final __PyDict_MergeExPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('_PyDict_MergeEx'); - late final __PyDict_MergeEx = __PyDict_MergeExPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _PyDict_SetItemId( - ffi.Pointer dp, - ffi.Pointer<_Py_Identifier> key, - ffi.Pointer item, - ) { - return __PyDict_SetItemId( - dp, - key, - item, - ); - } - - late final __PyDict_SetItemIdPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer<_Py_Identifier>, - ffi.Pointer)>>('_PyDict_SetItemId'); - late final __PyDict_SetItemId = __PyDict_SetItemIdPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer<_Py_Identifier>, - ffi.Pointer)>(); - - int _PyDict_DelItemId( - ffi.Pointer mp, - ffi.Pointer<_Py_Identifier> key, - ) { - return __PyDict_DelItemId( - mp, - key, - ); - } - - late final __PyDict_DelItemIdPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer<_Py_Identifier>)>>('_PyDict_DelItemId'); - late final __PyDict_DelItemId = __PyDict_DelItemIdPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer<_Py_Identifier>)>(); - - void _PyDict_DebugMallocStats( - ffi.Pointer out, - ) { - return __PyDict_DebugMallocStats( - out, - ); - } - - late final __PyDict_DebugMallocStatsPtr = - _lookup)>>( - '_PyDict_DebugMallocStats'); - late final __PyDict_DebugMallocStats = __PyDict_DebugMallocStatsPtr - .asFunction)>(); - - ffi.Pointer _PyDictView_New( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyDictView_New( - arg0, - arg1, - ); - } - - late final __PyDictView_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyDictView_New'); - late final __PyDictView_New = __PyDictView_NewPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyDictView_Intersect( - ffi.Pointer self, - ffi.Pointer other, - ) { - return __PyDictView_Intersect( - self, - other, - ); - } - - late final __PyDictView_IntersectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyDictView_Intersect'); - late final __PyDictView_Intersect = __PyDictView_IntersectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyDict_AddWatcher( - PyDict_WatchCallback callback, - ) { - return _PyDict_AddWatcher( - callback, - ); - } - - late final _PyDict_AddWatcherPtr = - _lookup>( - 'PyDict_AddWatcher'); - late final _PyDict_AddWatcher = - _PyDict_AddWatcherPtr.asFunction(); - - int PyDict_ClearWatcher( - int watcher_id, - ) { - return _PyDict_ClearWatcher( - watcher_id, - ); - } - - late final _PyDict_ClearWatcherPtr = - _lookup>( - 'PyDict_ClearWatcher'); - late final _PyDict_ClearWatcher = - _PyDict_ClearWatcherPtr.asFunction(); - - int PyDict_Watch( - int watcher_id, - ffi.Pointer dict, - ) { - return _PyDict_Watch( - watcher_id, - dict, - ); - } - - late final _PyDict_WatchPtr = _lookup< - ffi.NativeFunction)>>( - 'PyDict_Watch'); - late final _PyDict_Watch = - _PyDict_WatchPtr.asFunction)>(); - - int PyDict_Unwatch( - int watcher_id, - ffi.Pointer dict, - ) { - return _PyDict_Unwatch( - watcher_id, - dict, - ); - } - - late final _PyDict_UnwatchPtr = _lookup< - ffi.NativeFunction)>>( - 'PyDict_Unwatch'); - late final _PyDict_Unwatch = - _PyDict_UnwatchPtr.asFunction)>(); - - late final ffi.Pointer _PyODict_Type = - _lookup('PyODict_Type'); - - PyTypeObject get PyODict_Type => _PyODict_Type.ref; - - late final ffi.Pointer _PyODictIter_Type = - _lookup('PyODictIter_Type'); - - PyTypeObject get PyODictIter_Type => _PyODictIter_Type.ref; - - late final ffi.Pointer _PyODictKeys_Type = - _lookup('PyODictKeys_Type'); - - PyTypeObject get PyODictKeys_Type => _PyODictKeys_Type.ref; - - late final ffi.Pointer _PyODictItems_Type = - _lookup('PyODictItems_Type'); - - PyTypeObject get PyODictItems_Type => _PyODictItems_Type.ref; - - late final ffi.Pointer _PyODictValues_Type = - _lookup('PyODictValues_Type'); - - PyTypeObject get PyODictValues_Type => _PyODictValues_Type.ref; - - ffi.Pointer PyODict_New() { - return _PyODict_New(); - } - - late final _PyODict_NewPtr = - _lookup Function()>>( - 'PyODict_New'); - late final _PyODict_New = - _PyODict_NewPtr.asFunction Function()>(); - - int PyODict_SetItem( - ffi.Pointer od, - ffi.Pointer key, - ffi.Pointer item, - ) { - return _PyODict_SetItem( - od, - key, - item, - ); - } - - late final _PyODict_SetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyODict_SetItem'); - late final _PyODict_SetItem = _PyODict_SetItemPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyODict_DelItem( - ffi.Pointer od, - ffi.Pointer key, - ) { - return _PyODict_DelItem( - od, - key, - ); - } - - late final _PyODict_DelItemPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyODict_DelItem'); - late final _PyODict_DelItem = _PyODict_DelItemPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _PyEnum_Type = - _lookup('PyEnum_Type'); - - PyTypeObject get PyEnum_Type => _PyEnum_Type.ref; - - late final ffi.Pointer _PyReversed_Type = - _lookup('PyReversed_Type'); - - PyTypeObject get PyReversed_Type => _PyReversed_Type.ref; - - late final ffi.Pointer _PySet_Type = - _lookup('PySet_Type'); - - PyTypeObject get PySet_Type => _PySet_Type.ref; - - late final ffi.Pointer _PyFrozenSet_Type = - _lookup('PyFrozenSet_Type'); - - PyTypeObject get PyFrozenSet_Type => _PyFrozenSet_Type.ref; - - late final ffi.Pointer _PySetIter_Type = - _lookup('PySetIter_Type'); - - PyTypeObject get PySetIter_Type => _PySetIter_Type.ref; - - ffi.Pointer PySet_New( - ffi.Pointer arg0, - ) { - return _PySet_New( - arg0, - ); - } - - late final _PySet_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('PySet_New'); - late final _PySet_New = _PySet_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyFrozenSet_New( - ffi.Pointer arg0, - ) { - return _PyFrozenSet_New( - arg0, - ); - } - - late final _PyFrozenSet_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFrozenSet_New'); - late final _PyFrozenSet_New = _PyFrozenSet_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PySet_Add( - ffi.Pointer set1, - ffi.Pointer key, - ) { - return _PySet_Add( - set1, - key, - ); - } - - late final _PySet_AddPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PySet_Add'); - late final _PySet_Add = _PySet_AddPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PySet_Clear( - ffi.Pointer set1, - ) { - return _PySet_Clear( - set1, - ); - } - - late final _PySet_ClearPtr = - _lookup)>>( - 'PySet_Clear'); - late final _PySet_Clear = - _PySet_ClearPtr.asFunction)>(); - - int PySet_Contains( - ffi.Pointer anyset, - ffi.Pointer key, - ) { - return _PySet_Contains( - anyset, - key, - ); - } - - late final _PySet_ContainsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PySet_Contains'); - late final _PySet_Contains = _PySet_ContainsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PySet_Discard( - ffi.Pointer set1, - ffi.Pointer key, - ) { - return _PySet_Discard( - set1, - key, - ); - } - - late final _PySet_DiscardPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PySet_Discard'); - late final _PySet_Discard = _PySet_DiscardPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PySet_Pop( - ffi.Pointer set1, - ) { - return _PySet_Pop( - set1, - ); - } - - late final _PySet_PopPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('PySet_Pop'); - late final _PySet_Pop = _PySet_PopPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PySet_Size( - ffi.Pointer anyset, - ) { - return _PySet_Size( - anyset, - ); - } - - late final _PySet_SizePtr = - _lookup)>>( - 'PySet_Size'); - late final _PySet_Size = - _PySet_SizePtr.asFunction)>(); - - late final ffi.Pointer> __PySet_Dummy = - _lookup>('_PySet_Dummy'); - - ffi.Pointer get _PySet_Dummy => __PySet_Dummy.value; - - set _PySet_Dummy(ffi.Pointer value) => __PySet_Dummy.value = value; - - int _PySet_NextEntry( - ffi.Pointer set1, - ffi.Pointer pos, - ffi.Pointer> key, - ffi.Pointer hash, - ) { - return __PySet_NextEntry( - set1, - pos, - key, - hash, - ); - } - - late final __PySet_NextEntryPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('_PySet_NextEntry'); - late final __PySet_NextEntry = __PySet_NextEntryPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, ffi.Pointer)>(); - - int _PySet_Update( - ffi.Pointer set1, - ffi.Pointer iterable, - ) { - return __PySet_Update( - set1, - iterable, - ); - } - - late final __PySet_UpdatePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('_PySet_Update'); - late final __PySet_Update = __PySet_UpdatePtr - .asFunction, ffi.Pointer)>(); - - late final ffi.Pointer _PyCFunction_Type = - _lookup('PyCFunction_Type'); - - PyTypeObject get PyCFunction_Type => _PyCFunction_Type.ref; - - PyCFunction PyCFunction_GetFunction( - ffi.Pointer arg0, - ) { - return _PyCFunction_GetFunction( - arg0, - ); - } - - late final _PyCFunction_GetFunctionPtr = - _lookup)>>( - 'PyCFunction_GetFunction'); - late final _PyCFunction_GetFunction = _PyCFunction_GetFunctionPtr.asFunction< - PyCFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyCFunction_GetSelf( - ffi.Pointer arg0, - ) { - return _PyCFunction_GetSelf( - arg0, - ); - } - - late final _PyCFunction_GetSelfPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCFunction_GetSelf'); - late final _PyCFunction_GetSelf = _PyCFunction_GetSelfPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyCFunction_GetFlags( - ffi.Pointer arg0, - ) { - return _PyCFunction_GetFlags( - arg0, - ); - } - - late final _PyCFunction_GetFlagsPtr = - _lookup)>>( - 'PyCFunction_GetFlags'); - late final _PyCFunction_GetFlags = _PyCFunction_GetFlagsPtr.asFunction< - int Function(ffi.Pointer)>(); - - ffi.Pointer PyCFunction_Call( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyCFunction_Call( - arg0, - arg1, - arg2, - ); - } - - late final _PyCFunction_CallPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyCFunction_Call'); - late final _PyCFunction_Call = _PyCFunction_CallPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyCFunction_New( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyCFunction_New( - arg0, - arg1, - ); - } - - late final _PyCFunction_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyCFunction_New'); - late final _PyCFunction_New = _PyCFunction_NewPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyCFunction_NewEx( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyCFunction_NewEx( - arg0, - arg1, - arg2, - ); - } - - late final _PyCFunction_NewExPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyCFunction_NewEx'); - late final _PyCFunction_NewEx = _PyCFunction_NewExPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyCMethod_New( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) { - return _PyCMethod_New( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final _PyCMethod_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyCMethod_New'); - late final _PyCMethod_New = _PyCMethod_NewPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _PyCMethod_Type = - _lookup('PyCMethod_Type'); - - PyTypeObject get PyCMethod_Type => _PyCMethod_Type.ref; - - late final ffi.Pointer _PyModule_Type = - _lookup('PyModule_Type'); - - PyTypeObject get PyModule_Type => _PyModule_Type.ref; - - ffi.Pointer PyModule_NewObject( - ffi.Pointer name, - ) { - return _PyModule_NewObject( - name, - ); - } - - late final _PyModule_NewObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyModule_NewObject'); - late final _PyModule_NewObject = _PyModule_NewObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyModule_New( - ffi.Pointer name, - ) { - return _PyModule_New( - name, - ); - } - - late final _PyModule_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyModule_New'); - late final _PyModule_New = _PyModule_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyModule_GetDict( - ffi.Pointer arg0, - ) { - return _PyModule_GetDict( - arg0, - ); - } - - late final _PyModule_GetDictPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyModule_GetDict'); - late final _PyModule_GetDict = _PyModule_GetDictPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyModule_GetNameObject( - ffi.Pointer arg0, - ) { - return _PyModule_GetNameObject( - arg0, - ); - } - - late final _PyModule_GetNameObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyModule_GetNameObject'); - late final _PyModule_GetNameObject = _PyModule_GetNameObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyModule_GetName( - ffi.Pointer arg0, - ) { - return _PyModule_GetName( - arg0, - ); - } - - late final _PyModule_GetNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyModule_GetName'); - late final _PyModule_GetName = _PyModule_GetNamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyModule_GetFilename( - ffi.Pointer arg0, - ) { - return _PyModule_GetFilename( - arg0, - ); - } - - late final _PyModule_GetFilenamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyModule_GetFilename'); - late final _PyModule_GetFilename = _PyModule_GetFilenamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyModule_GetFilenameObject( - ffi.Pointer arg0, - ) { - return _PyModule_GetFilenameObject( - arg0, - ); - } - - late final _PyModule_GetFilenameObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyModule_GetFilenameObject'); - late final _PyModule_GetFilenameObject = _PyModule_GetFilenameObjectPtr - .asFunction Function(ffi.Pointer)>(); - - void _PyModule_Clear( - ffi.Pointer arg0, - ) { - return __PyModule_Clear( - arg0, - ); - } - - late final __PyModule_ClearPtr = - _lookup)>>( - '_PyModule_Clear'); - late final __PyModule_Clear = - __PyModule_ClearPtr.asFunction)>(); - - void _PyModule_ClearDict( - ffi.Pointer arg0, - ) { - return __PyModule_ClearDict( - arg0, - ); - } - - late final __PyModule_ClearDictPtr = - _lookup)>>( - '_PyModule_ClearDict'); - late final __PyModule_ClearDict = __PyModule_ClearDictPtr - .asFunction)>(); - - int _PyModuleSpec_IsInitializing( - ffi.Pointer arg0, - ) { - return __PyModuleSpec_IsInitializing( - arg0, - ); - } - - late final __PyModuleSpec_IsInitializingPtr = - _lookup)>>( - '_PyModuleSpec_IsInitializing'); - late final __PyModuleSpec_IsInitializing = __PyModuleSpec_IsInitializingPtr - .asFunction)>(); - - ffi.Pointer PyModule_GetDef( - ffi.Pointer arg0, - ) { - return _PyModule_GetDef( - arg0, - ); - } - - late final _PyModule_GetDefPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyModule_GetDef'); - late final _PyModule_GetDef = _PyModule_GetDefPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyModule_GetState( - ffi.Pointer arg0, - ) { - return _PyModule_GetState( - arg0, - ); - } - - late final _PyModule_GetStatePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyModule_GetState'); - late final _PyModule_GetState = _PyModule_GetStatePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyModuleDef_Init( - ffi.Pointer arg0, - ) { - return _PyModuleDef_Init( - arg0, - ); - } - - late final _PyModuleDef_InitPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyModuleDef_Init'); - late final _PyModuleDef_Init = _PyModuleDef_InitPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _PyModuleDef_Type = - _lookup('PyModuleDef_Type'); - - PyTypeObject get PyModuleDef_Type => _PyModuleDef_Type.ref; - - late final ffi.Pointer _PyFunction_Type = - _lookup('PyFunction_Type'); - - PyTypeObject get PyFunction_Type => _PyFunction_Type.ref; - - ffi.Pointer PyFunction_New( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyFunction_New( - arg0, - arg1, - ); - } - - late final _PyFunction_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyFunction_New'); - late final _PyFunction_New = _PyFunction_NewPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyFunction_NewWithQualName( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyFunction_NewWithQualName( - arg0, - arg1, - arg2, - ); - } - - late final _PyFunction_NewWithQualNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyFunction_NewWithQualName'); - late final _PyFunction_NewWithQualName = - _PyFunction_NewWithQualNamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyFunction_GetCode( - ffi.Pointer arg0, - ) { - return _PyFunction_GetCode( - arg0, - ); - } - - late final _PyFunction_GetCodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFunction_GetCode'); - late final _PyFunction_GetCode = _PyFunction_GetCodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyFunction_GetGlobals( - ffi.Pointer arg0, - ) { - return _PyFunction_GetGlobals( - arg0, - ); - } - - late final _PyFunction_GetGlobalsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFunction_GetGlobals'); - late final _PyFunction_GetGlobals = _PyFunction_GetGlobalsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyFunction_GetModule( - ffi.Pointer arg0, - ) { - return _PyFunction_GetModule( - arg0, - ); - } - - late final _PyFunction_GetModulePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFunction_GetModule'); - late final _PyFunction_GetModule = _PyFunction_GetModulePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyFunction_GetDefaults( - ffi.Pointer arg0, - ) { - return _PyFunction_GetDefaults( - arg0, - ); - } - - late final _PyFunction_GetDefaultsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFunction_GetDefaults'); - late final _PyFunction_GetDefaults = _PyFunction_GetDefaultsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyFunction_SetDefaults( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyFunction_SetDefaults( - arg0, - arg1, - ); - } - - late final _PyFunction_SetDefaultsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyFunction_SetDefaults'); - late final _PyFunction_SetDefaults = _PyFunction_SetDefaultsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void PyFunction_SetVectorcall( - ffi.Pointer arg0, - vectorcallfunc arg1, - ) { - return _PyFunction_SetVectorcall( - arg0, - arg1, - ); - } - - late final _PyFunction_SetVectorcallPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - vectorcallfunc)>>('PyFunction_SetVectorcall'); - late final _PyFunction_SetVectorcall = - _PyFunction_SetVectorcallPtr.asFunction< - void Function(ffi.Pointer, vectorcallfunc)>(); - - ffi.Pointer PyFunction_GetKwDefaults( - ffi.Pointer arg0, - ) { - return _PyFunction_GetKwDefaults( - arg0, - ); - } - - late final _PyFunction_GetKwDefaultsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFunction_GetKwDefaults'); - late final _PyFunction_GetKwDefaults = _PyFunction_GetKwDefaultsPtr - .asFunction Function(ffi.Pointer)>(); - - int PyFunction_SetKwDefaults( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyFunction_SetKwDefaults( - arg0, - arg1, - ); - } - - late final _PyFunction_SetKwDefaultsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyFunction_SetKwDefaults'); - late final _PyFunction_SetKwDefaults = _PyFunction_SetKwDefaultsPtr - .asFunction, ffi.Pointer)>(); - - ffi.Pointer PyFunction_GetClosure( - ffi.Pointer arg0, - ) { - return _PyFunction_GetClosure( - arg0, - ); - } - - late final _PyFunction_GetClosurePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFunction_GetClosure'); - late final _PyFunction_GetClosure = _PyFunction_GetClosurePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyFunction_SetClosure( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyFunction_SetClosure( - arg0, - arg1, - ); - } - - late final _PyFunction_SetClosurePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyFunction_SetClosure'); - late final _PyFunction_SetClosure = _PyFunction_SetClosurePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyFunction_GetAnnotations( - ffi.Pointer arg0, - ) { - return _PyFunction_GetAnnotations( - arg0, - ); - } - - late final _PyFunction_GetAnnotationsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFunction_GetAnnotations'); - late final _PyFunction_GetAnnotations = _PyFunction_GetAnnotationsPtr - .asFunction Function(ffi.Pointer)>(); - - int PyFunction_SetAnnotations( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyFunction_SetAnnotations( - arg0, - arg1, - ); - } - - late final _PyFunction_SetAnnotationsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyFunction_SetAnnotations'); - late final _PyFunction_SetAnnotations = _PyFunction_SetAnnotationsPtr - .asFunction, ffi.Pointer)>(); - - ffi.Pointer _PyFunction_Vectorcall( - ffi.Pointer func, - ffi.Pointer> stack, - int nargsf, - ffi.Pointer kwnames, - ) { - return __PyFunction_Vectorcall( - func, - stack, - nargsf, - kwnames, - ); - } - - late final __PyFunction_VectorcallPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Size, - ffi.Pointer)>>('_PyFunction_Vectorcall'); - late final __PyFunction_Vectorcall = __PyFunction_VectorcallPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer>, int, ffi.Pointer)>(); - - late final ffi.Pointer _PyClassMethod_Type = - _lookup('PyClassMethod_Type'); - - PyTypeObject get PyClassMethod_Type => _PyClassMethod_Type.ref; - - late final ffi.Pointer _PyStaticMethod_Type = - _lookup('PyStaticMethod_Type'); - - PyTypeObject get PyStaticMethod_Type => _PyStaticMethod_Type.ref; - - ffi.Pointer PyClassMethod_New( - ffi.Pointer arg0, - ) { - return _PyClassMethod_New( - arg0, - ); - } - - late final _PyClassMethod_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyClassMethod_New'); - late final _PyClassMethod_New = _PyClassMethod_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyStaticMethod_New( - ffi.Pointer arg0, - ) { - return _PyStaticMethod_New( - arg0, - ); - } - - late final _PyStaticMethod_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyStaticMethod_New'); - late final _PyStaticMethod_New = _PyStaticMethod_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyFunction_AddWatcher( - PyFunction_WatchCallback callback, - ) { - return _PyFunction_AddWatcher( - callback, - ); - } - - late final _PyFunction_AddWatcherPtr = - _lookup>( - 'PyFunction_AddWatcher'); - late final _PyFunction_AddWatcher = _PyFunction_AddWatcherPtr.asFunction< - int Function(PyFunction_WatchCallback)>(); - - int PyFunction_ClearWatcher( - int watcher_id, - ) { - return _PyFunction_ClearWatcher( - watcher_id, - ); - } - - late final _PyFunction_ClearWatcherPtr = - _lookup>( - 'PyFunction_ClearWatcher'); - late final _PyFunction_ClearWatcher = - _PyFunction_ClearWatcherPtr.asFunction(); - - late final ffi.Pointer _PyMethod_Type = - _lookup('PyMethod_Type'); - - PyTypeObject get PyMethod_Type => _PyMethod_Type.ref; - - ffi.Pointer PyMethod_New( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyMethod_New( - arg0, - arg1, - ); - } - - late final _PyMethod_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyMethod_New'); - late final _PyMethod_New = _PyMethod_NewPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyMethod_Function( - ffi.Pointer arg0, - ) { - return _PyMethod_Function( - arg0, - ); - } - - late final _PyMethod_FunctionPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyMethod_Function'); - late final _PyMethod_Function = _PyMethod_FunctionPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyMethod_Self( - ffi.Pointer arg0, - ) { - return _PyMethod_Self( - arg0, - ); - } - - late final _PyMethod_SelfPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyMethod_Self'); - late final _PyMethod_Self = _PyMethod_SelfPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _PyInstanceMethod_Type = - _lookup('PyInstanceMethod_Type'); - - PyTypeObject get PyInstanceMethod_Type => _PyInstanceMethod_Type.ref; - - ffi.Pointer PyInstanceMethod_New( - ffi.Pointer arg0, - ) { - return _PyInstanceMethod_New( - arg0, - ); - } - - late final _PyInstanceMethod_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyInstanceMethod_New'); - late final _PyInstanceMethod_New = _PyInstanceMethod_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyInstanceMethod_Function( - ffi.Pointer arg0, - ) { - return _PyInstanceMethod_Function( - arg0, - ); - } - - late final _PyInstanceMethod_FunctionPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyInstanceMethod_Function'); - late final _PyInstanceMethod_Function = _PyInstanceMethod_FunctionPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyFile_FromFd( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, - ffi.Pointer arg6, - int arg7, - ) { - return _PyFile_FromFd( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, - arg6, - arg7, - ); - } - - late final _PyFile_FromFdPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('PyFile_FromFd'); - late final _PyFile_FromFd = _PyFile_FromFdPtr.asFunction< - ffi.Pointer Function( - int, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - - ffi.Pointer PyFile_GetLine( - ffi.Pointer arg0, - int arg1, - ) { - return _PyFile_GetLine( - arg0, - arg1, - ); - } - - late final _PyFile_GetLinePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyFile_GetLine'); - late final _PyFile_GetLine = _PyFile_GetLinePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - int PyFile_WriteObject( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return _PyFile_WriteObject( - arg0, - arg1, - arg2, - ); - } - - late final _PyFile_WriteObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('PyFile_WriteObject'); - late final _PyFile_WriteObject = _PyFile_WriteObjectPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int PyFile_WriteString( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyFile_WriteString( - arg0, - arg1, - ); - } - - late final _PyFile_WriteStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyFile_WriteString'); - late final _PyFile_WriteString = _PyFile_WriteStringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyObject_AsFileDescriptor( - ffi.Pointer arg0, - ) { - return _PyObject_AsFileDescriptor( - arg0, - ); - } - - late final _PyObject_AsFileDescriptorPtr = - _lookup)>>( - 'PyObject_AsFileDescriptor'); - late final _PyObject_AsFileDescriptor = _PyObject_AsFileDescriptorPtr - .asFunction)>(); - - late final ffi.Pointer> _Py_FileSystemDefaultEncoding = - _lookup>('Py_FileSystemDefaultEncoding'); - - ffi.Pointer get Py_FileSystemDefaultEncoding => - _Py_FileSystemDefaultEncoding.value; - - set Py_FileSystemDefaultEncoding(ffi.Pointer value) => - _Py_FileSystemDefaultEncoding.value = value; - - late final ffi.Pointer> - _Py_FileSystemDefaultEncodeErrors = - _lookup>('Py_FileSystemDefaultEncodeErrors'); - - ffi.Pointer get Py_FileSystemDefaultEncodeErrors => - _Py_FileSystemDefaultEncodeErrors.value; - - set Py_FileSystemDefaultEncodeErrors(ffi.Pointer value) => - _Py_FileSystemDefaultEncodeErrors.value = value; - - late final ffi.Pointer _Py_HasFileSystemDefaultEncoding = - _lookup('Py_HasFileSystemDefaultEncoding'); - - int get Py_HasFileSystemDefaultEncoding => - _Py_HasFileSystemDefaultEncoding.value; - - set Py_HasFileSystemDefaultEncoding(int value) => - _Py_HasFileSystemDefaultEncoding.value = value; - - late final ffi.Pointer _Py_UTF8Mode = - _lookup('Py_UTF8Mode'); - - int get Py_UTF8Mode => _Py_UTF8Mode.value; - - set Py_UTF8Mode(int value) => _Py_UTF8Mode.value = value; - - ffi.Pointer Py_UniversalNewlineFgets( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) { - return _Py_UniversalNewlineFgets( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final _Py_UniversalNewlineFgetsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer)>>('Py_UniversalNewlineFgets'); - late final _Py_UniversalNewlineFgets = - _Py_UniversalNewlineFgetsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _Py_UniversalNewlineFgetsWithSize( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ) { - return __Py_UniversalNewlineFgetsWithSize( - arg0, - arg1, - arg2, - arg3, - arg4, - ); - } - - late final __Py_UniversalNewlineFgetsWithSizePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_Py_UniversalNewlineFgetsWithSize'); - late final __Py_UniversalNewlineFgetsWithSize = - __Py_UniversalNewlineFgetsWithSizePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyFile_NewStdPrinter( - int arg0, - ) { - return _PyFile_NewStdPrinter( - arg0, - ); - } - - late final _PyFile_NewStdPrinterPtr = - _lookup Function(ffi.Int)>>( - 'PyFile_NewStdPrinter'); - late final _PyFile_NewStdPrinter = _PyFile_NewStdPrinterPtr.asFunction< - ffi.Pointer Function(int)>(); - - late final ffi.Pointer _PyStdPrinter_Type = - _lookup('PyStdPrinter_Type'); - - PyTypeObject get PyStdPrinter_Type => _PyStdPrinter_Type.ref; - - ffi.Pointer PyFile_OpenCode( - ffi.Pointer utf8path, - ) { - return _PyFile_OpenCode( - utf8path, - ); - } - - late final _PyFile_OpenCodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFile_OpenCode'); - late final _PyFile_OpenCode = _PyFile_OpenCodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyFile_OpenCodeObject( - ffi.Pointer path, - ) { - return _PyFile_OpenCodeObject( - path, - ); - } - - late final _PyFile_OpenCodeObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFile_OpenCodeObject'); - late final _PyFile_OpenCodeObject = _PyFile_OpenCodeObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyFile_SetOpenCodeHook( - Py_OpenCodeHookFunction hook, - ffi.Pointer userData, - ) { - return _PyFile_SetOpenCodeHook( - hook, - userData, - ); - } - - late final _PyFile_SetOpenCodeHookPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(Py_OpenCodeHookFunction, - ffi.Pointer)>>('PyFile_SetOpenCodeHook'); - late final _PyFile_SetOpenCodeHook = _PyFile_SetOpenCodeHookPtr.asFunction< - int Function(Py_OpenCodeHookFunction, ffi.Pointer)>(); - - int _PyLong_FileDescriptor_Converter( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyLong_FileDescriptor_Converter( - arg0, - arg1, - ); - } - - late final __PyLong_FileDescriptor_ConverterPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyLong_FileDescriptor_Converter'); - late final __PyLong_FileDescriptor_Converter = - __PyLong_FileDescriptor_ConverterPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _PyCapsule_Type = - _lookup('PyCapsule_Type'); - - PyTypeObject get PyCapsule_Type => _PyCapsule_Type.ref; - - ffi.Pointer PyCapsule_New( - ffi.Pointer pointer, - ffi.Pointer name, - PyCapsule_Destructor destructor, - ) { - return _PyCapsule_New( - pointer, - name, - destructor, - ); - } - - late final _PyCapsule_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, PyCapsule_Destructor)>>('PyCapsule_New'); - late final _PyCapsule_New = _PyCapsule_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, PyCapsule_Destructor)>(); - - ffi.Pointer PyCapsule_GetPointer( - ffi.Pointer capsule, - ffi.Pointer name, - ) { - return _PyCapsule_GetPointer( - capsule, - name, - ); - } - - late final _PyCapsule_GetPointerPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyCapsule_GetPointer'); - late final _PyCapsule_GetPointer = _PyCapsule_GetPointerPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - PyCapsule_Destructor PyCapsule_GetDestructor( - ffi.Pointer capsule, - ) { - return _PyCapsule_GetDestructor( - capsule, - ); - } - - late final _PyCapsule_GetDestructorPtr = _lookup< - ffi.NativeFunction< - PyCapsule_Destructor Function( - ffi.Pointer)>>('PyCapsule_GetDestructor'); - late final _PyCapsule_GetDestructor = _PyCapsule_GetDestructorPtr.asFunction< - PyCapsule_Destructor Function(ffi.Pointer)>(); - - ffi.Pointer PyCapsule_GetName( - ffi.Pointer capsule, - ) { - return _PyCapsule_GetName( - capsule, - ); - } - - late final _PyCapsule_GetNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCapsule_GetName'); - late final _PyCapsule_GetName = _PyCapsule_GetNamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCapsule_GetContext( - ffi.Pointer capsule, - ) { - return _PyCapsule_GetContext( - capsule, - ); - } - - late final _PyCapsule_GetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCapsule_GetContext'); - late final _PyCapsule_GetContext = _PyCapsule_GetContextPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyCapsule_IsValid( - ffi.Pointer capsule, - ffi.Pointer name, - ) { - return _PyCapsule_IsValid( - capsule, - name, - ); - } - - late final _PyCapsule_IsValidPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyCapsule_IsValid'); - late final _PyCapsule_IsValid = _PyCapsule_IsValidPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyCapsule_SetPointer( - ffi.Pointer capsule, - ffi.Pointer pointer, - ) { - return _PyCapsule_SetPointer( - capsule, - pointer, - ); - } - - late final _PyCapsule_SetPointerPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyCapsule_SetPointer'); - late final _PyCapsule_SetPointer = _PyCapsule_SetPointerPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyCapsule_SetDestructor( - ffi.Pointer capsule, - PyCapsule_Destructor destructor, - ) { - return _PyCapsule_SetDestructor( - capsule, - destructor, - ); - } - - late final _PyCapsule_SetDestructorPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - PyCapsule_Destructor)>>('PyCapsule_SetDestructor'); - late final _PyCapsule_SetDestructor = _PyCapsule_SetDestructorPtr.asFunction< - int Function(ffi.Pointer, PyCapsule_Destructor)>(); - - int PyCapsule_SetName( - ffi.Pointer capsule, - ffi.Pointer name, - ) { - return _PyCapsule_SetName( - capsule, - name, - ); - } - - late final _PyCapsule_SetNamePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyCapsule_SetName'); - late final _PyCapsule_SetName = _PyCapsule_SetNamePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyCapsule_SetContext( - ffi.Pointer capsule, - ffi.Pointer context, - ) { - return _PyCapsule_SetContext( - capsule, - context, - ); - } - - late final _PyCapsule_SetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyCapsule_SetContext'); - late final _PyCapsule_SetContext = _PyCapsule_SetContextPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyCapsule_Import( - ffi.Pointer name, - int no_block, - ) { - return _PyCapsule_Import( - name, - no_block, - ); - } - - late final _PyCapsule_ImportPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyCapsule_Import'); - late final _PyCapsule_Import = _PyCapsule_ImportPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - late final ffi.Pointer _PyCode_Type = - _lookup('PyCode_Type'); - - PyTypeObject get PyCode_Type => _PyCode_Type.ref; - - ffi.Pointer PyUnstable_Code_New( - int arg0, - int arg1, - int arg2, - int arg3, - int arg4, - ffi.Pointer arg5, - ffi.Pointer arg6, - ffi.Pointer arg7, - ffi.Pointer arg8, - ffi.Pointer arg9, - ffi.Pointer arg10, - ffi.Pointer arg11, - ffi.Pointer arg12, - ffi.Pointer arg13, - int arg14, - ffi.Pointer arg15, - ffi.Pointer arg16, - ) { - return _PyUnstable_Code_New( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, - arg6, - arg7, - arg8, - arg9, - arg10, - arg11, - arg12, - arg13, - arg14, - arg15, - arg16, - ); - } - - late final _PyUnstable_Code_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int, - ffi.Int, - ffi.Int, - ffi.Int, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer)>>('PyUnstable_Code_New'); - late final _PyUnstable_Code_New = _PyUnstable_Code_NewPtr.asFunction< - ffi.Pointer Function( - int, - int, - int, - int, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyUnstable_Code_NewWithPosOnlyArgs( - int arg0, - int arg1, - int arg2, - int arg3, - int arg4, - int arg5, - ffi.Pointer arg6, - ffi.Pointer arg7, - ffi.Pointer arg8, - ffi.Pointer arg9, - ffi.Pointer arg10, - ffi.Pointer arg11, - ffi.Pointer arg12, - ffi.Pointer arg13, - ffi.Pointer arg14, - int arg15, - ffi.Pointer arg16, - ffi.Pointer arg17, - ) { - return _PyUnstable_Code_NewWithPosOnlyArgs( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, - arg6, - arg7, - arg8, - arg9, - arg10, - arg11, - arg12, - arg13, - arg14, - arg15, - arg16, - arg17, - ); - } - - late final _PyUnstable_Code_NewWithPosOnlyArgsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int, - ffi.Int, - ffi.Int, - ffi.Int, - ffi.Int, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer)>>('PyUnstable_Code_NewWithPosOnlyArgs'); - late final _PyUnstable_Code_NewWithPosOnlyArgs = - _PyUnstable_Code_NewWithPosOnlyArgsPtr.asFunction< - ffi.Pointer Function( - int, - int, - int, - int, - int, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyCode_NewEmpty( - ffi.Pointer filename, - ffi.Pointer funcname, - int firstlineno, - ) { - return _PyCode_NewEmpty( - filename, - funcname, - firstlineno, - ); - } - - late final _PyCode_NewEmptyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('PyCode_NewEmpty'); - late final _PyCode_NewEmpty = _PyCode_NewEmptyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - int PyCode_Addr2Line( - ffi.Pointer arg0, - int arg1, - ) { - return _PyCode_Addr2Line( - arg0, - arg1, - ); - } - - late final _PyCode_Addr2LinePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int)>>('PyCode_Addr2Line'); - late final _PyCode_Addr2Line = _PyCode_Addr2LinePtr.asFunction< - int Function(ffi.Pointer, int)>(); - - int PyCode_Addr2Location( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, - ) { - return _PyCode_Addr2Location( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, - ); - } - - late final _PyCode_Addr2LocationPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyCode_Addr2Location'); - late final _PyCode_Addr2Location = _PyCode_Addr2LocationPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - - int PyCode_AddWatcher( - PyCode_WatchCallback callback, - ) { - return _PyCode_AddWatcher( - callback, - ); - } - - late final _PyCode_AddWatcherPtr = - _lookup>( - 'PyCode_AddWatcher'); - late final _PyCode_AddWatcher = - _PyCode_AddWatcherPtr.asFunction(); - - int PyCode_ClearWatcher( - int watcher_id, - ) { - return _PyCode_ClearWatcher( - watcher_id, - ); - } - - late final _PyCode_ClearWatcherPtr = - _lookup>( - 'PyCode_ClearWatcher'); - late final _PyCode_ClearWatcher = - _PyCode_ClearWatcherPtr.asFunction(); - - int _PyCode_CheckLineNumber( - int lasti, - ffi.Pointer bounds, - ) { - return __PyCode_CheckLineNumber( - lasti, - bounds, - ); - } - - late final __PyCode_CheckLineNumberPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Int, - ffi.Pointer)>>('_PyCode_CheckLineNumber'); - late final __PyCode_CheckLineNumber = __PyCode_CheckLineNumberPtr - .asFunction)>(); - - ffi.Pointer _PyCode_ConstantKey( - ffi.Pointer obj, - ) { - return __PyCode_ConstantKey( - obj, - ); - } - - late final __PyCode_ConstantKeyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyCode_ConstantKey'); - late final __PyCode_ConstantKey = __PyCode_ConstantKeyPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyCode_Optimize( - ffi.Pointer code, - ffi.Pointer consts, - ffi.Pointer names, - ffi.Pointer lnotab, - ) { - return _PyCode_Optimize( - code, - consts, - names, - lnotab, - ); - } - - late final _PyCode_OptimizePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyCode_Optimize'); - late final _PyCode_Optimize = _PyCode_OptimizePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - int PyUnstable_Code_GetExtra( - ffi.Pointer code, - int index, - ffi.Pointer> extra, - ) { - return _PyUnstable_Code_GetExtra( - code, - index, - extra, - ); - } - - late final _PyUnstable_Code_GetExtraPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer>)>>('PyUnstable_Code_GetExtra'); - late final _PyUnstable_Code_GetExtra = - _PyUnstable_Code_GetExtraPtr.asFunction< - int Function(ffi.Pointer, int, - ffi.Pointer>)>(); - - int PyUnstable_Code_SetExtra( - ffi.Pointer code, - int index, - ffi.Pointer extra, - ) { - return _PyUnstable_Code_SetExtra( - code, - index, - extra, - ); - } - - late final _PyUnstable_Code_SetExtraPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyUnstable_Code_SetExtra'); - late final _PyUnstable_Code_SetExtra = - _PyUnstable_Code_SetExtraPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer PyCode_GetCode( - ffi.Pointer code, - ) { - return _PyCode_GetCode( - code, - ); - } - - late final _PyCode_GetCodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCode_GetCode'); - late final _PyCode_GetCode = _PyCode_GetCodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCode_GetVarnames( - ffi.Pointer code, - ) { - return _PyCode_GetVarnames( - code, - ); - } - - late final _PyCode_GetVarnamesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCode_GetVarnames'); - late final _PyCode_GetVarnames = _PyCode_GetVarnamesPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCode_GetCellvars( - ffi.Pointer code, - ) { - return _PyCode_GetCellvars( - code, - ); - } - - late final _PyCode_GetCellvarsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCode_GetCellvars'); - late final _PyCode_GetCellvars = _PyCode_GetCellvarsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCode_GetFreevars( - ffi.Pointer code, - ) { - return _PyCode_GetFreevars( - code, - ); - } - - late final _PyCode_GetFreevarsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCode_GetFreevars'); - late final _PyCode_GetFreevars = _PyCode_GetFreevarsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyFrame_GetLineNumber( - ffi.Pointer arg0, - ) { - return _PyFrame_GetLineNumber( - arg0, - ); - } - - late final _PyFrame_GetLineNumberPtr = - _lookup)>>( - 'PyFrame_GetLineNumber'); - late final _PyFrame_GetLineNumber = _PyFrame_GetLineNumberPtr.asFunction< - int Function(ffi.Pointer)>(); - - ffi.Pointer PyFrame_GetCode( - ffi.Pointer frame, - ) { - return _PyFrame_GetCode( - frame, - ); - } - - late final _PyFrame_GetCodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFrame_GetCode'); - late final _PyFrame_GetCode = _PyFrame_GetCodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _PyFrame_Type = - _lookup('PyFrame_Type'); - - PyTypeObject get PyFrame_Type => _PyFrame_Type.ref; - - ffi.Pointer PyFrame_GetBack( - ffi.Pointer frame, - ) { - return _PyFrame_GetBack( - frame, - ); - } - - late final _PyFrame_GetBackPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFrame_GetBack'); - late final _PyFrame_GetBack = _PyFrame_GetBackPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyFrame_GetLocals( - ffi.Pointer frame, - ) { - return _PyFrame_GetLocals( - frame, - ); - } - - late final _PyFrame_GetLocalsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFrame_GetLocals'); - late final _PyFrame_GetLocals = _PyFrame_GetLocalsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyFrame_GetGlobals( - ffi.Pointer frame, - ) { - return _PyFrame_GetGlobals( - frame, - ); - } - - late final _PyFrame_GetGlobalsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFrame_GetGlobals'); - late final _PyFrame_GetGlobals = _PyFrame_GetGlobalsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyFrame_GetBuiltins( - ffi.Pointer frame, - ) { - return _PyFrame_GetBuiltins( - frame, - ); - } - - late final _PyFrame_GetBuiltinsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFrame_GetBuiltins'); - late final _PyFrame_GetBuiltins = _PyFrame_GetBuiltinsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyFrame_GetGenerator( - ffi.Pointer frame, - ) { - return _PyFrame_GetGenerator( - frame, - ); - } - - late final _PyFrame_GetGeneratorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyFrame_GetGenerator'); - late final _PyFrame_GetGenerator = _PyFrame_GetGeneratorPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyFrame_GetLasti( - ffi.Pointer frame, - ) { - return _PyFrame_GetLasti( - frame, - ); - } - - late final _PyFrame_GetLastiPtr = - _lookup)>>( - 'PyFrame_GetLasti'); - late final _PyFrame_GetLasti = _PyFrame_GetLastiPtr.asFunction< - int Function(ffi.Pointer)>(); - - ffi.Pointer PyFrame_GetVar( - ffi.Pointer frame, - ffi.Pointer name, - ) { - return _PyFrame_GetVar( - frame, - name, - ); - } - - late final _PyFrame_GetVarPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyFrame_GetVar'); - late final _PyFrame_GetVar = _PyFrame_GetVarPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyFrame_GetVarString( - ffi.Pointer frame, - ffi.Pointer name, - ) { - return _PyFrame_GetVarString( - frame, - name, - ); - } - - late final _PyFrame_GetVarStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyFrame_GetVarString'); - late final _PyFrame_GetVarString = _PyFrame_GetVarStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyUnstable_InterpreterFrame_GetCode( - ffi.Pointer<_PyInterpreterFrame> frame, - ) { - return _PyUnstable_InterpreterFrame_GetCode( - frame, - ); - } - - late final _PyUnstable_InterpreterFrame_GetCodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_PyInterpreterFrame>)>>( - 'PyUnstable_InterpreterFrame_GetCode'); - late final _PyUnstable_InterpreterFrame_GetCode = - _PyUnstable_InterpreterFrame_GetCodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer<_PyInterpreterFrame>)>(); - - int PyUnstable_InterpreterFrame_GetLasti( - ffi.Pointer<_PyInterpreterFrame> frame, - ) { - return _PyUnstable_InterpreterFrame_GetLasti( - frame, - ); - } - - late final _PyUnstable_InterpreterFrame_GetLastiPtr = _lookup< - ffi - .NativeFunction)>>( - 'PyUnstable_InterpreterFrame_GetLasti'); - late final _PyUnstable_InterpreterFrame_GetLasti = - _PyUnstable_InterpreterFrame_GetLastiPtr.asFunction< - int Function(ffi.Pointer<_PyInterpreterFrame>)>(); - - int PyUnstable_InterpreterFrame_GetLine( - ffi.Pointer<_PyInterpreterFrame> frame, - ) { - return _PyUnstable_InterpreterFrame_GetLine( - frame, - ); - } - - late final _PyUnstable_InterpreterFrame_GetLinePtr = _lookup< - ffi - .NativeFunction)>>( - 'PyUnstable_InterpreterFrame_GetLine'); - late final _PyUnstable_InterpreterFrame_GetLine = - _PyUnstable_InterpreterFrame_GetLinePtr.asFunction< - int Function(ffi.Pointer<_PyInterpreterFrame>)>(); - - int PyTraceBack_Here( - ffi.Pointer arg0, - ) { - return _PyTraceBack_Here( - arg0, - ); - } - - late final _PyTraceBack_HerePtr = - _lookup)>>( - 'PyTraceBack_Here'); - late final _PyTraceBack_Here = _PyTraceBack_HerePtr.asFunction< - int Function(ffi.Pointer)>(); - - int PyTraceBack_Print( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyTraceBack_Print( - arg0, - arg1, - ); - } - - late final _PyTraceBack_PrintPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyTraceBack_Print'); - late final _PyTraceBack_Print = _PyTraceBack_PrintPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _PyTraceBack_Type = - _lookup('PyTraceBack_Type'); - - PyTypeObject get PyTraceBack_Type => _PyTraceBack_Type.ref; - - int _Py_DisplaySourceLine( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - int arg3, - ffi.Pointer arg4, - ffi.Pointer> arg5, - ) { - return __Py_DisplaySourceLine( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, - ); - } - - late final __Py_DisplaySourceLinePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Int, - ffi.Pointer, - ffi.Pointer>)>>('_Py_DisplaySourceLine'); - late final __Py_DisplaySourceLine = __Py_DisplaySourceLinePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int, - ffi.Pointer, ffi.Pointer>)>(); - - void _PyTraceback_Add( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return __PyTraceback_Add( - arg0, - arg1, - arg2, - ); - } - - late final __PyTraceback_AddPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('_PyTraceback_Add'); - late final __PyTraceback_Add = __PyTraceback_AddPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer __Py_EllipsisObject = - _lookup('_Py_EllipsisObject'); - - PyObject get _Py_EllipsisObject => __Py_EllipsisObject.ref; - - late final ffi.Pointer _PySlice_Type = - _lookup('PySlice_Type'); - - PyTypeObject get PySlice_Type => _PySlice_Type.ref; - - late final ffi.Pointer _PyEllipsis_Type = - _lookup('PyEllipsis_Type'); - - PyTypeObject get PyEllipsis_Type => _PyEllipsis_Type.ref; - - ffi.Pointer PySlice_New( - ffi.Pointer start, - ffi.Pointer stop, - ffi.Pointer step, - ) { - return _PySlice_New( - start, - stop, - step, - ); - } - - late final _PySlice_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('PySlice_New'); - late final _PySlice_New = _PySlice_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PySlice_FromIndices( - int start, - int stop, - ) { - return __PySlice_FromIndices( - start, - stop, - ); - } - - late final __PySlice_FromIndicesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - Py_ssize_t, Py_ssize_t)>>('_PySlice_FromIndices'); - late final __PySlice_FromIndices = __PySlice_FromIndicesPtr - .asFunction Function(int, int)>(); - - int _PySlice_GetLongIndices( - ffi.Pointer self, - ffi.Pointer length, - ffi.Pointer> start_ptr, - ffi.Pointer> stop_ptr, - ffi.Pointer> step_ptr, - ) { - return __PySlice_GetLongIndices( - self, - length, - start_ptr, - stop_ptr, - step_ptr, - ); - } - - late final __PySlice_GetLongIndicesPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>>('_PySlice_GetLongIndices'); - late final __PySlice_GetLongIndices = __PySlice_GetLongIndicesPtr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>(); - - int PySlice_GetIndices( - ffi.Pointer r, - int length, - ffi.Pointer start, - ffi.Pointer stop, - ffi.Pointer step, - ) { - return _PySlice_GetIndices( - r, - length, - start, - stop, - step, - ); - } - - late final _PySlice_GetIndicesPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PySlice_GetIndices'); - late final _PySlice_GetIndices = _PySlice_GetIndicesPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - int PySlice_GetIndicesEx( - ffi.Pointer r, - int length, - ffi.Pointer start, - ffi.Pointer stop, - ffi.Pointer step, - ffi.Pointer slicelength, - ) { - return _PySlice_GetIndicesEx( - r, - length, - start, - stop, - step, - slicelength, - ); - } - - late final _PySlice_GetIndicesExPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PySlice_GetIndicesEx'); - late final _PySlice_GetIndicesEx = _PySlice_GetIndicesExPtr.asFunction< - int Function( - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - int PySlice_Unpack( - ffi.Pointer slice, - ffi.Pointer start, - ffi.Pointer stop, - ffi.Pointer step, - ) { - return _PySlice_Unpack( - slice, - start, - stop, - step, - ); - } - - late final _PySlice_UnpackPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PySlice_Unpack'); - late final _PySlice_Unpack = _PySlice_UnpackPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - int PySlice_AdjustIndices( - int length, - ffi.Pointer start, - ffi.Pointer stop, - int step, - ) { - return _PySlice_AdjustIndices( - length, - start, - stop, - step, - ); - } - - late final _PySlice_AdjustIndicesPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(Py_ssize_t, ffi.Pointer, - ffi.Pointer, Py_ssize_t)>>('PySlice_AdjustIndices'); - late final _PySlice_AdjustIndices = _PySlice_AdjustIndicesPtr.asFunction< - int Function( - int, ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _PyCell_Type = - _lookup('PyCell_Type'); - - PyTypeObject get PyCell_Type => _PyCell_Type.ref; - - ffi.Pointer PyCell_New( - ffi.Pointer arg0, - ) { - return _PyCell_New( - arg0, - ); - } - - late final _PyCell_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('PyCell_New'); - late final _PyCell_New = _PyCell_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCell_Get( - ffi.Pointer arg0, - ) { - return _PyCell_Get( - arg0, - ); - } - - late final _PyCell_GetPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('PyCell_Get'); - late final _PyCell_Get = _PyCell_GetPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyCell_Set( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyCell_Set( - arg0, - arg1, - ); - } - - late final _PyCell_SetPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PyCell_Set'); - late final _PyCell_Set = _PyCell_SetPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _PySeqIter_Type = - _lookup('PySeqIter_Type'); - - PyTypeObject get PySeqIter_Type => _PySeqIter_Type.ref; - - late final ffi.Pointer _PyCallIter_Type = - _lookup('PyCallIter_Type'); - - PyTypeObject get PyCallIter_Type => _PyCallIter_Type.ref; - - ffi.Pointer PySeqIter_New( - ffi.Pointer arg0, - ) { - return _PySeqIter_New( - arg0, - ); - } - - late final _PySeqIter_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PySeqIter_New'); - late final _PySeqIter_New = _PySeqIter_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCallIter_New( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyCallIter_New( - arg0, - arg1, - ); - } - - late final _PyCallIter_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyCallIter_New'); - late final _PyCallIter_New = _PyCallIter_NewPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _PyGen_Type = - _lookup('PyGen_Type'); - - PyTypeObject get PyGen_Type => _PyGen_Type.ref; - - ffi.Pointer PyGen_New( - ffi.Pointer arg0, - ) { - return _PyGen_New( - arg0, - ); - } - - late final _PyGen_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyGen_New'); - late final _PyGen_New = _PyGen_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyGen_NewWithQualName( - ffi.Pointer arg0, - ffi.Pointer name, - ffi.Pointer qualname, - ) { - return _PyGen_NewWithQualName( - arg0, - name, - qualname, - ); - } - - late final _PyGen_NewWithQualNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyGen_NewWithQualName'); - late final _PyGen_NewWithQualName = _PyGen_NewWithQualNamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - int _PyGen_SetStopIterationValue( - ffi.Pointer arg0, - ) { - return __PyGen_SetStopIterationValue( - arg0, - ); - } - - late final __PyGen_SetStopIterationValuePtr = - _lookup)>>( - '_PyGen_SetStopIterationValue'); - late final __PyGen_SetStopIterationValue = __PyGen_SetStopIterationValuePtr - .asFunction)>(); - - int _PyGen_FetchStopIterationValue( - ffi.Pointer> arg0, - ) { - return __PyGen_FetchStopIterationValue( - arg0, - ); - } - - late final __PyGen_FetchStopIterationValuePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>)>>( - '_PyGen_FetchStopIterationValue'); - late final __PyGen_FetchStopIterationValue = - __PyGen_FetchStopIterationValuePtr - .asFunction>)>(); - - void _PyGen_Finalize( - ffi.Pointer self, - ) { - return __PyGen_Finalize( - self, - ); - } - - late final __PyGen_FinalizePtr = - _lookup)>>( - '_PyGen_Finalize'); - late final __PyGen_Finalize = - __PyGen_FinalizePtr.asFunction)>(); - - ffi.Pointer PyGen_GetCode( - ffi.Pointer gen, - ) { - return _PyGen_GetCode( - gen, - ); - } - - late final _PyGen_GetCodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyGen_GetCode'); - late final _PyGen_GetCode = _PyGen_GetCodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _PyCoro_Type = - _lookup('PyCoro_Type'); - - PyTypeObject get PyCoro_Type => _PyCoro_Type.ref; - - late final ffi.Pointer __PyCoroWrapper_Type = - _lookup('_PyCoroWrapper_Type'); - - PyTypeObject get _PyCoroWrapper_Type => __PyCoroWrapper_Type.ref; - - ffi.Pointer PyCoro_New( - ffi.Pointer arg0, - ffi.Pointer name, - ffi.Pointer qualname, - ) { - return _PyCoro_New( - arg0, - name, - qualname, - ); - } - - late final _PyCoro_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('PyCoro_New'); - late final _PyCoro_New = _PyCoro_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _PyAsyncGen_Type = - _lookup('PyAsyncGen_Type'); - - PyTypeObject get PyAsyncGen_Type => _PyAsyncGen_Type.ref; - - late final ffi.Pointer __PyAsyncGenASend_Type = - _lookup('_PyAsyncGenASend_Type'); - - PyTypeObject get _PyAsyncGenASend_Type => __PyAsyncGenASend_Type.ref; - - late final ffi.Pointer __PyAsyncGenWrappedValue_Type = - _lookup('_PyAsyncGenWrappedValue_Type'); - - PyTypeObject get _PyAsyncGenWrappedValue_Type => - __PyAsyncGenWrappedValue_Type.ref; - - late final ffi.Pointer __PyAsyncGenAThrow_Type = - _lookup('_PyAsyncGenAThrow_Type'); - - PyTypeObject get _PyAsyncGenAThrow_Type => __PyAsyncGenAThrow_Type.ref; - - ffi.Pointer PyAsyncGen_New( - ffi.Pointer arg0, - ffi.Pointer name, - ffi.Pointer qualname, - ) { - return _PyAsyncGen_New( - arg0, - name, - qualname, - ); - } - - late final _PyAsyncGen_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('PyAsyncGen_New'); - late final _PyAsyncGen_New = _PyAsyncGen_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _PyClassMethodDescr_Type = - _lookup('PyClassMethodDescr_Type'); - - PyTypeObject get PyClassMethodDescr_Type => _PyClassMethodDescr_Type.ref; - - late final ffi.Pointer _PyGetSetDescr_Type = - _lookup('PyGetSetDescr_Type'); - - PyTypeObject get PyGetSetDescr_Type => _PyGetSetDescr_Type.ref; - - late final ffi.Pointer _PyMemberDescr_Type = - _lookup('PyMemberDescr_Type'); - - PyTypeObject get PyMemberDescr_Type => _PyMemberDescr_Type.ref; - - late final ffi.Pointer _PyMethodDescr_Type = - _lookup('PyMethodDescr_Type'); - - PyTypeObject get PyMethodDescr_Type => _PyMethodDescr_Type.ref; - - late final ffi.Pointer _PyWrapperDescr_Type = - _lookup('PyWrapperDescr_Type'); - - PyTypeObject get PyWrapperDescr_Type => _PyWrapperDescr_Type.ref; - - late final ffi.Pointer _PyDictProxy_Type = - _lookup('PyDictProxy_Type'); - - PyTypeObject get PyDictProxy_Type => _PyDictProxy_Type.ref; - - late final ffi.Pointer _PyProperty_Type = - _lookup('PyProperty_Type'); - - PyTypeObject get PyProperty_Type => _PyProperty_Type.ref; - - ffi.Pointer PyDescr_NewMethod( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyDescr_NewMethod( - arg0, - arg1, - ); - } - - late final _PyDescr_NewMethodPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyDescr_NewMethod'); - late final _PyDescr_NewMethod = _PyDescr_NewMethodPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyDescr_NewClassMethod( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyDescr_NewClassMethod( - arg0, - arg1, - ); - } - - late final _PyDescr_NewClassMethodPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyDescr_NewClassMethod'); - late final _PyDescr_NewClassMethod = _PyDescr_NewClassMethodPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyDescr_NewMember( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyDescr_NewMember( - arg0, - arg1, - ); - } - - late final _PyDescr_NewMemberPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyDescr_NewMember'); - late final _PyDescr_NewMember = _PyDescr_NewMemberPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyDescr_NewGetSet( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyDescr_NewGetSet( - arg0, - arg1, - ); - } - - late final _PyDescr_NewGetSetPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyDescr_NewGetSet'); - late final _PyDescr_NewGetSet = _PyDescr_NewGetSetPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyDictProxy_New( - ffi.Pointer arg0, - ) { - return _PyDictProxy_New( - arg0, - ); - } - - late final _PyDictProxy_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyDictProxy_New'); - late final _PyDictProxy_New = _PyDictProxy_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyWrapper_New( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyWrapper_New( - arg0, - arg1, - ); - } - - late final _PyWrapper_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyWrapper_New'); - late final _PyWrapper_New = _PyWrapper_NewPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyMember_GetOne( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyMember_GetOne( - arg0, - arg1, - ); - } - - late final _PyMember_GetOnePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyMember_GetOne'); - late final _PyMember_GetOne = _PyMember_GetOnePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyMember_SetOne( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyMember_SetOne( - arg0, - arg1, - arg2, - ); - } - - late final _PyMember_SetOnePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyMember_SetOne'); - late final _PyMember_SetOne = _PyMember_SetOnePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer __PyMethodWrapper_Type = - _lookup('_PyMethodWrapper_Type'); - - PyTypeObject get _PyMethodWrapper_Type => __PyMethodWrapper_Type.ref; - - ffi.Pointer PyDescr_NewWrapper( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyDescr_NewWrapper( - arg0, - arg1, - arg2, - ); - } - - late final _PyDescr_NewWrapperPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyDescr_NewWrapper'); - late final _PyDescr_NewWrapper = _PyDescr_NewWrapperPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - int PyDescr_IsData( - ffi.Pointer arg0, - ) { - return _PyDescr_IsData( - arg0, - ); - } - - late final _PyDescr_IsDataPtr = - _lookup)>>( - 'PyDescr_IsData'); - late final _PyDescr_IsData = - _PyDescr_IsDataPtr.asFunction)>(); - - ffi.Pointer Py_GenericAlias( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _Py_GenericAlias( - arg0, - arg1, - ); - } - - late final _Py_GenericAliasPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('Py_GenericAlias'); - late final _Py_GenericAlias = _Py_GenericAliasPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _Py_GenericAliasType = - _lookup('Py_GenericAliasType'); - - PyTypeObject get Py_GenericAliasType => _Py_GenericAliasType.ref; - - int PyErr_WarnEx( - ffi.Pointer category, - ffi.Pointer message, - int stack_level, - ) { - return _PyErr_WarnEx( - category, - message, - stack_level, - ); - } - - late final _PyErr_WarnExPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - Py_ssize_t)>>('PyErr_WarnEx'); - late final _PyErr_WarnEx = _PyErr_WarnExPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int PyErr_WarnFormat( - ffi.Pointer category, - int stack_level, - ffi.Pointer format, - ) { - return _PyErr_WarnFormat( - category, - stack_level, - format, - ); - } - - late final _PyErr_WarnFormatPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyErr_WarnFormat'); - late final _PyErr_WarnFormat = _PyErr_WarnFormatPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); - - int PyErr_ResourceWarning( - ffi.Pointer source, - int stack_level, - ffi.Pointer format, - ) { - return _PyErr_ResourceWarning( - source, - stack_level, - format, - ); - } - - late final _PyErr_ResourceWarningPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyErr_ResourceWarning'); - late final _PyErr_ResourceWarning = _PyErr_ResourceWarningPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); - - int PyErr_WarnExplicit( - ffi.Pointer category, - ffi.Pointer message, - ffi.Pointer filename, - int lineno, - ffi.Pointer module, - ffi.Pointer registry, - ) { - return _PyErr_WarnExplicit( - category, - message, - filename, - lineno, - module, - registry, - ); - } - - late final _PyErr_WarnExplicitPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer)>>('PyErr_WarnExplicit'); - late final _PyErr_WarnExplicit = _PyErr_WarnExplicitPtr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer)>(); - - int PyErr_WarnExplicitObject( - ffi.Pointer category, - ffi.Pointer message, - ffi.Pointer filename, - int lineno, - ffi.Pointer module, - ffi.Pointer registry, - ) { - return _PyErr_WarnExplicitObject( - category, - message, - filename, - lineno, - module, - registry, - ); - } - - late final _PyErr_WarnExplicitObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer)>>('PyErr_WarnExplicitObject'); - late final _PyErr_WarnExplicitObject = - _PyErr_WarnExplicitObjectPtr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer)>(); - - int PyErr_WarnExplicitFormat( - ffi.Pointer category, - ffi.Pointer filename, - int lineno, - ffi.Pointer module, - ffi.Pointer registry, - ffi.Pointer format, - ) { - return _PyErr_WarnExplicitFormat( - category, - filename, - lineno, - module, - registry, - format, - ); - } - - late final _PyErr_WarnExplicitFormatPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyErr_WarnExplicitFormat'); - late final _PyErr_WarnExplicitFormat = - _PyErr_WarnExplicitFormatPtr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer __PyWeakref_RefType = - _lookup('_PyWeakref_RefType'); - - PyTypeObject get _PyWeakref_RefType => __PyWeakref_RefType.ref; - - late final ffi.Pointer __PyWeakref_ProxyType = - _lookup('_PyWeakref_ProxyType'); - - PyTypeObject get _PyWeakref_ProxyType => __PyWeakref_ProxyType.ref; - - late final ffi.Pointer __PyWeakref_CallableProxyType = - _lookup('_PyWeakref_CallableProxyType'); - - PyTypeObject get _PyWeakref_CallableProxyType => - __PyWeakref_CallableProxyType.ref; - - ffi.Pointer PyWeakref_NewRef( - ffi.Pointer ob, - ffi.Pointer callback, - ) { - return _PyWeakref_NewRef( - ob, - callback, - ); - } - - late final _PyWeakref_NewRefPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyWeakref_NewRef'); - late final _PyWeakref_NewRef = _PyWeakref_NewRefPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyWeakref_NewProxy( - ffi.Pointer ob, - ffi.Pointer callback, - ) { - return _PyWeakref_NewProxy( - ob, - callback, - ); - } - - late final _PyWeakref_NewProxyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyWeakref_NewProxy'); - late final _PyWeakref_NewProxy = _PyWeakref_NewProxyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyWeakref_GetObject( - ffi.Pointer ref, - ) { - return _PyWeakref_GetObject( - ref, - ); - } - - late final _PyWeakref_GetObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyWeakref_GetObject'); - late final _PyWeakref_GetObject = _PyWeakref_GetObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int _PyWeakref_GetWeakrefCount( - ffi.Pointer head, - ) { - return __PyWeakref_GetWeakrefCount( - head, - ); - } - - late final __PyWeakref_GetWeakrefCountPtr = _lookup< - ffi - .NativeFunction)>>( - '_PyWeakref_GetWeakrefCount'); - late final __PyWeakref_GetWeakrefCount = __PyWeakref_GetWeakrefCountPtr - .asFunction)>(); - - void _PyWeakref_ClearRef( - ffi.Pointer self, - ) { - return __PyWeakref_ClearRef( - self, - ); - } - - late final __PyWeakref_ClearRefPtr = _lookup< - ffi.NativeFunction)>>( - '_PyWeakref_ClearRef'); - late final __PyWeakref_ClearRef = __PyWeakref_ClearRefPtr - .asFunction)>(); - - late final ffi.Pointer> _PyStructSequence_UnnamedField = - _lookup>('PyStructSequence_UnnamedField'); - - ffi.Pointer get PyStructSequence_UnnamedField => - _PyStructSequence_UnnamedField.value; - - set PyStructSequence_UnnamedField(ffi.Pointer value) => - _PyStructSequence_UnnamedField.value = value; - - void PyStructSequence_InitType( - ffi.Pointer type, - ffi.Pointer desc, - ) { - return _PyStructSequence_InitType( - type, - desc, - ); - } - - late final _PyStructSequence_InitTypePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>( - 'PyStructSequence_InitType'); - late final _PyStructSequence_InitType = - _PyStructSequence_InitTypePtr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyStructSequence_InitType2( - ffi.Pointer type, - ffi.Pointer desc, - ) { - return _PyStructSequence_InitType2( - type, - desc, - ); - } - - late final _PyStructSequence_InitType2Ptr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>( - 'PyStructSequence_InitType2'); - late final _PyStructSequence_InitType2 = - _PyStructSequence_InitType2Ptr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyStructSequence_NewType( - ffi.Pointer desc, - ) { - return _PyStructSequence_NewType( - desc, - ); - } - - late final _PyStructSequence_NewTypePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyStructSequence_NewType'); - late final _PyStructSequence_NewType = - _PyStructSequence_NewTypePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); - - ffi.Pointer PyStructSequence_New( - ffi.Pointer type, - ) { - return _PyStructSequence_New( - type, - ); - } - - late final _PyStructSequence_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyStructSequence_New'); - late final _PyStructSequence_New = _PyStructSequence_NewPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - void PyStructSequence_SetItem( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ) { - return _PyStructSequence_SetItem( - arg0, - arg1, - arg2, - ); - } - - late final _PyStructSequence_SetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PyStructSequence_SetItem'); - late final _PyStructSequence_SetItem = - _PyStructSequence_SetItemPtr.asFunction< - void Function(ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer PyStructSequence_GetItem( - ffi.Pointer arg0, - int arg1, - ) { - return _PyStructSequence_GetItem( - arg0, - arg1, - ); - } - - late final _PyStructSequence_GetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('PyStructSequence_GetItem'); - late final _PyStructSequence_GetItem = _PyStructSequence_GetItemPtr - .asFunction Function(ffi.Pointer, int)>(); - - late final ffi.Pointer _PyPickleBuffer_Type = - _lookup('PyPickleBuffer_Type'); - - PyTypeObject get PyPickleBuffer_Type => _PyPickleBuffer_Type.ref; - - ffi.Pointer PyPickleBuffer_FromObject( - ffi.Pointer arg0, - ) { - return _PyPickleBuffer_FromObject( - arg0, - ); - } - - late final _PyPickleBuffer_FromObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyPickleBuffer_FromObject'); - late final _PyPickleBuffer_FromObject = _PyPickleBuffer_FromObjectPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyPickleBuffer_GetBuffer( - ffi.Pointer arg0, - ) { - return _PyPickleBuffer_GetBuffer( - arg0, - ); - } - - late final _PyPickleBuffer_GetBufferPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyPickleBuffer_GetBuffer'); - late final _PyPickleBuffer_GetBuffer = _PyPickleBuffer_GetBufferPtr - .asFunction Function(ffi.Pointer)>(); - - int PyPickleBuffer_Release( - ffi.Pointer arg0, - ) { - return _PyPickleBuffer_Release( - arg0, - ); - } - - late final _PyPickleBuffer_ReleasePtr = - _lookup)>>( - 'PyPickleBuffer_Release'); - late final _PyPickleBuffer_Release = _PyPickleBuffer_ReleasePtr.asFunction< - int Function(ffi.Pointer)>(); - - ffi.Pointer _PyLong_FromTime_t( - int sec, - ) { - return __PyLong_FromTime_t( - sec, - ); - } - - late final __PyLong_FromTime_tPtr = - _lookup Function(time_t)>>( - '_PyLong_FromTime_t'); - late final __PyLong_FromTime_t = - __PyLong_FromTime_tPtr.asFunction Function(int)>(); - - int _PyLong_AsTime_t( - ffi.Pointer obj, - ) { - return __PyLong_AsTime_t( - obj, - ); - } - - late final __PyLong_AsTime_tPtr = - _lookup)>>( - '_PyLong_AsTime_t'); - late final __PyLong_AsTime_t = - __PyLong_AsTime_tPtr.asFunction)>(); - - int _PyTime_ObjectToTime_t( - ffi.Pointer obj, - ffi.Pointer sec, - int arg2, - ) { - return __PyTime_ObjectToTime_t( - obj, - sec, - arg2, - ); - } - - late final __PyTime_ObjectToTime_tPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('_PyTime_ObjectToTime_t'); - late final __PyTime_ObjectToTime_t = __PyTime_ObjectToTime_tPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _PyTime_ObjectToTimeval( - ffi.Pointer obj, - ffi.Pointer sec, - ffi.Pointer usec, - int arg3, - ) { - return __PyTime_ObjectToTimeval( - obj, - sec, - usec, - arg3, - ); - } - - late final __PyTime_ObjectToTimevalPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('_PyTime_ObjectToTimeval'); - late final __PyTime_ObjectToTimeval = __PyTime_ObjectToTimevalPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - int _PyTime_ObjectToTimespec( - ffi.Pointer obj, - ffi.Pointer sec, - ffi.Pointer nsec, - int arg3, - ) { - return __PyTime_ObjectToTimespec( - obj, - sec, - nsec, - arg3, - ); - } - - late final __PyTime_ObjectToTimespecPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('_PyTime_ObjectToTimespec'); - late final __PyTime_ObjectToTimespec = - __PyTime_ObjectToTimespecPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - int _PyTime_FromSeconds( - int seconds, - ) { - return __PyTime_FromSeconds( - seconds, - ); - } - - late final __PyTime_FromSecondsPtr = - _lookup>( - '_PyTime_FromSeconds'); - late final __PyTime_FromSeconds = - __PyTime_FromSecondsPtr.asFunction(); - - int _PyTime_FromNanoseconds( - int ns, - ) { - return __PyTime_FromNanoseconds( - ns, - ); - } - - late final __PyTime_FromNanosecondsPtr = - _lookup>( - '_PyTime_FromNanoseconds'); - late final __PyTime_FromNanoseconds = - __PyTime_FromNanosecondsPtr.asFunction(); - - int _PyTime_FromMicrosecondsClamp( - int us, - ) { - return __PyTime_FromMicrosecondsClamp( - us, - ); - } - - late final __PyTime_FromMicrosecondsClampPtr = - _lookup>( - '_PyTime_FromMicrosecondsClamp'); - late final __PyTime_FromMicrosecondsClamp = - __PyTime_FromMicrosecondsClampPtr.asFunction(); - - int _PyTime_FromNanosecondsObject( - ffi.Pointer<_PyTime_t> t, - ffi.Pointer obj, - ) { - return __PyTime_FromNanosecondsObject( - t, - obj, - ); - } - - late final __PyTime_FromNanosecondsObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyTime_t>, - ffi.Pointer)>>('_PyTime_FromNanosecondsObject'); - late final __PyTime_FromNanosecondsObject = - __PyTime_FromNanosecondsObjectPtr.asFunction< - int Function(ffi.Pointer<_PyTime_t>, ffi.Pointer)>(); - - int _PyTime_FromSecondsObject( - ffi.Pointer<_PyTime_t> t, - ffi.Pointer obj, - int round, - ) { - return __PyTime_FromSecondsObject( - t, - obj, - round, - ); - } - - late final __PyTime_FromSecondsObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyTime_t>, ffi.Pointer, - ffi.Int32)>>('_PyTime_FromSecondsObject'); - late final __PyTime_FromSecondsObject = - __PyTime_FromSecondsObjectPtr.asFunction< - int Function(ffi.Pointer<_PyTime_t>, ffi.Pointer, int)>(); - - int _PyTime_FromMillisecondsObject( - ffi.Pointer<_PyTime_t> t, - ffi.Pointer obj, - int round, - ) { - return __PyTime_FromMillisecondsObject( - t, - obj, - round, - ); - } - - late final __PyTime_FromMillisecondsObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyTime_t>, ffi.Pointer, - ffi.Int32)>>('_PyTime_FromMillisecondsObject'); - late final __PyTime_FromMillisecondsObject = - __PyTime_FromMillisecondsObjectPtr.asFunction< - int Function(ffi.Pointer<_PyTime_t>, ffi.Pointer, int)>(); - - double _PyTime_AsSecondsDouble( - int t, - ) { - return __PyTime_AsSecondsDouble( - t, - ); - } - - late final __PyTime_AsSecondsDoublePtr = - _lookup>( - '_PyTime_AsSecondsDouble'); - late final __PyTime_AsSecondsDouble = - __PyTime_AsSecondsDoublePtr.asFunction(); - - int _PyTime_AsMilliseconds( - int t, - int round, - ) { - return __PyTime_AsMilliseconds( - t, - round, - ); - } - - late final __PyTime_AsMillisecondsPtr = - _lookup>( - '_PyTime_AsMilliseconds'); - late final __PyTime_AsMilliseconds = - __PyTime_AsMillisecondsPtr.asFunction(); - - int _PyTime_AsMicroseconds( - int t, - int round, - ) { - return __PyTime_AsMicroseconds( - t, - round, - ); - } - - late final __PyTime_AsMicrosecondsPtr = - _lookup>( - '_PyTime_AsMicroseconds'); - late final __PyTime_AsMicroseconds = - __PyTime_AsMicrosecondsPtr.asFunction(); - - int _PyTime_AsNanoseconds( - int t, - ) { - return __PyTime_AsNanoseconds( - t, - ); - } - - late final __PyTime_AsNanosecondsPtr = - _lookup>( - '_PyTime_AsNanoseconds'); - late final __PyTime_AsNanoseconds = - __PyTime_AsNanosecondsPtr.asFunction(); - - ffi.Pointer _PyTime_AsNanosecondsObject( - int t, - ) { - return __PyTime_AsNanosecondsObject( - t, - ); - } - - late final __PyTime_AsNanosecondsObjectPtr = - _lookup Function(_PyTime_t)>>( - '_PyTime_AsNanosecondsObject'); - late final __PyTime_AsNanosecondsObject = __PyTime_AsNanosecondsObjectPtr - .asFunction Function(int)>(); - - int _PyTime_FromTimeval( - ffi.Pointer<_PyTime_t> tp, - ffi.Pointer tv, - ) { - return __PyTime_FromTimeval( - tp, - tv, - ); - } - - late final __PyTime_FromTimevalPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyTime_t>, - ffi.Pointer)>>('_PyTime_FromTimeval'); - late final __PyTime_FromTimeval = __PyTime_FromTimevalPtr - .asFunction, ffi.Pointer)>(); - - int _PyTime_AsTimeval( - int t, - ffi.Pointer tv, - int round, - ) { - return __PyTime_AsTimeval( - t, - tv, - round, - ); - } - - late final __PyTime_AsTimevalPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(_PyTime_t, ffi.Pointer, - ffi.Int32)>>('_PyTime_AsTimeval'); - late final __PyTime_AsTimeval = __PyTime_AsTimevalPtr - .asFunction, int)>(); - - void _PyTime_AsTimeval_clamp( - int t, - ffi.Pointer tv, - int round, - ) { - return __PyTime_AsTimeval_clamp( - t, - tv, - round, - ); - } - - late final __PyTime_AsTimeval_clampPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(_PyTime_t, ffi.Pointer, - ffi.Int32)>>('_PyTime_AsTimeval_clamp'); - late final __PyTime_AsTimeval_clamp = __PyTime_AsTimeval_clampPtr - .asFunction, int)>(); - - int _PyTime_AsTimevalTime_t( - int t, - ffi.Pointer secs, - ffi.Pointer us, - int round, - ) { - return __PyTime_AsTimevalTime_t( - t, - secs, - us, - round, - ); - } - - late final __PyTime_AsTimevalTime_tPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(_PyTime_t, ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('_PyTime_AsTimevalTime_t'); - late final __PyTime_AsTimevalTime_t = __PyTime_AsTimevalTime_tPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer, int)>(); - - int _PyTime_FromTimespec( - ffi.Pointer<_PyTime_t> tp, - ffi.Pointer ts, - ) { - return __PyTime_FromTimespec( - tp, - ts, - ); - } - - late final __PyTime_FromTimespecPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_PyTime_t>, - ffi.Pointer)>>('_PyTime_FromTimespec'); - late final __PyTime_FromTimespec = __PyTime_FromTimespecPtr.asFunction< - int Function(ffi.Pointer<_PyTime_t>, ffi.Pointer)>(); - - int _PyTime_AsTimespec( - int t, - ffi.Pointer ts, - ) { - return __PyTime_AsTimespec( - t, - ts, - ); - } - - late final __PyTime_AsTimespecPtr = _lookup< - ffi - .NativeFunction)>>( - '_PyTime_AsTimespec'); - late final __PyTime_AsTimespec = __PyTime_AsTimespecPtr - .asFunction)>(); - - void _PyTime_AsTimespec_clamp( - int t, - ffi.Pointer ts, - ) { - return __PyTime_AsTimespec_clamp( - t, - ts, - ); - } - - late final __PyTime_AsTimespec_clampPtr = _lookup< - ffi - .NativeFunction)>>( - '_PyTime_AsTimespec_clamp'); - late final __PyTime_AsTimespec_clamp = __PyTime_AsTimespec_clampPtr - .asFunction)>(); - - int _PyTime_Add( - int t1, - int t2, - ) { - return __PyTime_Add( - t1, - t2, - ); - } - - late final __PyTime_AddPtr = - _lookup>( - '_PyTime_Add'); - late final __PyTime_Add = - __PyTime_AddPtr.asFunction(); - - int _PyTime_MulDiv( - int ticks, - int mul, - int div, - ) { - return __PyTime_MulDiv( - ticks, - mul, - div, - ); - } - - late final __PyTime_MulDivPtr = _lookup< - ffi - .NativeFunction<_PyTime_t Function(_PyTime_t, _PyTime_t, _PyTime_t)>>( - '_PyTime_MulDiv'); - late final __PyTime_MulDiv = - __PyTime_MulDivPtr.asFunction(); - - int _PyTime_GetSystemClock() { - return __PyTime_GetSystemClock(); - } - - late final __PyTime_GetSystemClockPtr = - _lookup>( - '_PyTime_GetSystemClock'); - late final __PyTime_GetSystemClock = - __PyTime_GetSystemClockPtr.asFunction(); - - int _PyTime_GetSystemClockWithInfo( - ffi.Pointer<_PyTime_t> t, - ffi.Pointer<_Py_clock_info_t> info, - ) { - return __PyTime_GetSystemClockWithInfo( - t, - info, - ); - } - - late final __PyTime_GetSystemClockWithInfoPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer<_PyTime_t>, ffi.Pointer<_Py_clock_info_t>)>>( - '_PyTime_GetSystemClockWithInfo'); - late final __PyTime_GetSystemClockWithInfo = - __PyTime_GetSystemClockWithInfoPtr.asFunction< - int Function( - ffi.Pointer<_PyTime_t>, ffi.Pointer<_Py_clock_info_t>)>(); - - int _PyTime_GetMonotonicClock() { - return __PyTime_GetMonotonicClock(); - } - - late final __PyTime_GetMonotonicClockPtr = - _lookup>( - '_PyTime_GetMonotonicClock'); - late final __PyTime_GetMonotonicClock = - __PyTime_GetMonotonicClockPtr.asFunction(); - - int _PyTime_GetMonotonicClockWithInfo( - ffi.Pointer<_PyTime_t> t, - ffi.Pointer<_Py_clock_info_t> info, - ) { - return __PyTime_GetMonotonicClockWithInfo( - t, - info, - ); - } - - late final __PyTime_GetMonotonicClockWithInfoPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer<_PyTime_t>, ffi.Pointer<_Py_clock_info_t>)>>( - '_PyTime_GetMonotonicClockWithInfo'); - late final __PyTime_GetMonotonicClockWithInfo = - __PyTime_GetMonotonicClockWithInfoPtr.asFunction< - int Function( - ffi.Pointer<_PyTime_t>, ffi.Pointer<_Py_clock_info_t>)>(); - - int _PyTime_localtime( - int t, - ffi.Pointer tm, - ) { - return __PyTime_localtime( - t, - tm, - ); - } - - late final __PyTime_localtimePtr = - _lookup)>>( - '_PyTime_localtime'); - late final __PyTime_localtime = - __PyTime_localtimePtr.asFunction)>(); - - int _PyTime_gmtime( - int t, - ffi.Pointer tm, - ) { - return __PyTime_gmtime( - t, - tm, - ); - } - - late final __PyTime_gmtimePtr = - _lookup)>>( - '_PyTime_gmtime'); - late final __PyTime_gmtime = - __PyTime_gmtimePtr.asFunction)>(); - - int _PyTime_GetPerfCounter() { - return __PyTime_GetPerfCounter(); - } - - late final __PyTime_GetPerfCounterPtr = - _lookup>( - '_PyTime_GetPerfCounter'); - late final __PyTime_GetPerfCounter = - __PyTime_GetPerfCounterPtr.asFunction(); - - int _PyTime_GetPerfCounterWithInfo( - ffi.Pointer<_PyTime_t> t, - ffi.Pointer<_Py_clock_info_t> info, - ) { - return __PyTime_GetPerfCounterWithInfo( - t, - info, - ); - } - - late final __PyTime_GetPerfCounterWithInfoPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer<_PyTime_t>, ffi.Pointer<_Py_clock_info_t>)>>( - '_PyTime_GetPerfCounterWithInfo'); - late final __PyTime_GetPerfCounterWithInfo = - __PyTime_GetPerfCounterWithInfoPtr.asFunction< - int Function( - ffi.Pointer<_PyTime_t>, ffi.Pointer<_Py_clock_info_t>)>(); - - int _PyDeadline_Init( - int timeout, - ) { - return __PyDeadline_Init( - timeout, - ); - } - - late final __PyDeadline_InitPtr = - _lookup>( - '_PyDeadline_Init'); - late final __PyDeadline_Init = - __PyDeadline_InitPtr.asFunction(); - - int _PyDeadline_Get( - int deadline, - ) { - return __PyDeadline_Get( - deadline, - ); - } - - late final __PyDeadline_GetPtr = - _lookup>( - '_PyDeadline_Get'); - late final __PyDeadline_Get = - __PyDeadline_GetPtr.asFunction(); - - int PyCodec_Register( - ffi.Pointer search_function, - ) { - return _PyCodec_Register( - search_function, - ); - } - - late final _PyCodec_RegisterPtr = - _lookup)>>( - 'PyCodec_Register'); - late final _PyCodec_Register = - _PyCodec_RegisterPtr.asFunction)>(); - - int PyCodec_Unregister( - ffi.Pointer search_function, - ) { - return _PyCodec_Unregister( - search_function, - ); - } - - late final _PyCodec_UnregisterPtr = - _lookup)>>( - 'PyCodec_Unregister'); - late final _PyCodec_Unregister = - _PyCodec_UnregisterPtr.asFunction)>(); - - ffi.Pointer _PyCodec_Lookup( - ffi.Pointer encoding, - ) { - return __PyCodec_Lookup( - encoding, - ); - } - - late final __PyCodec_LookupPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyCodec_Lookup'); - late final __PyCodec_Lookup = __PyCodec_LookupPtr - .asFunction Function(ffi.Pointer)>(); - - int _PyCodec_Forget( - ffi.Pointer encoding, - ) { - return __PyCodec_Forget( - encoding, - ); - } - - late final __PyCodec_ForgetPtr = - _lookup)>>( - '_PyCodec_Forget'); - late final __PyCodec_Forget = - __PyCodec_ForgetPtr.asFunction)>(); - - int PyCodec_KnownEncoding( - ffi.Pointer encoding, - ) { - return _PyCodec_KnownEncoding( - encoding, - ); - } - - late final _PyCodec_KnownEncodingPtr = - _lookup)>>( - 'PyCodec_KnownEncoding'); - late final _PyCodec_KnownEncoding = _PyCodec_KnownEncodingPtr.asFunction< - int Function(ffi.Pointer)>(); - - ffi.Pointer PyCodec_Encode( - ffi.Pointer object, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyCodec_Encode( - object, - encoding, - errors, - ); - } - - late final _PyCodec_EncodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('PyCodec_Encode'); - late final _PyCodec_Encode = _PyCodec_EncodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyCodec_Decode( - ffi.Pointer object, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyCodec_Decode( - object, - encoding, - errors, - ); - } - - late final _PyCodec_DecodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('PyCodec_Decode'); - late final _PyCodec_Decode = _PyCodec_DecodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyCodec_LookupTextEncoding( - ffi.Pointer encoding, - ffi.Pointer alternate_command, - ) { - return __PyCodec_LookupTextEncoding( - encoding, - alternate_command, - ); - } - - late final __PyCodec_LookupTextEncodingPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyCodec_LookupTextEncoding'); - late final __PyCodec_LookupTextEncoding = - __PyCodec_LookupTextEncodingPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyCodec_EncodeText( - ffi.Pointer object, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return __PyCodec_EncodeText( - object, - encoding, - errors, - ); - } - - late final __PyCodec_EncodeTextPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_PyCodec_EncodeText'); - late final __PyCodec_EncodeText = __PyCodec_EncodeTextPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyCodec_DecodeText( - ffi.Pointer object, - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return __PyCodec_DecodeText( - object, - encoding, - errors, - ); - } - - late final __PyCodec_DecodeTextPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_PyCodec_DecodeText'); - late final __PyCodec_DecodeText = __PyCodec_DecodeTextPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyCodecInfo_GetIncrementalDecoder( - ffi.Pointer codec_info, - ffi.Pointer errors, - ) { - return __PyCodecInfo_GetIncrementalDecoder( - codec_info, - errors, - ); - } - - late final __PyCodecInfo_GetIncrementalDecoderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyCodecInfo_GetIncrementalDecoder'); - late final __PyCodecInfo_GetIncrementalDecoder = - __PyCodecInfo_GetIncrementalDecoderPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyCodecInfo_GetIncrementalEncoder( - ffi.Pointer codec_info, - ffi.Pointer errors, - ) { - return __PyCodecInfo_GetIncrementalEncoder( - codec_info, - errors, - ); - } - - late final __PyCodecInfo_GetIncrementalEncoderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyCodecInfo_GetIncrementalEncoder'); - late final __PyCodecInfo_GetIncrementalEncoder = - __PyCodecInfo_GetIncrementalEncoderPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyCodec_Encoder( - ffi.Pointer encoding, - ) { - return _PyCodec_Encoder( - encoding, - ); - } - - late final _PyCodec_EncoderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCodec_Encoder'); - late final _PyCodec_Encoder = _PyCodec_EncoderPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCodec_Decoder( - ffi.Pointer encoding, - ) { - return _PyCodec_Decoder( - encoding, - ); - } - - late final _PyCodec_DecoderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCodec_Decoder'); - late final _PyCodec_Decoder = _PyCodec_DecoderPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCodec_IncrementalEncoder( - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyCodec_IncrementalEncoder( - encoding, - errors, - ); - } - - late final _PyCodec_IncrementalEncoderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyCodec_IncrementalEncoder'); - late final _PyCodec_IncrementalEncoder = - _PyCodec_IncrementalEncoderPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyCodec_IncrementalDecoder( - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _PyCodec_IncrementalDecoder( - encoding, - errors, - ); - } - - late final _PyCodec_IncrementalDecoderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyCodec_IncrementalDecoder'); - late final _PyCodec_IncrementalDecoder = - _PyCodec_IncrementalDecoderPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyCodec_StreamReader( - ffi.Pointer encoding, - ffi.Pointer stream, - ffi.Pointer errors, - ) { - return _PyCodec_StreamReader( - encoding, - stream, - errors, - ); - } - - late final _PyCodec_StreamReaderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyCodec_StreamReader'); - late final _PyCodec_StreamReader = _PyCodec_StreamReaderPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyCodec_StreamWriter( - ffi.Pointer encoding, - ffi.Pointer stream, - ffi.Pointer errors, - ) { - return _PyCodec_StreamWriter( - encoding, - stream, - errors, - ); - } - - late final _PyCodec_StreamWriterPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyCodec_StreamWriter'); - late final _PyCodec_StreamWriter = _PyCodec_StreamWriterPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - int PyCodec_RegisterError( - ffi.Pointer name, - ffi.Pointer error, - ) { - return _PyCodec_RegisterError( - name, - error, - ); - } - - late final _PyCodec_RegisterErrorPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyCodec_RegisterError'); - late final _PyCodec_RegisterError = _PyCodec_RegisterErrorPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyCodec_LookupError( - ffi.Pointer name, - ) { - return _PyCodec_LookupError( - name, - ); - } - - late final _PyCodec_LookupErrorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCodec_LookupError'); - late final _PyCodec_LookupError = _PyCodec_LookupErrorPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCodec_StrictErrors( - ffi.Pointer exc, - ) { - return _PyCodec_StrictErrors( - exc, - ); - } - - late final _PyCodec_StrictErrorsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCodec_StrictErrors'); - late final _PyCodec_StrictErrors = _PyCodec_StrictErrorsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCodec_IgnoreErrors( - ffi.Pointer exc, - ) { - return _PyCodec_IgnoreErrors( - exc, - ); - } - - late final _PyCodec_IgnoreErrorsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCodec_IgnoreErrors'); - late final _PyCodec_IgnoreErrors = _PyCodec_IgnoreErrorsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCodec_ReplaceErrors( - ffi.Pointer exc, - ) { - return _PyCodec_ReplaceErrors( - exc, - ); - } - - late final _PyCodec_ReplaceErrorsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCodec_ReplaceErrors'); - late final _PyCodec_ReplaceErrors = _PyCodec_ReplaceErrorsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCodec_XMLCharRefReplaceErrors( - ffi.Pointer exc, - ) { - return _PyCodec_XMLCharRefReplaceErrors( - exc, - ); - } - - late final _PyCodec_XMLCharRefReplaceErrorsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCodec_XMLCharRefReplaceErrors'); - late final _PyCodec_XMLCharRefReplaceErrors = - _PyCodec_XMLCharRefReplaceErrorsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCodec_BackslashReplaceErrors( - ffi.Pointer exc, - ) { - return _PyCodec_BackslashReplaceErrors( - exc, - ); - } - - late final _PyCodec_BackslashReplaceErrorsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCodec_BackslashReplaceErrors'); - late final _PyCodec_BackslashReplaceErrors = - _PyCodec_BackslashReplaceErrorsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyCodec_NameReplaceErrors( - ffi.Pointer exc, - ) { - return _PyCodec_NameReplaceErrors( - exc, - ); - } - - late final _PyCodec_NameReplaceErrorsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyCodec_NameReplaceErrors'); - late final _PyCodec_NameReplaceErrors = _PyCodec_NameReplaceErrorsPtr - .asFunction Function(ffi.Pointer)>(); - - late final ffi.Pointer> _Py_hexdigits = - _lookup>('Py_hexdigits'); - - ffi.Pointer get Py_hexdigits => _Py_hexdigits.value; - - set Py_hexdigits(ffi.Pointer value) => _Py_hexdigits.value = value; - - void PyThread_init_thread() { - return _PyThread_init_thread(); - } - - late final _PyThread_init_threadPtr = - _lookup>('PyThread_init_thread'); - late final _PyThread_init_thread = - _PyThread_init_threadPtr.asFunction(); - - int PyThread_start_new_thread( - ffi.Pointer)>> - arg0, - ffi.Pointer arg1, - ) { - return _PyThread_start_new_thread( - arg0, - arg1, - ); - } - - late final _PyThread_start_new_threadPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer< - ffi.NativeFunction)>>, - ffi.Pointer)>>('PyThread_start_new_thread'); - late final _PyThread_start_new_thread = - _PyThread_start_new_threadPtr.asFunction< - int Function( - ffi.Pointer< - ffi.NativeFunction)>>, - ffi.Pointer)>(); - - void PyThread_exit_thread() { - return _PyThread_exit_thread(); - } - - late final _PyThread_exit_threadPtr = - _lookup>('PyThread_exit_thread'); - late final _PyThread_exit_thread = - _PyThread_exit_threadPtr.asFunction(); - - int PyThread_get_thread_ident() { - return _PyThread_get_thread_ident(); - } - - late final _PyThread_get_thread_identPtr = - _lookup>( - 'PyThread_get_thread_ident'); - late final _PyThread_get_thread_ident = - _PyThread_get_thread_identPtr.asFunction(); - - int PyThread_get_thread_native_id() { - return _PyThread_get_thread_native_id(); - } - - late final _PyThread_get_thread_native_idPtr = - _lookup>( - 'PyThread_get_thread_native_id'); - late final _PyThread_get_thread_native_id = - _PyThread_get_thread_native_idPtr.asFunction(); - - PyThread_type_lock PyThread_allocate_lock() { - return _PyThread_allocate_lock(); - } - - late final _PyThread_allocate_lockPtr = - _lookup>( - 'PyThread_allocate_lock'); - late final _PyThread_allocate_lock = - _PyThread_allocate_lockPtr.asFunction(); - - void PyThread_free_lock( - PyThread_type_lock arg0, - ) { - return _PyThread_free_lock( - arg0, - ); - } - - late final _PyThread_free_lockPtr = - _lookup>( - 'PyThread_free_lock'); - late final _PyThread_free_lock = - _PyThread_free_lockPtr.asFunction(); - - int PyThread_acquire_lock( - PyThread_type_lock arg0, - int arg1, - ) { - return _PyThread_acquire_lock( - arg0, - arg1, - ); - } - - late final _PyThread_acquire_lockPtr = _lookup< - ffi.NativeFunction>( - 'PyThread_acquire_lock'); - late final _PyThread_acquire_lock = _PyThread_acquire_lockPtr.asFunction< - int Function(PyThread_type_lock, int)>(); - - int PyThread_acquire_lock_timed( - PyThread_type_lock arg0, - int microseconds, - int intr_flag, - ) { - return _PyThread_acquire_lock_timed( - arg0, - microseconds, - intr_flag, - ); - } - - late final _PyThread_acquire_lock_timedPtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(PyThread_type_lock, ffi.LongLong, - ffi.Int)>>('PyThread_acquire_lock_timed'); - late final _PyThread_acquire_lock_timed = _PyThread_acquire_lock_timedPtr - .asFunction(); - - void PyThread_release_lock( - PyThread_type_lock arg0, - ) { - return _PyThread_release_lock( - arg0, - ); - } - - late final _PyThread_release_lockPtr = - _lookup>( - 'PyThread_release_lock'); - late final _PyThread_release_lock = - _PyThread_release_lockPtr.asFunction(); - - int PyThread_get_stacksize() { - return _PyThread_get_stacksize(); - } - - late final _PyThread_get_stacksizePtr = - _lookup>( - 'PyThread_get_stacksize'); - late final _PyThread_get_stacksize = - _PyThread_get_stacksizePtr.asFunction(); - - int PyThread_set_stacksize( - int arg0, - ) { - return _PyThread_set_stacksize( - arg0, - ); - } - - late final _PyThread_set_stacksizePtr = - _lookup>( - 'PyThread_set_stacksize'); - late final _PyThread_set_stacksize = - _PyThread_set_stacksizePtr.asFunction(); - - ffi.Pointer PyThread_GetInfo() { - return _PyThread_GetInfo(); - } - - late final _PyThread_GetInfoPtr = - _lookup Function()>>( - 'PyThread_GetInfo'); - late final _PyThread_GetInfo = - _PyThread_GetInfoPtr.asFunction Function()>(); - - int PyThread_create_key() { - return _PyThread_create_key(); - } - - late final _PyThread_create_keyPtr = - _lookup>('PyThread_create_key'); - late final _PyThread_create_key = - _PyThread_create_keyPtr.asFunction(); - - void PyThread_delete_key( - int key, - ) { - return _PyThread_delete_key( - key, - ); - } - - late final _PyThread_delete_keyPtr = - _lookup>( - 'PyThread_delete_key'); - late final _PyThread_delete_key = - _PyThread_delete_keyPtr.asFunction(); - - int PyThread_set_key_value( - int key, - ffi.Pointer value, - ) { - return _PyThread_set_key_value( - key, - value, - ); - } - - late final _PyThread_set_key_valuePtr = _lookup< - ffi.NativeFunction)>>( - 'PyThread_set_key_value'); - late final _PyThread_set_key_value = _PyThread_set_key_valuePtr.asFunction< - int Function(int, ffi.Pointer)>(); - - ffi.Pointer PyThread_get_key_value( - int key, - ) { - return _PyThread_get_key_value( - key, - ); - } - - late final _PyThread_get_key_valuePtr = - _lookup Function(ffi.Int)>>( - 'PyThread_get_key_value'); - late final _PyThread_get_key_value = _PyThread_get_key_valuePtr.asFunction< - ffi.Pointer Function(int)>(); - - void PyThread_delete_key_value( - int key, - ) { - return _PyThread_delete_key_value( - key, - ); - } - - late final _PyThread_delete_key_valuePtr = - _lookup>( - 'PyThread_delete_key_value'); - late final _PyThread_delete_key_value = - _PyThread_delete_key_valuePtr.asFunction(); - - void PyThread_ReInitTLS() { - return _PyThread_ReInitTLS(); - } - - late final _PyThread_ReInitTLSPtr = - _lookup>('PyThread_ReInitTLS'); - late final _PyThread_ReInitTLS = - _PyThread_ReInitTLSPtr.asFunction(); - - ffi.Pointer PyThread_tss_alloc() { - return _PyThread_tss_alloc(); - } - - late final _PyThread_tss_allocPtr = - _lookup Function()>>( - 'PyThread_tss_alloc'); - late final _PyThread_tss_alloc = - _PyThread_tss_allocPtr.asFunction Function()>(); - - void PyThread_tss_free( - ffi.Pointer key, - ) { - return _PyThread_tss_free( - key, - ); - } - - late final _PyThread_tss_freePtr = - _lookup)>>( - 'PyThread_tss_free'); - late final _PyThread_tss_free = - _PyThread_tss_freePtr.asFunction)>(); - - int PyThread_tss_is_created( - ffi.Pointer key, - ) { - return _PyThread_tss_is_created( - key, - ); - } - - late final _PyThread_tss_is_createdPtr = - _lookup)>>( - 'PyThread_tss_is_created'); - late final _PyThread_tss_is_created = _PyThread_tss_is_createdPtr.asFunction< - int Function(ffi.Pointer)>(); - - int PyThread_tss_create( - ffi.Pointer key, - ) { - return _PyThread_tss_create( - key, - ); - } - - late final _PyThread_tss_createPtr = - _lookup)>>( - 'PyThread_tss_create'); - late final _PyThread_tss_create = - _PyThread_tss_createPtr.asFunction)>(); - - void PyThread_tss_delete( - ffi.Pointer key, - ) { - return _PyThread_tss_delete( - key, - ); - } - - late final _PyThread_tss_deletePtr = - _lookup)>>( - 'PyThread_tss_delete'); - late final _PyThread_tss_delete = _PyThread_tss_deletePtr.asFunction< - void Function(ffi.Pointer)>(); - - int PyThread_tss_set( - ffi.Pointer key, - ffi.Pointer value, - ) { - return _PyThread_tss_set( - key, - value, - ); - } - - late final _PyThread_tss_setPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyThread_tss_set'); - late final _PyThread_tss_set = _PyThread_tss_setPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyThread_tss_get( - ffi.Pointer key, - ) { - return _PyThread_tss_get( - key, - ); - } - - late final _PyThread_tss_getPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyThread_tss_get'); - late final _PyThread_tss_get = _PyThread_tss_getPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int _PyThread_at_fork_reinit( - ffi.Pointer lock, - ) { - return __PyThread_at_fork_reinit( - lock, - ); - } - - late final __PyThread_at_fork_reinitPtr = _lookup< - ffi - .NativeFunction)>>( - '_PyThread_at_fork_reinit'); - late final __PyThread_at_fork_reinit = __PyThread_at_fork_reinitPtr - .asFunction)>(); - - late final ffi.Pointer _PyContext_Type = - _lookup('PyContext_Type'); - - PyTypeObject get PyContext_Type => _PyContext_Type.ref; - - late final ffi.Pointer _PyContextVar_Type = - _lookup('PyContextVar_Type'); - - PyTypeObject get PyContextVar_Type => _PyContextVar_Type.ref; - - late final ffi.Pointer _PyContextToken_Type = - _lookup('PyContextToken_Type'); - - PyTypeObject get PyContextToken_Type => _PyContextToken_Type.ref; - - ffi.Pointer PyContext_New() { - return _PyContext_New(); - } - - late final _PyContext_NewPtr = - _lookup Function()>>( - 'PyContext_New'); - late final _PyContext_New = - _PyContext_NewPtr.asFunction Function()>(); - - ffi.Pointer PyContext_Copy( - ffi.Pointer arg0, - ) { - return _PyContext_Copy( - arg0, - ); - } - - late final _PyContext_CopyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyContext_Copy'); - late final _PyContext_Copy = _PyContext_CopyPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyContext_CopyCurrent() { - return _PyContext_CopyCurrent(); - } - - late final _PyContext_CopyCurrentPtr = - _lookup Function()>>( - 'PyContext_CopyCurrent'); - late final _PyContext_CopyCurrent = - _PyContext_CopyCurrentPtr.asFunction Function()>(); - - int PyContext_Enter( - ffi.Pointer arg0, - ) { - return _PyContext_Enter( - arg0, - ); - } - - late final _PyContext_EnterPtr = - _lookup)>>( - 'PyContext_Enter'); - late final _PyContext_Enter = - _PyContext_EnterPtr.asFunction)>(); - - int PyContext_Exit( - ffi.Pointer arg0, - ) { - return _PyContext_Exit( - arg0, - ); - } - - late final _PyContext_ExitPtr = - _lookup)>>( - 'PyContext_Exit'); - late final _PyContext_Exit = - _PyContext_ExitPtr.asFunction)>(); - - ffi.Pointer PyContextVar_New( - ffi.Pointer name, - ffi.Pointer default_value, - ) { - return _PyContextVar_New( - name, - default_value, - ); - } - - late final _PyContextVar_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyContextVar_New'); - late final _PyContextVar_New = _PyContextVar_NewPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyContextVar_Get( - ffi.Pointer var1, - ffi.Pointer default_value, - ffi.Pointer> value, - ) { - return _PyContextVar_Get( - var1, - default_value, - value, - ); - } - - late final _PyContextVar_GetPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>('PyContextVar_Get'); - late final _PyContextVar_Get = _PyContextVar_GetPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); - - ffi.Pointer PyContextVar_Set( - ffi.Pointer var1, - ffi.Pointer value, - ) { - return _PyContextVar_Set( - var1, - value, - ); - } - - late final _PyContextVar_SetPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyContextVar_Set'); - late final _PyContextVar_Set = _PyContextVar_SetPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyContextVar_Reset( - ffi.Pointer var1, - ffi.Pointer token, - ) { - return _PyContextVar_Reset( - var1, - token, - ); - } - - late final _PyContextVar_ResetPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyContextVar_Reset'); - late final _PyContextVar_Reset = _PyContextVar_ResetPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyContext_NewHamtForTests() { - return __PyContext_NewHamtForTests(); - } - - late final __PyContext_NewHamtForTestsPtr = - _lookup Function()>>( - '_PyContext_NewHamtForTests'); - late final __PyContext_NewHamtForTests = __PyContext_NewHamtForTestsPtr - .asFunction Function()>(); - - int PyArg_Parse( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyArg_Parse( - arg0, - arg1, - ); - } - - late final _PyArg_ParsePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PyArg_Parse'); - late final _PyArg_Parse = _PyArg_ParsePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyArg_ParseTuple( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyArg_ParseTuple( - arg0, - arg1, - ); - } - - late final _PyArg_ParseTuplePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyArg_ParseTuple'); - late final _PyArg_ParseTuple = _PyArg_ParseTuplePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyArg_ParseTupleAndKeywords( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - ) { - return _PyArg_ParseTupleAndKeywords( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final _PyArg_ParseTupleAndKeywordsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>>( - 'PyArg_ParseTupleAndKeywords'); - late final _PyArg_ParseTupleAndKeywords = - _PyArg_ParseTupleAndKeywordsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - int PyArg_VaParse( - ffi.Pointer arg0, - ffi.Pointer arg1, - va_list arg2, - ) { - return _PyArg_VaParse( - arg0, - arg1, - arg2, - ); - } - - late final _PyArg_VaParsePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - va_list)>>('PyArg_VaParse'); - late final _PyArg_VaParse = _PyArg_VaParsePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, va_list)>(); - - int PyArg_VaParseTupleAndKeywords( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - va_list arg4, - ) { - return _PyArg_VaParseTupleAndKeywords( - arg0, - arg1, - arg2, - arg3, - arg4, - ); - } - - late final _PyArg_VaParseTupleAndKeywordsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - va_list)>>('PyArg_VaParseTupleAndKeywords'); - late final _PyArg_VaParseTupleAndKeywords = - _PyArg_VaParseTupleAndKeywordsPtr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - va_list)>(); - - int PyArg_ValidateKeywordArguments( - ffi.Pointer arg0, - ) { - return _PyArg_ValidateKeywordArguments( - arg0, - ); - } - - late final _PyArg_ValidateKeywordArgumentsPtr = - _lookup)>>( - 'PyArg_ValidateKeywordArguments'); - late final _PyArg_ValidateKeywordArguments = - _PyArg_ValidateKeywordArgumentsPtr.asFunction< - int Function(ffi.Pointer)>(); - - int PyArg_UnpackTuple( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - int arg3, - ) { - return _PyArg_UnpackTuple( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final _PyArg_UnpackTuplePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - Py_ssize_t, Py_ssize_t)>>('PyArg_UnpackTuple'); - late final _PyArg_UnpackTuple = _PyArg_UnpackTuplePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - ffi.Pointer Py_BuildValue( - ffi.Pointer arg0, - ) { - return _Py_BuildValue( - arg0, - ); - } - - late final _Py_BuildValuePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('Py_BuildValue'); - late final _Py_BuildValue = _Py_BuildValuePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer _Py_BuildValue_SizeT( - ffi.Pointer arg0, - ) { - return __Py_BuildValue_SizeT( - arg0, - ); - } - - late final __Py_BuildValue_SizeTPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_Py_BuildValue_SizeT'); - late final __Py_BuildValue_SizeT = __Py_BuildValue_SizeTPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer Py_VaBuildValue( - ffi.Pointer arg0, - va_list arg1, - ) { - return _Py_VaBuildValue( - arg0, - arg1, - ); - } - - late final _Py_VaBuildValuePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, va_list)>>('Py_VaBuildValue'); - late final _Py_VaBuildValue = _Py_VaBuildValuePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, va_list)>(); - - int PyModule_AddObjectRef( - ffi.Pointer mod, - ffi.Pointer name, - ffi.Pointer value, - ) { - return _PyModule_AddObjectRef( - mod, - name, - value, - ); - } - - late final _PyModule_AddObjectRefPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyModule_AddObjectRef'); - late final _PyModule_AddObjectRef = _PyModule_AddObjectRefPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyModule_AddObject( - ffi.Pointer mod, - ffi.Pointer arg1, - ffi.Pointer value, - ) { - return _PyModule_AddObject( - mod, - arg1, - value, - ); - } - - late final _PyModule_AddObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyModule_AddObject'); - late final _PyModule_AddObject = _PyModule_AddObjectPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyModule_AddIntConstant( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return _PyModule_AddIntConstant( - arg0, - arg1, - arg2, - ); - } - - late final _PyModule_AddIntConstantPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Long)>>('PyModule_AddIntConstant'); - late final _PyModule_AddIntConstant = _PyModule_AddIntConstantPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int PyModule_AddStringConstant( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyModule_AddStringConstant( - arg0, - arg1, - arg2, - ); - } - - late final _PyModule_AddStringConstantPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyModule_AddStringConstant'); - late final _PyModule_AddStringConstant = - _PyModule_AddStringConstantPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyModule_AddType( - ffi.Pointer module, - ffi.Pointer type, - ) { - return _PyModule_AddType( - module, - type, - ); - } - - late final _PyModule_AddTypePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyModule_AddType'); - late final _PyModule_AddType = _PyModule_AddTypePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyModule_SetDocString( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyModule_SetDocString( - arg0, - arg1, - ); - } - - late final _PyModule_SetDocStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyModule_SetDocString'); - late final _PyModule_SetDocString = _PyModule_SetDocStringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyModule_AddFunctions( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyModule_AddFunctions( - arg0, - arg1, - ); - } - - late final _PyModule_AddFunctionsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyModule_AddFunctions'); - late final _PyModule_AddFunctions = _PyModule_AddFunctionsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyModule_ExecDef( - ffi.Pointer module, - ffi.Pointer def, - ) { - return _PyModule_ExecDef( - module, - def, - ); - } - - late final _PyModule_ExecDefPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyModule_ExecDef'); - late final _PyModule_ExecDef = _PyModule_ExecDefPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyModule_Create2( - ffi.Pointer arg0, - int apiver, - ) { - return _PyModule_Create2( - arg0, - apiver, - ); - } - - late final _PyModule_Create2Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyModule_Create2'); - late final _PyModule_Create2 = _PyModule_Create2Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer PyModule_FromDefAndSpec2( - ffi.Pointer def, - ffi.Pointer spec, - int module_api_version, - ) { - return _PyModule_FromDefAndSpec2( - def, - spec, - module_api_version, - ); - } - - late final _PyModule_FromDefAndSpec2Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('PyModule_FromDefAndSpec2'); - late final _PyModule_FromDefAndSpec2 = - _PyModule_FromDefAndSpec2Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _Py_VaBuildValue_SizeT( - ffi.Pointer arg0, - va_list arg1, - ) { - return __Py_VaBuildValue_SizeT( - arg0, - arg1, - ); - } - - late final __Py_VaBuildValue_SizeTPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, va_list)>>('_Py_VaBuildValue_SizeT'); - late final __Py_VaBuildValue_SizeT = __Py_VaBuildValue_SizeTPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, va_list)>(); - - ffi.Pointer> _Py_VaBuildStack_SizeT( - ffi.Pointer> small_stack, - int small_stack_len, - ffi.Pointer format, - va_list va, - ffi.Pointer p_nargs, - ) { - return __Py_VaBuildStack_SizeT( - small_stack, - small_stack_len, - format, - va, - p_nargs, - ); - } - - late final __Py_VaBuildStack_SizeTPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Pointer>, - Py_ssize_t, - ffi.Pointer, - va_list, - ffi.Pointer)>>('_Py_VaBuildStack_SizeT'); - late final __Py_VaBuildStack_SizeT = __Py_VaBuildStack_SizeTPtr.asFunction< - ffi.Pointer> Function( - ffi.Pointer>, - int, - ffi.Pointer, - va_list, - ffi.Pointer)>(); - - int _PyArg_UnpackStack( - ffi.Pointer> args, - int nargs, - ffi.Pointer name, - int min, - int max, - ) { - return __PyArg_UnpackStack( - args, - nargs, - name, - min, - max, - ); - } - - late final __PyArg_UnpackStackPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, - Py_ssize_t, - ffi.Pointer, - Py_ssize_t, - Py_ssize_t)>>('_PyArg_UnpackStack'); - late final __PyArg_UnpackStack = __PyArg_UnpackStackPtr.asFunction< - int Function(ffi.Pointer>, int, - ffi.Pointer, int, int)>(); - - int _PyArg_NoKeywords( - ffi.Pointer funcname, - ffi.Pointer kwargs, - ) { - return __PyArg_NoKeywords( - funcname, - kwargs, - ); - } - - late final __PyArg_NoKeywordsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyArg_NoKeywords'); - late final __PyArg_NoKeywords = __PyArg_NoKeywordsPtr - .asFunction, ffi.Pointer)>(); - - int _PyArg_NoKwnames( - ffi.Pointer funcname, - ffi.Pointer kwnames, - ) { - return __PyArg_NoKwnames( - funcname, - kwnames, - ); - } - - late final __PyArg_NoKwnamesPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyArg_NoKwnames'); - late final __PyArg_NoKwnames = __PyArg_NoKwnamesPtr - .asFunction, ffi.Pointer)>(); - - int _PyArg_NoPositional( - ffi.Pointer funcname, - ffi.Pointer args, - ) { - return __PyArg_NoPositional( - funcname, - args, - ); - } - - late final __PyArg_NoPositionalPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyArg_NoPositional'); - late final __PyArg_NoPositional = __PyArg_NoPositionalPtr - .asFunction, ffi.Pointer)>(); - - void _PyArg_BadArgument( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) { - return __PyArg_BadArgument( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final __PyArg_BadArgumentPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_PyArg_BadArgument'); - late final __PyArg_BadArgument = __PyArg_BadArgumentPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - int _PyArg_CheckPositional( - ffi.Pointer arg0, - int arg1, - int arg2, - int arg3, - ) { - return __PyArg_CheckPositional( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final __PyArg_CheckPositionalPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, Py_ssize_t, - Py_ssize_t)>>('_PyArg_CheckPositional'); - late final __PyArg_CheckPositional = __PyArg_CheckPositionalPtr - .asFunction, int, int, int)>(); - - ffi.Pointer> _Py_VaBuildStack( - ffi.Pointer> small_stack, - int small_stack_len, - ffi.Pointer format, - va_list va, - ffi.Pointer p_nargs, - ) { - return __Py_VaBuildStack( - small_stack, - small_stack_len, - format, - va, - p_nargs, - ); - } - - late final __Py_VaBuildStackPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Pointer>, - Py_ssize_t, - ffi.Pointer, - va_list, - ffi.Pointer)>>('_Py_VaBuildStack'); - late final __Py_VaBuildStack = __Py_VaBuildStackPtr.asFunction< - ffi.Pointer> Function( - ffi.Pointer>, - int, - ffi.Pointer, - va_list, - ffi.Pointer)>(); - - int _PyArg_ParseTupleAndKeywordsFast( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer<_PyArg_Parser> arg2, - ) { - return __PyArg_ParseTupleAndKeywordsFast( - arg0, - arg1, - arg2, - ); - } - - late final __PyArg_ParseTupleAndKeywordsFastPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_PyArg_Parser>)>>('_PyArg_ParseTupleAndKeywordsFast'); - late final __PyArg_ParseTupleAndKeywordsFast = - __PyArg_ParseTupleAndKeywordsFastPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_PyArg_Parser>)>(); - - int _PyArg_ParseStack( - ffi.Pointer> args, - int nargs, - ffi.Pointer format, - ) { - return __PyArg_ParseStack( - args, - nargs, - format, - ); - } - - late final __PyArg_ParseStackPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, Py_ssize_t, - ffi.Pointer)>>('_PyArg_ParseStack'); - late final __PyArg_ParseStack = __PyArg_ParseStackPtr.asFunction< - int Function( - ffi.Pointer>, int, ffi.Pointer)>(); - - int _PyArg_ParseStackAndKeywords( - ffi.Pointer> args, - int nargs, - ffi.Pointer kwnames, - ffi.Pointer<_PyArg_Parser> arg3, - ) { - return __PyArg_ParseStackAndKeywords( - args, - nargs, - kwnames, - arg3, - ); - } - - late final __PyArg_ParseStackAndKeywordsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer<_PyArg_Parser>)>>('_PyArg_ParseStackAndKeywords'); - late final __PyArg_ParseStackAndKeywords = - __PyArg_ParseStackAndKeywordsPtr.asFunction< - int Function(ffi.Pointer>, int, - ffi.Pointer, ffi.Pointer<_PyArg_Parser>)>(); - - int _PyArg_VaParseTupleAndKeywordsFast( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer<_PyArg_Parser> arg2, - va_list arg3, - ) { - return __PyArg_VaParseTupleAndKeywordsFast( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final __PyArg_VaParseTupleAndKeywordsFastPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_PyArg_Parser>, - va_list)>>('_PyArg_VaParseTupleAndKeywordsFast'); - late final __PyArg_VaParseTupleAndKeywordsFast = - __PyArg_VaParseTupleAndKeywordsFastPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_PyArg_Parser>, va_list)>(); - - ffi.Pointer> _PyArg_UnpackKeywords( - ffi.Pointer> args, - int nargs, - ffi.Pointer kwargs, - ffi.Pointer kwnames, - ffi.Pointer<_PyArg_Parser> parser, - int minpos, - int maxpos, - int minkw, - ffi.Pointer> buf, - ) { - return __PyArg_UnpackKeywords( - args, - nargs, - kwargs, - kwnames, - parser, - minpos, - maxpos, - minkw, - buf, - ); - } - - late final __PyArg_UnpackKeywordsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Pointer>, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_PyArg_Parser>, - ffi.Int, - ffi.Int, - ffi.Int, - ffi.Pointer>)>>('_PyArg_UnpackKeywords'); - late final __PyArg_UnpackKeywords = __PyArg_UnpackKeywordsPtr.asFunction< - ffi.Pointer> Function( - ffi.Pointer>, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_PyArg_Parser>, - int, - int, - int, - ffi.Pointer>)>(); - - ffi.Pointer> _PyArg_UnpackKeywordsWithVararg( - ffi.Pointer> args, - int nargs, - ffi.Pointer kwargs, - ffi.Pointer kwnames, - ffi.Pointer<_PyArg_Parser> parser, - int minpos, - int maxpos, - int minkw, - int vararg, - ffi.Pointer> buf, - ) { - return __PyArg_UnpackKeywordsWithVararg( - args, - nargs, - kwargs, - kwnames, - parser, - minpos, - maxpos, - minkw, - vararg, - buf, - ); - } - - late final __PyArg_UnpackKeywordsWithVarargPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Pointer>, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_PyArg_Parser>, - ffi.Int, - ffi.Int, - ffi.Int, - ffi.Int, - ffi.Pointer>)>>( - '_PyArg_UnpackKeywordsWithVararg'); - late final __PyArg_UnpackKeywordsWithVararg = - __PyArg_UnpackKeywordsWithVarargPtr.asFunction< - ffi.Pointer> Function( - ffi.Pointer>, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_PyArg_Parser>, - int, - int, - int, - int, - ffi.Pointer>)>(); - - ffi.Pointer _PyModule_CreateInitialized( - ffi.Pointer arg0, - int apiver, - ) { - return __PyModule_CreateInitialized( - arg0, - apiver, - ); - } - - late final __PyModule_CreateInitializedPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Int)>>('_PyModule_CreateInitialized'); - late final __PyModule_CreateInitialized = - __PyModule_CreateInitializedPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - int _PyModule_Add( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return __PyModule_Add( - arg0, - arg1, - arg2, - ); - } - - late final __PyModule_AddPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('_PyModule_Add'); - late final __PyModule_Add = __PyModule_AddPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyCompile_OpcodeStackEffect( - int opcode, - int oparg, - ) { - return _PyCompile_OpcodeStackEffect( - opcode, - oparg, - ); - } - - late final _PyCompile_OpcodeStackEffectPtr = - _lookup>( - 'PyCompile_OpcodeStackEffect'); - late final _PyCompile_OpcodeStackEffect = - _PyCompile_OpcodeStackEffectPtr.asFunction(); - - int PyCompile_OpcodeStackEffectWithJump( - int opcode, - int oparg, - int jump, - ) { - return _PyCompile_OpcodeStackEffectWithJump( - opcode, - oparg, - jump, - ); - } - - late final _PyCompile_OpcodeStackEffectWithJumpPtr = - _lookup>( - 'PyCompile_OpcodeStackEffectWithJump'); - late final _PyCompile_OpcodeStackEffectWithJump = - _PyCompile_OpcodeStackEffectWithJumpPtr.asFunction< - int Function(int, int, int)>(); - - ffi.Pointer Py_CompileString( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return _Py_CompileString( - arg0, - arg1, - arg2, - ); - } - - late final _Py_CompileStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('Py_CompileString'); - late final _Py_CompileString = _Py_CompileStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - void PyErr_Print() { - return _PyErr_Print(); - } - - late final _PyErr_PrintPtr = - _lookup>('PyErr_Print'); - late final _PyErr_Print = _PyErr_PrintPtr.asFunction(); - - void PyErr_PrintEx( - int arg0, - ) { - return _PyErr_PrintEx( - arg0, - ); - } - - late final _PyErr_PrintExPtr = - _lookup>('PyErr_PrintEx'); - late final _PyErr_PrintEx = - _PyErr_PrintExPtr.asFunction(); - - void PyErr_Display( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyErr_Display( - arg0, - arg1, - arg2, - ); - } - - late final _PyErr_DisplayPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyErr_Display'); - late final _PyErr_Display = _PyErr_DisplayPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void PyErr_DisplayException( - ffi.Pointer arg0, - ) { - return _PyErr_DisplayException( - arg0, - ); - } - - late final _PyErr_DisplayExceptionPtr = - _lookup)>>( - 'PyErr_DisplayException'); - late final _PyErr_DisplayException = _PyErr_DisplayExceptionPtr.asFunction< - void Function(ffi.Pointer)>(); - - late final ffi.Pointer>> - _PyOS_InputHook = - _lookup>>( - 'PyOS_InputHook'); - - ffi.Pointer> get PyOS_InputHook => - _PyOS_InputHook.value; - - set PyOS_InputHook( - ffi.Pointer> value) => - _PyOS_InputHook.value = value; - - int PyRun_SimpleStringFlags( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyRun_SimpleStringFlags( - arg0, - arg1, - ); - } - - late final _PyRun_SimpleStringFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyRun_SimpleStringFlags'); - late final _PyRun_SimpleStringFlags = _PyRun_SimpleStringFlagsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _PyRun_SimpleFileObject( - ffi.Pointer fp, - ffi.Pointer filename, - int closeit, - ffi.Pointer flags, - ) { - return __PyRun_SimpleFileObject( - fp, - filename, - closeit, - flags, - ); - } - - late final __PyRun_SimpleFileObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int, - ffi.Pointer)>>('_PyRun_SimpleFileObject'); - late final __PyRun_SimpleFileObject = __PyRun_SimpleFileObjectPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - int PyRun_AnyFileExFlags( - ffi.Pointer fp, - ffi.Pointer filename, - int closeit, - ffi.Pointer flags, - ) { - return _PyRun_AnyFileExFlags( - fp, - filename, - closeit, - flags, - ); - } - - late final _PyRun_AnyFileExFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int, - ffi.Pointer)>>('PyRun_AnyFileExFlags'); - late final _PyRun_AnyFileExFlags = _PyRun_AnyFileExFlagsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - int _PyRun_AnyFileObject( - ffi.Pointer fp, - ffi.Pointer filename, - int closeit, - ffi.Pointer flags, - ) { - return __PyRun_AnyFileObject( - fp, - filename, - closeit, - flags, - ); - } - - late final __PyRun_AnyFileObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int, - ffi.Pointer)>>('_PyRun_AnyFileObject'); - late final __PyRun_AnyFileObject = __PyRun_AnyFileObjectPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - int PyRun_SimpleFileExFlags( - ffi.Pointer fp, - ffi.Pointer filename, - int closeit, - ffi.Pointer flags, - ) { - return _PyRun_SimpleFileExFlags( - fp, - filename, - closeit, - flags, - ); - } - - late final _PyRun_SimpleFileExFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int, - ffi.Pointer)>>('PyRun_SimpleFileExFlags'); - late final _PyRun_SimpleFileExFlags = _PyRun_SimpleFileExFlagsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - int PyRun_InteractiveOneFlags( - ffi.Pointer fp, - ffi.Pointer filename, - ffi.Pointer flags, - ) { - return _PyRun_InteractiveOneFlags( - fp, - filename, - flags, - ); - } - - late final _PyRun_InteractiveOneFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyRun_InteractiveOneFlags'); - late final _PyRun_InteractiveOneFlags = - _PyRun_InteractiveOneFlagsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyRun_InteractiveOneObject( - ffi.Pointer fp, - ffi.Pointer filename, - ffi.Pointer flags, - ) { - return _PyRun_InteractiveOneObject( - fp, - filename, - flags, - ); - } - - late final _PyRun_InteractiveOneObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyRun_InteractiveOneObject'); - late final _PyRun_InteractiveOneObject = - _PyRun_InteractiveOneObjectPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyRun_InteractiveLoopFlags( - ffi.Pointer fp, - ffi.Pointer filename, - ffi.Pointer flags, - ) { - return _PyRun_InteractiveLoopFlags( - fp, - filename, - flags, - ); - } - - late final _PyRun_InteractiveLoopFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyRun_InteractiveLoopFlags'); - late final _PyRun_InteractiveLoopFlags = - _PyRun_InteractiveLoopFlagsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _PyRun_InteractiveLoopObject( - ffi.Pointer fp, - ffi.Pointer filename, - ffi.Pointer flags, - ) { - return __PyRun_InteractiveLoopObject( - fp, - filename, - flags, - ); - } - - late final __PyRun_InteractiveLoopObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('_PyRun_InteractiveLoopObject'); - late final __PyRun_InteractiveLoopObject = - __PyRun_InteractiveLoopObjectPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyRun_StringFlags( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ) { - return _PyRun_StringFlags( - arg0, - arg1, - arg2, - arg3, - arg4, - ); - } - - late final _PyRun_StringFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyRun_StringFlags'); - late final _PyRun_StringFlags = _PyRun_StringFlagsPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyRun_FileExFlags( - ffi.Pointer fp, - ffi.Pointer filename, - int start, - ffi.Pointer globals, - ffi.Pointer locals, - int closeit, - ffi.Pointer flags, - ) { - return _PyRun_FileExFlags( - fp, - filename, - start, - globals, - locals, - closeit, - flags, - ); - } - - late final _PyRun_FileExFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer)>>('PyRun_FileExFlags'); - late final _PyRun_FileExFlags = _PyRun_FileExFlagsPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - ffi.Pointer Py_CompileStringExFlags( - ffi.Pointer str, - ffi.Pointer filename, - int start, - ffi.Pointer flags, - int optimize, - ) { - return _Py_CompileStringExFlags( - str, - filename, - start, - flags, - optimize, - ); - } - - late final _Py_CompileStringExFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Int)>>('Py_CompileStringExFlags'); - late final _Py_CompileStringExFlags = _Py_CompileStringExFlagsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); - - ffi.Pointer Py_CompileStringObject( - ffi.Pointer str, - ffi.Pointer filename, - int start, - ffi.Pointer flags, - int optimize, - ) { - return _Py_CompileStringObject( - str, - filename, - start, - flags, - optimize, - ); - } - - late final _Py_CompileStringObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Int)>>('Py_CompileStringObject'); - late final _Py_CompileStringObject = _Py_CompileStringObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); - - ffi.Pointer _Py_SourceAsString( - ffi.Pointer cmd, - ffi.Pointer funcname, - ffi.Pointer what, - ffi.Pointer cf, - ffi.Pointer> cmd_copy, - ) { - return __Py_SourceAsString( - cmd, - funcname, - what, - cf, - cmd_copy, - ); - } - - late final __Py_SourceAsStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('_Py_SourceAsString'); - late final __Py_SourceAsString = __Py_SourceAsStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - ffi.Pointer PyRun_String( - ffi.Pointer str, - int s, - ffi.Pointer g, - ffi.Pointer l, - ) { - return _PyRun_String( - str, - s, - g, - l, - ); - } - - late final _PyRun_StringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Int, - ffi.Pointer, ffi.Pointer)>>('PyRun_String'); - late final _PyRun_String = _PyRun_StringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - int PyRun_AnyFile( - ffi.Pointer fp, - ffi.Pointer name, - ) { - return _PyRun_AnyFile( - fp, - name, - ); - } - - late final _PyRun_AnyFilePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PyRun_AnyFile'); - late final _PyRun_AnyFile = _PyRun_AnyFilePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyRun_AnyFileEx( - ffi.Pointer fp, - ffi.Pointer name, - int closeit, - ) { - return _PyRun_AnyFileEx( - fp, - name, - closeit, - ); - } - - late final _PyRun_AnyFileExPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('PyRun_AnyFileEx'); - late final _PyRun_AnyFileEx = _PyRun_AnyFileExPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int PyRun_AnyFileFlags( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyRun_AnyFileFlags( - arg0, - arg1, - arg2, - ); - } - - late final _PyRun_AnyFileFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyRun_AnyFileFlags'); - late final _PyRun_AnyFileFlags = _PyRun_AnyFileFlagsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyRun_SimpleString( - ffi.Pointer s, - ) { - return _PyRun_SimpleString( - s, - ); - } - - late final _PyRun_SimpleStringPtr = - _lookup)>>( - 'PyRun_SimpleString'); - late final _PyRun_SimpleString = - _PyRun_SimpleStringPtr.asFunction)>(); - - int PyRun_SimpleFile( - ffi.Pointer f, - ffi.Pointer p, - ) { - return _PyRun_SimpleFile( - f, - p, - ); - } - - late final _PyRun_SimpleFilePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PyRun_SimpleFile'); - late final _PyRun_SimpleFile = _PyRun_SimpleFilePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyRun_SimpleFileEx( - ffi.Pointer f, - ffi.Pointer p, - int c, - ) { - return _PyRun_SimpleFileEx( - f, - p, - c, - ); - } - - late final _PyRun_SimpleFileExPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('PyRun_SimpleFileEx'); - late final _PyRun_SimpleFileEx = _PyRun_SimpleFileExPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int PyRun_InteractiveOne( - ffi.Pointer f, - ffi.Pointer p, - ) { - return _PyRun_InteractiveOne( - f, - p, - ); - } - - late final _PyRun_InteractiveOnePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyRun_InteractiveOne'); - late final _PyRun_InteractiveOne = _PyRun_InteractiveOnePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyRun_InteractiveLoop( - ffi.Pointer f, - ffi.Pointer p, - ) { - return _PyRun_InteractiveLoop( - f, - p, - ); - } - - late final _PyRun_InteractiveLoopPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyRun_InteractiveLoop'); - late final _PyRun_InteractiveLoop = _PyRun_InteractiveLoopPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyRun_File( - ffi.Pointer fp, - ffi.Pointer p, - int s, - ffi.Pointer g, - ffi.Pointer l, - ) { - return _PyRun_File( - fp, - p, - s, - g, - l, - ); - } - - late final _PyRun_FilePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer)>>('PyRun_File'); - late final _PyRun_File = _PyRun_FilePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - int, ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyRun_FileEx( - ffi.Pointer fp, - ffi.Pointer p, - int s, - ffi.Pointer g, - ffi.Pointer l, - int c, - ) { - return _PyRun_FileEx( - fp, - p, - s, - g, - l, - c, - ); - } - - late final _PyRun_FileExPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('PyRun_FileEx'); - late final _PyRun_FileEx = _PyRun_FileExPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - int, ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer PyRun_FileFlags( - ffi.Pointer fp, - ffi.Pointer p, - int s, - ffi.Pointer g, - ffi.Pointer l, - ffi.Pointer flags, - ) { - return _PyRun_FileFlags( - fp, - p, - s, - g, - l, - flags, - ); - } - - late final _PyRun_FileFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyRun_FileFlags'); - late final _PyRun_FileFlags = _PyRun_FileFlagsPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyOS_Readline( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyOS_Readline( - arg0, - arg1, - arg2, - ); - } - - late final _PyOS_ReadlinePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyOS_Readline'); - late final _PyOS_Readline = _PyOS_ReadlinePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer> __PyOS_ReadlineTState = - _lookup>('_PyOS_ReadlineTState'); - - ffi.Pointer get _PyOS_ReadlineTState => - __PyOS_ReadlineTState.value; - - set _PyOS_ReadlineTState(ffi.Pointer value) => - __PyOS_ReadlineTState.value = value; - - late final ffi.Pointer< - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>> - _PyOS_ReadlineFunctionPointer = _lookup< - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>>('PyOS_ReadlineFunctionPointer'); - - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>> - get PyOS_ReadlineFunctionPointer => _PyOS_ReadlineFunctionPointer.value; - - set PyOS_ReadlineFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - value) => - _PyOS_ReadlineFunctionPointer.value = value; - - void Py_Initialize() { - return _Py_Initialize(); - } - - late final _Py_InitializePtr = - _lookup>('Py_Initialize'); - late final _Py_Initialize = _Py_InitializePtr.asFunction(); - - void Py_InitializeEx( - int arg0, - ) { - return _Py_InitializeEx( - arg0, - ); - } - - late final _Py_InitializeExPtr = - _lookup>( - 'Py_InitializeEx'); - late final _Py_InitializeEx = - _Py_InitializeExPtr.asFunction(); - - void Py_Finalize() { - return _Py_Finalize(); - } - - late final _Py_FinalizePtr = - _lookup>('Py_Finalize'); - late final _Py_Finalize = _Py_FinalizePtr.asFunction(); - - int Py_FinalizeEx() { - return _Py_FinalizeEx(); - } - - late final _Py_FinalizeExPtr = - _lookup>('Py_FinalizeEx'); - late final _Py_FinalizeEx = _Py_FinalizeExPtr.asFunction(); - - int Py_IsInitialized() { - return _Py_IsInitialized(); - } - - late final _Py_IsInitializedPtr = - _lookup>('Py_IsInitialized'); - late final _Py_IsInitialized = - _Py_IsInitializedPtr.asFunction(); - - ffi.Pointer Py_NewInterpreter() { - return _Py_NewInterpreter(); - } - - late final _Py_NewInterpreterPtr = - _lookup Function()>>( - 'Py_NewInterpreter'); - late final _Py_NewInterpreter = - _Py_NewInterpreterPtr.asFunction Function()>(); - - void Py_EndInterpreter( - ffi.Pointer arg0, - ) { - return _Py_EndInterpreter( - arg0, - ); - } - - late final _Py_EndInterpreterPtr = _lookup< - ffi.NativeFunction)>>( - 'Py_EndInterpreter'); - late final _Py_EndInterpreter = _Py_EndInterpreterPtr.asFunction< - void Function(ffi.Pointer)>(); - - int Py_AtExit( - ffi.Pointer> func, - ) { - return _Py_AtExit1( - func, - ); - } - - late final _Py_AtExitPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>)>>( - 'Py_AtExit'); - late final _Py_AtExit1 = _Py_AtExitPtr.asFunction< - int Function(ffi.Pointer>)>(); - - void Py_Exit( - int arg0, - ) { - return _Py_Exit( - arg0, - ); - } - - late final _Py_ExitPtr = - _lookup>('Py_Exit'); - late final _Py_Exit = _Py_ExitPtr.asFunction(); - - int Py_Main( - int argc, - ffi.Pointer> argv, - ) { - return _Py_Main( - argc, - argv, - ); - } - - late final _Py_MainPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer>)>>('Py_Main'); - late final _Py_Main = _Py_MainPtr.asFunction< - int Function(int, ffi.Pointer>)>(); - - int Py_BytesMain( - int argc, - ffi.Pointer> argv, - ) { - return _Py_BytesMain( - argc, - argv, - ); - } - - late final _Py_BytesMainPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer>)>>('Py_BytesMain'); - late final _Py_BytesMain = _Py_BytesMainPtr.asFunction< - int Function(int, ffi.Pointer>)>(); - - void Py_SetProgramName( - ffi.Pointer arg0, - ) { - return _Py_SetProgramName( - arg0, - ); - } - - late final _Py_SetProgramNamePtr = - _lookup)>>( - 'Py_SetProgramName'); - late final _Py_SetProgramName = - _Py_SetProgramNamePtr.asFunction)>(); - - ffi.Pointer Py_GetProgramName() { - return _Py_GetProgramName(); - } - - late final _Py_GetProgramNamePtr = - _lookup Function()>>( - 'Py_GetProgramName'); - late final _Py_GetProgramName = - _Py_GetProgramNamePtr.asFunction Function()>(); - - void Py_SetPythonHome( - ffi.Pointer arg0, - ) { - return _Py_SetPythonHome( - arg0, - ); - } - - late final _Py_SetPythonHomePtr = - _lookup)>>( - 'Py_SetPythonHome'); - late final _Py_SetPythonHome = - _Py_SetPythonHomePtr.asFunction)>(); - - ffi.Pointer Py_GetPythonHome() { - return _Py_GetPythonHome(); - } - - late final _Py_GetPythonHomePtr = - _lookup Function()>>( - 'Py_GetPythonHome'); - late final _Py_GetPythonHome = - _Py_GetPythonHomePtr.asFunction Function()>(); - - ffi.Pointer Py_GetProgramFullPath() { - return _Py_GetProgramFullPath(); - } - - late final _Py_GetProgramFullPathPtr = - _lookup Function()>>( - 'Py_GetProgramFullPath'); - late final _Py_GetProgramFullPath = - _Py_GetProgramFullPathPtr.asFunction Function()>(); - - ffi.Pointer Py_GetPrefix() { - return _Py_GetPrefix(); - } - - late final _Py_GetPrefixPtr = - _lookup Function()>>( - 'Py_GetPrefix'); - late final _Py_GetPrefix = - _Py_GetPrefixPtr.asFunction Function()>(); - - ffi.Pointer Py_GetExecPrefix() { - return _Py_GetExecPrefix(); - } - - late final _Py_GetExecPrefixPtr = - _lookup Function()>>( - 'Py_GetExecPrefix'); - late final _Py_GetExecPrefix = - _Py_GetExecPrefixPtr.asFunction Function()>(); - - ffi.Pointer Py_GetPath() { - return _Py_GetPath(); - } - - late final _Py_GetPathPtr = - _lookup Function()>>( - 'Py_GetPath'); - late final _Py_GetPath = - _Py_GetPathPtr.asFunction Function()>(); - - void Py_SetPath( - ffi.Pointer arg0, - ) { - return _Py_SetPath( - arg0, - ); - } - - late final _Py_SetPathPtr = - _lookup)>>( - 'Py_SetPath'); - late final _Py_SetPath = - _Py_SetPathPtr.asFunction)>(); - - ffi.Pointer Py_GetVersion() { - return _Py_GetVersion(); - } - - late final _Py_GetVersionPtr = - _lookup Function()>>( - 'Py_GetVersion'); - late final _Py_GetVersion = - _Py_GetVersionPtr.asFunction Function()>(); - - ffi.Pointer Py_GetPlatform() { - return _Py_GetPlatform(); - } - - late final _Py_GetPlatformPtr = - _lookup Function()>>( - 'Py_GetPlatform'); - late final _Py_GetPlatform = - _Py_GetPlatformPtr.asFunction Function()>(); - - ffi.Pointer Py_GetCopyright() { - return _Py_GetCopyright(); - } - - late final _Py_GetCopyrightPtr = - _lookup Function()>>( - 'Py_GetCopyright'); - late final _Py_GetCopyright = - _Py_GetCopyrightPtr.asFunction Function()>(); - - ffi.Pointer Py_GetCompiler() { - return _Py_GetCompiler(); - } - - late final _Py_GetCompilerPtr = - _lookup Function()>>( - 'Py_GetCompiler'); - late final _Py_GetCompiler = - _Py_GetCompilerPtr.asFunction Function()>(); - - ffi.Pointer Py_GetBuildInfo() { - return _Py_GetBuildInfo(); - } - - late final _Py_GetBuildInfoPtr = - _lookup Function()>>( - 'Py_GetBuildInfo'); - late final _Py_GetBuildInfo = - _Py_GetBuildInfoPtr.asFunction Function()>(); - - PyOS_sighandler_t PyOS_getsig( - int arg0, - ) { - return _PyOS_getsig( - arg0, - ); - } - - late final _PyOS_getsigPtr = - _lookup>( - 'PyOS_getsig'); - late final _PyOS_getsig = - _PyOS_getsigPtr.asFunction(); - - PyOS_sighandler_t PyOS_setsig( - int arg0, - PyOS_sighandler_t arg1, - ) { - return _PyOS_setsig( - arg0, - arg1, - ); - } - - late final _PyOS_setsigPtr = _lookup< - ffi.NativeFunction< - PyOS_sighandler_t Function( - ffi.Int, PyOS_sighandler_t)>>('PyOS_setsig'); - late final _PyOS_setsig = _PyOS_setsigPtr.asFunction< - PyOS_sighandler_t Function(int, PyOS_sighandler_t)>(); - - late final ffi.Pointer _Py_Version = - _lookup('Py_Version'); - - int get Py_Version => _Py_Version.value; - - set Py_Version(int value) => _Py_Version.value = value; - - int Py_FrozenMain( - int argc, - ffi.Pointer> argv, - ) { - return _Py_FrozenMain( - argc, - argv, - ); - } - - late final _Py_FrozenMainPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer>)>>('Py_FrozenMain'); - late final _Py_FrozenMain = _Py_FrozenMainPtr.asFunction< - int Function(int, ffi.Pointer>)>(); - - int Py_SetStandardStreamEncoding( - ffi.Pointer encoding, - ffi.Pointer errors, - ) { - return _Py_SetStandardStreamEncoding( - encoding, - errors, - ); - } - - late final _Py_SetStandardStreamEncodingPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('Py_SetStandardStreamEncoding'); - late final _Py_SetStandardStreamEncoding = _Py_SetStandardStreamEncodingPtr - .asFunction, ffi.Pointer)>(); - - PyStatus Py_PreInitialize( - ffi.Pointer src_config, - ) { - return _Py_PreInitialize( - src_config, - ); - } - - late final _Py_PreInitializePtr = - _lookup)>>( - 'Py_PreInitialize'); - late final _Py_PreInitialize = _Py_PreInitializePtr.asFunction< - PyStatus Function(ffi.Pointer)>(); - - PyStatus Py_PreInitializeFromBytesArgs( - ffi.Pointer src_config, - int argc, - ffi.Pointer> argv, - ) { - return _Py_PreInitializeFromBytesArgs( - src_config, - argc, - argv, - ); - } - - late final _Py_PreInitializeFromBytesArgsPtr = _lookup< - ffi.NativeFunction< - PyStatus Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer>)>>( - 'Py_PreInitializeFromBytesArgs'); - late final _Py_PreInitializeFromBytesArgs = - _Py_PreInitializeFromBytesArgsPtr.asFunction< - PyStatus Function(ffi.Pointer, int, - ffi.Pointer>)>(); - - PyStatus Py_PreInitializeFromArgs( - ffi.Pointer src_config, - int argc, - ffi.Pointer> argv, - ) { - return _Py_PreInitializeFromArgs( - src_config, - argc, - argv, - ); - } - - late final _Py_PreInitializeFromArgsPtr = _lookup< - ffi.NativeFunction< - PyStatus Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer>)>>( - 'Py_PreInitializeFromArgs'); - late final _Py_PreInitializeFromArgs = - _Py_PreInitializeFromArgsPtr.asFunction< - PyStatus Function(ffi.Pointer, int, - ffi.Pointer>)>(); - - int _Py_IsCoreInitialized() { - return __Py_IsCoreInitialized(); - } - - late final __Py_IsCoreInitializedPtr = - _lookup>('_Py_IsCoreInitialized'); - late final __Py_IsCoreInitialized = - __Py_IsCoreInitializedPtr.asFunction(); - - PyStatus Py_InitializeFromConfig( - ffi.Pointer config, - ) { - return _Py_InitializeFromConfig( - config, - ); - } - - late final _Py_InitializeFromConfigPtr = - _lookup)>>( - 'Py_InitializeFromConfig'); - late final _Py_InitializeFromConfig = _Py_InitializeFromConfigPtr.asFunction< - PyStatus Function(ffi.Pointer)>(); - - PyStatus _Py_InitializeMain() { - return __Py_InitializeMain(); - } - - late final __Py_InitializeMainPtr = - _lookup>('_Py_InitializeMain'); - late final __Py_InitializeMain = - __Py_InitializeMainPtr.asFunction(); - - int Py_RunMain() { - return _Py_RunMain(); - } - - late final _Py_RunMainPtr = - _lookup>('Py_RunMain'); - late final _Py_RunMain = _Py_RunMainPtr.asFunction(); - - void Py_ExitStatusException( - PyStatus err, - ) { - return _Py_ExitStatusException( - err, - ); - } - - late final _Py_ExitStatusExceptionPtr = - _lookup>( - 'Py_ExitStatusException'); - late final _Py_ExitStatusException = - _Py_ExitStatusExceptionPtr.asFunction(); - - void _Py_RestoreSignals() { - return __Py_RestoreSignals(); - } - - late final __Py_RestoreSignalsPtr = - _lookup>('_Py_RestoreSignals'); - late final __Py_RestoreSignals = - __Py_RestoreSignalsPtr.asFunction(); - - int Py_FdIsInteractive( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _Py_FdIsInteractive1( - arg0, - arg1, - ); - } - - late final _Py_FdIsInteractivePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('Py_FdIsInteractive'); - late final _Py_FdIsInteractive1 = _Py_FdIsInteractivePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _Py_FdIsInteractive( - ffi.Pointer fp, - ffi.Pointer filename, - ) { - return __Py_FdIsInteractive( - fp, - filename, - ); - } - - late final __Py_FdIsInteractivePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_Py_FdIsInteractive'); - late final __Py_FdIsInteractive = __Py_FdIsInteractivePtr - .asFunction, ffi.Pointer)>(); - - void _Py_SetProgramFullPath( - ffi.Pointer arg0, - ) { - return __Py_SetProgramFullPath( - arg0, - ); - } - - late final __Py_SetProgramFullPathPtr = - _lookup)>>( - '_Py_SetProgramFullPath'); - late final __Py_SetProgramFullPath = __Py_SetProgramFullPathPtr - .asFunction)>(); - - ffi.Pointer _Py_gitidentifier() { - return __Py_gitidentifier(); - } - - late final __Py_gitidentifierPtr = - _lookup Function()>>( - '_Py_gitidentifier'); - late final __Py_gitidentifier = - __Py_gitidentifierPtr.asFunction Function()>(); - - ffi.Pointer _Py_gitversion() { - return __Py_gitversion(); - } - - late final __Py_gitversionPtr = - _lookup Function()>>( - '_Py_gitversion'); - late final __Py_gitversion = - __Py_gitversionPtr.asFunction Function()>(); - - int _Py_IsFinalizing() { - return __Py_IsFinalizing(); - } - - late final __Py_IsFinalizingPtr = - _lookup>('_Py_IsFinalizing'); - late final __Py_IsFinalizing = - __Py_IsFinalizingPtr.asFunction(); - - int _Py_IsInterpreterFinalizing( - ffi.Pointer interp, - ) { - return __Py_IsInterpreterFinalizing( - interp, - ); - } - - late final __Py_IsInterpreterFinalizingPtr = _lookup< - ffi - .NativeFunction)>>( - '_Py_IsInterpreterFinalizing'); - late final __Py_IsInterpreterFinalizing = __Py_IsInterpreterFinalizingPtr - .asFunction)>(); - - int _PyOS_URandom( - ffi.Pointer buffer, - int size, - ) { - return __PyOS_URandom( - buffer, - size, - ); - } - - late final __PyOS_URandomPtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - '_PyOS_URandom'); - late final __PyOS_URandom = - __PyOS_URandomPtr.asFunction, int)>(); - - int _PyOS_URandomNonblock( - ffi.Pointer buffer, - int size, - ) { - return __PyOS_URandomNonblock( - buffer, - size, - ); - } - - late final __PyOS_URandomNonblockPtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - '_PyOS_URandomNonblock'); - late final __PyOS_URandomNonblock = __PyOS_URandomNonblockPtr - .asFunction, int)>(); - - int _Py_CoerceLegacyLocale( - int warn, - ) { - return __Py_CoerceLegacyLocale( - warn, - ); - } - - late final __Py_CoerceLegacyLocalePtr = - _lookup>( - '_Py_CoerceLegacyLocale'); - late final __Py_CoerceLegacyLocale = - __Py_CoerceLegacyLocalePtr.asFunction(); - - int _Py_LegacyLocaleDetected( - int warn, - ) { - return __Py_LegacyLocaleDetected( - warn, - ); - } - - late final __Py_LegacyLocaleDetectedPtr = - _lookup>( - '_Py_LegacyLocaleDetected'); - late final __Py_LegacyLocaleDetected = - __Py_LegacyLocaleDetectedPtr.asFunction(); - - ffi.Pointer _Py_SetLocaleFromEnv( - int category, - ) { - return __Py_SetLocaleFromEnv( - category, - ); - } - - late final __Py_SetLocaleFromEnvPtr = - _lookup Function(ffi.Int)>>( - '_Py_SetLocaleFromEnv'); - late final __Py_SetLocaleFromEnv = __Py_SetLocaleFromEnvPtr - .asFunction Function(int)>(); - - PyStatus Py_NewInterpreterFromConfig( - ffi.Pointer> tstate_p, - ffi.Pointer config, - ) { - return _Py_NewInterpreterFromConfig( - tstate_p, - config, - ); - } - - late final _Py_NewInterpreterFromConfigPtr = _lookup< - ffi.NativeFunction< - PyStatus Function(ffi.Pointer>, - ffi.Pointer)>>( - 'Py_NewInterpreterFromConfig'); - late final _Py_NewInterpreterFromConfig = - _Py_NewInterpreterFromConfigPtr.asFunction< - PyStatus Function(ffi.Pointer>, - ffi.Pointer)>(); - - int _Py_AtExit( - ffi.Pointer arg0, - atexit_datacallbackfunc arg1, - ffi.Pointer arg2, - ) { - return __Py_AtExit( - arg0, - arg1, - arg2, - ); - } - - late final __Py_AtExitPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - atexit_datacallbackfunc, ffi.Pointer)>>('_Py_AtExit'); - late final __Py_AtExit = __Py_AtExitPtr.asFunction< - int Function(ffi.Pointer, atexit_datacallbackfunc, - ffi.Pointer)>(); - - ffi.Pointer PyEval_EvalCode( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _PyEval_EvalCode( - arg0, - arg1, - arg2, - ); - } - - late final _PyEval_EvalCodePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyEval_EvalCode'); - late final _PyEval_EvalCode = _PyEval_EvalCodePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyEval_EvalCodeEx( - ffi.Pointer co, - ffi.Pointer globals, - ffi.Pointer locals, - ffi.Pointer> args, - int argc, - ffi.Pointer> kwds, - int kwdc, - ffi.Pointer> defs, - int defc, - ffi.Pointer kwdefs, - ffi.Pointer closure, - ) { - return _PyEval_EvalCodeEx( - co, - globals, - locals, - args, - argc, - kwds, - kwdc, - defs, - defc, - kwdefs, - closure, - ); - } - - late final _PyEval_EvalCodeExPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - ffi.Pointer>, - ffi.Int, - ffi.Pointer>, - ffi.Int, - ffi.Pointer, - ffi.Pointer)>>('PyEval_EvalCodeEx'); - late final _PyEval_EvalCodeEx = _PyEval_EvalCodeExPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - int, - ffi.Pointer>, - int, - ffi.Pointer>, - int, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyEval_CallObjectWithKeywords( - ffi.Pointer callable, - ffi.Pointer args, - ffi.Pointer kwargs, - ) { - return _PyEval_CallObjectWithKeywords( - callable, - args, - kwargs, - ); - } - - late final _PyEval_CallObjectWithKeywordsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyEval_CallObjectWithKeywords'); - late final _PyEval_CallObjectWithKeywords = - _PyEval_CallObjectWithKeywordsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyEval_CallFunction( - ffi.Pointer callable, - ffi.Pointer format, - ) { - return _PyEval_CallFunction( - callable, - format, - ); - } - - late final _PyEval_CallFunctionPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyEval_CallFunction'); - late final _PyEval_CallFunction = _PyEval_CallFunctionPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyEval_CallMethod( - ffi.Pointer obj, - ffi.Pointer name, - ffi.Pointer format, - ) { - return _PyEval_CallMethod( - obj, - name, - format, - ); - } - - late final _PyEval_CallMethodPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyEval_CallMethod'); - late final _PyEval_CallMethod = _PyEval_CallMethodPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyEval_GetBuiltins() { - return _PyEval_GetBuiltins(); - } - - late final _PyEval_GetBuiltinsPtr = - _lookup Function()>>( - 'PyEval_GetBuiltins'); - late final _PyEval_GetBuiltins = - _PyEval_GetBuiltinsPtr.asFunction Function()>(); - - ffi.Pointer PyEval_GetGlobals() { - return _PyEval_GetGlobals(); - } - - late final _PyEval_GetGlobalsPtr = - _lookup Function()>>( - 'PyEval_GetGlobals'); - late final _PyEval_GetGlobals = - _PyEval_GetGlobalsPtr.asFunction Function()>(); - - ffi.Pointer PyEval_GetLocals() { - return _PyEval_GetLocals(); - } - - late final _PyEval_GetLocalsPtr = - _lookup Function()>>( - 'PyEval_GetLocals'); - late final _PyEval_GetLocals = - _PyEval_GetLocalsPtr.asFunction Function()>(); - - ffi.Pointer PyEval_GetFrame() { - return _PyEval_GetFrame(); - } - - late final _PyEval_GetFramePtr = - _lookup Function()>>( - 'PyEval_GetFrame'); - late final _PyEval_GetFrame = - _PyEval_GetFramePtr.asFunction Function()>(); - - int Py_AddPendingCall( - ffi.Pointer)>> - func, - ffi.Pointer arg, - ) { - return _Py_AddPendingCall( - func, - arg, - ); - } - - late final _Py_AddPendingCallPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer< - ffi.NativeFunction)>>, - ffi.Pointer)>>('Py_AddPendingCall'); - late final _Py_AddPendingCall = _Py_AddPendingCallPtr.asFunction< - int Function( - ffi.Pointer< - ffi.NativeFunction)>>, - ffi.Pointer)>(); - - int Py_MakePendingCalls() { - return _Py_MakePendingCalls(); - } - - late final _Py_MakePendingCallsPtr = - _lookup>('Py_MakePendingCalls'); - late final _Py_MakePendingCalls = - _Py_MakePendingCallsPtr.asFunction(); - - void Py_SetRecursionLimit( - int arg0, - ) { - return _Py_SetRecursionLimit( - arg0, - ); - } - - late final _Py_SetRecursionLimitPtr = - _lookup>( - 'Py_SetRecursionLimit'); - late final _Py_SetRecursionLimit = - _Py_SetRecursionLimitPtr.asFunction(); - - int Py_GetRecursionLimit() { - return _Py_GetRecursionLimit(); - } - - late final _Py_GetRecursionLimitPtr = - _lookup>('Py_GetRecursionLimit'); - late final _Py_GetRecursionLimit = - _Py_GetRecursionLimitPtr.asFunction(); - - int Py_EnterRecursiveCall( - ffi.Pointer where, - ) { - return _Py_EnterRecursiveCall( - where, - ); - } - - late final _Py_EnterRecursiveCallPtr = - _lookup)>>( - 'Py_EnterRecursiveCall'); - late final _Py_EnterRecursiveCall = _Py_EnterRecursiveCallPtr.asFunction< - int Function(ffi.Pointer)>(); - - void Py_LeaveRecursiveCall() { - return _Py_LeaveRecursiveCall(); - } - - late final _Py_LeaveRecursiveCallPtr = - _lookup>('Py_LeaveRecursiveCall'); - late final _Py_LeaveRecursiveCall = - _Py_LeaveRecursiveCallPtr.asFunction(); - - ffi.Pointer PyEval_GetFuncName( - ffi.Pointer arg0, - ) { - return _PyEval_GetFuncName( - arg0, - ); - } - - late final _PyEval_GetFuncNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyEval_GetFuncName'); - late final _PyEval_GetFuncName = _PyEval_GetFuncNamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyEval_GetFuncDesc( - ffi.Pointer arg0, - ) { - return _PyEval_GetFuncDesc( - arg0, - ); - } - - late final _PyEval_GetFuncDescPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyEval_GetFuncDesc'); - late final _PyEval_GetFuncDesc = _PyEval_GetFuncDescPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyEval_EvalFrame( - ffi.Pointer arg0, - ) { - return _PyEval_EvalFrame( - arg0, - ); - } - - late final _PyEval_EvalFramePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyEval_EvalFrame'); - late final _PyEval_EvalFrame = _PyEval_EvalFramePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyEval_EvalFrameEx( - ffi.Pointer f, - int exc, - ) { - return _PyEval_EvalFrameEx( - f, - exc, - ); - } - - late final _PyEval_EvalFrameExPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyEval_EvalFrameEx'); - late final _PyEval_EvalFrameEx = _PyEval_EvalFrameExPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer PyEval_SaveThread() { - return _PyEval_SaveThread(); - } - - late final _PyEval_SaveThreadPtr = - _lookup Function()>>( - 'PyEval_SaveThread'); - late final _PyEval_SaveThread = - _PyEval_SaveThreadPtr.asFunction Function()>(); - - void PyEval_RestoreThread( - ffi.Pointer arg0, - ) { - return _PyEval_RestoreThread( - arg0, - ); - } - - late final _PyEval_RestoreThreadPtr = _lookup< - ffi.NativeFunction)>>( - 'PyEval_RestoreThread'); - late final _PyEval_RestoreThread = _PyEval_RestoreThreadPtr.asFunction< - void Function(ffi.Pointer)>(); - - int PyEval_ThreadsInitialized() { - return _PyEval_ThreadsInitialized(); - } - - late final _PyEval_ThreadsInitializedPtr = - _lookup>( - 'PyEval_ThreadsInitialized'); - late final _PyEval_ThreadsInitialized = - _PyEval_ThreadsInitializedPtr.asFunction(); - - void PyEval_InitThreads() { - return _PyEval_InitThreads(); - } - - late final _PyEval_InitThreadsPtr = - _lookup>('PyEval_InitThreads'); - late final _PyEval_InitThreads = - _PyEval_InitThreadsPtr.asFunction(); - - void PyEval_AcquireLock() { - return _PyEval_AcquireLock(); - } - - late final _PyEval_AcquireLockPtr = - _lookup>('PyEval_AcquireLock'); - late final _PyEval_AcquireLock = - _PyEval_AcquireLockPtr.asFunction(); - - void PyEval_ReleaseLock() { - return _PyEval_ReleaseLock(); - } - - late final _PyEval_ReleaseLockPtr = - _lookup>('PyEval_ReleaseLock'); - late final _PyEval_ReleaseLock = - _PyEval_ReleaseLockPtr.asFunction(); - - void PyEval_AcquireThread( - ffi.Pointer tstate, - ) { - return _PyEval_AcquireThread( - tstate, - ); - } - - late final _PyEval_AcquireThreadPtr = _lookup< - ffi.NativeFunction)>>( - 'PyEval_AcquireThread'); - late final _PyEval_AcquireThread = _PyEval_AcquireThreadPtr.asFunction< - void Function(ffi.Pointer)>(); - - void PyEval_ReleaseThread( - ffi.Pointer tstate, - ) { - return _PyEval_ReleaseThread( - tstate, - ); - } - - late final _PyEval_ReleaseThreadPtr = _lookup< - ffi.NativeFunction)>>( - 'PyEval_ReleaseThread'); - late final _PyEval_ReleaseThread = _PyEval_ReleaseThreadPtr.asFunction< - void Function(ffi.Pointer)>(); - - void PyEval_SetProfile( - Py_tracefunc arg0, - ffi.Pointer arg1, - ) { - return _PyEval_SetProfile1( - arg0, - arg1, - ); - } - - late final _PyEval_SetProfilePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - Py_tracefunc, ffi.Pointer)>>('PyEval_SetProfile'); - late final _PyEval_SetProfile1 = _PyEval_SetProfilePtr.asFunction< - void Function(Py_tracefunc, ffi.Pointer)>(); - - void PyEval_SetProfileAllThreads( - Py_tracefunc arg0, - ffi.Pointer arg1, - ) { - return _PyEval_SetProfileAllThreads( - arg0, - arg1, - ); - } - - late final _PyEval_SetProfileAllThreadsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(Py_tracefunc, - ffi.Pointer)>>('PyEval_SetProfileAllThreads'); - late final _PyEval_SetProfileAllThreads = _PyEval_SetProfileAllThreadsPtr - .asFunction)>(); - - int _PyEval_SetProfile( - ffi.Pointer tstate, - Py_tracefunc func, - ffi.Pointer arg, - ) { - return __PyEval_SetProfile( - tstate, - func, - arg, - ); - } - - late final __PyEval_SetProfilePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_tracefunc, - ffi.Pointer)>>('_PyEval_SetProfile'); - late final __PyEval_SetProfile = __PyEval_SetProfilePtr.asFunction< - int Function( - ffi.Pointer, Py_tracefunc, ffi.Pointer)>(); - - void PyEval_SetTrace( - Py_tracefunc arg0, - ffi.Pointer arg1, - ) { - return _PyEval_SetTrace1( - arg0, - arg1, - ); - } - - late final _PyEval_SetTracePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - Py_tracefunc, ffi.Pointer)>>('PyEval_SetTrace'); - late final _PyEval_SetTrace1 = _PyEval_SetTracePtr.asFunction< - void Function(Py_tracefunc, ffi.Pointer)>(); - - void PyEval_SetTraceAllThreads( - Py_tracefunc arg0, - ffi.Pointer arg1, - ) { - return _PyEval_SetTraceAllThreads( - arg0, - arg1, - ); - } - - late final _PyEval_SetTraceAllThreadsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(Py_tracefunc, - ffi.Pointer)>>('PyEval_SetTraceAllThreads'); - late final _PyEval_SetTraceAllThreads = _PyEval_SetTraceAllThreadsPtr - .asFunction)>(); - - int _PyEval_SetTrace( - ffi.Pointer tstate, - Py_tracefunc func, - ffi.Pointer arg, - ) { - return __PyEval_SetTrace( - tstate, - func, - arg, - ); - } - - late final __PyEval_SetTracePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_tracefunc, - ffi.Pointer)>>('_PyEval_SetTrace'); - late final __PyEval_SetTrace = __PyEval_SetTracePtr.asFunction< - int Function( - ffi.Pointer, Py_tracefunc, ffi.Pointer)>(); - - ffi.Pointer _PyEval_GetBuiltin( - ffi.Pointer arg0, - ) { - return __PyEval_GetBuiltin( - arg0, - ); - } - - late final __PyEval_GetBuiltinPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyEval_GetBuiltin'); - late final __PyEval_GetBuiltin = __PyEval_GetBuiltinPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _PyEval_GetBuiltinId( - ffi.Pointer<_Py_Identifier> arg0, - ) { - return __PyEval_GetBuiltinId( - arg0, - ); - } - - late final __PyEval_GetBuiltinIdPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_Py_Identifier>)>>('_PyEval_GetBuiltinId'); - late final __PyEval_GetBuiltinId = __PyEval_GetBuiltinIdPtr.asFunction< - ffi.Pointer Function(ffi.Pointer<_Py_Identifier>)>(); - - int PyEval_MergeCompilerFlags( - ffi.Pointer cf, - ) { - return _PyEval_MergeCompilerFlags( - cf, - ); - } - - late final _PyEval_MergeCompilerFlagsPtr = _lookup< - ffi.NativeFunction)>>( - 'PyEval_MergeCompilerFlags'); - late final _PyEval_MergeCompilerFlags = _PyEval_MergeCompilerFlagsPtr - .asFunction)>(); - - ffi.Pointer _PyEval_EvalFrameDefault( - ffi.Pointer tstate, - ffi.Pointer<_PyInterpreterFrame> f, - int exc, - ) { - return __PyEval_EvalFrameDefault( - tstate, - f, - exc, - ); - } - - late final __PyEval_EvalFrameDefaultPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer<_PyInterpreterFrame>, - ffi.Int)>>('_PyEval_EvalFrameDefault'); - late final __PyEval_EvalFrameDefault = - __PyEval_EvalFrameDefaultPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer<_PyInterpreterFrame>, int)>(); - - void _PyEval_SetSwitchInterval( - int microseconds, - ) { - return __PyEval_SetSwitchInterval( - microseconds, - ); - } - - late final __PyEval_SetSwitchIntervalPtr = - _lookup>( - '_PyEval_SetSwitchInterval'); - late final __PyEval_SetSwitchInterval = - __PyEval_SetSwitchIntervalPtr.asFunction(); - - int _PyEval_GetSwitchInterval() { - return __PyEval_GetSwitchInterval(); - } - - late final __PyEval_GetSwitchIntervalPtr = - _lookup>( - '_PyEval_GetSwitchInterval'); - late final __PyEval_GetSwitchInterval = - __PyEval_GetSwitchIntervalPtr.asFunction(); - - int _PyEval_MakePendingCalls( - ffi.Pointer arg0, - ) { - return __PyEval_MakePendingCalls( - arg0, - ); - } - - late final __PyEval_MakePendingCallsPtr = - _lookup)>>( - '_PyEval_MakePendingCalls'); - late final __PyEval_MakePendingCalls = __PyEval_MakePendingCallsPtr - .asFunction)>(); - - int PyUnstable_Eval_RequestCodeExtraIndex( - freefunc arg0, - ) { - return _PyUnstable_Eval_RequestCodeExtraIndex( - arg0, - ); - } - - late final _PyUnstable_Eval_RequestCodeExtraIndexPtr = - _lookup>( - 'PyUnstable_Eval_RequestCodeExtraIndex'); - late final _PyUnstable_Eval_RequestCodeExtraIndex = - _PyUnstable_Eval_RequestCodeExtraIndexPtr.asFunction< - int Function(freefunc)>(); - - int _PyEval_SliceIndex( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyEval_SliceIndex( - arg0, - arg1, - ); - } - - late final __PyEval_SliceIndexPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyEval_SliceIndex'); - late final __PyEval_SliceIndex = __PyEval_SliceIndexPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _PyEval_SliceIndexNotNone( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyEval_SliceIndexNotNone( - arg0, - arg1, - ); - } - - late final __PyEval_SliceIndexNotNonePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyEval_SliceIndexNotNone'); - late final __PyEval_SliceIndexNotNone = - __PyEval_SliceIndexNotNonePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PySys_GetObject( - ffi.Pointer arg0, - ) { - return _PySys_GetObject( - arg0, - ); - } - - late final _PySys_GetObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PySys_GetObject'); - late final _PySys_GetObject = _PySys_GetObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PySys_SetObject( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PySys_SetObject( - arg0, - arg1, - ); - } - - late final _PySys_SetObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PySys_SetObject'); - late final _PySys_SetObject = _PySys_SetObjectPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void PySys_SetArgv( - int arg0, - ffi.Pointer> arg1, - ) { - return _PySys_SetArgv( - arg0, - arg1, - ); - } - - late final _PySys_SetArgvPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int, ffi.Pointer>)>>('PySys_SetArgv'); - late final _PySys_SetArgv = _PySys_SetArgvPtr.asFunction< - void Function(int, ffi.Pointer>)>(); - - void PySys_SetArgvEx( - int arg0, - ffi.Pointer> arg1, - int arg2, - ) { - return _PySys_SetArgvEx( - arg0, - arg1, - arg2, - ); - } - - late final _PySys_SetArgvExPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer>, - ffi.Int)>>('PySys_SetArgvEx'); - late final _PySys_SetArgvEx = _PySys_SetArgvExPtr.asFunction< - void Function(int, ffi.Pointer>, int)>(); - - void PySys_SetPath( - ffi.Pointer arg0, - ) { - return _PySys_SetPath( - arg0, - ); - } - - late final _PySys_SetPathPtr = - _lookup)>>( - 'PySys_SetPath'); - late final _PySys_SetPath = - _PySys_SetPathPtr.asFunction)>(); - - void PySys_WriteStdout( - ffi.Pointer format, - ) { - return _PySys_WriteStdout( - format, - ); - } - - late final _PySys_WriteStdoutPtr = - _lookup)>>( - 'PySys_WriteStdout'); - late final _PySys_WriteStdout = - _PySys_WriteStdoutPtr.asFunction)>(); - - void PySys_WriteStderr( - ffi.Pointer format, - ) { - return _PySys_WriteStderr( - format, - ); - } - - late final _PySys_WriteStderrPtr = - _lookup)>>( - 'PySys_WriteStderr'); - late final _PySys_WriteStderr = - _PySys_WriteStderrPtr.asFunction)>(); - - void PySys_FormatStdout( - ffi.Pointer format, - ) { - return _PySys_FormatStdout( - format, - ); - } - - late final _PySys_FormatStdoutPtr = - _lookup)>>( - 'PySys_FormatStdout'); - late final _PySys_FormatStdout = - _PySys_FormatStdoutPtr.asFunction)>(); - - void PySys_FormatStderr( - ffi.Pointer format, - ) { - return _PySys_FormatStderr( - format, - ); - } - - late final _PySys_FormatStderrPtr = - _lookup)>>( - 'PySys_FormatStderr'); - late final _PySys_FormatStderr = - _PySys_FormatStderrPtr.asFunction)>(); - - void PySys_ResetWarnOptions() { - return _PySys_ResetWarnOptions(); - } - - late final _PySys_ResetWarnOptionsPtr = - _lookup>( - 'PySys_ResetWarnOptions'); - late final _PySys_ResetWarnOptions = - _PySys_ResetWarnOptionsPtr.asFunction(); - - void PySys_AddWarnOption( - ffi.Pointer arg0, - ) { - return _PySys_AddWarnOption( - arg0, - ); - } - - late final _PySys_AddWarnOptionPtr = - _lookup)>>( - 'PySys_AddWarnOption'); - late final _PySys_AddWarnOption = _PySys_AddWarnOptionPtr.asFunction< - void Function(ffi.Pointer)>(); - - void PySys_AddWarnOptionUnicode( - ffi.Pointer arg0, - ) { - return _PySys_AddWarnOptionUnicode( - arg0, - ); - } - - late final _PySys_AddWarnOptionUnicodePtr = - _lookup)>>( - 'PySys_AddWarnOptionUnicode'); - late final _PySys_AddWarnOptionUnicode = _PySys_AddWarnOptionUnicodePtr - .asFunction)>(); - - int PySys_HasWarnOptions() { - return _PySys_HasWarnOptions(); - } - - late final _PySys_HasWarnOptionsPtr = - _lookup>('PySys_HasWarnOptions'); - late final _PySys_HasWarnOptions = - _PySys_HasWarnOptionsPtr.asFunction(); - - void PySys_AddXOption( - ffi.Pointer arg0, - ) { - return _PySys_AddXOption( - arg0, - ); - } - - late final _PySys_AddXOptionPtr = - _lookup)>>( - 'PySys_AddXOption'); - late final _PySys_AddXOption = - _PySys_AddXOptionPtr.asFunction)>(); - - ffi.Pointer PySys_GetXOptions() { - return _PySys_GetXOptions(); - } - - late final _PySys_GetXOptionsPtr = - _lookup Function()>>( - 'PySys_GetXOptions'); - late final _PySys_GetXOptions = - _PySys_GetXOptionsPtr.asFunction Function()>(); - - int PyUnstable_PerfMapState_Init() { - return _PyUnstable_PerfMapState_Init(); - } - - late final _PyUnstable_PerfMapState_InitPtr = - _lookup>( - 'PyUnstable_PerfMapState_Init'); - late final _PyUnstable_PerfMapState_Init = - _PyUnstable_PerfMapState_InitPtr.asFunction(); - - int PyUnstable_WritePerfMapEntry( - ffi.Pointer code_addr, - int code_size, - ffi.Pointer entry_name, - ) { - return _PyUnstable_WritePerfMapEntry( - code_addr, - code_size, - entry_name, - ); - } - - late final _PyUnstable_WritePerfMapEntryPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.UnsignedInt, - ffi.Pointer)>>('PyUnstable_WritePerfMapEntry'); - late final _PyUnstable_WritePerfMapEntry = - _PyUnstable_WritePerfMapEntryPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); - - void PyUnstable_PerfMapState_Fini() { - return _PyUnstable_PerfMapState_Fini(); - } - - late final _PyUnstable_PerfMapState_FiniPtr = - _lookup>( - 'PyUnstable_PerfMapState_Fini'); - late final _PyUnstable_PerfMapState_Fini = - _PyUnstable_PerfMapState_FiniPtr.asFunction(); - - ffi.Pointer _PySys_GetAttr( - ffi.Pointer tstate, - ffi.Pointer name, - ) { - return __PySys_GetAttr( - tstate, - name, - ); - } - - late final __PySys_GetAttrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PySys_GetAttr'); - late final __PySys_GetAttr = __PySys_GetAttrPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int _PySys_GetSizeOf( - ffi.Pointer arg0, - ) { - return __PySys_GetSizeOf( - arg0, - ); - } - - late final __PySys_GetSizeOfPtr = - _lookup)>>( - '_PySys_GetSizeOf'); - late final __PySys_GetSizeOf = - __PySys_GetSizeOfPtr.asFunction)>(); - - int PySys_Audit( - ffi.Pointer event, - ffi.Pointer argFormat, - ) { - return _PySys_Audit( - event, - argFormat, - ); - } - - late final _PySys_AuditPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PySys_Audit'); - late final _PySys_Audit = _PySys_AuditPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PySys_AddAuditHook( - Py_AuditHookFunction arg0, - ffi.Pointer arg1, - ) { - return _PySys_AddAuditHook( - arg0, - arg1, - ); - } - - late final _PySys_AddAuditHookPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(Py_AuditHookFunction, - ffi.Pointer)>>('PySys_AddAuditHook'); - late final _PySys_AddAuditHook = _PySys_AddAuditHookPtr.asFunction< - int Function(Py_AuditHookFunction, ffi.Pointer)>(); - - ffi.Pointer PyOS_FSPath( - ffi.Pointer path, - ) { - return _PyOS_FSPath( - path, - ); - } - - late final _PyOS_FSPathPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyOS_FSPath'); - late final _PyOS_FSPath = _PyOS_FSPathPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyOS_InterruptOccurred() { - return _PyOS_InterruptOccurred(); - } - - late final _PyOS_InterruptOccurredPtr = - _lookup>('PyOS_InterruptOccurred'); - late final _PyOS_InterruptOccurred = - _PyOS_InterruptOccurredPtr.asFunction(); - - void PyOS_BeforeFork() { - return _PyOS_BeforeFork(); - } - - late final _PyOS_BeforeForkPtr = - _lookup>('PyOS_BeforeFork'); - late final _PyOS_BeforeFork = - _PyOS_BeforeForkPtr.asFunction(); - - void PyOS_AfterFork_Parent() { - return _PyOS_AfterFork_Parent(); - } - - late final _PyOS_AfterFork_ParentPtr = - _lookup>('PyOS_AfterFork_Parent'); - late final _PyOS_AfterFork_Parent = - _PyOS_AfterFork_ParentPtr.asFunction(); - - void PyOS_AfterFork_Child() { - return _PyOS_AfterFork_Child(); - } - - late final _PyOS_AfterFork_ChildPtr = - _lookup>('PyOS_AfterFork_Child'); - late final _PyOS_AfterFork_Child = - _PyOS_AfterFork_ChildPtr.asFunction(); - - void PyOS_AfterFork() { - return _PyOS_AfterFork(); - } - - late final _PyOS_AfterForkPtr = - _lookup>('PyOS_AfterFork'); - late final _PyOS_AfterFork = _PyOS_AfterForkPtr.asFunction(); - - int _PyOS_IsMainThread() { - return __PyOS_IsMainThread(); - } - - late final __PyOS_IsMainThreadPtr = - _lookup>('_PyOS_IsMainThread'); - late final __PyOS_IsMainThread = - __PyOS_IsMainThreadPtr.asFunction(); - - int PyImport_GetMagicNumber() { - return _PyImport_GetMagicNumber(); - } - - late final _PyImport_GetMagicNumberPtr = - _lookup>( - 'PyImport_GetMagicNumber'); - late final _PyImport_GetMagicNumber = - _PyImport_GetMagicNumberPtr.asFunction(); - - ffi.Pointer PyImport_GetMagicTag() { - return _PyImport_GetMagicTag(); - } - - late final _PyImport_GetMagicTagPtr = - _lookup Function()>>( - 'PyImport_GetMagicTag'); - late final _PyImport_GetMagicTag = - _PyImport_GetMagicTagPtr.asFunction Function()>(); - - ffi.Pointer PyImport_ExecCodeModule( - ffi.Pointer name, - ffi.Pointer co, - ) { - return _PyImport_ExecCodeModule( - name, - co, - ); - } - - late final _PyImport_ExecCodeModulePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyImport_ExecCodeModule'); - late final _PyImport_ExecCodeModule = _PyImport_ExecCodeModulePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyImport_ExecCodeModuleEx( - ffi.Pointer name, - ffi.Pointer co, - ffi.Pointer pathname, - ) { - return _PyImport_ExecCodeModuleEx( - name, - co, - pathname, - ); - } - - late final _PyImport_ExecCodeModuleExPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyImport_ExecCodeModuleEx'); - late final _PyImport_ExecCodeModuleEx = - _PyImport_ExecCodeModuleExPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyImport_ExecCodeModuleWithPathnames( - ffi.Pointer name, - ffi.Pointer co, - ffi.Pointer pathname, - ffi.Pointer cpathname, - ) { - return _PyImport_ExecCodeModuleWithPathnames( - name, - co, - pathname, - cpathname, - ); - } - - late final _PyImport_ExecCodeModuleWithPathnamesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyImport_ExecCodeModuleWithPathnames'); - late final _PyImport_ExecCodeModuleWithPathnames = - _PyImport_ExecCodeModuleWithPathnamesPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyImport_ExecCodeModuleObject( - ffi.Pointer name, - ffi.Pointer co, - ffi.Pointer pathname, - ffi.Pointer cpathname, - ) { - return _PyImport_ExecCodeModuleObject( - name, - co, - pathname, - cpathname, - ); - } - - late final _PyImport_ExecCodeModuleObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyImport_ExecCodeModuleObject'); - late final _PyImport_ExecCodeModuleObject = - _PyImport_ExecCodeModuleObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer PyImport_GetModuleDict() { - return _PyImport_GetModuleDict(); - } - - late final _PyImport_GetModuleDictPtr = - _lookup Function()>>( - 'PyImport_GetModuleDict'); - late final _PyImport_GetModuleDict = - _PyImport_GetModuleDictPtr.asFunction Function()>(); - - ffi.Pointer PyImport_GetModule( - ffi.Pointer name, - ) { - return _PyImport_GetModule( - name, - ); - } - - late final _PyImport_GetModulePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyImport_GetModule'); - late final _PyImport_GetModule = _PyImport_GetModulePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyImport_AddModuleObject( - ffi.Pointer name, - ) { - return _PyImport_AddModuleObject( - name, - ); - } - - late final _PyImport_AddModuleObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyImport_AddModuleObject'); - late final _PyImport_AddModuleObject = _PyImport_AddModuleObjectPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyImport_AddModule( - ffi.Pointer name, - ) { - return _PyImport_AddModule( - name, - ); - } - - late final _PyImport_AddModulePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyImport_AddModule'); - late final _PyImport_AddModule = _PyImport_AddModulePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyImport_ImportModule( - ffi.Pointer name, - ) { - return _PyImport_ImportModule( - name, - ); - } - - late final _PyImport_ImportModulePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyImport_ImportModule'); - late final _PyImport_ImportModule = _PyImport_ImportModulePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyImport_ImportModuleNoBlock( - ffi.Pointer name, - ) { - return _PyImport_ImportModuleNoBlock( - name, - ); - } - - late final _PyImport_ImportModuleNoBlockPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyImport_ImportModuleNoBlock'); - late final _PyImport_ImportModuleNoBlock = _PyImport_ImportModuleNoBlockPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyImport_ImportModuleLevel( - ffi.Pointer name, - ffi.Pointer globals, - ffi.Pointer locals, - ffi.Pointer fromlist, - int level, - ) { - return _PyImport_ImportModuleLevel( - name, - globals, - locals, - fromlist, - level, - ); - } - - late final _PyImport_ImportModuleLevelPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('PyImport_ImportModuleLevel'); - late final _PyImport_ImportModuleLevel = - _PyImport_ImportModuleLevelPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - - ffi.Pointer PyImport_ImportModuleLevelObject( - ffi.Pointer name, - ffi.Pointer globals, - ffi.Pointer locals, - ffi.Pointer fromlist, - int level, - ) { - return _PyImport_ImportModuleLevelObject( - name, - globals, - locals, - fromlist, - level, - ); - } - - late final _PyImport_ImportModuleLevelObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('PyImport_ImportModuleLevelObject'); - late final _PyImport_ImportModuleLevelObject = - _PyImport_ImportModuleLevelObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - - ffi.Pointer PyImport_GetImporter( - ffi.Pointer path, - ) { - return _PyImport_GetImporter( - path, - ); - } - - late final _PyImport_GetImporterPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyImport_GetImporter'); - late final _PyImport_GetImporter = _PyImport_GetImporterPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyImport_Import( - ffi.Pointer name, - ) { - return _PyImport_Import( - name, - ); - } - - late final _PyImport_ImportPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyImport_Import'); - late final _PyImport_Import = _PyImport_ImportPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyImport_ReloadModule( - ffi.Pointer m, - ) { - return _PyImport_ReloadModule( - m, - ); - } - - late final _PyImport_ReloadModulePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyImport_ReloadModule'); - late final _PyImport_ReloadModule = _PyImport_ReloadModulePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyImport_ImportFrozenModuleObject( - ffi.Pointer name, - ) { - return _PyImport_ImportFrozenModuleObject( - name, - ); - } - - late final _PyImport_ImportFrozenModuleObjectPtr = - _lookup)>>( - 'PyImport_ImportFrozenModuleObject'); - late final _PyImport_ImportFrozenModuleObject = - _PyImport_ImportFrozenModuleObjectPtr.asFunction< - int Function(ffi.Pointer)>(); - - int PyImport_ImportFrozenModule( - ffi.Pointer name, - ) { - return _PyImport_ImportFrozenModule( - name, - ); - } - - late final _PyImport_ImportFrozenModulePtr = - _lookup)>>( - 'PyImport_ImportFrozenModule'); - late final _PyImport_ImportFrozenModule = _PyImport_ImportFrozenModulePtr - .asFunction)>(); - - int PyImport_AppendInittab( - ffi.Pointer name, - ffi.Pointer Function()>> initfunc, - ) { - return _PyImport_AppendInittab( - name, - initfunc, - ); - } - - late final _PyImport_AppendInittabPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction Function()>>)>>( - 'PyImport_AppendInittab'); - late final _PyImport_AppendInittab = _PyImport_AppendInittabPtr.asFunction< - int Function(ffi.Pointer, - ffi.Pointer Function()>>)>(); - - ffi.Pointer PyInit__imp() { - return _PyInit__imp(); - } - - late final _PyInit__impPtr = - _lookup Function()>>( - 'PyInit__imp'); - late final _PyInit__imp = - _PyInit__impPtr.asFunction Function()>(); - - int _PyImport_IsInitialized( - ffi.Pointer arg0, - ) { - return __PyImport_IsInitialized( - arg0, - ); - } - - late final __PyImport_IsInitializedPtr = _lookup< - ffi - .NativeFunction)>>( - '_PyImport_IsInitialized'); - late final __PyImport_IsInitialized = __PyImport_IsInitializedPtr - .asFunction)>(); - - ffi.Pointer _PyImport_GetModuleId( - ffi.Pointer<_Py_Identifier> name, - ) { - return __PyImport_GetModuleId( - name, - ); - } - - late final __PyImport_GetModuleIdPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_Py_Identifier>)>>('_PyImport_GetModuleId'); - late final __PyImport_GetModuleId = __PyImport_GetModuleIdPtr.asFunction< - ffi.Pointer Function(ffi.Pointer<_Py_Identifier>)>(); - - int _PyImport_SetModule( - ffi.Pointer name, - ffi.Pointer module, - ) { - return __PyImport_SetModule( - name, - module, - ); - } - - late final __PyImport_SetModulePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyImport_SetModule'); - late final __PyImport_SetModule = __PyImport_SetModulePtr - .asFunction, ffi.Pointer)>(); - - int _PyImport_SetModuleString( - ffi.Pointer name, - ffi.Pointer module, - ) { - return __PyImport_SetModuleString( - name, - module, - ); - } - - late final __PyImport_SetModuleStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyImport_SetModuleString'); - late final __PyImport_SetModuleString = __PyImport_SetModuleStringPtr - .asFunction, ffi.Pointer)>(); - - void _PyImport_AcquireLock( - ffi.Pointer interp, - ) { - return __PyImport_AcquireLock( - interp, - ); - } - - late final __PyImport_AcquireLockPtr = _lookup< - ffi - .NativeFunction)>>( - '_PyImport_AcquireLock'); - late final __PyImport_AcquireLock = __PyImport_AcquireLockPtr - .asFunction)>(); - - int _PyImport_ReleaseLock( - ffi.Pointer interp, - ) { - return __PyImport_ReleaseLock( - interp, - ); - } - - late final __PyImport_ReleaseLockPtr = _lookup< - ffi - .NativeFunction)>>( - '_PyImport_ReleaseLock'); - late final __PyImport_ReleaseLock = __PyImport_ReleaseLockPtr - .asFunction)>(); - - int _PyImport_FixupBuiltin( - ffi.Pointer mod, - ffi.Pointer name, - ffi.Pointer modules, - ) { - return __PyImport_FixupBuiltin( - mod, - name, - modules, - ); - } - - late final __PyImport_FixupBuiltinPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('_PyImport_FixupBuiltin'); - late final __PyImport_FixupBuiltin = __PyImport_FixupBuiltinPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _PyImport_FixupExtensionObject( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) { - return __PyImport_FixupExtensionObject( - arg0, - arg1, - arg2, - arg3, - ); - } - - late final __PyImport_FixupExtensionObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_PyImport_FixupExtensionObject'); - late final __PyImport_FixupExtensionObject = - __PyImport_FixupExtensionObjectPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer> _PyImport_Inittab = - _lookup>('PyImport_Inittab'); - - ffi.Pointer<_inittab> get PyImport_Inittab => _PyImport_Inittab.value; - - set PyImport_Inittab(ffi.Pointer<_inittab> value) => - _PyImport_Inittab.value = value; - - int PyImport_ExtendInittab( - ffi.Pointer<_inittab> newtab, - ) { - return _PyImport_ExtendInittab( - newtab, - ); - } - - late final _PyImport_ExtendInittabPtr = - _lookup)>>( - 'PyImport_ExtendInittab'); - late final _PyImport_ExtendInittab = _PyImport_ExtendInittabPtr.asFunction< - int Function(ffi.Pointer<_inittab>)>(); - - late final ffi.Pointer> _PyImport_FrozenModules = - _lookup>('PyImport_FrozenModules'); - - ffi.Pointer<_frozen> get PyImport_FrozenModules => - _PyImport_FrozenModules.value; - - set PyImport_FrozenModules(ffi.Pointer<_frozen> value) => - _PyImport_FrozenModules.value = value; - - ffi.Pointer _PyImport_GetModuleAttr( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyImport_GetModuleAttr( - arg0, - arg1, - ); - } - - late final __PyImport_GetModuleAttrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyImport_GetModuleAttr'); - late final __PyImport_GetModuleAttr = __PyImport_GetModuleAttrPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyImport_GetModuleAttrString( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __PyImport_GetModuleAttrString( - arg0, - arg1, - ); - } - - late final __PyImport_GetModuleAttrStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyImport_GetModuleAttrString'); - late final __PyImport_GetModuleAttrString = - __PyImport_GetModuleAttrStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_CallNoArgs( - ffi.Pointer func, - ) { - return _PyObject_CallNoArgs( - func, - ); - } - - late final _PyObject_CallNoArgsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_CallNoArgs'); - late final _PyObject_CallNoArgs = _PyObject_CallNoArgsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_Call( - ffi.Pointer callable, - ffi.Pointer args, - ffi.Pointer kwargs, - ) { - return _PyObject_Call( - callable, - args, - kwargs, - ); - } - - late final _PyObject_CallPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('PyObject_Call'); - late final _PyObject_Call = _PyObject_CallPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_CallObject( - ffi.Pointer callable, - ffi.Pointer args, - ) { - return _PyObject_CallObject( - callable, - args, - ); - } - - late final _PyObject_CallObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_CallObject'); - late final _PyObject_CallObject = _PyObject_CallObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_CallFunction( - ffi.Pointer callable, - ffi.Pointer format, - ) { - return _PyObject_CallFunction( - callable, - format, - ); - } - - late final _PyObject_CallFunctionPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_CallFunction'); - late final _PyObject_CallFunction = _PyObject_CallFunctionPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_CallMethod( - ffi.Pointer obj, - ffi.Pointer name, - ffi.Pointer format, - ) { - return _PyObject_CallMethod1( - obj, - name, - format, - ); - } - - late final _PyObject_CallMethodPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyObject_CallMethod'); - late final _PyObject_CallMethod1 = _PyObject_CallMethodPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyObject_CallFunction_SizeT( - ffi.Pointer callable, - ffi.Pointer format, - ) { - return __PyObject_CallFunction_SizeT( - callable, - format, - ); - } - - late final __PyObject_CallFunction_SizeTPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('_PyObject_CallFunction_SizeT'); - late final __PyObject_CallFunction_SizeT = - __PyObject_CallFunction_SizeTPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyObject_CallMethod_SizeT( - ffi.Pointer obj, - ffi.Pointer name, - ffi.Pointer format, - ) { - return __PyObject_CallMethod_SizeT( - obj, - name, - format, - ); - } - - late final __PyObject_CallMethod_SizeTPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_PyObject_CallMethod_SizeT'); - late final __PyObject_CallMethod_SizeT = - __PyObject_CallMethod_SizeTPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_CallFunctionObjArgs( - ffi.Pointer callable, - ) { - return _PyObject_CallFunctionObjArgs( - callable, - ); - } - - late final _PyObject_CallFunctionObjArgsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_CallFunctionObjArgs'); - late final _PyObject_CallFunctionObjArgs = _PyObject_CallFunctionObjArgsPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_CallMethodObjArgs( - ffi.Pointer obj, - ffi.Pointer name, - ) { - return _PyObject_CallMethodObjArgs( - obj, - name, - ); - } - - late final _PyObject_CallMethodObjArgsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_CallMethodObjArgs'); - late final _PyObject_CallMethodObjArgs = - _PyObject_CallMethodObjArgsPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyVectorcall_NARGS( - int nargsf, - ) { - return _PyVectorcall_NARGS( - nargsf, - ); - } - - late final _PyVectorcall_NARGSPtr = - _lookup>( - 'PyVectorcall_NARGS'); - late final _PyVectorcall_NARGS = - _PyVectorcall_NARGSPtr.asFunction(); - - ffi.Pointer PyVectorcall_Call( - ffi.Pointer callable, - ffi.Pointer tuple, - ffi.Pointer dict, - ) { - return _PyVectorcall_Call( - callable, - tuple, - dict, - ); - } - - late final _PyVectorcall_CallPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyVectorcall_Call'); - late final _PyVectorcall_Call = _PyVectorcall_CallPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_Vectorcall( - ffi.Pointer callable, - ffi.Pointer> args, - int nargsf, - ffi.Pointer kwnames, - ) { - return _PyObject_Vectorcall( - callable, - args, - nargsf, - kwnames, - ); - } - - late final _PyObject_VectorcallPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Size, - ffi.Pointer)>>('PyObject_Vectorcall'); - late final _PyObject_Vectorcall = _PyObject_VectorcallPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer>, int, ffi.Pointer)>(); - - ffi.Pointer PyObject_VectorcallMethod( - ffi.Pointer name, - ffi.Pointer> args, - int nargsf, - ffi.Pointer kwnames, - ) { - return _PyObject_VectorcallMethod( - name, - args, - nargsf, - kwnames, - ); - } - - late final _PyObject_VectorcallMethodPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Size, - ffi.Pointer)>>('PyObject_VectorcallMethod'); - late final _PyObject_VectorcallMethod = - _PyObject_VectorcallMethodPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, - int, - ffi.Pointer)>(); - - ffi.Pointer PyObject_Type( - ffi.Pointer o, - ) { - return _PyObject_Type( - o, - ); - } - - late final _PyObject_TypePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_Type'); - late final _PyObject_Type = _PyObject_TypePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyObject_Size( - ffi.Pointer o, - ) { - return _PyObject_Size( - o, - ); - } - - late final _PyObject_SizePtr = - _lookup)>>( - 'PyObject_Size'); - late final _PyObject_Size = - _PyObject_SizePtr.asFunction)>(); - - int PyObject_Length( - ffi.Pointer o, - ) { - return _PyObject_Length( - o, - ); - } - - late final _PyObject_LengthPtr = - _lookup)>>( - 'PyObject_Length'); - late final _PyObject_Length = - _PyObject_LengthPtr.asFunction)>(); - - ffi.Pointer PyObject_GetItem( - ffi.Pointer o, - ffi.Pointer key, - ) { - return _PyObject_GetItem( - o, - key, - ); - } - - late final _PyObject_GetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_GetItem'); - late final _PyObject_GetItem = _PyObject_GetItemPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyObject_SetItem( - ffi.Pointer o, - ffi.Pointer key, - ffi.Pointer v, - ) { - return _PyObject_SetItem( - o, - key, - v, - ); - } - - late final _PyObject_SetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyObject_SetItem'); - late final _PyObject_SetItem = _PyObject_SetItemPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyObject_DelItemString( - ffi.Pointer o, - ffi.Pointer key, - ) { - return _PyObject_DelItemString( - o, - key, - ); - } - - late final _PyObject_DelItemStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_DelItemString'); - late final _PyObject_DelItemString = _PyObject_DelItemStringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyObject_DelItem( - ffi.Pointer o, - ffi.Pointer key, - ) { - return _PyObject_DelItem( - o, - key, - ); - } - - late final _PyObject_DelItemPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_DelItem'); - late final _PyObject_DelItem = _PyObject_DelItemPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyObject_AsCharBuffer( - ffi.Pointer obj, - ffi.Pointer> buffer, - ffi.Pointer buffer_len, - ) { - return _PyObject_AsCharBuffer( - obj, - buffer, - buffer_len, - ); - } - - late final _PyObject_AsCharBufferPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('PyObject_AsCharBuffer'); - late final _PyObject_AsCharBuffer = _PyObject_AsCharBufferPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - ffi.Pointer)>(); - - int PyObject_CheckReadBuffer( - ffi.Pointer obj, - ) { - return _PyObject_CheckReadBuffer( - obj, - ); - } - - late final _PyObject_CheckReadBufferPtr = - _lookup)>>( - 'PyObject_CheckReadBuffer'); - late final _PyObject_CheckReadBuffer = _PyObject_CheckReadBufferPtr - .asFunction)>(); - - int PyObject_AsReadBuffer( - ffi.Pointer obj, - ffi.Pointer> buffer, - ffi.Pointer buffer_len, - ) { - return _PyObject_AsReadBuffer( - obj, - buffer, - buffer_len, - ); - } - - late final _PyObject_AsReadBufferPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('PyObject_AsReadBuffer'); - late final _PyObject_AsReadBuffer = _PyObject_AsReadBufferPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - ffi.Pointer)>(); - - int PyObject_AsWriteBuffer( - ffi.Pointer obj, - ffi.Pointer> buffer, - ffi.Pointer buffer_len, - ) { - return _PyObject_AsWriteBuffer( - obj, - buffer, - buffer_len, - ); - } - - late final _PyObject_AsWriteBufferPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('PyObject_AsWriteBuffer'); - late final _PyObject_AsWriteBuffer = _PyObject_AsWriteBufferPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - ffi.Pointer)>(); - - ffi.Pointer PyObject_Format( - ffi.Pointer obj, - ffi.Pointer format_spec, - ) { - return _PyObject_Format( - obj, - format_spec, - ); - } - - late final _PyObject_FormatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_Format'); - late final _PyObject_Format = _PyObject_FormatPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyObject_GetIter( - ffi.Pointer arg0, - ) { - return _PyObject_GetIter( - arg0, - ); - } - - late final _PyObject_GetIterPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_GetIter'); - late final _PyObject_GetIter = _PyObject_GetIterPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_GetAIter( - ffi.Pointer arg0, - ) { - return _PyObject_GetAIter( - arg0, - ); - } - - late final _PyObject_GetAIterPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyObject_GetAIter'); - late final _PyObject_GetAIter = _PyObject_GetAIterPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyIter_Check( - ffi.Pointer arg0, - ) { - return _PyIter_Check( - arg0, - ); - } - - late final _PyIter_CheckPtr = - _lookup)>>( - 'PyIter_Check'); - late final _PyIter_Check = - _PyIter_CheckPtr.asFunction)>(); - - int PyAIter_Check( - ffi.Pointer arg0, - ) { - return _PyAIter_Check( - arg0, - ); - } - - late final _PyAIter_CheckPtr = - _lookup)>>( - 'PyAIter_Check'); - late final _PyAIter_Check = - _PyAIter_CheckPtr.asFunction)>(); - - ffi.Pointer PyIter_Next( - ffi.Pointer arg0, - ) { - return _PyIter_Next( - arg0, - ); - } - - late final _PyIter_NextPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyIter_Next'); - late final _PyIter_Next = _PyIter_NextPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyIter_Send( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, - ) { - return _PyIter_Send( - arg0, - arg1, - arg2, - ); - } - - late final _PyIter_SendPtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>('PyIter_Send'); - late final _PyIter_Send = _PyIter_SendPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); - - int PyNumber_Check( - ffi.Pointer o, - ) { - return _PyNumber_Check( - o, - ); - } - - late final _PyNumber_CheckPtr = - _lookup)>>( - 'PyNumber_Check'); - late final _PyNumber_Check = - _PyNumber_CheckPtr.asFunction)>(); - - ffi.Pointer PyNumber_Add( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_Add( - o1, - o2, - ); - } - - late final _PyNumber_AddPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyNumber_Add'); - late final _PyNumber_Add = _PyNumber_AddPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_Subtract( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_Subtract( - o1, - o2, - ); - } - - late final _PyNumber_SubtractPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_Subtract'); - late final _PyNumber_Subtract = _PyNumber_SubtractPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_Multiply( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_Multiply( - o1, - o2, - ); - } - - late final _PyNumber_MultiplyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_Multiply'); - late final _PyNumber_Multiply = _PyNumber_MultiplyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_MatrixMultiply( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_MatrixMultiply( - o1, - o2, - ); - } - - late final _PyNumber_MatrixMultiplyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_MatrixMultiply'); - late final _PyNumber_MatrixMultiply = _PyNumber_MatrixMultiplyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_FloorDivide( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_FloorDivide( - o1, - o2, - ); - } - - late final _PyNumber_FloorDividePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_FloorDivide'); - late final _PyNumber_FloorDivide = _PyNumber_FloorDividePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_TrueDivide( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_TrueDivide( - o1, - o2, - ); - } - - late final _PyNumber_TrueDividePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_TrueDivide'); - late final _PyNumber_TrueDivide = _PyNumber_TrueDividePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_Remainder( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_Remainder( - o1, - o2, - ); - } - - late final _PyNumber_RemainderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_Remainder'); - late final _PyNumber_Remainder = _PyNumber_RemainderPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_Divmod( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_Divmod( - o1, - o2, - ); - } - - late final _PyNumber_DivmodPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_Divmod'); - late final _PyNumber_Divmod = _PyNumber_DivmodPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_Power( - ffi.Pointer o1, - ffi.Pointer o2, - ffi.Pointer o3, - ) { - return _PyNumber_Power( - o1, - o2, - o3, - ); - } - - late final _PyNumber_PowerPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('PyNumber_Power'); - late final _PyNumber_Power = _PyNumber_PowerPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_Negative( - ffi.Pointer o, - ) { - return _PyNumber_Negative( - o, - ); - } - - late final _PyNumber_NegativePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyNumber_Negative'); - late final _PyNumber_Negative = _PyNumber_NegativePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyNumber_Positive( - ffi.Pointer o, - ) { - return _PyNumber_Positive( - o, - ); - } - - late final _PyNumber_PositivePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyNumber_Positive'); - late final _PyNumber_Positive = _PyNumber_PositivePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyNumber_Absolute( - ffi.Pointer o, - ) { - return _PyNumber_Absolute( - o, - ); - } - - late final _PyNumber_AbsolutePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyNumber_Absolute'); - late final _PyNumber_Absolute = _PyNumber_AbsolutePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyNumber_Invert( - ffi.Pointer o, - ) { - return _PyNumber_Invert( - o, - ); - } - - late final _PyNumber_InvertPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyNumber_Invert'); - late final _PyNumber_Invert = _PyNumber_InvertPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyNumber_Lshift( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_Lshift( - o1, - o2, - ); - } - - late final _PyNumber_LshiftPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_Lshift'); - late final _PyNumber_Lshift = _PyNumber_LshiftPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_Rshift( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_Rshift( - o1, - o2, - ); - } - - late final _PyNumber_RshiftPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_Rshift'); - late final _PyNumber_Rshift = _PyNumber_RshiftPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_And( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_And( - o1, - o2, - ); - } - - late final _PyNumber_AndPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyNumber_And'); - late final _PyNumber_And = _PyNumber_AndPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_Xor( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_Xor( - o1, - o2, - ); - } - - late final _PyNumber_XorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyNumber_Xor'); - late final _PyNumber_Xor = _PyNumber_XorPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_Or( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_Or( - o1, - o2, - ); - } - - late final _PyNumber_OrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('PyNumber_Or'); - late final _PyNumber_Or = _PyNumber_OrPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyIndex_Check( - ffi.Pointer arg0, - ) { - return _PyIndex_Check( - arg0, - ); - } - - late final _PyIndex_CheckPtr = - _lookup)>>( - 'PyIndex_Check'); - late final _PyIndex_Check = - _PyIndex_CheckPtr.asFunction)>(); - - ffi.Pointer PyNumber_Index( - ffi.Pointer o, - ) { - return _PyNumber_Index1( - o, - ); - } - - late final _PyNumber_IndexPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyNumber_Index'); - late final _PyNumber_Index1 = _PyNumber_IndexPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - int PyNumber_AsSsize_t( - ffi.Pointer o, - ffi.Pointer exc, - ) { - return _PyNumber_AsSsize_t( - o, - exc, - ); - } - - late final _PyNumber_AsSsize_tPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_AsSsize_t'); - late final _PyNumber_AsSsize_t = _PyNumber_AsSsize_tPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_Long( - ffi.Pointer o, - ) { - return _PyNumber_Long( - o, - ); - } - - late final _PyNumber_LongPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyNumber_Long'); - late final _PyNumber_Long = _PyNumber_LongPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyNumber_Float( - ffi.Pointer o, - ) { - return _PyNumber_Float( - o, - ); - } - - late final _PyNumber_FloatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyNumber_Float'); - late final _PyNumber_Float = _PyNumber_FloatPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceAdd( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceAdd( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceAddPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceAdd'); - late final _PyNumber_InPlaceAdd = _PyNumber_InPlaceAddPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceSubtract( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceSubtract( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceSubtractPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceSubtract'); - late final _PyNumber_InPlaceSubtract = - _PyNumber_InPlaceSubtractPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceMultiply( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceMultiply( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceMultiplyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceMultiply'); - late final _PyNumber_InPlaceMultiply = - _PyNumber_InPlaceMultiplyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceMatrixMultiply( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceMatrixMultiply( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceMatrixMultiplyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceMatrixMultiply'); - late final _PyNumber_InPlaceMatrixMultiply = - _PyNumber_InPlaceMatrixMultiplyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceFloorDivide( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceFloorDivide( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceFloorDividePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceFloorDivide'); - late final _PyNumber_InPlaceFloorDivide = - _PyNumber_InPlaceFloorDividePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceTrueDivide( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceTrueDivide( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceTrueDividePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceTrueDivide'); - late final _PyNumber_InPlaceTrueDivide = - _PyNumber_InPlaceTrueDividePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceRemainder( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceRemainder( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceRemainderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceRemainder'); - late final _PyNumber_InPlaceRemainder = - _PyNumber_InPlaceRemainderPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlacePower( - ffi.Pointer o1, - ffi.Pointer o2, - ffi.Pointer o3, - ) { - return _PyNumber_InPlacePower( - o1, - o2, - o3, - ); - } - - late final _PyNumber_InPlacePowerPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlacePower'); - late final _PyNumber_InPlacePower = _PyNumber_InPlacePowerPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceLshift( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceLshift( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceLshiftPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceLshift'); - late final _PyNumber_InPlaceLshift = _PyNumber_InPlaceLshiftPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceRshift( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceRshift( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceRshiftPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceRshift'); - late final _PyNumber_InPlaceRshift = _PyNumber_InPlaceRshiftPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceAnd( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceAnd( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceAndPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceAnd'); - late final _PyNumber_InPlaceAnd = _PyNumber_InPlaceAndPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceXor( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceXor( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceXorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceXor'); - late final _PyNumber_InPlaceXor = _PyNumber_InPlaceXorPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_InPlaceOr( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PyNumber_InPlaceOr( - o1, - o2, - ); - } - - late final _PyNumber_InPlaceOrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyNumber_InPlaceOr'); - late final _PyNumber_InPlaceOr = _PyNumber_InPlaceOrPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyNumber_ToBase( - ffi.Pointer n, - int base, - ) { - return _PyNumber_ToBase( - n, - base, - ); - } - - late final _PyNumber_ToBasePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('PyNumber_ToBase'); - late final _PyNumber_ToBase = _PyNumber_ToBasePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - int PySequence_Check( - ffi.Pointer o, - ) { - return _PySequence_Check( - o, - ); - } - - late final _PySequence_CheckPtr = - _lookup)>>( - 'PySequence_Check'); - late final _PySequence_Check = - _PySequence_CheckPtr.asFunction)>(); - - int PySequence_Size( - ffi.Pointer o, - ) { - return _PySequence_Size( - o, - ); - } - - late final _PySequence_SizePtr = - _lookup)>>( - 'PySequence_Size'); - late final _PySequence_Size = - _PySequence_SizePtr.asFunction)>(); - - int PySequence_Length( - ffi.Pointer o, - ) { - return _PySequence_Length( - o, - ); - } - - late final _PySequence_LengthPtr = - _lookup)>>( - 'PySequence_Length'); - late final _PySequence_Length = - _PySequence_LengthPtr.asFunction)>(); - - ffi.Pointer PySequence_Concat( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PySequence_Concat( - o1, - o2, - ); - } - - late final _PySequence_ConcatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PySequence_Concat'); - late final _PySequence_Concat = _PySequence_ConcatPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PySequence_Repeat( - ffi.Pointer o, - int count, - ) { - return _PySequence_Repeat( - o, - count, - ); - } - - late final _PySequence_RepeatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('PySequence_Repeat'); - late final _PySequence_Repeat = _PySequence_RepeatPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer PySequence_GetItem( - ffi.Pointer o, - int i, - ) { - return _PySequence_GetItem( - o, - i, - ); - } - - late final _PySequence_GetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('PySequence_GetItem'); - late final _PySequence_GetItem = _PySequence_GetItemPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer PySequence_GetSlice( - ffi.Pointer o, - int i1, - int i2, - ) { - return _PySequence_GetSlice( - o, - i1, - i2, - ); - } - - late final _PySequence_GetSlicePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t, - Py_ssize_t)>>('PySequence_GetSlice'); - late final _PySequence_GetSlice = _PySequence_GetSlicePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - int PySequence_SetItem( - ffi.Pointer o, - int i, - ffi.Pointer v, - ) { - return _PySequence_SetItem( - o, - i, - v, - ); - } - - late final _PySequence_SetItemPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, - ffi.Pointer)>>('PySequence_SetItem'); - late final _PySequence_SetItem = _PySequence_SetItemPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); - - int PySequence_DelItem( - ffi.Pointer o, - int i, - ) { - return _PySequence_DelItem( - o, - i, - ); - } - - late final _PySequence_DelItemPtr = _lookup< - ffi - .NativeFunction, Py_ssize_t)>>( - 'PySequence_DelItem'); - late final _PySequence_DelItem = _PySequence_DelItemPtr.asFunction< - int Function(ffi.Pointer, int)>(); - - int PySequence_SetSlice( - ffi.Pointer o, - int i1, - int i2, - ffi.Pointer v, - ) { - return _PySequence_SetSlice( - o, - i1, - i2, - v, - ); - } - - late final _PySequence_SetSlicePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, Py_ssize_t, - ffi.Pointer)>>('PySequence_SetSlice'); - late final _PySequence_SetSlice = _PySequence_SetSlicePtr.asFunction< - int Function(ffi.Pointer, int, int, ffi.Pointer)>(); - - int PySequence_DelSlice( - ffi.Pointer o, - int i1, - int i2, - ) { - return _PySequence_DelSlice( - o, - i1, - i2, - ); - } - - late final _PySequence_DelSlicePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, Py_ssize_t, - Py_ssize_t)>>('PySequence_DelSlice'); - late final _PySequence_DelSlice = _PySequence_DelSlicePtr.asFunction< - int Function(ffi.Pointer, int, int)>(); - - ffi.Pointer PySequence_Tuple( - ffi.Pointer o, - ) { - return _PySequence_Tuple( - o, - ); - } - - late final _PySequence_TuplePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PySequence_Tuple'); - late final _PySequence_Tuple = _PySequence_TuplePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PySequence_List( - ffi.Pointer o, - ) { - return _PySequence_List( - o, - ); - } - - late final _PySequence_ListPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PySequence_List'); - late final _PySequence_List = _PySequence_ListPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PySequence_Fast( - ffi.Pointer o, - ffi.Pointer m, - ) { - return _PySequence_Fast( - o, - m, - ); - } - - late final _PySequence_FastPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PySequence_Fast'); - late final _PySequence_Fast = _PySequence_FastPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PySequence_Count( - ffi.Pointer o, - ffi.Pointer value, - ) { - return _PySequence_Count( - o, - value, - ); - } - - late final _PySequence_CountPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(ffi.Pointer, - ffi.Pointer)>>('PySequence_Count'); - late final _PySequence_Count = _PySequence_CountPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PySequence_Contains( - ffi.Pointer seq, - ffi.Pointer ob, - ) { - return _PySequence_Contains( - seq, - ob, - ); - } - - late final _PySequence_ContainsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PySequence_Contains'); - late final _PySequence_Contains = _PySequence_ContainsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PySequence_In( - ffi.Pointer o, - ffi.Pointer value, - ) { - return _PySequence_In( - o, - value, - ); - } - - late final _PySequence_InPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PySequence_In'); - late final _PySequence_In = _PySequence_InPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PySequence_Index( - ffi.Pointer o, - ffi.Pointer value, - ) { - return _PySequence_Index( - o, - value, - ); - } - - late final _PySequence_IndexPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(ffi.Pointer, - ffi.Pointer)>>('PySequence_Index'); - late final _PySequence_Index = _PySequence_IndexPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PySequence_InPlaceConcat( - ffi.Pointer o1, - ffi.Pointer o2, - ) { - return _PySequence_InPlaceConcat( - o1, - o2, - ); - } - - late final _PySequence_InPlaceConcatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PySequence_InPlaceConcat'); - late final _PySequence_InPlaceConcat = - _PySequence_InPlaceConcatPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PySequence_InPlaceRepeat( - ffi.Pointer o, - int count, - ) { - return _PySequence_InPlaceRepeat( - o, - count, - ); - } - - late final _PySequence_InPlaceRepeatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>('PySequence_InPlaceRepeat'); - late final _PySequence_InPlaceRepeat = _PySequence_InPlaceRepeatPtr - .asFunction Function(ffi.Pointer, int)>(); - - int PyMapping_Check( - ffi.Pointer o, - ) { - return _PyMapping_Check( - o, - ); - } - - late final _PyMapping_CheckPtr = - _lookup)>>( - 'PyMapping_Check'); - late final _PyMapping_Check = - _PyMapping_CheckPtr.asFunction)>(); - - int PyMapping_Size( - ffi.Pointer o, - ) { - return _PyMapping_Size( - o, - ); - } - - late final _PyMapping_SizePtr = - _lookup)>>( - 'PyMapping_Size'); - late final _PyMapping_Size = - _PyMapping_SizePtr.asFunction)>(); - - int PyMapping_Length( - ffi.Pointer o, - ) { - return _PyMapping_Length( - o, - ); - } - - late final _PyMapping_LengthPtr = - _lookup)>>( - 'PyMapping_Length'); - late final _PyMapping_Length = - _PyMapping_LengthPtr.asFunction)>(); - - int PyMapping_HasKeyString( - ffi.Pointer o, - ffi.Pointer key, - ) { - return _PyMapping_HasKeyString( - o, - key, - ); - } - - late final _PyMapping_HasKeyStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyMapping_HasKeyString'); - late final _PyMapping_HasKeyString = _PyMapping_HasKeyStringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyMapping_HasKey( - ffi.Pointer o, - ffi.Pointer key, - ) { - return _PyMapping_HasKey( - o, - key, - ); - } - - late final _PyMapping_HasKeyPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyMapping_HasKey'); - late final _PyMapping_HasKey = _PyMapping_HasKeyPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer PyMapping_Keys( - ffi.Pointer o, - ) { - return _PyMapping_Keys( - o, - ); - } - - late final _PyMapping_KeysPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyMapping_Keys'); - late final _PyMapping_Keys = _PyMapping_KeysPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyMapping_Values( - ffi.Pointer o, - ) { - return _PyMapping_Values( - o, - ); - } - - late final _PyMapping_ValuesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyMapping_Values'); - late final _PyMapping_Values = _PyMapping_ValuesPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyMapping_Items( - ffi.Pointer o, - ) { - return _PyMapping_Items( - o, - ); - } - - late final _PyMapping_ItemsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('PyMapping_Items'); - late final _PyMapping_Items = _PyMapping_ItemsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer PyMapping_GetItemString( - ffi.Pointer o, - ffi.Pointer key, - ) { - return _PyMapping_GetItemString( - o, - key, - ); - } - - late final _PyMapping_GetItemStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyMapping_GetItemString'); - late final _PyMapping_GetItemString = _PyMapping_GetItemStringPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyMapping_SetItemString( - ffi.Pointer o, - ffi.Pointer key, - ffi.Pointer value, - ) { - return _PyMapping_SetItemString( - o, - key, - value, - ); - } - - late final _PyMapping_SetItemStringPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('PyMapping_SetItemString'); - late final _PyMapping_SetItemString = _PyMapping_SetItemStringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int PyObject_IsInstance( - ffi.Pointer object, - ffi.Pointer typeorclass, - ) { - return _PyObject_IsInstance( - object, - typeorclass, - ); - } - - late final _PyObject_IsInstancePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_IsInstance'); - late final _PyObject_IsInstance = _PyObject_IsInstancePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int PyObject_IsSubclass( - ffi.Pointer object, - ffi.Pointer typeorclass, - ) { - return _PyObject_IsSubclass( - object, - typeorclass, - ); - } - - late final _PyObject_IsSubclassPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_IsSubclass'); - late final _PyObject_IsSubclass = _PyObject_IsSubclassPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyStack_AsDict( - ffi.Pointer> values, - ffi.Pointer kwnames, - ) { - return __PyStack_AsDict( - values, - kwnames, - ); - } - - late final __PyStack_AsDictPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer>, - ffi.Pointer)>>('_PyStack_AsDict'); - late final __PyStack_AsDict = __PyStack_AsDictPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer>, ffi.Pointer)>(); - - ffi.Pointer _Py_CheckFunctionResult( - ffi.Pointer tstate, - ffi.Pointer callable, - ffi.Pointer result, - ffi.Pointer where, - ) { - return __Py_CheckFunctionResult( - tstate, - callable, - result, - where, - ); - } - - late final __Py_CheckFunctionResultPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_Py_CheckFunctionResult'); - late final __Py_CheckFunctionResult = __Py_CheckFunctionResultPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _PyObject_MakeTpCall( - ffi.Pointer tstate, - ffi.Pointer callable, - ffi.Pointer> args, - int nargs, - ffi.Pointer keywords, - ) { - return __PyObject_MakeTpCall( - tstate, - callable, - args, - nargs, - keywords, - ); - } - - late final __PyObject_MakeTpCallPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - Py_ssize_t, - ffi.Pointer)>>('_PyObject_MakeTpCall'); - late final __PyObject_MakeTpCall = __PyObject_MakeTpCallPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - int, - ffi.Pointer)>(); - - vectorcallfunc PyVectorcall_Function( - ffi.Pointer callable, - ) { - return _PyVectorcall_Function( - callable, - ); - } - - late final _PyVectorcall_FunctionPtr = _lookup< - ffi.NativeFunction)>>( - 'PyVectorcall_Function'); - late final _PyVectorcall_Function = _PyVectorcall_FunctionPtr.asFunction< - vectorcallfunc Function(ffi.Pointer)>(); - - ffi.Pointer PyObject_VectorcallDict( - ffi.Pointer callable, - ffi.Pointer> args, - int nargsf, - ffi.Pointer kwargs, - ) { - return _PyObject_VectorcallDict( - callable, - args, - nargsf, - kwargs, - ); - } - - late final _PyObject_VectorcallDictPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Size, - ffi.Pointer)>>('PyObject_VectorcallDict'); - late final _PyObject_VectorcallDict = _PyObject_VectorcallDictPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer>, int, ffi.Pointer)>(); - - ffi.Pointer _PyObject_FastCall( - ffi.Pointer func, - ffi.Pointer> args, - int nargs, - ) { - return __PyObject_FastCall( - func, - args, - nargs, - ); - } - - late final __PyObject_FastCallPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, - Py_ssize_t)>>('_PyObject_FastCall'); - late final __PyObject_FastCall = __PyObject_FastCallPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - ffi.Pointer PyObject_CallOneArg( - ffi.Pointer func, - ffi.Pointer arg, - ) { - return _PyObject_CallOneArg( - func, - arg, - ); - } - - late final _PyObject_CallOneArgPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('PyObject_CallOneArg'); - late final _PyObject_CallOneArg = _PyObject_CallOneArgPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyObject_CallMethod( - ffi.Pointer obj, - ffi.Pointer name, - ffi.Pointer format, - ) { - return __PyObject_CallMethod( - obj, - name, - format, - ); - } - - late final __PyObject_CallMethodPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_PyObject_CallMethod'); - late final __PyObject_CallMethod = __PyObject_CallMethodPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyObject_CallMethodId( - ffi.Pointer obj, - ffi.Pointer<_Py_Identifier> name, - ffi.Pointer format, - ) { - return __PyObject_CallMethodId( - obj, - name, - format, - ); - } - - late final __PyObject_CallMethodIdPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer<_Py_Identifier>, - ffi.Pointer)>>('_PyObject_CallMethodId'); - late final __PyObject_CallMethodId = __PyObject_CallMethodIdPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer<_Py_Identifier>, ffi.Pointer)>(); - - ffi.Pointer _PyObject_CallMethodId_SizeT( - ffi.Pointer obj, - ffi.Pointer<_Py_Identifier> name, - ffi.Pointer format, - ) { - return __PyObject_CallMethodId_SizeT( - obj, - name, - format, - ); - } - - late final __PyObject_CallMethodId_SizeTPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer<_Py_Identifier>, - ffi.Pointer)>>('_PyObject_CallMethodId_SizeT'); - late final __PyObject_CallMethodId_SizeT = - __PyObject_CallMethodId_SizeTPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer<_Py_Identifier>, ffi.Pointer)>(); - - ffi.Pointer _PyObject_CallMethodIdObjArgs( - ffi.Pointer obj, - ffi.Pointer<_Py_Identifier> name, - ) { - return __PyObject_CallMethodIdObjArgs( - obj, - name, - ); - } - - late final __PyObject_CallMethodIdObjArgsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer<_Py_Identifier>)>>('_PyObject_CallMethodIdObjArgs'); - late final __PyObject_CallMethodIdObjArgs = - __PyObject_CallMethodIdObjArgsPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer<_Py_Identifier>)>(); - - int _PyObject_HasLen( - ffi.Pointer o, - ) { - return __PyObject_HasLen( - o, - ); - } - - late final __PyObject_HasLenPtr = - _lookup)>>( - '_PyObject_HasLen'); - late final __PyObject_HasLen = - __PyObject_HasLenPtr.asFunction)>(); - - int PyObject_LengthHint( - ffi.Pointer o, - int arg1, - ) { - return _PyObject_LengthHint( - o, - arg1, - ); - } - - late final _PyObject_LengthHintPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function( - ffi.Pointer, Py_ssize_t)>>('PyObject_LengthHint'); - late final _PyObject_LengthHint = _PyObject_LengthHintPtr.asFunction< - int Function(ffi.Pointer, int)>(); - - int _PySequence_IterSearch( - ffi.Pointer seq, - ffi.Pointer obj, - int operation, - ) { - return __PySequence_IterSearch( - seq, - obj, - operation, - ); - } - - late final __PySequence_IterSearchPtr = _lookup< - ffi.NativeFunction< - Py_ssize_t Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('_PySequence_IterSearch'); - late final __PySequence_IterSearch = __PySequence_IterSearchPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _PyObject_RealIsInstance( - ffi.Pointer inst, - ffi.Pointer cls, - ) { - return __PyObject_RealIsInstance( - inst, - cls, - ); - } - - late final __PyObject_RealIsInstancePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyObject_RealIsInstance'); - late final __PyObject_RealIsInstance = __PyObject_RealIsInstancePtr - .asFunction, ffi.Pointer)>(); - - int _PyObject_RealIsSubclass( - ffi.Pointer derived, - ffi.Pointer cls, - ) { - return __PyObject_RealIsSubclass( - derived, - cls, - ); - } - - late final __PyObject_RealIsSubclassPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_PyObject_RealIsSubclass'); - late final __PyObject_RealIsSubclass = __PyObject_RealIsSubclassPtr - .asFunction, ffi.Pointer)>(); - - ffi.Pointer> _PySequence_BytesToCharpArray( - ffi.Pointer self, - ) { - return __PySequence_BytesToCharpArray( - self, - ); - } - - late final __PySequence_BytesToCharpArrayPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Pointer)>>('_PySequence_BytesToCharpArray'); - late final __PySequence_BytesToCharpArray = - __PySequence_BytesToCharpArrayPtr.asFunction< - ffi.Pointer> Function(ffi.Pointer)>(); - - void _Py_FreeCharPArray( - ffi.Pointer> array, - ) { - return __Py_FreeCharPArray( - array, - ); - } - - late final __Py_FreeCharPArrayPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer>)>>('_Py_FreeCharPArray'); - late final __Py_FreeCharPArray = __Py_FreeCharPArrayPtr - .asFunction>)>(); - - void _Py_add_one_to_index_F( - int nd, - ffi.Pointer index, - ffi.Pointer shape, - ) { - return __Py_add_one_to_index_F( - nd, - index, - shape, - ); - } - - late final __Py_add_one_to_index_FPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer, - ffi.Pointer)>>('_Py_add_one_to_index_F'); - late final __Py_add_one_to_index_F = __Py_add_one_to_index_FPtr.asFunction< - void Function(int, ffi.Pointer, ffi.Pointer)>(); - - void _Py_add_one_to_index_C( - int nd, - ffi.Pointer index, - ffi.Pointer shape, - ) { - return __Py_add_one_to_index_C( - nd, - index, - shape, - ); - } - - late final __Py_add_one_to_index_CPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer, - ffi.Pointer)>>('_Py_add_one_to_index_C'); - late final __Py_add_one_to_index_C = __Py_add_one_to_index_CPtr.asFunction< - void Function(int, ffi.Pointer, ffi.Pointer)>(); - - int _Py_convert_optional_to_ssize_t( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return __Py_convert_optional_to_ssize_t( - arg0, - arg1, - ); - } - - late final __Py_convert_optional_to_ssize_tPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('_Py_convert_optional_to_ssize_t'); - late final __Py_convert_optional_to_ssize_t = - __Py_convert_optional_to_ssize_tPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _PyNumber_Index( - ffi.Pointer o, - ) { - return __PyNumber_Index( - o, - ); - } - - late final __PyNumber_IndexPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyNumber_Index'); - late final __PyNumber_Index = __PyNumber_IndexPtr - .asFunction Function(ffi.Pointer)>(); - - late final ffi.Pointer _PyFilter_Type = - _lookup('PyFilter_Type'); - - PyTypeObject get PyFilter_Type => _PyFilter_Type.ref; - - late final ffi.Pointer _PyMap_Type = - _lookup('PyMap_Type'); - - PyTypeObject get PyMap_Type => _PyMap_Type.ref; - - late final ffi.Pointer _PyZip_Type = - _lookup('PyZip_Type'); - - PyTypeObject get PyZip_Type => _PyZip_Type.ref; - - late final ffi.Pointer> __Py_ctype_table = - _lookup>('_Py_ctype_table'); - - ffi.Pointer get _Py_ctype_table => __Py_ctype_table.value; - - set _Py_ctype_table(ffi.Pointer value) => - __Py_ctype_table.value = value; - - late final ffi.Pointer> __Py_ctype_tolower = - _lookup>('_Py_ctype_tolower'); - - ffi.Pointer get _Py_ctype_tolower => - __Py_ctype_tolower.value; - - set _Py_ctype_tolower(ffi.Pointer value) => - __Py_ctype_tolower.value = value; - - late final ffi.Pointer> __Py_ctype_toupper = - _lookup>('_Py_ctype_toupper'); - - ffi.Pointer get _Py_ctype_toupper => - __Py_ctype_toupper.value; - - set _Py_ctype_toupper(ffi.Pointer value) => - __Py_ctype_toupper.value = value; - - double PyOS_string_to_double( - ffi.Pointer str, - ffi.Pointer> endptr, - ffi.Pointer overflow_exception, - ) { - return _PyOS_string_to_double( - str, - endptr, - overflow_exception, - ); - } - - late final _PyOS_string_to_doublePtr = _lookup< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('PyOS_string_to_double'); - late final _PyOS_string_to_double = _PyOS_string_to_doublePtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer>, - ffi.Pointer)>(); - - ffi.Pointer PyOS_double_to_string( - double val, - int format_code, - int precision, - int flags, - ffi.Pointer type, - ) { - return _PyOS_double_to_string( - val, - format_code, - precision, - flags, - type, - ); - } - - late final _PyOS_double_to_stringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Double, ffi.Char, ffi.Int, ffi.Int, - ffi.Pointer)>>('PyOS_double_to_string'); - late final _PyOS_double_to_string = _PyOS_double_to_stringPtr.asFunction< - ffi.Pointer Function( - double, int, int, int, ffi.Pointer)>(); - - ffi.Pointer _Py_string_to_number_with_underscores( - ffi.Pointer str, - int len, - ffi.Pointer what, - ffi.Pointer obj, - ffi.Pointer arg, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t, ffi.Pointer)>> - innerfunc, - ) { - return __Py_string_to_number_with_underscores( - str, - len, - what, - obj, - arg, - innerfunc, - ); - } - - late final __Py_string_to_number_with_underscoresPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - Py_ssize_t, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - Py_ssize_t, ffi.Pointer)>>)>>( - '_Py_string_to_number_with_underscores'); - late final __Py_string_to_number_with_underscores = - __Py_string_to_number_with_underscoresPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - Py_ssize_t, ffi.Pointer)>>)>(); - - double _Py_parse_inf_or_nan( - ffi.Pointer p, - ffi.Pointer> endptr, - ) { - return __Py_parse_inf_or_nan( - p, - endptr, - ); - } - - late final __Py_parse_inf_or_nanPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer>)>>('_Py_parse_inf_or_nan'); - late final __Py_parse_inf_or_nan = __Py_parse_inf_or_nanPtr.asFunction< - double Function( - ffi.Pointer, ffi.Pointer>)>(); - - int PyOS_mystrnicmp( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return _PyOS_mystrnicmp( - arg0, - arg1, - arg2, - ); - } - - late final _PyOS_mystrnicmpPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - Py_ssize_t)>>('PyOS_mystrnicmp'); - late final _PyOS_mystrnicmp = _PyOS_mystrnicmpPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int PyOS_mystricmp( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _PyOS_mystricmp( - arg0, - arg1, - ); - } - - late final _PyOS_mystricmpPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('PyOS_mystricmp'); - late final _PyOS_mystricmp = _PyOS_mystricmpPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer Py_DecodeLocale( - ffi.Pointer arg, - ffi.Pointer size, - ) { - return _Py_DecodeLocale( - arg, - size, - ); - } - - late final _Py_DecodeLocalePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('Py_DecodeLocale'); - late final _Py_DecodeLocale = _Py_DecodeLocalePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer Py_EncodeLocale( - ffi.Pointer text, - ffi.Pointer error_pos, - ) { - return _Py_EncodeLocale( - text, - error_pos, - ); - } - - late final _Py_EncodeLocalePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('Py_EncodeLocale'); - late final _Py_EncodeLocale = _Py_EncodeLocalePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _Py_fopen_obj( - ffi.Pointer path, - ffi.Pointer mode, - ) { - return __Py_fopen_obj( - path, - mode, - ); - } - - late final __Py_fopen_objPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('_Py_fopen_obj'); - late final __Py_fopen_obj = __Py_fopen_objPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int PyTraceMalloc_Track( - int domain, - int ptr, - int size, - ) { - return _PyTraceMalloc_Track( - domain, - ptr, - size, - ); - } - - late final _PyTraceMalloc_TrackPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.UnsignedInt, ffi.UintPtr, ffi.Size)>>('PyTraceMalloc_Track'); - late final _PyTraceMalloc_Track = - _PyTraceMalloc_TrackPtr.asFunction(); - - int PyTraceMalloc_Untrack( - int domain, - int ptr, - ) { - return _PyTraceMalloc_Untrack( - domain, - ptr, - ); - } - - late final _PyTraceMalloc_UntrackPtr = _lookup< - ffi.NativeFunction>( - 'PyTraceMalloc_Untrack'); - late final _PyTraceMalloc_Untrack = - _PyTraceMalloc_UntrackPtr.asFunction(); - - ffi.Pointer _PyTraceMalloc_GetTraceback( - int domain, - int ptr, - ) { - return __PyTraceMalloc_GetTraceback( - domain, - ptr, - ); - } - - late final __PyTraceMalloc_GetTracebackPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.UnsignedInt, ffi.UintPtr)>>('_PyTraceMalloc_GetTraceback'); - late final __PyTraceMalloc_GetTraceback = __PyTraceMalloc_GetTracebackPtr - .asFunction Function(int, int)>(); - - int _PyTraceMalloc_IsTracing() { - return __PyTraceMalloc_IsTracing(); - } - - late final __PyTraceMalloc_IsTracingPtr = - _lookup>( - '_PyTraceMalloc_IsTracing'); - late final __PyTraceMalloc_IsTracing = - __PyTraceMalloc_IsTracingPtr.asFunction(); - - void _PyTraceMalloc_ClearTraces() { - return __PyTraceMalloc_ClearTraces(); - } - - late final __PyTraceMalloc_ClearTracesPtr = - _lookup>( - '_PyTraceMalloc_ClearTraces'); - late final __PyTraceMalloc_ClearTraces = - __PyTraceMalloc_ClearTracesPtr.asFunction(); - - ffi.Pointer _PyTraceMalloc_GetTraces() { - return __PyTraceMalloc_GetTraces(); - } - - late final __PyTraceMalloc_GetTracesPtr = - _lookup Function()>>( - '_PyTraceMalloc_GetTraces'); - late final __PyTraceMalloc_GetTraces = __PyTraceMalloc_GetTracesPtr - .asFunction Function()>(); - - ffi.Pointer _PyTraceMalloc_GetObjectTraceback( - ffi.Pointer obj, - ) { - return __PyTraceMalloc_GetObjectTraceback( - obj, - ); - } - - late final __PyTraceMalloc_GetObjectTracebackPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_PyTraceMalloc_GetObjectTraceback'); - late final __PyTraceMalloc_GetObjectTraceback = - __PyTraceMalloc_GetObjectTracebackPtr - .asFunction Function(ffi.Pointer)>(); - - int _PyTraceMalloc_Init() { - return __PyTraceMalloc_Init(); - } - - late final __PyTraceMalloc_InitPtr = - _lookup>('_PyTraceMalloc_Init'); - late final __PyTraceMalloc_Init = - __PyTraceMalloc_InitPtr.asFunction(); - - int _PyTraceMalloc_Start( - int max_nframe, - ) { - return __PyTraceMalloc_Start( - max_nframe, - ); - } - - late final __PyTraceMalloc_StartPtr = - _lookup>( - '_PyTraceMalloc_Start'); - late final __PyTraceMalloc_Start = - __PyTraceMalloc_StartPtr.asFunction(); - - void _PyTraceMalloc_Stop() { - return __PyTraceMalloc_Stop(); - } - - late final __PyTraceMalloc_StopPtr = - _lookup>('_PyTraceMalloc_Stop'); - late final __PyTraceMalloc_Stop = - __PyTraceMalloc_StopPtr.asFunction(); - - int _PyTraceMalloc_GetTracebackLimit() { - return __PyTraceMalloc_GetTracebackLimit(); - } - - late final __PyTraceMalloc_GetTracebackLimitPtr = - _lookup>( - '_PyTraceMalloc_GetTracebackLimit'); - late final __PyTraceMalloc_GetTracebackLimit = - __PyTraceMalloc_GetTracebackLimitPtr.asFunction(); - - int _PyTraceMalloc_GetMemory() { - return __PyTraceMalloc_GetMemory(); - } - - late final __PyTraceMalloc_GetMemoryPtr = - _lookup>( - '_PyTraceMalloc_GetMemory'); - late final __PyTraceMalloc_GetMemory = - __PyTraceMalloc_GetMemoryPtr.asFunction(); - - ffi.Pointer _PyTraceMalloc_GetTracedMemory() { - return __PyTraceMalloc_GetTracedMemory(); - } - - late final __PyTraceMalloc_GetTracedMemoryPtr = - _lookup Function()>>( - '_PyTraceMalloc_GetTracedMemory'); - late final __PyTraceMalloc_GetTracedMemory = - __PyTraceMalloc_GetTracedMemoryPtr - .asFunction Function()>(); - - void _PyTraceMalloc_ResetPeak() { - return __PyTraceMalloc_ResetPeak(); - } - - late final __PyTraceMalloc_ResetPeakPtr = - _lookup>( - '_PyTraceMalloc_ResetPeak'); - late final __PyTraceMalloc_ResetPeak = - __PyTraceMalloc_ResetPeakPtr.asFunction(); -} - -abstract class PyMemAllocatorDomain { - static const int PYMEM_DOMAIN_RAW = 0; - static const int PYMEM_DOMAIN_MEM = 1; - static const int PYMEM_DOMAIN_OBJ = 2; -} - -abstract class PyMemAllocatorName { - static const int PYMEM_ALLOCATOR_NOT_SET = 0; - static const int PYMEM_ALLOCATOR_DEFAULT = 1; - static const int PYMEM_ALLOCATOR_DEBUG = 2; - static const int PYMEM_ALLOCATOR_MALLOC = 3; - static const int PYMEM_ALLOCATOR_MALLOC_DEBUG = 4; - static const int PYMEM_ALLOCATOR_PYMALLOC = 5; - static const int PYMEM_ALLOCATOR_PYMALLOC_DEBUG = 6; -} - -final class PyMemAllocatorEx extends ffi.Struct { - external ffi.Pointer ctx; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer ctx, ffi.Size size)>> malloc; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer ctx, ffi.Size nelem, ffi.Size elsize)>> - calloc; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer ctx, - ffi.Pointer ptr, ffi.Size new_size)>> realloc; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer ctx, ffi.Pointer ptr)>> free; -} - -final class PyModuleDef extends ffi.Struct { - external PyModuleDef_Base m_base; - - external ffi.Pointer m_name; - - external ffi.Pointer m_doc; - - @Py_ssize_t() - external int m_size; - - external ffi.Pointer m_methods; - - external ffi.Pointer m_slots; - - external traverseproc m_traverse; - - external inquiry m_clear; - - external freefunc m_free; -} - -final class PyModuleDef_Base extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer Function()>> - m_init; - - @Py_ssize_t() - external int m_index; - - external ffi.Pointer m_copy; -} - -typedef PyObject = _object; - -final class _object extends ffi.Struct { - external UnnamedUnion1 unnamed; - - external ffi.Pointer ob_type; -} - -final class UnnamedUnion1 extends ffi.Union { - @Py_ssize_t() - external int ob_refcnt; - - @ffi.Array.multi([2]) - external ffi.Array ob_refcnt_split; -} - -typedef Py_ssize_t = ssize_t; -typedef ssize_t = __darwin_ssize_t; -typedef __darwin_ssize_t = ffi.Long; -typedef PyTypeObject = _typeobject; - -final class _typeobject extends ffi.Struct { - external PyVarObject ob_base; - - external ffi.Pointer tp_name; - - @Py_ssize_t() - external int tp_basicsize; - - @Py_ssize_t() - external int tp_itemsize; - - external destructor tp_dealloc; - - @Py_ssize_t() - external int tp_vectorcall_offset; - - external getattrfunc tp_getattr; - - external setattrfunc tp_setattr; - - external ffi.Pointer tp_as_async; - - external reprfunc tp_repr; - - external ffi.Pointer tp_as_number; - - external ffi.Pointer tp_as_sequence; - - external ffi.Pointer tp_as_mapping; - - external hashfunc tp_hash; - - external ternaryfunc tp_call; - - external reprfunc tp_str; - - external getattrofunc tp_getattro; - - external setattrofunc tp_setattro; - - external ffi.Pointer tp_as_buffer; - - @ffi.UnsignedLong() - external int tp_flags; - - external ffi.Pointer tp_doc; - - external traverseproc tp_traverse; - - external inquiry tp_clear; - - external richcmpfunc tp_richcompare; - - @Py_ssize_t() - external int tp_weaklistoffset; - - external getiterfunc tp_iter; - - external iternextfunc tp_iternext; - - external ffi.Pointer tp_methods; - - external ffi.Pointer tp_members; - - external ffi.Pointer tp_getset; - - external ffi.Pointer tp_base; - - external ffi.Pointer tp_dict; - - external descrgetfunc tp_descr_get; - - external descrsetfunc tp_descr_set; - - @Py_ssize_t() - external int tp_dictoffset; - - external initproc tp_init; - - external allocfunc tp_alloc; - - external newfunc tp_new; - - external freefunc tp_free; - - external inquiry tp_is_gc; - - external ffi.Pointer tp_bases; - - external ffi.Pointer tp_mro; - - external ffi.Pointer tp_cache; - - external ffi.Pointer tp_subclasses; - - external ffi.Pointer tp_weaklist; - - external destructor tp_del; - - @ffi.UnsignedInt() - external int tp_version_tag; - - external destructor tp_finalize; - - external vectorcallfunc tp_vectorcall; - - @ffi.UnsignedChar() - external int tp_watched; -} - -final class PyVarObject extends ffi.Struct { - external PyObject1 ob_base; - - @Py_ssize_t() - external int ob_size; -} - -typedef PyObject1 = _object; -typedef destructor = ffi - .Pointer)>>; -typedef getattrfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>; -typedef setattrfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>; - -final class PyAsyncMethods extends ffi.Struct { - external unaryfunc am_await; - - external unaryfunc am_aiter; - - external unaryfunc am_anext; - - external sendfunc am_send; -} - -typedef unaryfunc = ffi.Pointer< - ffi - .NativeFunction Function(ffi.Pointer)>>; -typedef sendfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer iter, - ffi.Pointer value, - ffi.Pointer> result)>>; - -abstract class PySendResult { - static const int PYGEN_RETURN = 0; - static const int PYGEN_ERROR = -1; - static const int PYGEN_NEXT = 1; -} - -typedef reprfunc = ffi.Pointer< - ffi - .NativeFunction Function(ffi.Pointer)>>; - -final class PyNumberMethods extends ffi.Struct { - external binaryfunc nb_add; - - external binaryfunc nb_subtract; - - external binaryfunc nb_multiply; - - external binaryfunc nb_remainder; - - external binaryfunc nb_divmod; - - external ternaryfunc nb_power; - - external unaryfunc nb_negative; - - external unaryfunc nb_positive; - - external unaryfunc nb_absolute; - - external inquiry nb_bool; - - external unaryfunc nb_invert; - - external binaryfunc nb_lshift; - - external binaryfunc nb_rshift; - - external binaryfunc nb_and; - - external binaryfunc nb_xor; - - external binaryfunc nb_or; - - external unaryfunc nb_int; - - external ffi.Pointer nb_reserved; - - external unaryfunc nb_float; - - external binaryfunc nb_inplace_add; - - external binaryfunc nb_inplace_subtract; - - external binaryfunc nb_inplace_multiply; - - external binaryfunc nb_inplace_remainder; - - external ternaryfunc nb_inplace_power; - - external binaryfunc nb_inplace_lshift; - - external binaryfunc nb_inplace_rshift; - - external binaryfunc nb_inplace_and; - - external binaryfunc nb_inplace_xor; - - external binaryfunc nb_inplace_or; - - external binaryfunc nb_floor_divide; - - external binaryfunc nb_true_divide; - - external binaryfunc nb_inplace_floor_divide; - - external binaryfunc nb_inplace_true_divide; - - external unaryfunc nb_index; - - external binaryfunc nb_matrix_multiply; - - external binaryfunc nb_inplace_matrix_multiply; -} - -typedef binaryfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>; -typedef ternaryfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>; -typedef inquiry - = ffi.Pointer)>>; - -final class PySequenceMethods extends ffi.Struct { - external lenfunc sq_length; - - external binaryfunc sq_concat; - - external ssizeargfunc sq_repeat; - - external ssizeargfunc sq_item; - - external ffi.Pointer was_sq_slice; - - external ssizeobjargproc sq_ass_item; - - external ffi.Pointer was_sq_ass_slice; - - external objobjproc sq_contains; - - external binaryfunc sq_inplace_concat; - - external ssizeargfunc sq_inplace_repeat; -} - -typedef lenfunc = ffi - .Pointer)>>; -typedef ssizeargfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, Py_ssize_t)>>; -typedef ssizeobjargproc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, Py_ssize_t, ffi.Pointer)>>; -typedef objobjproc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; - -final class PyMappingMethods extends ffi.Struct { - external lenfunc mp_length; - - external binaryfunc mp_subscript; - - external objobjargproc mp_ass_subscript; -} - -typedef objobjargproc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>; -typedef hashfunc = ffi - .Pointer)>>; -typedef Py_hash_t = Py_ssize_t; -typedef getattrofunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>; -typedef setattrofunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>; - -final class PyBufferProcs extends ffi.Struct { - external getbufferproc bf_getbuffer; - - external releasebufferproc bf_releasebuffer; -} - -typedef getbufferproc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>>; - -final class Py_buffer extends ffi.Struct { - external ffi.Pointer buf; - - external ffi.Pointer obj; - - @Py_ssize_t() - external int len; - - @Py_ssize_t() - external int itemsize; - - @ffi.Int() - external int readonly; - - @ffi.Int() - external int ndim; - - external ffi.Pointer format; - - external ffi.Pointer shape; - - external ffi.Pointer strides; - - external ffi.Pointer suboffsets; - - external ffi.Pointer internal; -} - -typedef releasebufferproc = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef traverseproc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, visitproc, ffi.Pointer)>>; -typedef visitproc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; -typedef richcmpfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>>; -typedef getiterfunc = ffi.Pointer< - ffi - .NativeFunction Function(ffi.Pointer)>>; -typedef iternextfunc = ffi.Pointer< - ffi - .NativeFunction Function(ffi.Pointer)>>; - -final class PyMethodDef extends ffi.Struct { - external ffi.Pointer ml_name; - - external PyCFunction ml_meth; - - @ffi.Int() - external int ml_flags; - - external ffi.Pointer ml_doc; -} - -typedef PyCFunction = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>; - -final class PyMemberDef extends ffi.Struct { - external ffi.Pointer name; - - @ffi.Int() - external int type; - - @Py_ssize_t() - external int offset; - - @ffi.Int() - external int flags; - - external ffi.Pointer doc; -} - -final class PyGetSetDef extends ffi.Struct { - external ffi.Pointer name; - - external getter get1; - - external setter set1; - - external ffi.Pointer doc; - - external ffi.Pointer closure; -} - -typedef getter = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>; -typedef setter = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>; -typedef PyTypeObject1 = _typeobject; -typedef descrgetfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>; -typedef descrsetfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>; -typedef initproc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>; -typedef allocfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, Py_ssize_t)>>; -typedef newfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>; -typedef freefunc - = ffi.Pointer)>>; -typedef vectorcallfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer callable, - ffi.Pointer> args, - ffi.Size nargsf, - ffi.Pointer kwnames)>>; - -final class PyModuleDef_Slot extends ffi.Struct { - @ffi.Int() - external int slot; - - external ffi.Pointer value; -} - -final class _longobject extends ffi.Struct { - external PyObject ob_base; - - external _PyLongValue long_value; -} - -final class _PyLongValue extends ffi.Struct { - @ffi.UintPtr() - external int lv_tag; - - @ffi.Array.multi([1]) - external ffi.Array ob_digit; -} - -typedef digit = ffi.Uint32; - -final class PyCodeObject extends ffi.Struct { - external PyVarObject ob_base; - - external ffi.Pointer co_consts; - - external ffi.Pointer co_names; - - external ffi.Pointer co_exceptiontable; - - @ffi.Int() - external int co_flags; - - @ffi.Int() - external int co_argcount; - - @ffi.Int() - external int co_posonlyargcount; - - @ffi.Int() - external int co_kwonlyargcount; - - @ffi.Int() - external int co_stacksize; - - @ffi.Int() - external int co_firstlineno; - - @ffi.Int() - external int co_nlocalsplus; - - @ffi.Int() - external int co_framesize; - - @ffi.Int() - external int co_nlocals; - - @ffi.Int() - external int co_ncellvars; - - @ffi.Int() - external int co_nfreevars; - - @ffi.Uint32() - external int co_version; - - external ffi.Pointer co_localsplusnames; - - external ffi.Pointer co_localspluskinds; - - external ffi.Pointer co_filename; - - external ffi.Pointer co_name; - - external ffi.Pointer co_qualname; - - external ffi.Pointer co_linetable; - - external ffi.Pointer co_weakreflist; - - external ffi.Pointer<_PyCoCached> _co_cached; - - @ffi.Uint64() - external int _co_instrumentation_version; - - external ffi.Pointer<_PyCoMonitoringData> _co_monitoring; - - @ffi.Int() - external int _co_firsttraceable; - - external ffi.Pointer co_extra; - - @ffi.Array.multi([1]) - external ffi.Array co_code_adaptive; -} - -final class _PyCoCached extends ffi.Struct { - external ffi.Pointer _co_code; - - external ffi.Pointer _co_varnames; - - external ffi.Pointer _co_cellvars; - - external ffi.Pointer _co_freevars; -} - -final class _PyCoMonitoringData extends ffi.Struct { - external _Py_LocalMonitors local_monitors; - - external _Py_LocalMonitors active_monitors; - - external ffi.Pointer tools; - - external ffi.Pointer<_PyCoLineInstrumentationData> lines; - - external ffi.Pointer line_tools; - - external ffi.Pointer per_instruction_opcodes; - - external ffi.Pointer per_instruction_tools; -} - -final class _Py_LocalMonitors extends ffi.Struct { - @ffi.Array.multi([15]) - external ffi.Array tools; -} - -final class _PyCoLineInstrumentationData extends ffi.Struct { - @ffi.Uint8() - external int original_opcode; - - @ffi.Int8() - external int line_delta; -} - -final class _frame extends ffi.Opaque {} - -final class _ts extends ffi.Opaque {} - -final class _is extends ffi.Opaque {} - -final class PyType_Slot extends ffi.Struct { - @ffi.Int() - external int slot; - - external ffi.Pointer pfunc; -} - -final class PyType_Spec extends ffi.Struct { - external ffi.Pointer name; - - @ffi.Int() - external int basicsize; - - @ffi.Int() - external int itemsize; - - @ffi.UnsignedInt() - external int flags; - - external ffi.Pointer slots; -} - -final class _Py_Identifier extends ffi.Struct { - external ffi.Pointer string; - - @Py_ssize_t() - external int index; -} - -final class _specialization_cache extends ffi.Struct { - external ffi.Pointer getitem; - - @ffi.Uint32() - external int getitem_version; -} - -final class _heaptypeobject extends ffi.Struct { - external PyTypeObject ht_type; - - external PyAsyncMethods as_async; - - external PyNumberMethods as_number; - - external PyMappingMethods as_mapping; - - external PySequenceMethods as_sequence; - - external PyBufferProcs as_buffer; - - external ffi.Pointer ht_name; - - external ffi.Pointer ht_slots; - - external ffi.Pointer ht_qualname; - - external ffi.Pointer<_dictkeysobject> ht_cached_keys; - - external ffi.Pointer ht_module; - - external ffi.Pointer _ht_tpname; - - external _specialization_cache _spec_cache; -} - -final class _dictkeysobject extends ffi.Opaque {} - -typedef FILE = __sFILE; - -final class __sFILE extends ffi.Struct { - external ffi.Pointer _p; - - @ffi.Int() - external int _r; - - @ffi.Int() - external int _w; - - @ffi.Short() - external int _flags; - - @ffi.Short() - external int _file; - - external __sbuf _bf; - - @ffi.Int() - external int _lbfsize; - - external ffi.Pointer _cookie; - - external ffi - .Pointer)>> - _close; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>> _read; - - external ffi.Pointer< - ffi.NativeFunction< - fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>> _seek; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>> _write; - - external __sbuf _ub; - - external ffi.Pointer<__sFILEX> _extra; - - @ffi.Int() - external int _ur; - - @ffi.Array.multi([3]) - external ffi.Array _ubuf; - - @ffi.Array.multi([1]) - external ffi.Array _nbuf; - - external __sbuf _lb; - - @ffi.Int() - external int _blksize; - - @fpos_t() - external int _offset; -} - -final class __sbuf extends ffi.Struct { - external ffi.Pointer _base; - - @ffi.Int() - external int _size; -} - -typedef fpos_t = __darwin_off_t; -typedef __darwin_off_t = __int64_t; -typedef __int64_t = ffi.LongLong; - -final class __sFILEX extends ffi.Opaque {} - -typedef PyThreadState = _ts; -typedef PyType_WatchCallback = ffi - .Pointer)>>; -typedef gcvisitobjects_t = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; - -final class PyObjectArenaAllocator extends ffi.Struct { - external ffi.Pointer ctx; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer ctx, ffi.Size size)>> alloc; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer ctx, - ffi.Pointer ptr, ffi.Size size)>> free; -} - -final class _Py_HashSecret_t extends ffi.Union { - @ffi.Array.multi([24]) - external ffi.Array uc; - - external UnnamedStruct2 fnv; - - external UnnamedStruct3 siphash; - - external UnnamedStruct4 djbx33a; - - external UnnamedStruct5 expat; -} - -final class UnnamedStruct2 extends ffi.Struct { - @Py_hash_t() - external int prefix; - - @Py_hash_t() - external int suffix; -} - -final class UnnamedStruct3 extends ffi.Struct { - @ffi.Uint64() - external int k0; - - @ffi.Uint64() - external int k1; -} - -final class UnnamedStruct4 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array padding; - - @Py_hash_t() - external int suffix; -} - -final class UnnamedStruct5 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array padding; - - @Py_hash_t() - external int hashsalt; -} - -final class PyHash_FuncDef extends ffi.Struct { - external ffi.Pointer< - ffi.NativeFunction< - Py_hash_t Function(ffi.Pointer, Py_ssize_t)>> hash; - - external ffi.Pointer name; - - @ffi.Int() - external int hash_bits; - - @ffi.Int() - external int seed_bits; -} - -final class PyByteArrayObject extends ffi.Struct { - external PyVarObject ob_base; - - @Py_ssize_t() - external int ob_alloc; - - external ffi.Pointer ob_bytes; - - external ffi.Pointer ob_start; - - @Py_ssize_t() - external int ob_exports; -} - -typedef va_list = __builtin_va_list; -typedef __builtin_va_list = ffi.Pointer; - -final class PyBytesObject extends ffi.Struct { - external PyVarObject ob_base; - - @Py_hash_t() - external int ob_shash; - - @ffi.Array.multi([1]) - external ffi.Array ob_sval; -} - -final class _PyBytesWriter extends ffi.Struct { - external ffi.Pointer buffer; - - @Py_ssize_t() - external int allocated; - - @Py_ssize_t() - external int min_size; - - @ffi.Int() - external int use_bytearray; - - @ffi.Int() - external int overallocate; - - @ffi.Int() - external int use_small_buffer; - - @ffi.Array.multi([512]) - external ffi.Array small_buffer; -} - -typedef Py_UCS4 = ffi.Uint32; - -final class PyASCIIObject extends ffi.Opaque {} - -final class PyCompactUnicodeObject extends ffi.Opaque {} - -final class PyUnicodeObject extends ffi.Opaque {} - -abstract class PyUnicode_Kind { - static const int PyUnicode_1BYTE_KIND = 1; - static const int PyUnicode_2BYTE_KIND = 2; - static const int PyUnicode_4BYTE_KIND = 4; -} - -final class _PyUnicodeWriter extends ffi.Struct { - external ffi.Pointer buffer; - - external ffi.Pointer data; - - @ffi.Int() - external int kind; - - @Py_UCS4() - external int maxchar; - - @Py_ssize_t() - external int size; - - @Py_ssize_t() - external int pos; - - @Py_ssize_t() - external int min_length; - - @Py_UCS4() - external int min_char; - - @ffi.UnsignedChar() - external int overallocate; - - @ffi.UnsignedChar() - external int readonly; -} - -final class PyStatus extends ffi.Struct { - @ffi.Int32() - external int _type; - - external ffi.Pointer func; - - external ffi.Pointer err_msg; - - @ffi.Int() - external int exitcode; -} - -final class PyWideStringList extends ffi.Struct { - @Py_ssize_t() - external int length; - - external ffi.Pointer> items; -} - -final class PyPreConfig extends ffi.Struct { - @ffi.Int() - external int _config_init; - - @ffi.Int() - external int parse_argv; - - @ffi.Int() - external int isolated; - - @ffi.Int() - external int use_environment; - - @ffi.Int() - external int configure_locale; - - @ffi.Int() - external int coerce_c_locale; - - @ffi.Int() - external int coerce_c_locale_warn; - - @ffi.Int() - external int utf8_mode; - - @ffi.Int() - external int dev_mode; - - @ffi.Int() - external int allocator; -} - -final class PyConfig extends ffi.Struct { - @ffi.Int() - external int _config_init; - - @ffi.Int() - external int isolated; - - @ffi.Int() - external int use_environment; - - @ffi.Int() - external int dev_mode; - - @ffi.Int() - external int install_signal_handlers; - - @ffi.Int() - external int use_hash_seed; - - @ffi.UnsignedLong() - external int hash_seed; - - @ffi.Int() - external int faulthandler; - - @ffi.Int() - external int tracemalloc; - - @ffi.Int() - external int perf_profiling; - - @ffi.Int() - external int import_time; - - @ffi.Int() - external int code_debug_ranges; - - @ffi.Int() - external int show_ref_count; - - @ffi.Int() - external int dump_refs; - - external ffi.Pointer dump_refs_file; - - @ffi.Int() - external int malloc_stats; - - external ffi.Pointer filesystem_encoding; - - external ffi.Pointer filesystem_errors; - - external ffi.Pointer pycache_prefix; - - @ffi.Int() - external int parse_argv; - - external PyWideStringList orig_argv; - - external PyWideStringList argv; - - external PyWideStringList xoptions; - - external PyWideStringList warnoptions; - - @ffi.Int() - external int site_import; - - @ffi.Int() - external int bytes_warning; - - @ffi.Int() - external int warn_default_encoding; - - @ffi.Int() - external int inspect; - - @ffi.Int() - external int interactive; - - @ffi.Int() - external int optimization_level; - - @ffi.Int() - external int parser_debug; - - @ffi.Int() - external int write_bytecode; - - @ffi.Int() - external int verbose; - - @ffi.Int() - external int quiet; - - @ffi.Int() - external int user_site_directory; - - @ffi.Int() - external int configure_c_stdio; - - @ffi.Int() - external int buffered_stdio; - - external ffi.Pointer stdio_encoding; - - external ffi.Pointer stdio_errors; - - external ffi.Pointer check_hash_pycs_mode; - - @ffi.Int() - external int use_frozen_modules; - - @ffi.Int() - external int safe_path; - - @ffi.Int() - external int int_max_str_digits; - - @ffi.Int() - external int pathconfig_warnings; - - external ffi.Pointer program_name; - - external ffi.Pointer pythonpath_env; - - external ffi.Pointer home; - - external ffi.Pointer platlibdir; - - @ffi.Int() - external int module_search_paths_set; - - external PyWideStringList module_search_paths; - - external ffi.Pointer stdlib_dir; - - external ffi.Pointer executable; - - external ffi.Pointer base_executable; - - external ffi.Pointer prefix; - - external ffi.Pointer base_prefix; - - external ffi.Pointer exec_prefix; - - external ffi.Pointer base_exec_prefix; - - @ffi.Int() - external int skip_source_first_line; - - external ffi.Pointer run_command; - - external ffi.Pointer run_module; - - external ffi.Pointer run_filename; - - @ffi.Int() - external int _install_importlib; - - @ffi.Int() - external int _init_main; - - @ffi.Int() - external int _is_python_build; -} - -typedef PyInterpreterState = _is; -typedef PyFrameObject = _frame; - -abstract class PyGILState_STATE { - static const int PyGILState_LOCKED = 0; - static const int PyGILState_UNLOCKED = 1; -} - -final class _PyCFrame extends ffi.Struct { - external ffi.Pointer<_PyInterpreterFrame> current_frame; - - external ffi.Pointer<_PyCFrame> previous; -} - -final class _PyInterpreterFrame extends ffi.Opaque {} - -final class _err_stackitem extends ffi.Struct { - external ffi.Pointer exc_value; - - external ffi.Pointer<_err_stackitem> previous_item; -} - -final class _stack_chunk extends ffi.Struct { - external ffi.Pointer<_stack_chunk> previous; - - @ffi.Size() - external int size; - - @ffi.Size() - external int top; - - @ffi.Array.multi([1]) - external ffi.Array> data; -} - -final class _py_trashcan extends ffi.Struct { - @ffi.Int() - external int delete_nesting; - - external ffi.Pointer delete_later; -} - -typedef _PyFrameEvalFunction = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer<_PyInterpreterFrame>, ffi.Int)>>; - -final class _xid extends ffi.Struct { - external ffi.Pointer data; - - external ffi.Pointer obj; - - @ffi.Int64() - external int interp; - - external xid_newobjectfunc new_object; - - external xid_freefunc free; -} - -typedef xid_newobjectfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer<_PyCrossInterpreterData>)>>; -typedef _PyCrossInterpreterData = _xid; -typedef xid_freefunc - = ffi.Pointer)>>; -typedef crossinterpdatafunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_PyCrossInterpreterData>)>>; - -final class PyBaseExceptionObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dict; - - external ffi.Pointer args; - - external ffi.Pointer notes; - - external ffi.Pointer traceback; - - external ffi.Pointer context; - - external ffi.Pointer cause; - - @ffi.Char() - external int suppress_context; -} - -final class PyBaseExceptionGroupObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dict; - - external ffi.Pointer args; - - external ffi.Pointer notes; - - external ffi.Pointer traceback; - - external ffi.Pointer context; - - external ffi.Pointer cause; - - @ffi.Char() - external int suppress_context; - - external ffi.Pointer msg; - - external ffi.Pointer excs; -} - -final class PySyntaxErrorObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dict; - - external ffi.Pointer args; - - external ffi.Pointer notes; - - external ffi.Pointer traceback; - - external ffi.Pointer context; - - external ffi.Pointer cause; - - @ffi.Char() - external int suppress_context; - - external ffi.Pointer msg; - - external ffi.Pointer filename; - - external ffi.Pointer lineno; - - external ffi.Pointer offset; - - external ffi.Pointer end_lineno; - - external ffi.Pointer end_offset; - - external ffi.Pointer text; - - external ffi.Pointer print_file_and_line; -} - -final class PyImportErrorObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dict; - - external ffi.Pointer args; - - external ffi.Pointer notes; - - external ffi.Pointer traceback; - - external ffi.Pointer context; - - external ffi.Pointer cause; - - @ffi.Char() - external int suppress_context; - - external ffi.Pointer msg; - - external ffi.Pointer name; - - external ffi.Pointer path; - - external ffi.Pointer name_from; -} - -final class PyUnicodeErrorObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dict; - - external ffi.Pointer args; - - external ffi.Pointer notes; - - external ffi.Pointer traceback; - - external ffi.Pointer context; - - external ffi.Pointer cause; - - @ffi.Char() - external int suppress_context; - - external ffi.Pointer encoding; - - external ffi.Pointer object; - - @Py_ssize_t() - external int start; - - @Py_ssize_t() - external int end; - - external ffi.Pointer reason; -} - -final class PySystemExitObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dict; - - external ffi.Pointer args; - - external ffi.Pointer notes; - - external ffi.Pointer traceback; - - external ffi.Pointer context; - - external ffi.Pointer cause; - - @ffi.Char() - external int suppress_context; - - external ffi.Pointer code; -} - -final class PyOSErrorObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dict; - - external ffi.Pointer args; - - external ffi.Pointer notes; - - external ffi.Pointer traceback; - - external ffi.Pointer context; - - external ffi.Pointer cause; - - @ffi.Char() - external int suppress_context; - - external ffi.Pointer myerrno; - - external ffi.Pointer strerror; - - external ffi.Pointer filename; - - external ffi.Pointer filename2; - - @Py_ssize_t() - external int written; -} - -final class PyStopIterationObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dict; - - external ffi.Pointer args; - - external ffi.Pointer notes; - - external ffi.Pointer traceback; - - external ffi.Pointer context; - - external ffi.Pointer cause; - - @ffi.Char() - external int suppress_context; - - external ffi.Pointer value; -} - -final class PyNameErrorObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dict; - - external ffi.Pointer args; - - external ffi.Pointer notes; - - external ffi.Pointer traceback; - - external ffi.Pointer context; - - external ffi.Pointer cause; - - @ffi.Char() - external int suppress_context; - - external ffi.Pointer name; -} - -final class PyAttributeErrorObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dict; - - external ffi.Pointer args; - - external ffi.Pointer notes; - - external ffi.Pointer traceback; - - external ffi.Pointer context; - - external ffi.Pointer cause; - - @ffi.Char() - external int suppress_context; - - external ffi.Pointer obj; - - external ffi.Pointer name; -} - -typedef _PyErr_StackItem = _err_stackitem; -typedef PyLongObject = _longobject; - -final class PyFloatObject extends ffi.Struct { - external PyObject ob_base; - - @ffi.Double() - external double ob_fval; -} - -final class Py_complex extends ffi.Struct { - @ffi.Double() - external double real; - - @ffi.Double() - external double imag; -} - -final class PyComplexObject extends ffi.Struct { - external PyObject ob_base; - - external Py_complex cval; -} - -final class _PyManagedBufferObject extends ffi.Struct { - external PyObject ob_base; - - @ffi.Int() - external int flags; - - @Py_ssize_t() - external int exports; - - external Py_buffer master; -} - -final class PyMemoryViewObject extends ffi.Struct { - external PyVarObject ob_base; - - external ffi.Pointer<_PyManagedBufferObject> mbuf; - - @Py_hash_t() - external int hash; - - @ffi.Int() - external int flags; - - @Py_ssize_t() - external int exports; - - external Py_buffer view; - - external ffi.Pointer weakreflist; - - @ffi.Array.multi([1]) - external ffi.Array ob_array; -} - -final class PyTupleObject extends ffi.Struct { - external PyVarObject ob_base; - - @ffi.Array.multi([1]) - external ffi.Array> ob_item; -} - -final class PyListObject extends ffi.Struct { - external PyVarObject ob_base; - - external ffi.Pointer> ob_item; - - @Py_ssize_t() - external int allocated; -} - -final class _dictvalues extends ffi.Opaque {} - -final class PyDictObject extends ffi.Struct { - external PyObject ob_base; - - @Py_ssize_t() - external int ma_used; - - @ffi.Uint64() - external int ma_version_tag; - - external ffi.Pointer ma_keys; - - external ffi.Pointer ma_values; -} - -typedef PyDictKeysObject = _dictkeysobject; -typedef PyDictValues = _dictvalues; - -final class _PyDictViewObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer dv_dict; -} - -abstract class PyDict_WatchEvent { - static const int PyDict_EVENT_ADDED = 0; - static const int PyDict_EVENT_MODIFIED = 1; - static const int PyDict_EVENT_DELETED = 2; - static const int PyDict_EVENT_CLONED = 3; - static const int PyDict_EVENT_CLEARED = 4; - static const int PyDict_EVENT_DEALLOCATED = 5; -} - -typedef PyDict_WatchCallback = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Int32 event, ffi.Pointer dict, - ffi.Pointer key, ffi.Pointer new_value)>>; - -final class _odictobject extends ffi.Opaque {} - -final class setentry extends ffi.Struct { - external ffi.Pointer key; - - @Py_hash_t() - external int hash; -} - -final class PySetObject extends ffi.Struct { - external PyObject ob_base; - - @Py_ssize_t() - external int fill; - - @Py_ssize_t() - external int used; - - @Py_ssize_t() - external int mask; - - external ffi.Pointer table; - - @Py_hash_t() - external int hash; - - @Py_ssize_t() - external int finger; - - @ffi.Array.multi([8]) - external ffi.Array smalltable; - - external ffi.Pointer weakreflist; -} - -final class PyCFunctionObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer m_ml; - - external ffi.Pointer m_self; - - external ffi.Pointer m_module; - - external ffi.Pointer m_weakreflist; - - external vectorcallfunc vectorcall; -} - -final class PyCMethodObject extends ffi.Struct { - external PyCFunctionObject func; - - external ffi.Pointer mm_class; -} - -final class PyFrameConstructor extends ffi.Struct { - external ffi.Pointer fc_globals; - - external ffi.Pointer fc_builtins; - - external ffi.Pointer fc_name; - - external ffi.Pointer fc_qualname; - - external ffi.Pointer fc_code; - - external ffi.Pointer fc_defaults; - - external ffi.Pointer fc_kwdefaults; - - external ffi.Pointer fc_closure; -} - -final class PyFunctionObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer func_globals; - - external ffi.Pointer func_builtins; - - external ffi.Pointer func_name; - - external ffi.Pointer func_qualname; - - external ffi.Pointer func_code; - - external ffi.Pointer func_defaults; - - external ffi.Pointer func_kwdefaults; - - external ffi.Pointer func_closure; - - external ffi.Pointer func_doc; - - external ffi.Pointer func_dict; - - external ffi.Pointer func_weakreflist; - - external ffi.Pointer func_module; - - external ffi.Pointer func_annotations; - - external ffi.Pointer func_typeparams; - - external vectorcallfunc vectorcall; - - @ffi.Uint32() - external int func_version; -} - -abstract class PyFunction_WatchEvent { - static const int PyFunction_EVENT_CREATE = 0; - static const int PyFunction_EVENT_DESTROY = 1; - static const int PyFunction_EVENT_MODIFY_CODE = 2; - static const int PyFunction_EVENT_MODIFY_DEFAULTS = 3; - static const int PyFunction_EVENT_MODIFY_KWDEFAULTS = 4; -} - -typedef PyFunction_WatchCallback = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Int32 event, ffi.Pointer func, - ffi.Pointer new_value)>>; - -final class PyMethodObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer im_func; - - external ffi.Pointer im_self; - - external ffi.Pointer im_weakreflist; - - external vectorcallfunc vectorcall; -} - -final class PyInstanceMethodObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer func; -} - -typedef Py_OpenCodeHookFunction = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>; -typedef PyCapsule_Destructor - = ffi.Pointer)>>; - -final class _Py_GlobalMonitors extends ffi.Struct { - @ffi.Array.multi([15]) - external ffi.Array tools; -} - -final class _Py_CODEUNIT extends ffi.Union { - @ffi.Uint16() - external int cache; - - external UnnamedStruct7 op; -} - -final class UnnamedStruct7 extends ffi.Struct { - @ffi.Uint8() - external int code; - - @ffi.Uint8() - external int arg; -} - -abstract class PyCodeEvent { - static const int PY_CODE_EVENT_CREATE = 0; - static const int PY_CODE_EVENT_DESTROY = 1; -} - -typedef PyCode_WatchCallback = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Int32 event, ffi.Pointer co)>>; - -final class _opaque extends ffi.Struct { - @ffi.Int() - external int computed_line; - - external ffi.Pointer lo_next; - - external ffi.Pointer limit; -} - -final class _line_offsets extends ffi.Struct { - @ffi.Int() - external int ar_start; - - @ffi.Int() - external int ar_end; - - @ffi.Int() - external int ar_line; - - external _opaque opaque; -} - -typedef PyCodeAddressRange = _line_offsets; - -abstract class _PyCodeLocationInfoKind { - static const int PY_CODE_LOCATION_INFO_SHORT0 = 0; - static const int PY_CODE_LOCATION_INFO_ONE_LINE0 = 10; - static const int PY_CODE_LOCATION_INFO_ONE_LINE1 = 11; - static const int PY_CODE_LOCATION_INFO_ONE_LINE2 = 12; - static const int PY_CODE_LOCATION_INFO_NO_COLUMNS = 13; - static const int PY_CODE_LOCATION_INFO_LONG = 14; - static const int PY_CODE_LOCATION_INFO_NONE = 15; -} - -final class _traceback extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer tb_next; - - external ffi.Pointer tb_frame; - - @ffi.Int() - external int tb_lasti; - - @ffi.Int() - external int tb_lineno; -} - -typedef PyTracebackObject = _traceback; - -final class PySliceObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer start; - - external ffi.Pointer stop; - - external ffi.Pointer step; -} - -final class PyCellObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer ob_ref; -} - -final class PyGenObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer gi_weakreflist; - - external ffi.Pointer gi_name; - - external ffi.Pointer gi_qualname; - - external _PyErr_StackItem gi_exc_state; - - external ffi.Pointer gi_origin_or_finalizer; - - @ffi.Char() - external int gi_hooks_inited; - - @ffi.Char() - external int gi_closed; - - @ffi.Char() - external int gi_running_async; - - @ffi.Int8() - external int gi_frame_state; - - @ffi.Array.multi([1]) - external ffi.Array> gi_iframe; -} - -final class PyCoroObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer cr_weakreflist; - - external ffi.Pointer cr_name; - - external ffi.Pointer cr_qualname; - - external _PyErr_StackItem cr_exc_state; - - external ffi.Pointer cr_origin_or_finalizer; - - @ffi.Char() - external int cr_hooks_inited; - - @ffi.Char() - external int cr_closed; - - @ffi.Char() - external int cr_running_async; - - @ffi.Int8() - external int cr_frame_state; - - @ffi.Array.multi([1]) - external ffi.Array> cr_iframe; -} - -final class PyAsyncGenObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer ag_weakreflist; - - external ffi.Pointer ag_name; - - external ffi.Pointer ag_qualname; - - external _PyErr_StackItem ag_exc_state; - - external ffi.Pointer ag_origin_or_finalizer; - - @ffi.Char() - external int ag_hooks_inited; - - @ffi.Char() - external int ag_closed; - - @ffi.Char() - external int ag_running_async; - - @ffi.Int8() - external int ag_frame_state; - - @ffi.Array.multi([1]) - external ffi.Array> ag_iframe; -} - -final class wrapperbase extends ffi.Struct { - external ffi.Pointer name; - - @ffi.Int() - external int offset; - - external ffi.Pointer function; - - external wrapperfunc wrapper; - - external ffi.Pointer doc; - - @ffi.Int() - external int flags; - - external ffi.Pointer name_strobj; -} - -typedef wrapperfunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer self, - ffi.Pointer args, ffi.Pointer wrapped)>>; - -final class PyDescrObject extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer d_type; - - external ffi.Pointer d_name; - - external ffi.Pointer d_qualname; -} - -final class PyMethodDescrObject extends ffi.Struct { - external PyDescrObject d_common; - - external ffi.Pointer d_method; - - external vectorcallfunc vectorcall; -} - -final class PyMemberDescrObject extends ffi.Struct { - external PyDescrObject d_common; - - external ffi.Pointer d_member; -} - -final class PyGetSetDescrObject extends ffi.Struct { - external PyDescrObject d_common; - - external ffi.Pointer d_getset; -} - -final class PyWrapperDescrObject extends ffi.Struct { - external PyDescrObject d_common; - - external ffi.Pointer d_base; - - external ffi.Pointer d_wrapped; -} - -final class _PyWeakReference extends ffi.Struct { - external PyObject ob_base; - - external ffi.Pointer wr_object; - - external ffi.Pointer wr_callback; - - @Py_hash_t() - external int hash; - - external ffi.Pointer wr_prev; - - external ffi.Pointer wr_next; - - external vectorcallfunc vectorcall; -} - -typedef PyWeakReference = _PyWeakReference; - -final class PyStructSequence_Field extends ffi.Struct { - external ffi.Pointer name; - - external ffi.Pointer doc; -} - -final class PyStructSequence_Desc extends ffi.Struct { - external ffi.Pointer name; - - external ffi.Pointer doc; - - external ffi.Pointer fields; - - @ffi.Int() - external int n_in_sequence; -} - -final class timeval extends ffi.Struct { - @__darwin_time_t() - external int tv_sec; - - @__darwin_suseconds_t() - external int tv_usec; -} - -typedef __darwin_time_t = ffi.Long; -typedef __darwin_suseconds_t = __int32_t; -typedef __int32_t = ffi.Int; - -abstract class _PyTime_round_t { - static const int _PyTime_ROUND_FLOOR = 0; - static const int _PyTime_ROUND_CEILING = 1; - static const int _PyTime_ROUND_HALF_EVEN = 2; - static const int _PyTime_ROUND_UP = 3; - static const int _PyTime_ROUND_TIMEOUT = 3; -} - -typedef time_t = __darwin_time_t; -typedef _PyTime_t = ffi.Int64; - -final class timespec extends ffi.Struct { - @__darwin_time_t() - external int tv_sec; - - @ffi.Long() - external int tv_nsec; -} - -final class _Py_clock_info_t extends ffi.Struct { - external ffi.Pointer implementation; - - @ffi.Int() - external int monotonic; - - @ffi.Int() - external int adjustable; - - @ffi.Double() - external double resolution; -} - -final class tm extends ffi.Struct { - @ffi.Int() - external int tm_sec; - - @ffi.Int() - external int tm_min; - - @ffi.Int() - external int tm_hour; - - @ffi.Int() - external int tm_mday; - - @ffi.Int() - external int tm_mon; - - @ffi.Int() - external int tm_year; - - @ffi.Int() - external int tm_wday; - - @ffi.Int() - external int tm_yday; - - @ffi.Int() - external int tm_isdst; - - @ffi.Long() - external int tm_gmtoff; - - external ffi.Pointer tm_zone; -} - -abstract class PyLockStatus { - static const int PY_LOCK_FAILURE = 0; - static const int PY_LOCK_ACQUIRED = 1; - static const int PY_LOCK_INTR = 2; -} - -typedef PyThread_type_lock = ffi.Pointer; - -final class _Py_tss_t extends ffi.Struct { - @ffi.Int() - external int _is_initialized; - - @pthread_key_t() - external int _key; -} - -typedef pthread_key_t = __darwin_pthread_key_t; -typedef __darwin_pthread_key_t = ffi.UnsignedLong; -typedef Py_tss_t = _Py_tss_t; - -final class _pycontextobject extends ffi.Opaque {} - -final class _pycontextvarobject extends ffi.Opaque {} - -final class _pycontexttokenobject extends ffi.Opaque {} - -final class _PyArg_Parser extends ffi.Struct { - @ffi.Int() - external int initialized; - - external ffi.Pointer format; - - external ffi.Pointer> keywords; - - external ffi.Pointer fname; - - external ffi.Pointer custom_msg; - - @ffi.Int() - external int pos; - - @ffi.Int() - external int min; - - @ffi.Int() - external int max; - - external ffi.Pointer kwtuple; - - external ffi.Pointer<_PyArg_Parser> next; -} - -final class PyCompilerFlags extends ffi.Struct { - @ffi.Int() - external int cf_flags; - - @ffi.Int() - external int cf_feature_version; -} - -final class _PyCompilerSrcLocation extends ffi.Struct { - @ffi.Int() - external int lineno; - - @ffi.Int() - external int end_lineno; - - @ffi.Int() - external int col_offset; - - @ffi.Int() - external int end_col_offset; -} - -final class PyFutureFeatures extends ffi.Struct { - @ffi.Int() - external int ff_features; - - external _PyCompilerSrcLocation ff_location; -} - -typedef PyOS_sighandler_t - = ffi.Pointer>; - -final class PyInterpreterConfig extends ffi.Struct { - @ffi.Int() - external int use_main_obmalloc; - - @ffi.Int() - external int allow_fork; - - @ffi.Int() - external int allow_exec; - - @ffi.Int() - external int allow_threads; - - @ffi.Int() - external int allow_daemon_threads; - - @ffi.Int() - external int check_multi_interp_extensions; - - @ffi.Int() - external int gil; -} - -typedef atexit_datacallbackfunc - = ffi.Pointer)>>; -typedef Py_tracefunc = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int, ffi.Pointer)>>; - -final class PerfMapState extends ffi.Struct { - external ffi.Pointer perf_map; - - external PyThread_type_lock map_lock; -} - -typedef Py_AuditHookFunction = ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>; - -final class _inittab extends ffi.Struct { - external ffi.Pointer name; - - external ffi.Pointer Function()>> - initfunc; -} - -final class _frozen extends ffi.Struct { - external ffi.Pointer name; - - external ffi.Pointer code; - - @ffi.Int() - external int size; - - @ffi.Int() - external int is_package; - - external ffi.Pointer Function()>> - get_code; -} - -const int _PyStatus_TYPE_OK = 0; - -const int _PyStatus_TYPE_ERROR = 1; - -const int _PyStatus_TYPE_EXIT = 2; - -const int PY_RELEASE_LEVEL_ALPHA = 10; - -const int PY_RELEASE_LEVEL_BETA = 11; - -const int PY_RELEASE_LEVEL_GAMMA = 12; - -const int PY_RELEASE_LEVEL_FINAL = 15; - -const int PY_MAJOR_VERSION = 3; - -const int PY_MINOR_VERSION = 12; - -const int PY_MICRO_VERSION = 3; - -const int PY_RELEASE_LEVEL = 15; - -const int PY_RELEASE_SERIAL = 0; - -const String PY_VERSION = '3.12.3'; - -const int PY_VERSION_HEX = 51119088; - -const int ALIGNOF_LONG = 8; - -const int ALIGNOF_MAX_ALIGN_T = 8; - -const int ALIGNOF_SIZE_T = 8; - -const int ANDROID_API_LEVEL = 21; - -const int ENABLE_IPV6 = 1; - -const int HAVE_ACCEPT = 1; - -const int HAVE_ACCEPT4 = 1; - -const int HAVE_ACOSH = 1; - -const int HAVE_ADDRINFO = 1; - -const int HAVE_ALARM = 1; - -const int HAVE_ALLOCA_H = 1; - -const int HAVE_ASINH = 1; - -const int HAVE_ASM_TYPES_H = 1; - -const int HAVE_ATANH = 1; - -const int HAVE_BIND = 1; - -const int HAVE_BROKEN_SEM_GETVALUE = 1; - -const int HAVE_BUILTIN_ATOMIC = 1; - -const int HAVE_CHMOD = 1; - -const int HAVE_CHOWN = 1; - -const int HAVE_CHROOT = 1; - -const int HAVE_CLOCK = 1; - -const int HAVE_CLOCK_GETRES = 1; - -const int HAVE_CLOCK_GETTIME = 1; - -const int HAVE_CLOCK_NANOSLEEP = 1; - -const int HAVE_CLOCK_SETTIME = 1; - -const int HAVE_CONNECT = 1; - -const int HAVE_DECL_RTLD_DEEPBIND = 0; - -const int HAVE_DECL_RTLD_GLOBAL = 1; - -const int HAVE_DECL_RTLD_LAZY = 1; - -const int HAVE_DECL_RTLD_LOCAL = 1; - -const int HAVE_DECL_RTLD_MEMBER = 0; - -const int HAVE_DECL_RTLD_NODELETE = 1; - -const int HAVE_DECL_RTLD_NOLOAD = 1; - -const int HAVE_DECL_RTLD_NOW = 1; - -const int HAVE_DEVICE_MACROS = 1; - -const int HAVE_DIRENT_D_TYPE = 1; - -const int HAVE_DIRENT_H = 1; - -const int HAVE_DIRFD = 1; - -const int HAVE_DLFCN_H = 1; - -const int HAVE_DLOPEN = 1; - -const int HAVE_DUP = 1; - -const int HAVE_DUP2 = 1; - -const int HAVE_DUP3 = 1; - -const int HAVE_DYNAMIC_LOADING = 1; - -const int HAVE_ENDIAN_H = 1; - -const int HAVE_EPOLL = 1; - -const int HAVE_EPOLL_CREATE1 = 1; - -const int HAVE_ERF = 1; - -const int HAVE_ERFC = 1; - -const int HAVE_ERRNO_H = 1; - -const int HAVE_EVENTFD = 1; - -const int HAVE_EXECV = 1; - -const int HAVE_EXPM1 = 1; - -const int HAVE_FACCESSAT = 1; - -const int HAVE_FCHDIR = 1; - -const int HAVE_FCHMOD = 1; - -const int HAVE_FCHMODAT = 1; - -const int HAVE_FCHOWN = 1; - -const int HAVE_FCHOWNAT = 1; - -const int HAVE_FCNTL_H = 1; - -const int HAVE_FDATASYNC = 1; - -const int HAVE_FDOPENDIR = 1; - -const int HAVE_FFI_CLOSURE_ALLOC = 1; - -const int HAVE_FFI_PREP_CIF_VAR = 1; - -const int HAVE_FFI_PREP_CLOSURE_LOC = 1; - -const int HAVE_FLOCK = 1; - -const int HAVE_FORK = 1; - -const int HAVE_FPATHCONF = 1; - -const int HAVE_FSEEKO = 1; - -const int HAVE_FSTATAT = 1; - -const int HAVE_FSTATVFS = 1; - -const int HAVE_FSYNC = 1; - -const int HAVE_FTELLO = 1; - -const int HAVE_FTRUNCATE = 1; - -const int HAVE_FUTIMENS = 1; - -const int HAVE_GAI_STRERROR = 1; - -const int HAVE_GCC_UINT128_T = 1; - -const int HAVE_GETADDRINFO = 1; - -const int HAVE_GETC_UNLOCKED = 1; - -const int HAVE_GETEGID = 1; - -const int HAVE_GETEUID = 1; - -const int HAVE_GETGID = 1; - -const int HAVE_GETGRGID = 1; - -const int HAVE_GETGROUPLIST = 1; - -const int HAVE_GETGROUPS = 1; - -const int HAVE_GETHOSTBYADDR = 1; - -const int HAVE_GETHOSTBYNAME = 1; - -const int HAVE_GETHOSTBYNAME_R = 1; - -const int HAVE_GETHOSTBYNAME_R_6_ARG = 1; - -const int HAVE_GETHOSTNAME = 1; - -const int HAVE_GETITIMER = 1; - -const int HAVE_GETLOGIN = 1; - -const int HAVE_GETNAMEINFO = 1; - -const int HAVE_GETPAGESIZE = 1; - -const int HAVE_GETPEERNAME = 1; - -const int HAVE_GETPGID = 1; - -const int HAVE_GETPGRP = 1; - -const int HAVE_GETPID = 1; - -const int HAVE_GETPPID = 1; - -const int HAVE_GETPRIORITY = 1; - -const int HAVE_GETPROTOBYNAME = 1; - -const int HAVE_GETPWNAM_R = 1; - -const int HAVE_GETPWUID = 1; - -const int HAVE_GETPWUID_R = 1; - -const int HAVE_GETRANDOM_SYSCALL = 1; - -const int HAVE_GETRESGID = 1; - -const int HAVE_GETRESUID = 1; - -const int HAVE_GETRUSAGE = 1; - -const int HAVE_GETSERVBYNAME = 1; - -const int HAVE_GETSERVBYPORT = 1; - -const int HAVE_GETSID = 1; - -const int HAVE_GETSOCKNAME = 1; - -const int HAVE_GETUID = 1; - -const int HAVE_GRP_H = 1; - -const int HAVE_HSTRERROR = 1; - -const int HAVE_HTOLE64 = 1; - -const int HAVE_INET_ATON = 1; - -const int HAVE_INET_NTOA = 1; - -const int HAVE_INET_PTON = 1; - -const int HAVE_INITGROUPS = 1; - -const int HAVE_INTTYPES_H = 1; - -const int HAVE_KILL = 1; - -const int HAVE_KILLPG = 1; - -const int HAVE_LANGINFO_H = 1; - -const int HAVE_LCHOWN = 1; - -const int HAVE_LIBDL = 1; - -const int HAVE_LINK = 1; - -const int HAVE_LINKAT = 1; - -const int HAVE_LINUX_AUXVEC_H = 1; - -const int HAVE_LINUX_CAN_BCM_H = 1; - -const int HAVE_LINUX_CAN_H = 1; - -const int HAVE_LINUX_CAN_J1939_H = 1; - -const int HAVE_LINUX_CAN_RAW_FD_FRAMES = 1; - -const int HAVE_LINUX_CAN_RAW_H = 1; - -const int HAVE_LINUX_CAN_RAW_JOIN_FILTERS = 1; - -const int HAVE_LINUX_FS_H = 1; - -const int HAVE_LINUX_LIMITS_H = 1; - -const int HAVE_LINUX_MEMFD_H = 1; - -const int HAVE_LINUX_NETLINK_H = 1; - -const int HAVE_LINUX_QRTR_H = 1; - -const int HAVE_LINUX_RANDOM_H = 1; - -const int HAVE_LINUX_SOUNDCARD_H = 1; - -const int HAVE_LINUX_TIPC_H = 1; - -const int HAVE_LINUX_VM_SOCKETS_H = 1; - -const int HAVE_LINUX_WAIT_H = 1; - -const int HAVE_LISTEN = 1; - -const int HAVE_LOG1P = 1; - -const int HAVE_LOG2 = 1; - -const int HAVE_LONG_DOUBLE = 1; - -const int HAVE_LSTAT = 1; - -const int HAVE_MADVISE = 1; - -const int HAVE_MAKEDEV = 1; - -const int HAVE_MBRTOWC = 1; - -const int HAVE_MEMRCHR = 1; - -const int HAVE_MKDIRAT = 1; - -const int HAVE_MKFIFO = 1; - -const int HAVE_MKNOD = 1; - -const int HAVE_MKNODAT = 1; - -const int HAVE_MKTIME = 1; - -const int HAVE_MMAP = 1; - -const int HAVE_MREMAP = 1; - -const int HAVE_NANOSLEEP = 1; - -const int HAVE_NETDB_H = 1; - -const int HAVE_NETINET_IN_H = 1; - -const int HAVE_NETPACKET_PACKET_H = 1; - -const int HAVE_NET_ETHERNET_H = 1; - -const int HAVE_NET_IF_H = 1; - -const int HAVE_NICE = 1; - -const int HAVE_OPENAT = 1; - -const int HAVE_OPENDIR = 1; - -const int HAVE_PATHCONF = 1; - -const int HAVE_PAUSE = 1; - -const int HAVE_PIPE = 1; - -const int HAVE_PIPE2 = 1; - -const int HAVE_POLL = 1; - -const int HAVE_POLL_H = 1; - -const int HAVE_POSIX_FADVISE = 1; - -const int HAVE_POSIX_FALLOCATE = 1; - -const int HAVE_PREAD = 1; - -const int HAVE_PRLIMIT = 1; - -const int HAVE_PROTOTYPES = 1; - -const int HAVE_PTHREAD_CONDATTR_SETCLOCK = 1; - -const int HAVE_PTHREAD_GETCPUCLOCKID = 1; - -const int HAVE_PTHREAD_H = 1; - -const int HAVE_PTHREAD_KILL = 1; - -const int HAVE_PTHREAD_SIGMASK = 1; - -const int HAVE_PTY_H = 1; - -const int HAVE_PWRITE = 1; - -const int HAVE_READLINK = 1; - -const int HAVE_READLINKAT = 1; - -const int HAVE_READV = 1; - -const int HAVE_REALPATH = 1; - -const int HAVE_RECVFROM = 1; - -const int HAVE_RENAMEAT = 1; - -const int HAVE_SCHED_GET_PRIORITY_MAX = 1; - -const int HAVE_SCHED_H = 1; - -const int HAVE_SCHED_RR_GET_INTERVAL = 1; - -const int HAVE_SCHED_SETAFFINITY = 1; - -const int HAVE_SCHED_SETPARAM = 1; - -const int HAVE_SCHED_SETSCHEDULER = 1; - -const int HAVE_SEM_GETVALUE = 1; - -const int HAVE_SEM_OPEN = 1; - -const int HAVE_SEM_TIMEDWAIT = 1; - -const int HAVE_SEM_UNLINK = 1; - -const int HAVE_SENDFILE = 1; - -const int HAVE_SENDTO = 1; - -const int HAVE_SETEGID = 1; - -const int HAVE_SETEUID = 1; - -const int HAVE_SETGID = 1; - -const int HAVE_SETGROUPS = 1; - -const int HAVE_SETITIMER = 1; - -const int HAVE_SETJMP_H = 1; - -const int HAVE_SETLOCALE = 1; - -const int HAVE_SETNS = 1; - -const int HAVE_SETPGID = 1; - -const int HAVE_SETPGRP = 1; - -const int HAVE_SETPRIORITY = 1; - -const int HAVE_SETREGID = 1; - -const int HAVE_SETRESGID = 1; - -const int HAVE_SETRESUID = 1; - -const int HAVE_SETREUID = 1; - -const int HAVE_SETSID = 1; - -const int HAVE_SETSOCKOPT = 1; - -const int HAVE_SETUID = 1; - -const int HAVE_SETVBUF = 1; - -const int HAVE_SHUTDOWN = 1; - -const int HAVE_SIGACTION = 1; - -const int HAVE_SIGALTSTACK = 1; - -const int HAVE_SIGFILLSET = 1; - -const int HAVE_SIGINFO_T_SI_BAND = 1; - -const int HAVE_SIGINTERRUPT = 1; - -const int HAVE_SIGNAL_H = 1; - -const int HAVE_SIGPENDING = 1; - -const int HAVE_SIGWAIT = 1; - -const int HAVE_SNPRINTF = 1; - -const int HAVE_SOCKADDR_ALG = 1; - -const int HAVE_SOCKADDR_STORAGE = 1; - -const int HAVE_SOCKET = 1; - -const int HAVE_SOCKETPAIR = 1; - -const int HAVE_SPAWN_H = 1; - -const int HAVE_SPLICE = 1; - -const int HAVE_SSIZE_T = 1; - -const int HAVE_STATVFS = 1; - -const int HAVE_STAT_TV_NSEC = 1; - -const int HAVE_STDINT_H = 1; - -const int HAVE_STDIO_H = 1; - -const int HAVE_STDLIB_H = 1; - -const int HAVE_STD_ATOMIC = 1; - -const int HAVE_STRFTIME = 1; - -const int HAVE_STRINGS_H = 1; - -const int HAVE_STRING_H = 1; - -const int HAVE_STRLCPY = 1; - -const int HAVE_STRSIGNAL = 1; - -const int HAVE_STRUCT_PASSWD_PW_GECOS = 1; - -const int HAVE_STRUCT_PASSWD_PW_PASSWD = 1; - -const int HAVE_STRUCT_STAT_ST_BLKSIZE = 1; - -const int HAVE_STRUCT_STAT_ST_BLOCKS = 1; - -const int HAVE_STRUCT_STAT_ST_RDEV = 1; - -const int HAVE_STRUCT_TM_TM_ZONE = 1; - -const int HAVE_SYMLINK = 1; - -const int HAVE_SYMLINKAT = 1; - -const int HAVE_SYNC = 1; - -const int HAVE_SYSCONF = 1; - -const int HAVE_SYSEXITS_H = 1; - -const int HAVE_SYSLOG_H = 1; - -const int HAVE_SYSTEM = 1; - -const int HAVE_SYS_AUXV_H = 1; - -const int HAVE_SYS_ENDIAN_H = 1; - -const int HAVE_SYS_EPOLL_H = 1; - -const int HAVE_SYS_EVENTFD_H = 1; - -const int HAVE_SYS_FILE_H = 1; - -const int HAVE_SYS_IOCTL_H = 1; - -const int HAVE_SYS_MMAN_H = 1; - -const int HAVE_SYS_PARAM_H = 1; - -const int HAVE_SYS_POLL_H = 1; - -const int HAVE_SYS_RANDOM_H = 1; - -const int HAVE_SYS_RESOURCE_H = 1; - -const int HAVE_SYS_SELECT_H = 1; - -const int HAVE_SYS_SENDFILE_H = 1; - -const int HAVE_SYS_SOCKET_H = 1; - -const int HAVE_SYS_STATVFS_H = 1; - -const int HAVE_SYS_STAT_H = 1; - -const int HAVE_SYS_SYSCALL_H = 1; - -const int HAVE_SYS_SYSMACROS_H = 1; - -const int HAVE_SYS_TIMES_H = 1; - -const int HAVE_SYS_TIME_H = 1; - -const int HAVE_SYS_TYPES_H = 1; - -const int HAVE_SYS_UIO_H = 1; - -const int HAVE_SYS_UN_H = 1; - -const int HAVE_SYS_UTSNAME_H = 1; - -const int HAVE_SYS_WAIT_H = 1; - -const int HAVE_SYS_XATTR_H = 1; - -const int HAVE_TCGETPGRP = 1; - -const int HAVE_TCSETPGRP = 1; - -const int HAVE_TEMPNAM = 1; - -const int HAVE_TERMIOS_H = 1; - -const int HAVE_TIMEGM = 1; - -const int HAVE_TIMES = 1; - -const int HAVE_TMPFILE = 1; - -const int HAVE_TMPNAM = 1; - -const int HAVE_TM_ZONE = 1; - -const int HAVE_TRUNCATE = 1; - -const int HAVE_TTYNAME = 1; - -const int HAVE_UMASK = 1; - -const int HAVE_UNAME = 1; - -const int HAVE_UNISTD_H = 1; - -const int HAVE_UNLINKAT = 1; - -const int HAVE_UNSHARE = 1; - -const int HAVE_UTIMENSAT = 1; - -const int HAVE_UTIMES = 1; - -const int HAVE_UTIME_H = 1; - -const int HAVE_UTMP_H = 1; - -const int HAVE_VFORK = 1; - -const int HAVE_WAIT = 1; - -const int HAVE_WAIT4 = 1; - -const int HAVE_WAITID = 1; - -const int HAVE_WAITPID = 1; - -const int HAVE_WCHAR_H = 1; - -const int HAVE_WCSCOLL = 1; - -const int HAVE_WCSFTIME = 1; - -const int HAVE_WCSXFRM = 1; - -const int HAVE_WMEMCMP = 1; - -const int HAVE_WRITEV = 1; - -const int HAVE_ZLIB_COPY = 1; - -const int HAVE_ZLIB_H = 1; - -const int MAJOR_IN_SYSMACROS = 1; - -const int PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT = 1; - -const String PY_BUILTIN_HASHLIB_HASHES = 'md5,sha1,sha2,sha3,blake2'; - -const int PY_COERCE_C_LOCALE = 1; - -const int PY_SSL_DEFAULT_CIPHERS = 1; - -const int PY_SUPPORT_TIER = 0; - -const int Py_ENABLE_SHARED = 1; - -const int SIZEOF_DOUBLE = 8; - -const int SIZEOF_FLOAT = 4; - -const int SIZEOF_FPOS_T = 8; - -const int SIZEOF_INT = 4; - -const int SIZEOF_LONG = 8; - -const int SIZEOF_LONG_DOUBLE = 8; - -const int SIZEOF_LONG_LONG = 8; - -const int SIZEOF_OFF_T = 8; - -const int SIZEOF_PID_T = 4; - -const int SIZEOF_PTHREAD_KEY_T = 4; - -const int SIZEOF_PTHREAD_T = 8; - -const int SIZEOF_SHORT = 2; - -const int SIZEOF_SIZE_T = 8; - -const int SIZEOF_TIME_T = 8; - -const int SIZEOF_UINTPTR_T = 8; - -const int SIZEOF_VOID_P = 8; - -const int SIZEOF_WCHAR_T = 4; - -const int SIZEOF__BOOL = 1; - -const int STDC_HEADERS = 1; - -const int SYS_SELECT_WITH_SYS_TIME = 1; - -const int _ALL_SOURCE = 1; - -const int _DARWIN_C_SOURCE = 1; - -const int __EXTENSIONS__ = 1; - -const int _GNU_SOURCE = 1; - -const int _HPUX_ALT_XOPEN_SOCKET_API = 1; - -const int _NETBSD_SOURCE = 1; - -const int _OPENBSD_SOURCE = 1; - -const int _POSIX_PTHREAD_SEMANTICS = 1; - -const int __STDC_WANT_IEC_60559_ATTRIBS_EXT__ = 1; - -const int __STDC_WANT_IEC_60559_BFP_EXT__ = 1; - -const int __STDC_WANT_IEC_60559_DFP_EXT__ = 1; - -const int __STDC_WANT_IEC_60559_FUNCS_EXT__ = 1; - -const int __STDC_WANT_IEC_60559_TYPES_EXT__ = 1; - -const int __STDC_WANT_LIB_EXT2__ = 1; - -const int __STDC_WANT_MATH_SPEC_FUNCS__ = 1; - -const int _TANDEM_SOURCE = 1; - -const int _XOPEN_SOURCE = 700; - -const int WITH_DECIMAL_CONTEXTVAR = 1; - -const int WITH_DOC_STRINGS = 1; - -const int WITH_FREELISTS = 1; - -const int WITH_PYMALLOC = 1; - -const int _POSIX_C_SOURCE = 200809; - -const String _PYTHONFRAMEWORK = ''; - -const int _REENTRANT = 1; - -const int _XOPEN_SOURCE_EXTENDED = 1; - -const int __BSD_VISIBLE = 1; - -const int HAVE_LONG_LONG = 1; - -const int PY_LLONG_MIN = -9223372036854775808; - -const int PY_LLONG_MAX = 9223372036854775807; - -const int PY_ULLONG_MAX = -1; - -const int PYLONG_BITS_IN_DIGIT = 30; - -const int PY_SSIZE_T_MAX = 9223372036854775807; - -const int PY_SSIZE_T_MIN = -9223372036854775808; - -const int SIZEOF_PY_HASH_T = 8; - -const int SIZEOF_PY_UHASH_T = 8; - -const int PY_SIZE_MAX = -1; - -const String PY_FORMAT_SIZE_T = 'z'; - -const int PY_BIG_ENDIAN = 0; - -const int PY_LITTLE_ENDIAN = 1; - -const int PY_DWORD_MAX = 4294967295; - -const double Py_MATH_PIl = 3.141592653589793; - -const double Py_MATH_PI = 3.141592653589793; - -const double Py_MATH_El = 2.718281828459045; - -const double Py_MATH_E = 2.718281828459045; - -const double Py_MATH_TAU = 6.283185307179586; - -const double Py_INFINITY = double.infinity; - -const double Py_HUGE_VAL = double.infinity; - -const double Py_NAN = double.nan; - -const int PyBUF_MAX_NDIM = 64; - -const int PyBUF_SIMPLE = 0; - -const int PyBUF_WRITABLE = 1; - -const int PyBUF_WRITEABLE = 1; - -const int PyBUF_FORMAT = 4; - -const int PyBUF_ND = 8; - -const int PyBUF_STRIDES = 24; - -const int PyBUF_C_CONTIGUOUS = 56; - -const int PyBUF_F_CONTIGUOUS = 88; - -const int PyBUF_ANY_CONTIGUOUS = 152; - -const int PyBUF_INDIRECT = 280; - -const int PyBUF_CONTIG = 9; - -const int PyBUF_CONTIG_RO = 8; - -const int PyBUF_STRIDED = 25; - -const int PyBUF_STRIDED_RO = 24; - -const int PyBUF_RECORDS = 29; - -const int PyBUF_RECORDS_RO = 28; - -const int PyBUF_FULL = 285; - -const int PyBUF_FULL_RO = 284; - -const int PyBUF_READ = 256; - -const int PyBUF_WRITE = 512; - -const int _Py_IMMORTAL_REFCNT = 4294967295; - -const int Py_INVALID_SIZE = -1; - -const int Py_PRINT_RAW = 1; - -const int _Py_TPFLAGS_STATIC_BUILTIN = 2; - -const int Py_TPFLAGS_MANAGED_WEAKREF = 8; - -const int Py_TPFLAGS_MANAGED_DICT = 16; - -const int Py_TPFLAGS_PREHEADER = 24; - -const int Py_TPFLAGS_SEQUENCE = 32; - -const int Py_TPFLAGS_MAPPING = 64; - -const int Py_TPFLAGS_DISALLOW_INSTANTIATION = 128; - -const int Py_TPFLAGS_IMMUTABLETYPE = 256; - -const int Py_TPFLAGS_HEAPTYPE = 512; - -const int Py_TPFLAGS_BASETYPE = 1024; - -const int Py_TPFLAGS_HAVE_VECTORCALL = 2048; - -const int _Py_TPFLAGS_HAVE_VECTORCALL = 2048; - -const int Py_TPFLAGS_READY = 4096; - -const int Py_TPFLAGS_READYING = 8192; - -const int Py_TPFLAGS_HAVE_GC = 16384; - -const int Py_TPFLAGS_HAVE_STACKLESS_EXTENSION = 0; - -const int Py_TPFLAGS_METHOD_DESCRIPTOR = 131072; - -const int Py_TPFLAGS_VALID_VERSION_TAG = 524288; - -const int Py_TPFLAGS_IS_ABSTRACT = 1048576; - -const int _Py_TPFLAGS_MATCH_SELF = 4194304; - -const int Py_TPFLAGS_ITEMS_AT_END = 8388608; - -const int Py_TPFLAGS_LONG_SUBCLASS = 16777216; - -const int Py_TPFLAGS_LIST_SUBCLASS = 33554432; - -const int Py_TPFLAGS_TUPLE_SUBCLASS = 67108864; - -const int Py_TPFLAGS_BYTES_SUBCLASS = 134217728; - -const int Py_TPFLAGS_UNICODE_SUBCLASS = 268435456; - -const int Py_TPFLAGS_DICT_SUBCLASS = 536870912; - -const int Py_TPFLAGS_BASE_EXC_SUBCLASS = 1073741824; - -const int Py_TPFLAGS_TYPE_SUBCLASS = 2147483648; - -const int Py_TPFLAGS_DEFAULT = 0; - -const int Py_TPFLAGS_HAVE_FINALIZE = 1; - -const int Py_TPFLAGS_HAVE_VERSION_TAG = 262144; - -const int Py_LT = 0; - -const int Py_LE = 1; - -const int Py_EQ = 2; - -const int Py_NE = 3; - -const int Py_GT = 4; - -const int Py_GE = 5; - -const int TYPE_MAX_WATCHERS = 8; - -const int Py_bf_getbuffer = 1; - -const int Py_bf_releasebuffer = 2; - -const int Py_mp_ass_subscript = 3; - -const int Py_mp_length = 4; - -const int Py_mp_subscript = 5; - -const int Py_nb_absolute = 6; - -const int Py_nb_add = 7; - -const int Py_nb_and = 8; - -const int Py_nb_bool = 9; - -const int Py_nb_divmod = 10; - -const int Py_nb_float = 11; - -const int Py_nb_floor_divide = 12; - -const int Py_nb_index = 13; - -const int Py_nb_inplace_add = 14; - -const int Py_nb_inplace_and = 15; - -const int Py_nb_inplace_floor_divide = 16; - -const int Py_nb_inplace_lshift = 17; - -const int Py_nb_inplace_multiply = 18; - -const int Py_nb_inplace_or = 19; - -const int Py_nb_inplace_power = 20; - -const int Py_nb_inplace_remainder = 21; - -const int Py_nb_inplace_rshift = 22; - -const int Py_nb_inplace_subtract = 23; - -const int Py_nb_inplace_true_divide = 24; - -const int Py_nb_inplace_xor = 25; - -const int Py_nb_int = 26; - -const int Py_nb_invert = 27; - -const int Py_nb_lshift = 28; - -const int Py_nb_multiply = 29; - -const int Py_nb_negative = 30; - -const int Py_nb_or = 31; - -const int Py_nb_positive = 32; - -const int Py_nb_power = 33; - -const int Py_nb_remainder = 34; - -const int Py_nb_rshift = 35; - -const int Py_nb_subtract = 36; - -const int Py_nb_true_divide = 37; - -const int Py_nb_xor = 38; - -const int Py_sq_ass_item = 39; - -const int Py_sq_concat = 40; - -const int Py_sq_contains = 41; - -const int Py_sq_inplace_concat = 42; - -const int Py_sq_inplace_repeat = 43; - -const int Py_sq_item = 44; - -const int Py_sq_length = 45; - -const int Py_sq_repeat = 46; - -const int Py_tp_alloc = 47; - -const int Py_tp_base = 48; - -const int Py_tp_bases = 49; - -const int Py_tp_call = 50; - -const int Py_tp_clear = 51; - -const int Py_tp_dealloc = 52; - -const int Py_tp_del = 53; - -const int Py_tp_descr_get = 54; - -const int Py_tp_descr_set = 55; - -const int Py_tp_doc = 56; - -const int Py_tp_getattr = 57; - -const int Py_tp_getattro = 58; - -const int Py_tp_hash = 59; - -const int Py_tp_init = 60; - -const int Py_tp_is_gc = 61; - -const int Py_tp_iter = 62; - -const int Py_tp_iternext = 63; - -const int Py_tp_methods = 64; - -const int Py_tp_new = 65; - -const int Py_tp_repr = 66; - -const int Py_tp_richcompare = 67; - -const int Py_tp_setattr = 68; - -const int Py_tp_setattro = 69; - -const int Py_tp_str = 70; - -const int Py_tp_traverse = 71; - -const int Py_tp_members = 72; - -const int Py_tp_getset = 73; - -const int Py_tp_free = 74; - -const int Py_nb_matrix_multiply = 75; - -const int Py_nb_inplace_matrix_multiply = 76; - -const int Py_am_await = 77; - -const int Py_am_aiter = 78; - -const int Py_am_anext = 79; - -const int Py_tp_finalize = 80; - -const int Py_am_send = 81; - -const int _PyHASH_MULTIPLIER = 1000003; - -const int _PyHASH_BITS = 61; - -const int _PyHASH_MODULUS = 2305843009213693951; - -const int _PyHASH_INF = 314159; - -const int _PyHASH_IMAG = 1000003; - -const int Py_HASH_CUTOFF = 0; - -const int Py_HASH_EXTERNAL = 0; - -const int Py_HASH_SIPHASH24 = 1; - -const int Py_HASH_FNV = 2; - -const int Py_HASH_SIPHASH13 = 3; - -const int Py_HASH_ALGORITHM = 3; - -const int Py_UNICODE_SIZE = 4; - -const int Py_UNICODE_REPLACEMENT_CHARACTER = 65533; - -const int SSTATE_NOT_INTERNED = 0; - -const int SSTATE_INTERNED_MORTAL = 1; - -const int SSTATE_INTERNED_IMMORTAL = 2; - -const int SSTATE_INTERNED_IMMORTAL_STATIC = 3; - -const int MAX_CO_EXTRA_USERS = 255; - -const int Py_RTFLAGS_USE_MAIN_OBMALLOC = 32; - -const int Py_RTFLAGS_MULTI_INTERP_EXTENSIONS = 256; - -const int Py_RTFLAGS_THREADS = 1024; - -const int Py_RTFLAGS_DAEMON_THREADS = 2048; - -const int Py_RTFLAGS_FORK = 32768; - -const int Py_RTFLAGS_EXEC = 65536; - -const int PyTrace_CALL = 0; - -const int PyTrace_EXCEPTION = 1; - -const int PyTrace_LINE = 2; - -const int PyTrace_RETURN = 3; - -const int PyTrace_C_CALL = 4; - -const int PyTrace_C_EXCEPTION = 5; - -const int PyTrace_C_RETURN = 6; - -const int PyTrace_OPCODE = 7; - -const int C_RECURSION_LIMIT = 10000; - -const String _Py_PARSE_PID = 'i'; - -const String _Py_PARSE_INTPTR = 'l'; - -const String _Py_PARSE_UINTPTR = 'k'; - -const int PyLong_SHIFT = 30; - -const int _PyLong_DECIMAL_SHIFT = 9; - -const int _PyLong_DECIMAL_BASE = 1000000000; - -const int PyLong_BASE = 1073741824; - -const int PyLong_MASK = 1073741823; - -const int _PyLong_SIGN_MASK = 3; - -const int _PyLong_NON_SIZE_BITS = 3; - -const int _Py_MANAGED_BUFFER_RELEASED = 1; - -const int _Py_MANAGED_BUFFER_FREE_FORMAT = 2; - -const int _Py_MEMORYVIEW_RELEASED = 1; - -const int _Py_MEMORYVIEW_C = 2; - -const int _Py_MEMORYVIEW_FORTRAN = 4; - -const int _Py_MEMORYVIEW_SCALAR = 8; - -const int _Py_MEMORYVIEW_PIL = 16; - -const int _Py_MEMORYVIEW_RESTRICTED = 32; - -const int PySet_MINSIZE = 8; - -const int METH_VARARGS = 1; - -const int METH_KEYWORDS = 2; - -const int METH_NOARGS = 4; - -const int METH_O = 8; - -const int METH_CLASS = 16; - -const int METH_STATIC = 32; - -const int METH_COEXIST = 64; - -const int METH_FASTCALL = 128; - -const int METH_STACKLESS = 0; - -const int METH_METHOD = 512; - -const int Py_mod_create = 1; - -const int Py_mod_exec = 2; - -const int Py_mod_multiple_interpreters = 3; - -const int _Py_mod_LAST_SLOT = 3; - -const String PY_STDIOTEXTMODE = 'b'; - -const int _PY_MONITORING_LOCAL_EVENTS = 10; - -const int _PY_MONITORING_UNGROUPED_EVENTS = 15; - -const int _PY_MONITORING_EVENTS = 17; - -const int CO_OPTIMIZED = 1; - -const int CO_NEWLOCALS = 2; - -const int CO_VARARGS = 4; - -const int CO_VARKEYWORDS = 8; - -const int CO_NESTED = 16; - -const int CO_GENERATOR = 32; - -const int CO_COROUTINE = 128; - -const int CO_ITERABLE_COROUTINE = 256; - -const int CO_ASYNC_GENERATOR = 512; - -const int CO_FUTURE_DIVISION = 131072; - -const int CO_FUTURE_ABSOLUTE_IMPORT = 262144; - -const int CO_FUTURE_WITH_STATEMENT = 524288; - -const int CO_FUTURE_PRINT_FUNCTION = 1048576; - -const int CO_FUTURE_UNICODE_LITERALS = 2097152; - -const int CO_FUTURE_BARRY_AS_BDFL = 4194304; - -const int CO_FUTURE_GENERATOR_STOP = 8388608; - -const int CO_FUTURE_ANNOTATIONS = 16777216; - -const int CO_MAXBLOCKS = 20; - -const int Py_T_SHORT = 0; - -const int Py_T_INT = 1; - -const int Py_T_LONG = 2; - -const int Py_T_FLOAT = 3; - -const int Py_T_DOUBLE = 4; - -const int Py_T_STRING = 5; - -const int _Py_T_OBJECT = 6; - -const int Py_T_CHAR = 7; - -const int Py_T_BYTE = 8; - -const int Py_T_UBYTE = 9; - -const int Py_T_USHORT = 10; - -const int Py_T_UINT = 11; - -const int Py_T_ULONG = 12; - -const int Py_T_STRING_INPLACE = 13; - -const int Py_T_BOOL = 14; - -const int Py_T_OBJECT_EX = 16; - -const int Py_T_LONGLONG = 17; - -const int Py_T_ULONGLONG = 18; - -const int Py_T_PYSSIZET = 19; - -const int _Py_T_NONE = 20; - -const int Py_READONLY = 1; - -const int Py_AUDIT_READ = 2; - -const int _Py_WRITE_RESTRICTED = 4; - -const int Py_RELATIVE_OFFSET = 8; - -const int PyWrapperFlag_KEYWORDS = 1; - -const int _PyTime_MIN = -9223372036854775808; - -const int _PyTime_MAX = 9223372036854775807; - -const int _SIZEOF_PYTIME_T = 8; - -const int WAIT_LOCK = 1; - -const int NOWAIT_LOCK = 0; - -const int PY_TIMEOUT_MAX = 9223372036854775; - -const int PYTHREAD_INVALID_THREAD_ID = -1; - -const int Py_CLEANUP_SUPPORTED = 131072; - -const int PYTHON_API_VERSION = 1013; - -const String PYTHON_API_STRING = '1013'; - -const int PYTHON_ABI_VERSION = 3; - -const String PYTHON_ABI_STRING = '3'; - -const int Py_single_input = 256; - -const int Py_file_input = 257; - -const int Py_eval_input = 258; - -const int Py_func_type_input = 345; - -const int PyCF_MASK = 33423360; - -const int PyCF_MASK_OBSOLETE = 16; - -const int PyCF_SOURCE_IS_UTF8 = 256; - -const int PyCF_DONT_IMPLY_DEDENT = 512; - -const int PyCF_ONLY_AST = 1024; - -const int PyCF_IGNORE_COOKIE = 2048; - -const int PyCF_TYPE_COMMENTS = 4096; - -const int PyCF_ALLOW_TOP_LEVEL_AWAIT = 8192; - -const int PyCF_ALLOW_INCOMPLETE_INPUT = 16384; - -const int PyCF_COMPILE_MASK = 30208; - -const String FUTURE_NESTED_SCOPES = 'nested_scopes'; - -const String FUTURE_GENERATORS = 'generators'; - -const String FUTURE_DIVISION = 'division'; - -const String FUTURE_ABSOLUTE_IMPORT = 'absolute_import'; - -const String FUTURE_WITH_STATEMENT = 'with_statement'; - -const String FUTURE_PRINT_FUNCTION = 'print_function'; - -const String FUTURE_UNICODE_LITERALS = 'unicode_literals'; - -const String FUTURE_BARRY_AS_BDFL = 'barry_as_FLUFL'; - -const String FUTURE_GENERATOR_STOP = 'generator_stop'; - -const String FUTURE_ANNOTATIONS = 'annotations'; - -const int PY_INVALID_STACK_EFFECT = 2147483647; - -const int PYOS_STACK_MARGIN = 2048; - -const int PyInterpreterConfig_DEFAULT_GIL = 0; - -const int PyInterpreterConfig_SHARED_GIL = 1; - -const int PyInterpreterConfig_OWN_GIL = 2; - -const int FVC_MASK = 3; - -const int FVC_NONE = 0; - -const int FVC_STR = 1; - -const int FVC_REPR = 2; - -const int FVC_ASCII = 3; - -const int FVS_MASK = 4; - -const int FVS_HAVE_SPEC = 4; - -const int PY_VECTORCALL_ARGUMENTS_OFFSET = -9223372036854775808; - -const int _PY_FASTCALL_SMALL_STACK = 5; - -const int PY_ITERSEARCH_COUNT = 1; - -const int PY_ITERSEARCH_INDEX = 2; - -const int PY_ITERSEARCH_CONTAINS = 3; - -const int PY_CTF_LOWER = 1; - -const int PY_CTF_UPPER = 2; - -const int PY_CTF_ALPHA = 3; - -const int PY_CTF_DIGIT = 4; - -const int PY_CTF_ALNUM = 7; - -const int PY_CTF_SPACE = 8; - -const int PY_CTF_XDIGIT = 16; - -const int Py_DTSF_SIGN = 1; - -const int Py_DTSF_ADD_DOT_0 = 2; - -const int Py_DTSF_ALT = 4; - -const int Py_DTSF_NO_NEG_0 = 8; - -const int Py_DTST_FINITE = 0; - -const int Py_DTST_INFINITE = 1; - -const int Py_DTST_NAN = 2; diff --git a/src/serious_python_android/lib/src/log.dart b/src/serious_python_android/lib/src/log.dart deleted file mode 100644 index 2cfa01ec..00000000 --- a/src/serious_python_android/lib/src/log.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:flutter/foundation.dart'; - -void spDebug(String message) { - if (message.startsWith('[serious_python]')) { - debugPrint(message); - } else { - debugPrint('[serious_python] $message'); - } -} - diff --git a/src/serious_python_android/pubspec.yaml b/src/serious_python_android/pubspec.yaml index 81be5f4d..a96d2251 100644 --- a/src/serious_python_android/pubspec.yaml +++ b/src/serious_python_android/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_android description: Android implementation of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 2.0.0 +version: 3.0.0 environment: sdk: ">=3.0.0 <4.0.0" @@ -15,14 +15,12 @@ dependencies: serious_python_platform_interface: path: ../serious_python_platform_interface path: ^1.9.0 - ffi: ^2.1.2 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^2.0.0 - ffigen: ^9.0.0 - + flutter: plugin: implements: serious_python diff --git a/src/serious_python_android/python/_sp_bootstrap.py b/src/serious_python_android/python/_sp_bootstrap.py new file mode 100644 index 00000000..be29d3c6 --- /dev/null +++ b/src/serious_python_android/python/_sp_bootstrap.py @@ -0,0 +1,139 @@ +"""serious_python Android import bootstrap. + +Installed by the dart-bridge embedder *before* ``site`` runs, via the fixed call:: + + import _sp_bootstrap; _sp_bootstrap.install() + +It registers a ``sys.meta_path`` finder that resolves native CPython extension +modules which the build relocated into ``jniLibs//`` as real ``lib.so`` +files (loaded by basename through the Android linker namespace, exactly like +``libdart_bridge.so``). Pure ``.py``/``.pyc`` modules are left to ``zipimport`` / +``FileFinder`` — this finder returns ``None`` for them. + +For every relocated extension the build leaves a ``.soref`` marker at the module's +original path; its content is the ``lib.so`` filename. The marker is read +**lazily** in ``find_spec`` via the frozen ``zipimport`` ``get_data`` API (for zip +entries) or a plain ``open`` (for entries extracted to disk, e.g. ``extract.zip``). + +CRITICAL: this module must load and run *before any native module is resolvable*, +so it imports **only builtin/frozen** machinery — ``sys``, ``zipimport``, +``importlib.machinery`` — and never ``zipfile``/``struct``/``zlib`` (which would be +a chicken-and-egg: those are themselves native). +""" + +import sys +import posix # builtin (native-free): read env without importing os +import zipimport +from importlib.machinery import ExtensionFileLoader, ModuleSpec + +_MARKER_SUFFIX = ".soref" +_installed = False + + +def _native_lib_dir(): + # nativeLibraryDir, exported by AndroidPlugin before Py_Initialize. Under legacy + # packaging the mangled libs are extracted there, so an absolute origin lets the + # interpreter dlopen them (some Android CPython builds prepend "./" to a no-slash + # origin, which breaks a bare-soname namespace lookup). Empty under modern + # packaging -> fall back to bare soname (linker-namespace resolution). + v = posix.environ.get(b"ANDROID_NATIVE_LIBRARY_DIR") + return v.decode("utf-8") if v else None + + +def _apk_native_prefix(): + # base.apk!/lib// — Bionic zip-path to libs mmap'd from the APK under modern + # packaging (useLegacyPackaging=false), where libs are NOT extracted to disk. + v = posix.environ.get(b"ANDROID_APK_NATIVE_PREFIX") + return v.decode("utf-8") if v else None + + +class _SorefFinder: + """meta_path finder: dotted name -> jniLibs lib via its ``.soref`` marker.""" + + def __init__(self): + # Cache one zipimporter per zip sys.path entry. Value is None for entries + # that are not zips (plain directories) so we don't retry zipimporter(). + self._zi_cache = {} + self._native_dir = _native_lib_dir() + self._apk_prefix = _apk_native_prefix() + + def _zipimporter(self, entry): + try: + return self._zi_cache[entry] + except KeyError: + try: + zi = zipimport.zipimporter(entry) + except Exception: + zi = None # not a zip (e.g. a directory) + self._zi_cache[entry] = zi + return zi + + def _read_marker(self, member): + """Return the soname recorded in ``member`` (.soref), or None if absent. + + Probes every current ``sys.path`` entry: zip entries via the frozen + ``zipimport.get_data`` (known member, no native deps), directory entries + via a plain ``open`` (covers packages unpacked from ``extract.zip``). + """ + for entry in sys.path: + if not entry: + continue + zi = self._zipimporter(entry) + if zi is not None: + try: + return zi.get_data(member) # archive-relative member path + except Exception: + continue + else: + # Directory entry: try the marker as a real file on disk. + path = entry + "/" + member + try: + with open(path, "rb") as f: + return f.read() + except OSError: + continue + return None + + def find_spec(self, fullname, path=None, target=None): + member = fullname.replace(".", "/") + _MARKER_SUFFIX + data = self._read_marker(member) + if data is None: + return None # not a relocated native module -> let others handle it + soname = data.decode("utf-8").strip() + # Resolve the lib to an absolute origin (CPython prepends "./" to a no-slash + # origin, which breaks bare-soname loading). Prefer the extracted copy under + # nativeLibraryDir (legacy packaging); else the Bionic APK zip-path (modern + # packaging, mmap'd from the APK, never extracted). + origin = soname + if self._native_dir: + cand = self._native_dir + "/" + soname + try: + open(cand, "rb").close() + origin = cand + except OSError: + pass + if origin == soname and self._apk_prefix: + origin = self._apk_prefix + soname + loader = ExtensionFileLoader(fullname, origin) + return ModuleSpec(fullname, loader, origin=origin) + + +def install(): + """Insert the finder at the front of ``sys.meta_path`` (idempotent).""" + global _installed + if _installed: + return + # Bootstrap audit: any extension module (.so) already imported at this point was + # loaded during interpreter core-init, BEFORE the finder existed — which only works + # if it was builtin/frozen. A non-empty list means that module must be made static + # (PyImport_AppendInittab) or it will fail under modern packaging. Expected: empty. + pre = [n for n, m in sys.modules.items() + if getattr(m, "__file__", None) and str(m.__file__).endswith(".so")] + if pre: + sys.stderr.write("SP_BOOTSTRAP pre-finder native modules: %r\n" % (pre,)) + for f in sys.meta_path: + if isinstance(f, _SorefFinder): + _installed = True + return + sys.meta_path.insert(0, _SorefFinder()) + _installed = True diff --git a/src/serious_python_android/python_ffigen.yaml b/src/serious_python_android/python_ffigen.yaml deleted file mode 100644 index af1efb05..00000000 --- a/src/serious_python_android/python_ffigen.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# Run with `dart run ffigen --config python_ffigen.yaml`. - -output: "lib/src/gen.dart" -# enums: -# rename: -# "_(.*)": "$1" -# member-rename: -# "_(.*)": -# "_(.*)": "$1" -globals: - rename: - "^class (\\w+) extends ffi.Struct": "final class $1 extends ffi.Struct" - "^class (\\w+) extends ffi.Opaque": "final class $1 extends ffi.Opaque" - "^class (\\w+) extends ffi.Union": "final class $1 extends ffi.Union" -headers: - entry-points: - - "/Users/feodor/projects/flet-dev/python-mobile/install/android/arm64-v8a/python-3.12/include/python3.12/Python.h" - include-directives: - - "/Users/feodor/projects/flet-dev/python-mobile/install/android/arm64-v8a/python-3.12/include/python3.12/*" - - "/Users/feodor/projects/flet-dev/python-mobile/install/android/arm64-v8a/python-3.12/include/python3.12/internal/*" - - "/Users/feodor/projects/flet-dev/python-mobile/install/android/arm64-v8a/python-3.12/include/python3.12/cpython/*" -name: "CPython" -llvm-path: - - /opt/homebrew/opt/llvm -#compiler-opts: "-I/usr/local/opt/llvm/lib/clang/10.0.0/include/ -I/usr/local/Frameworks/Python.framework/Versions/3.8/include/python3.8/" -description: "Bindings to Python C interface\nignore_for_file: unused_field, unused_element\n" -#array-workaround: true \ No newline at end of file diff --git a/src/serious_python_android/src/CMakeLists.txt b/src/serious_python_android/src/CMakeLists.txt deleted file mode 100644 index c2800814..00000000 --- a/src/serious_python_android/src/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project(serious_python_library VERSION 0.0.1 LANGUAGES C) - -add_library(serious_python SHARED - "serious_python.c" -) - -set_target_properties(serious_python PROPERTIES - PUBLIC_HEADER serious_python.h - OUTPUT_NAME "serious_python" -) - -# Add 16 KB page size support for Android 15 -if(ANDROID) - set_target_properties(serious_python PROPERTIES - LINK_FLAGS "-Wl,-z,max-page-size=16384" - ) -endif() - -target_compile_definitions(serious_python PUBLIC DART_SHARED_LIB) diff --git a/src/serious_python_android/src/serious_python.c b/src/serious_python_android/src/serious_python.c deleted file mode 100644 index e952f9f7..00000000 --- a/src/serious_python_android/src/serious_python.c +++ /dev/null @@ -1,23 +0,0 @@ -#include "serious_python.h" - -// A very short-lived native function. -// -// For very short-lived functions, it is fine to call them on the main isolate. -// They will block the Dart execution while running the native function, so -// only do this for native functions which are guaranteed to be short-lived. -FFI_PLUGIN_EXPORT intptr_t sum(intptr_t a, intptr_t b) { return a + b; } - -// A longer-lived native function, which occupies the thread calling it. -// -// Do not call these kind of native functions in the main isolate. They will -// block Dart execution. This will cause dropped frames in Flutter applications. -// Instead, call these native functions on a separate isolate. -FFI_PLUGIN_EXPORT intptr_t sum_long_running(intptr_t a, intptr_t b) { - // Simulate work. -#if _WIN32 - Sleep(5000); -#else - usleep(5000 * 1000); -#endif - return a + b; -} diff --git a/src/serious_python_android/src/serious_python.h b/src/serious_python_android/src/serious_python.h deleted file mode 100644 index 084c6422..00000000 --- a/src/serious_python_android/src/serious_python.h +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -#if _WIN32 -#include -#else -#include -#include -#endif - -#if _WIN32 -#define FFI_PLUGIN_EXPORT __declspec(dllexport) -#else -#define FFI_PLUGIN_EXPORT -#endif - -// A very short-lived native function. -// -// For very short-lived functions, it is fine to call them on the main isolate. -// They will block the Dart execution while running the native function, so -// only do this for native functions which are guaranteed to be short-lived. -FFI_PLUGIN_EXPORT intptr_t sum(intptr_t a, intptr_t b); - -// A longer lived native function, which occupies the thread calling it. -// -// Do not call these kind of native functions in the main isolate. They will -// block Dart execution. This will cause dropped frames in Flutter applications. -// Instead, call these native functions on a separate isolate. -FFI_PLUGIN_EXPORT intptr_t sum_long_running(intptr_t a, intptr_t b); diff --git a/src/serious_python_darwin/CHANGELOG.md b/src/serious_python_darwin/CHANGELOG.md index df4e13d5..0e217db7 100644 --- a/src/serious_python_darwin/CHANGELOG.md +++ b/src/serious_python_darwin/CHANGELOG.md @@ -1,3 +1,10 @@ +## 3.0.0 + +* **In-process Python (dart_bridge FFI).** The Python lifecycle is absorbed into `dart_bridge.xcframework` (from `flet-dev/dart-bridge` **1.4.0**) instead of a socket transport; the Swift plugin registers the dart_bridge inittab, the pod is declared `static_framework` for xcframework vendoring, and the embedded `Python.app` is stripped from `Python.framework`. +* **Breaking change:** requires Flutter **3.44.2**. +* The podspec resolves the Python version from the generated `python_versions.properties` (a snapshot of python-build's `manifest.json`) and passes the full version, build date and `dart_bridge` version to `prepare_ios.sh` / `prepare_macos.sh` (`dart_bridge_version` is `$4`); `SERIOUS_PYTHON_VERSION` is the knob, the per-field env vars are escape hatches. The prepare scripts re-extract `dist_ios` / `dist_macos` when the selected version changes (a version marker) so a clean build can't mix C-extension ABIs. +* Remove the scaffold `getPlatformVersion` method. + ## 2.0.0 * **Breaking change:** default bundled Python version is now 3.14 (was 3.12). Apps built without an explicit `SERIOUS_PYTHON_VERSION` env var pull `python-ios-dart-3.14.tar.gz` / `python-macos-dart-3.14.tar.gz` from `flet-dev/python-build`. Set `SERIOUS_PYTHON_VERSION=3.12` to preserve the previous default. diff --git a/src/serious_python_darwin/darwin/Classes/SeriousPythonPlugin.swift b/src/serious_python_darwin/darwin/Classes/SeriousPythonPlugin.swift index 0c233a3c..07224c3d 100644 --- a/src/serious_python_darwin/darwin/Classes/SeriousPythonPlugin.swift +++ b/src/serious_python_darwin/darwin/Classes/SeriousPythonPlugin.swift @@ -5,10 +5,22 @@ import UIKit import FlutterMacOS #endif -import Python +// Keep-alive references to dart_bridge.xcframework's C entry points. Dart +// resolves them via `DynamicLibrary.process()` at runtime; without these +// static references the host app's linker `-dead_strip` pass could drop +// them even though `-all_load` pulled the archive members in. +@_silgen_name("serious_python_run") +private func _sp_run_keepalive(_ cfg: OpaquePointer?) -> Int32 +@_silgen_name("DartBridge_InitDartApiDL") +private func _sp_init_keepalive(_ data: UnsafeMutableRawPointer?) -> Int +@_silgen_name("DartBridge_EnqueueMessage") +private func _sp_enqueue_keepalive(_ data: UnsafePointer?, _ len: Int) +/// Thin Flutter plugin: surfaces the python.bundle resource path to Dart. +/// All Python lifecycle now lives in `serious_python_run` +/// (dart_bridge.xcframework), invoked from Dart. public class SeriousPythonPlugin: NSObject, FlutterPlugin { - + public static func register(with registrar: FlutterPluginRegistrar) { // Workaround for https://github.com/flutter/flutter/issues/118103. #if os(iOS) @@ -19,118 +31,42 @@ public class SeriousPythonPlugin: NSObject, FlutterPlugin { let channel = FlutterMethodChannel(name: "serious_python", binaryMessenger: messenger) let instance = SeriousPythonPlugin() registrar.addMethodCallDelegate(instance, channel: channel) + + // Static reference to dart_bridge symbols — see top-of-file note. + // The branch is unreachable at runtime (the registrar argument is + // always non-nil), but the linker only sees a live call site. + if unsafeBitCast(registrar, to: Int.self) == 0 { + _ = _sp_run_keepalive(nil) + _ = _sp_init_keepalive(nil) + _sp_enqueue_keepalive(nil, 0) + } } - + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { switch call.method { - case "getPlatformVersion": - #if os(iOS) - result("iOS " + UIDevice.current.systemVersion) - #else - result("macOS " + ProcessInfo.processInfo.operatingSystemVersionString) - #endif - case "runPython": - let args: [String: Any] = call.arguments as? [String: Any] ?? [:] - let appPath = args["appPath"] as! String - let script = args["script"] as? String - let modulePaths = args["modulePaths"] as? [String] ?? [] - let envVars = args["environmentVariables"] as? [String:String] ?? [:] - let sync = args["sync"] as? Bool ?? false - - NSLog("Swift runPython(appPath: \(appPath), modulePaths: \(modulePaths))") - - let appDir = URL(fileURLWithPath: appPath).deletingLastPathComponent().path - - // bundle root path + case "getResourcePath": + // The python.bundle that prepare_{ios,macos}.sh assembles ends up + // inside this plugin's framework bundle as a Resources subbundle. + // Dart calls this to discover the stdlib / site-packages layout + // before invoking `serious_python_run`. guard let frameworkBundle = Bundle(for: type(of: self)).resourceURL else { - result(FlutterError(code: "FRAMEWORK_BUNDLE_ERROR", - message: "Failed to get framework resource URL", + result(FlutterError(code: "FRAMEWORK_BUNDLE_ERROR", + message: "Failed to get framework resource URL", details: nil)) return } - let pythonBundleURL = frameworkBundle.appendingPathComponent("python.bundle") - - guard let pythonBundle = Bundle(url: pythonBundleURL) else { - result(FlutterError(code: "PYTHON_BUNDLE_ERROR", - message: "Failed to load Python bundle", + guard let pythonBundle = Bundle(url: pythonBundleURL), + let resourcePath = pythonBundle.resourcePath else { + result(FlutterError(code: "PYTHON_BUNDLE_ERROR", + message: "Failed to load python.bundle", details: pythonBundleURL.path)) return } + result(resourcePath) - guard let resourcePath = pythonBundle.resourcePath else { - result(FlutterError(code: "RESOURCE_PATH_ERROR", - message: "Failed to locate Python bundle resources", - details: nil)) - return - } - - let pythonPaths: [String] = modulePaths + [ - appDir, - "\(appDir)/__pypackages__", - "\(resourcePath)/site-packages", - "\(resourcePath)/stdlib", - "\(resourcePath)/stdlib/lib-dynload" - ] - - setenv("PYTHONINSPECT", "1", 1) - setenv("PYTHONDONTWRITEBYTECODE", "1", 1) - setenv("PYTHONNOUSERSITE", "1", 1) - setenv("PYTHONUNBUFFERED", "1", 1) - setenv("LC_CTYPE", "UTF-8", 1) - setenv("PYTHONHOME", resourcePath, 1) - setenv("PYTHONPATH", pythonPaths.joined(separator: ":"), 1) - - // custom env vars - envVars.forEach {v in - setenv(v.key, v.value, 1) - } - - // run program either sync or in a thread - if (sync) { - if (script == nil) { - runPythonFile(appPath: appPath) - } else { - runPythonScript(script: script!) - } - } else { - if (script == nil) { - let t = Thread(target: self, selector: #selector(runPythonFile), object: appPath) - t.start() - } else { - let t = Thread(target: self, selector: #selector(runPythonScript), object: script!) - t.start() - } - } - - result(nil) default: result(FlutterMethodNotImplemented) } } - - @objc func runPythonFile(appPath: String) { - Py_Initialize() - - // run app - let file = fopen(appPath, "r") - let result = PyRun_SimpleFileEx(file, appPath, 1) - if (result != 0) { - print("Python program completed with error.") - } - - Py_Finalize() - } - - @objc func runPythonScript(script: String) { - Py_Initialize() - - // run app - let result = PyRun_SimpleString(script) - if (result != 0) { - print("Python script completed with error.") - } - - Py_Finalize() - } } diff --git a/src/serious_python_darwin/darwin/prepare_ios.sh b/src/serious_python_darwin/darwin/prepare_ios.sh index 9242b021..817ae1ae 100755 --- a/src/serious_python_darwin/darwin/prepare_ios.sh +++ b/src/serious_python_darwin/darwin/prepare_ios.sh @@ -1,17 +1,55 @@ python_version=${1:?} +python_full_version=${2:?} +python_build_date=${3:?} +# dart-bridge release (flet-dev/dart-bridge), passed in from the version table. +# The xcframework is abi3 and CPython-version-independent — one binary covers +# all 3.12+ Python versions. +dart_bridge_version=${4:?} script_dir=$(cd "$(dirname "$0")" && pwd -P) dist=$script_dir/dist_ios -if [ ! -d "$dist" ]; then - mkdir -p $dist +# Cross-plugin download cache; see prepare_macos.sh for the convention. +cache_root="${FLET_CACHE_DIR:-$HOME/.flet/cache}" +pb_cache="$cache_root/python-build/v$python_full_version" +db_cache="$cache_root/dart-bridge/v$dart_bridge_version" +mkdir -p "$pb_cache" "$db_cache" - python_ios_dist_file="python-ios-dart-$python_version.tar.gz" - python_ios_dist_url="https://github.com/flet-dev/python-build/releases/download/v$python_version/$python_ios_dist_file" +# ---- flet-dev/python-build (iOS embedded Python runtime) ------------------ +python_ios_dist_file="python-ios-dart-$python_full_version.tar.gz" +python_ios_dist_path="$pb_cache/$python_ios_dist_file" +if [ ! -f "$python_ios_dist_path" ]; then + python_ios_dist_url="https://github.com/flet-dev/python-build/releases/download/$python_build_date/$python_ios_dist_file" + curl -fL -o "$python_ios_dist_path.tmp" "$python_ios_dist_url" + mv "$python_ios_dist_path.tmp" "$python_ios_dist_path" +fi - # download iOS dist - curl -LO $python_ios_dist_url - tar -xzf $python_ios_dist_file -C $dist - mv $dist/python-stdlib $dist/stdlib - rm $python_ios_dist_file -fi \ No newline at end of file +# Re-extract when $dist is missing OR was assembled for a different Python +# version. The guard used to be `[ ! -d "$dist" ]`, which left a stale dist_ios +# from a previous Python version in place — e.g. bundling 3.12 under 3.14 +# site-packages, which trips C-extension ABI errors ("unknown slot ID") at +# import. A version marker keys the extracted dist to $python_full_version. +marker="$dist/.python_full_version" +if [ ! -d "$dist" ] || [ "$(cat "$marker" 2>/dev/null)" != "$python_full_version" ]; then + rm -rf "$dist" + mkdir -p "$dist" + tar -xzf "$python_ios_dist_path" -C "$dist" + mv "$dist/python-stdlib" "$dist/stdlib" + echo "$python_full_version" > "$marker" +fi + +# ---- flet-dev/dart-bridge (xcframework) ----------------------------------- +# Separate cache guard so a stale $dist from before this change still picks +# up the new artifact on first re-prepare. +dart_bridge_file="dart_bridge-apple.xcframework.zip" +dart_bridge_path="$db_cache/$dart_bridge_file" +if [ ! -f "$dart_bridge_path" ]; then + dart_bridge_url="https://github.com/flet-dev/dart-bridge/releases/download/v$dart_bridge_version/$dart_bridge_file" + curl -fL -o "$dart_bridge_path.tmp" "$dart_bridge_url" + mv "$dart_bridge_path.tmp" "$dart_bridge_path" +fi + +if [ ! -d "$dist/xcframeworks/dart_bridge.xcframework" ]; then + mkdir -p "$dist/xcframeworks" + unzip -q "$dart_bridge_path" -d "$dist/xcframeworks/" +fi diff --git a/src/serious_python_darwin/darwin/prepare_macos.sh b/src/serious_python_darwin/darwin/prepare_macos.sh index ecba57d2..1e4479ce 100755 --- a/src/serious_python_darwin/darwin/prepare_macos.sh +++ b/src/serious_python_darwin/darwin/prepare_macos.sh @@ -1,17 +1,68 @@ python_version=${1:?} +python_full_version=${2:?} +python_build_date=${3:?} +# dart-bridge release (flet-dev/dart-bridge), passed in from the version table. +# Same xcframework is reused across iOS and macOS — it carries slices for both. +dart_bridge_version=${4:?} script_dir=$(cd "$(dirname "$0")" && pwd -P) dist=$script_dir/dist_macos -if [ ! -d "$dist" ]; then - mkdir -p $dist +# Cross-plugin download cache. FLET_CACHE_DIR is the same env var the Android +# gradle task + flet build's external tooling already use; ~/.flet/cache is +# the shared default. Tarballs land here and survive `flutter clean`. +cache_root="${FLET_CACHE_DIR:-$HOME/.flet/cache}" +pb_cache="$cache_root/python-build/v$python_full_version" +db_cache="$cache_root/dart-bridge/v$dart_bridge_version" +mkdir -p "$pb_cache" "$db_cache" - python_macos_dist_file="python-macos-dart-$python_version.tar.gz" - python_macos_dist_url="https://github.com/flet-dev/python-build/releases/download/v$python_version/$python_macos_dist_file" +# ---- flet-dev/python-build (macOS embedded Python runtime) ---------------- +python_macos_dist_file="python-macos-dart-$python_full_version.tar.gz" +python_macos_dist_path="$pb_cache/$python_macos_dist_file" +if [ ! -f "$python_macos_dist_path" ]; then + python_macos_dist_url="https://github.com/flet-dev/python-build/releases/download/$python_build_date/$python_macos_dist_file" + # .tmp + mv so a Ctrl-C / network blip doesn't poison the cache. + curl -fL -o "$python_macos_dist_path.tmp" "$python_macos_dist_url" + mv "$python_macos_dist_path.tmp" "$python_macos_dist_path" +fi - # download macos dist - curl -LO $python_macos_dist_url - tar -xzf $python_macos_dist_file -C $dist - mv $dist/python-stdlib $dist/stdlib - rm $python_macos_dist_file -fi \ No newline at end of file +# Re-extract when $dist is missing OR was assembled for a different Python +# version. The guard used to be `[ ! -d "$dist" ]`, which left a stale dist_macos +# from a previous Python version in place — e.g. bundling 3.12 under 3.14 +# site-packages, which trips C-extension ABI errors ("unknown slot ID") at +# import. A version marker keys the extracted dist to $python_full_version. +marker="$dist/.python_full_version" +if [ ! -d "$dist" ] || [ "$(cat "$marker" 2>/dev/null)" != "$python_full_version" ]; then + rm -rf "$dist" + mkdir -p "$dist" + tar -xzf "$python_macos_dist_path" -C "$dist" + mv "$dist/python-stdlib" "$dist/stdlib" + + # python-build-standalone bakes a standalone launcher Python.app into + # Python.framework/Versions//Resources/. Its Mach-O has a hardcoded + # load command pointing at the CI runner's build path + # (/Users/runner/work/python-build/.../Python.framework/Versions/X.Y/Python), + # so DYLD can't resolve it on any other machine. When the host .app is + # built, macOS LaunchServices scans nested .app bundles and tries to + # launch this Python.app — every scan produces a "Python quit + # unexpectedly" crash dialog. We don't need this launcher for embedded + # use; libdart_bridge dlopens Python.framework's main binary directly. + find "$dist/xcframeworks" -type d -name 'Python.app' -prune -exec rm -rf {} + + echo "$python_full_version" > "$marker" +fi + +# ---- flet-dev/dart-bridge (xcframework, same archive for macOS + iOS) ----- +# Separate cache guard so a stale $dist from before this change still picks +# up the new artifact on first re-prepare. +dart_bridge_file="dart_bridge-apple.xcframework.zip" +dart_bridge_path="$db_cache/$dart_bridge_file" +if [ ! -f "$dart_bridge_path" ]; then + dart_bridge_url="https://github.com/flet-dev/dart-bridge/releases/download/v$dart_bridge_version/$dart_bridge_file" + curl -fL -o "$dart_bridge_path.tmp" "$dart_bridge_url" + mv "$dart_bridge_path.tmp" "$dart_bridge_path" +fi + +if [ ! -d "$dist/xcframeworks/dart_bridge.xcframework" ]; then + mkdir -p "$dist/xcframeworks" + unzip -q "$dart_bridge_path" -d "$dist/xcframeworks/" +fi diff --git a/src/serious_python_darwin/darwin/python_versions.properties b/src/serious_python_darwin/darwin/python_versions.properties new file mode 100644 index 00000000..7cc4bbe2 --- /dev/null +++ b/src/serious_python_darwin/darwin/python_versions.properties @@ -0,0 +1,8 @@ +# GENERATED by `dart run serious_python:gen_version_tables` from +# python-build manifest.json (release 20260614). Do not edit by hand. +default_python_version=3.14 +dart_bridge_version=1.4.0 +python_build_release_date=20260614 +3.12.full_version=3.12.13 +3.13.full_version=3.13.14 +3.14.full_version=3.14.6 diff --git a/src/serious_python_darwin/darwin/serious_python_darwin.podspec b/src/serious_python_darwin/darwin/serious_python_darwin.podspec index 3be1282b..809d0bd8 100644 --- a/src/serious_python_darwin/darwin/serious_python_darwin.podspec +++ b/src/serious_python_darwin/darwin/serious_python_darwin.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'serious_python_darwin' - s.version = '2.0.0' + s.version = '3.0.0' s.summary = 'A cross-platform plugin for adding embedded Python runtime to your Flutter apps.' s.description = <<-DESC A cross-platform plugin for adding embedded Python runtime to your Flutter apps. @@ -13,7 +13,12 @@ Pod::Spec.new do |s| s.license = { :file => '../LICENSE' } s.author = { 'Appveyor Systems Inc.' => 'hello@flet.dev' } s.source = { :path => '.' } - #s.static_framework = true + # dart_bridge.xcframework (vendored below) contains static .a archives. + # CocoaPods 1.16+ refuses to install vendored xcframeworks with static + # libraries unless the consuming pod is itself declared as a static + # framework. Python.xcframework is also static, so this was always + # implicitly the case — just being explicit now. + s.static_framework = true s.source_files = ['Classes/**/*'] s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' @@ -27,15 +32,30 @@ Pod::Spec.new do |s| } s.swift_version = '5.0' - python_version = ENV['SERIOUS_PYTHON_VERSION'] || "3.14" + # Python runtime versions come from the generated python_versions.properties + # (a snapshot of python-build's manifest.json — see serious_python's + # `gen_version_tables`). SERIOUS_PYTHON_VERSION selects the version; the rest + # derive from the table. The per-field env vars are escape hatches. + pv = {} + File.foreach(File.join(__dir__, 'python_versions.properties')) do |line| + line = line.strip + next if line.empty? || line.start_with?('#') + k, v = line.split('=', 2) + pv[k] = v + end + python_version = ENV['SERIOUS_PYTHON_VERSION'] || pv['default_python_version'] + python_full_version = ENV['SERIOUS_PYTHON_FULL_VERSION'] || pv["#{python_version}.full_version"] + python_build_date = ENV['SERIOUS_PYTHON_BUILD_DATE'] || pv['python_build_release_date'] + dart_bridge_version = ENV['DART_BRIDGE_VERSION'] || pv['dart_bridge_version'] + raise "serious_python: unknown SERIOUS_PYTHON_VERSION '#{python_version}'" if python_full_version.nil? dist_ios = "dist_ios" dist_macos = "dist_macos" prepare_command = <<-CMD ./symlink_pod.sh - ./prepare_ios.sh #{python_version} - ./prepare_macos.sh #{python_version} + ./prepare_ios.sh #{python_version} #{python_full_version} #{python_build_date} #{dart_bridge_version} + ./prepare_macos.sh #{python_version} #{python_full_version} #{python_build_date} #{dart_bridge_version} ./sync_site_packages.sh CMD diff --git a/src/serious_python_darwin/darwin/sync_site_packages.sh b/src/serious_python_darwin/darwin/sync_site_packages.sh index 4864d631..82d99374 100755 --- a/src/serious_python_darwin/darwin/sync_site_packages.sh +++ b/src/serious_python_darwin/darwin/sync_site_packages.sh @@ -43,7 +43,16 @@ if [[ -n "$SERIOUS_PYTHON_SITE_PACKAGES" && -d "$SERIOUS_PYTHON_SITE_PACKAGES" ] dist=$script_dir/dist_macos mkdir -p $dist/site-packages - rsync -av --delete "$SERIOUS_PYTHON_SITE_PACKAGES/" "$dist/site-packages/" + # Exclude the .pod symlink created by symlink_pod.sh — it points at + # this plugin's source tree. If it lands in dist_macos/site-packages, + # CocoaPods packages it into the production .app, where macOS + # LaunchServices finds the embedded Python.app inside the symlinked + # Python.xcframework and tries to launch it (DYLD failure, repeated + # crash report popups), and `flet build`'s copy_tree follows the + # symlink into a code-signed source tree and hits EPERM on every + # file. .pod is only needed by package_command.dart at packaging + # time to invoke this sync script; it does not belong in the bundle. + rsync -av --delete --exclude '.pod' "$SERIOUS_PYTHON_SITE_PACKAGES/" "$dist/site-packages/" fi else echo "SERIOUS_PYTHON_SITE_PACKAGES is not set." diff --git a/src/serious_python_darwin/lib/serious_python_darwin.dart b/src/serious_python_darwin/lib/serious_python_darwin.dart index 3392ba34..bc68da36 100644 --- a/src/serious_python_darwin/lib/serious_python_darwin.dart +++ b/src/serious_python_darwin/lib/serious_python_darwin.dart @@ -1,38 +1,70 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; +import 'package:path/path.dart' as p; import 'package:serious_python_platform_interface/serious_python_platform_interface.dart'; -/// An implementation of [SeriousPythonPlatform] that uses method channels. +/// iOS / macOS implementation of [SeriousPythonPlatform]. +/// +/// Python lifecycle (env, sys.path, Py_Initialize, run, finalize, sync/async) +/// lives in `serious_python_run`, statically linked into the host app via +/// dart_bridge.xcframework. This class just resolves the python.bundle +/// resource path from the Swift plugin and dispatches a single FFI call. class SeriousPythonDarwin extends SeriousPythonPlatform { - /// The method channel used to interact with the native platform. @visibleForTesting final methodChannel = const MethodChannel('serious_python'); - /// Registers this class as the default instance of [SeriousPythonPlatform] static void registerWith() { SeriousPythonPlatform.instance = SeriousPythonDarwin(); } - @override - Future getPlatformVersion() async { - final version = - await methodChannel.invokeMethod('getPlatformVersion'); - return version; - } - @override Future run(String appPath, {String? script, List? modulePaths, Map? environmentVariables, bool? sync}) async { - final Map arguments = { - 'appPath': appPath, - 'script': script, - 'modulePaths': modulePaths, - 'environmentVariables': environmentVariables, - 'sync': sync + final resourcePath = + await methodChannel.invokeMethod('getResourcePath'); + if (resourcePath == null) { + throw StateError( + 'serious_python: failed to resolve plugin resource path'); + } + + final appDir = p.dirname(appPath); + final pythonPaths = [ + ...?modulePaths, + appDir, + p.join(appDir, '__pypackages__'), + p.join(resourcePath, 'site-packages'), + p.join(resourcePath, 'stdlib'), + p.join(resourcePath, 'stdlib', 'lib-dynload'), + ]; + + final env = { + 'PYTHONINSPECT': '1', + 'PYTHONDONTWRITEBYTECODE': '1', + 'PYTHONNOUSERSITE': '1', + 'PYTHONUNBUFFERED': '1', + 'LC_CTYPE': 'UTF-8', + 'PYTHONHOME': resourcePath, + 'PYTHONPATH': pythonPaths.join(':'), + ...?environmentVariables, }; - return await methodChannel.invokeMethod('runPython', arguments); + + final rc = runPython( + bridge: DartBridge.instance, + appPath: script == null ? appPath : null, + script: script, + modulePaths: pythonPaths, + environmentVariables: env, + sync: sync ?? false, + ); + + // sync=true: rc is the Python exit code. sync=false: rc is the spawn + // result (0 = worker thread started successfully). + if (rc != 0) { + return 'Python exited with code $rc'; + } + return null; } } diff --git a/src/serious_python_darwin/pubspec.yaml b/src/serious_python_darwin/pubspec.yaml index e2b781e2..0252505e 100644 --- a/src/serious_python_darwin/pubspec.yaml +++ b/src/serious_python_darwin/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_darwin description: iOS and macOS implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 2.0.0 +version: 3.0.0 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_linux/CHANGELOG.md b/src/serious_python_linux/CHANGELOG.md index 04fc548a..d1341a8e 100644 --- a/src/serious_python_linux/CHANGELOG.md +++ b/src/serious_python_linux/CHANGELOG.md @@ -1,3 +1,10 @@ +## 3.0.0 + +* **In-process Python (dart_bridge FFI).** The Python lifecycle is absorbed into `libdart_bridge.so` (from `flet-dev/dart-bridge` **1.4.0**, `DT_RPATH $ORIGIN`) instead of a socket transport. +* **Breaking change:** requires Flutter **3.44.2**. +* `CMakeLists.txt` resolves the Python version from the generated `python_versions.properties` (a snapshot of python-build's `manifest.json`): `SERIOUS_PYTHON_VERSION` selects the version; the full version and build date derive from the table, with `SERIOUS_PYTHON_FULL_VERSION` / `SERIOUS_PYTHON_BUILD_DATE` left as escape hatches. Downloads continue to use python-build's date-keyed release scheme. +* Remove the scaffold `getPlatformVersion` method. + ## 2.0.0 * **Breaking change:** default bundled Python version is now 3.14 (was 3.12). The plugin downloads `python-linux-dart-3.14-.tar.gz` from `flet-dev/python-build` and bundles `libpython3.14.so.1.0` unless `SERIOUS_PYTHON_VERSION=3.12` is set in the build environment. diff --git a/src/serious_python_linux/lib/serious_python_linux.dart b/src/serious_python_linux/lib/serious_python_linux.dart index c76ab176..fee2ac94 100644 --- a/src/serious_python_linux/lib/serious_python_linux.dart +++ b/src/serious_python_linux/lib/serious_python_linux.dart @@ -1,42 +1,79 @@ import 'dart:io'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; +import 'package:path/path.dart' as p; import 'package:serious_python_platform_interface/serious_python_platform_interface.dart'; +/// Linux implementation of [SeriousPythonPlatform]. +/// +/// Python lifecycle (env, sys.path, Py_Initialize, run, finalize, sync/async) +/// lives in `serious_python_run`, packaged as `libdart_bridge.so` and +/// downloaded by the plugin's CMakeLists.txt from +/// flet-dev/dart-bridge's GitHub Releases. +/// +/// At runtime this class: +/// 1. Derives PYTHONHOME from `Platform.resolvedExecutable` (where the +/// bundled CPython stdlib lives, alongside the runner .exe). +/// 2. Locates the `python3.` stdlib subdir by scanning the exe dir +/// (the actual minor version is fixed at build time but the Dart side +/// doesn't have a compile-time constant for it). +/// 3. Hands env + sys.path to `serious_python_run` in a single FFI call. class SeriousPythonLinux extends SeriousPythonPlatform { - /// The method channel used to interact with the native platform. - @visibleForTesting - final methodChannel = const MethodChannel('serious_python_linux'); - - /// Registers this class as the default instance of [SeriousPythonPlatform] static void registerWith() { SeriousPythonPlatform.instance = SeriousPythonLinux(); } - @override - Future getPlatformVersion() async { - final version = - await methodChannel.invokeMethod('getPlatformVersion'); - return "$version ${Platform.resolvedExecutable}"; - } - @override Future run(String appPath, {String? script, List? modulePaths, Map? environmentVariables, bool? sync}) async { - final Map arguments = { - 'exePath': Platform.resolvedExecutable, - 'appPath': appPath, - 'modulePaths': modulePaths, - 'environmentVariables': environmentVariables, - 'sync': sync + final exeDir = p.dirname(Platform.resolvedExecutable); + final appDir = p.dirname(appPath); + final stdlibDir = _resolvePythonStdlibDir(exeDir); + + final pythonPaths = [ + ...?modulePaths, + appDir, + p.join(appDir, '__pypackages__'), + p.join(exeDir, 'site-packages'), + stdlibDir, + ]; + + final env = { + 'PYTHONINSPECT': '1', + 'PYTHONDONTWRITEBYTECODE': '1', + 'PYTHONNOUSERSITE': '1', + 'PYTHONUNBUFFERED': '1', + 'LC_CTYPE': 'UTF-8', + 'PYTHONHOME': exeDir, + 'PYTHONPATH': pythonPaths.join(':'), + ...?environmentVariables, }; - if (script != null) { - arguments['script'] = script; - } - return await methodChannel.invokeMethod('runPython', arguments); + + final rc = runPython( + bridge: DartBridge.instance, + appPath: script == null ? appPath : null, + script: script, + modulePaths: pythonPaths, + environmentVariables: env, + sync: sync ?? false, + ); + + // sync=true: rc is the Python exit code. sync=false: rc is the spawn + // result (0 = worker thread started successfully). + return rc != 0 ? 'Python exited with code $rc' : null; + } + + /// The Linux CMakeLists installs the python stdlib at + /// `/python`. Find the right subdir by name pattern. + static String _resolvePythonStdlibDir(String exeDir) { + final pattern = RegExp(r'^python3\.\d+$'); + final match = Directory(exeDir).listSync().whereType().firstWhere( + (d) => pattern.hasMatch(p.basename(d.path)), + orElse: () => throw StateError( + 'serious_python: no python3. stdlib dir found under $exeDir'), + ); + return match.path; } } diff --git a/src/serious_python_linux/linux/CMakeLists.txt b/src/serious_python_linux/linux/CMakeLists.txt index 89f6eb65..a7e27c3d 100644 --- a/src/serious_python_linux/linux/CMakeLists.txt +++ b/src/serious_python_linux/linux/CMakeLists.txt @@ -8,26 +8,107 @@ cmake_minimum_required(VERSION 3.10) # Project-level configuration. set(PROJECT_NAME "serious_python_linux") +# Python runtime versions come from the generated python_versions.properties +# (a snapshot of python-build's manifest.json — see serious_python's +# gen_version_tables). SERIOUS_PYTHON_VERSION selects the version; the rest +# derive from the table. The per-field env vars are escape hatches. +set(_PV_FILE "${CMAKE_CURRENT_LIST_DIR}/python_versions.properties") +function(pv_get key out) + string(REPLACE "." "\\." _re "${key}") + file(STRINGS "${_PV_FILE}" _m REGEX "^${_re}=") + if(_m) + string(REGEX REPLACE "^[^=]*=" "" _v "${_m}") + set(${out} "${_v}" PARENT_SCOPE) + else() + set(${out} "" PARENT_SCOPE) + endif() +endfunction() + if(DEFINED ENV{SERIOUS_PYTHON_VERSION}) set(PYTHON_VERSION "$ENV{SERIOUS_PYTHON_VERSION}") else() - set(PYTHON_VERSION "3.14") + pv_get("default_python_version" PYTHON_VERSION) +endif() +if(DEFINED ENV{SERIOUS_PYTHON_FULL_VERSION}) + set(PYTHON_FULL_VERSION "$ENV{SERIOUS_PYTHON_FULL_VERSION}") +else() + pv_get("${PYTHON_VERSION}.full_version" PYTHON_FULL_VERSION) +endif() +if(DEFINED ENV{SERIOUS_PYTHON_BUILD_DATE}) + set(PYTHON_BUILD_DATE "$ENV{SERIOUS_PYTHON_BUILD_DATE}") +else() + pv_get("python_build_release_date" PYTHON_BUILD_DATE) endif() set(PYTHON_ARCH ${CMAKE_HOST_SYSTEM_PROCESSOR}) +if(DEFINED ENV{DART_BRIDGE_VERSION}) + set(DART_BRIDGE_VERSION "$ENV{DART_BRIDGE_VERSION}") +else() + pv_get("dart_bridge_version" DART_BRIDGE_VERSION) +endif() +if(PYTHON_FULL_VERSION STREQUAL "") + message(FATAL_ERROR "serious_python: unknown SERIOUS_PYTHON_VERSION '${PYTHON_VERSION}'") +endif() + +# Cross-plugin download cache. FLET_CACHE_DIR is the same env var used by the +# Android gradle task, the Darwin prepare_*.sh scripts, and Windows +# CMakeLists; defaulting to ~/.flet/cache keeps a single shared location. +if(DEFINED ENV{FLET_CACHE_DIR}) + set(FLET_CACHE_DIR "$ENV{FLET_CACHE_DIR}") +else() + set(FLET_CACHE_DIR "$ENV{HOME}/.flet/cache") +endif() +set(PB_CACHE "${FLET_CACHE_DIR}/python-build/v${PYTHON_FULL_VERSION}") +set(DB_CACHE "${FLET_CACHE_DIR}/dart-bridge/v${DART_BRIDGE_VERSION}") +file(MAKE_DIRECTORY "${PB_CACHE}" "${DB_CACHE}") + project(${PROJECT_NAME} LANGUAGES CXX) # This value is used when generating builds using this plugin, so it must # not be changed. set(PLUGIN_NAME "serious_python_linux_plugin") +function(_sp_download url dest) + if(EXISTS "${dest}") + return() + endif() + message(STATUS "Downloading: ${url}") + # .tmp + rename so a Ctrl-C / network blip doesn't poison the cache. + file(DOWNLOAD "${url}" "${dest}.tmp" STATUS _dl_status SHOW_PROGRESS) + list(GET _dl_status 0 _dl_code) + list(GET _dl_status 1 _dl_message) + if(NOT _dl_code EQUAL 0) + file(REMOVE "${dest}.tmp") + message(FATAL_ERROR "Failed to download ${url}: ${_dl_message}") + endif() + file(RENAME "${dest}.tmp" "${dest}") +endfunction() + +# ---- python-linux-dart tarball (libpython + stdlib) ----------------------- +# Tarball lives in the shared cache; extraction targets the per-plugin build +# tree so a `flutter clean` doesn't force a re-download. set(PYTHON_PACKAGE ${CMAKE_BINARY_DIR}/python) -set(PYTHON_URL https://github.com/flet-dev/python-build/releases/download/v${PYTHON_VERSION}/python-linux-dart-${PYTHON_VERSION}-${PYTHON_ARCH}.tar.gz) -set(PYTHON_FILE ${CMAKE_BINARY_DIR}/python-linux-dart-${PYTHON_VERSION}-${PYTHON_ARCH}.tar.gz) -if (NOT EXISTS ${PYTHON_FILE}) - file(DOWNLOAD ${PYTHON_URL} ${PYTHON_FILE}) - file(ARCHIVE_EXTRACT INPUT ${PYTHON_FILE} DESTINATION ${CMAKE_BINARY_DIR}/python) +set(PYTHON_URL https://github.com/flet-dev/python-build/releases/download/${PYTHON_BUILD_DATE}/python-linux-dart-${PYTHON_FULL_VERSION}-${PYTHON_ARCH}.tar.gz) +set(PYTHON_FILE "${PB_CACHE}/python-linux-dart-${PYTHON_FULL_VERSION}-${PYTHON_ARCH}.tar.gz") +_sp_download("${PYTHON_URL}" "${PYTHON_FILE}") +if(NOT EXISTS "${PYTHON_PACKAGE}/lib/libpython3.so") + file(ARCHIVE_EXTRACT INPUT "${PYTHON_FILE}" DESTINATION "${PYTHON_PACKAGE}") endif() +# ---- dart_bridge prebuilt .so --------------------------------------------- +# abi3-linked against libpython3.so (the runtime linker finds libpython3.so +# next to the consuming app's exe; the python-linux-dart tarball above +# provides it). Cached under its arch-qualified name so multiple arches can +# co-exist in $FLET_CACHE_DIR; copied to a stable `libdart_bridge.so` in the +# build tree so Flutter's bundled_libraries machinery (and the Dart side's +# DynamicLibrary.open("libdart_bridge.so")) finds a deterministic name. +set(DART_BRIDGE_CACHED "${DB_CACHE}/libdart_bridge-linux-${PYTHON_ARCH}.so") +_sp_download( + "https://github.com/flet-dev/dart-bridge/releases/download/v${DART_BRIDGE_VERSION}/libdart_bridge-linux-${PYTHON_ARCH}.so" + "${DART_BRIDGE_CACHED}") +set(DART_BRIDGE_SO "${CMAKE_BINARY_DIR}/dart_bridge/libdart_bridge.so") +file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/dart_bridge") +configure_file("${DART_BRIDGE_CACHED}" "${DART_BRIDGE_SO}" COPYONLY) + # Any new source files that you add to the plugin should be added here. list(APPEND PLUGIN_SOURCES "serious_python_linux_plugin.cc" @@ -50,28 +131,23 @@ apply_standard_settings(${PLUGIN_NAME}) set_target_properties(${PLUGIN_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden) target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) -target_compile_definitions(${PLUGIN_NAME} PRIVATE - SERIOUS_PYTHON_VERSION="${PYTHON_VERSION}") # Source include directories and library dependencies. Add any plugin-specific # dependencies here. target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include" ) -include_directories( - "${PYTHON_PACKAGE}/include/python${PYTHON_VERSION}" -) target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) -target_link_libraries(${PLUGIN_NAME} PRIVATE - "${PYTHON_PACKAGE}/lib/libpython3.so" -) # List of absolute paths to libraries that should be bundled with the plugin. -# This list could contain prebuilt libraries, or libraries created by an -# external build triggered from this build file. +# Includes libdart_bridge.so (downloaded above) so Flutter copies it into the +# runner's lib/ dir; libpython3.so + libpython.so.1.0 from the python- +# linux-dart tarball so dart_bridge's DT_NEEDED libpython3.so resolves at +# runtime to the abi3 stub which forwards to the version-specific lib. set(serious_python_linux_bundled_libraries + "${DART_BRIDGE_SO}" "${PYTHON_PACKAGE}/lib/libpython3.so" "${PYTHON_PACKAGE}/lib/libpython${PYTHON_VERSION}.so.1.0" PARENT_SCOPE @@ -80,8 +156,13 @@ set(serious_python_linux_bundled_libraries install(DIRECTORY "${PYTHON_PACKAGE}/lib/python${PYTHON_VERSION}" DESTINATION "${CMAKE_BINARY_DIR}/bundle") -install(CODE " - file(REMOVE_RECURSE \"${CMAKE_BINARY_DIR}/bundle/site-packages\") - file(MAKE_DIRECTORY \"${CMAKE_BINARY_DIR}/bundle/site-packages\") - file(COPY \"$ENV{SERIOUS_PYTHON_SITE_PACKAGES}/\" DESTINATION \"${CMAKE_BINARY_DIR}/bundle/site-packages\") -") \ No newline at end of file +# Mirror an external site-packages dir into the bundle if the env var is set +# AND points at an existing directory. The env var may be set workflow-wide +# while specific jobs don't actually create the directory. +if(DEFINED ENV{SERIOUS_PYTHON_SITE_PACKAGES} AND EXISTS "$ENV{SERIOUS_PYTHON_SITE_PACKAGES}") + install(CODE " + file(REMOVE_RECURSE \"${CMAKE_BINARY_DIR}/bundle/site-packages\") + file(MAKE_DIRECTORY \"${CMAKE_BINARY_DIR}/bundle/site-packages\") + file(COPY \"$ENV{SERIOUS_PYTHON_SITE_PACKAGES}/\" DESTINATION \"${CMAKE_BINARY_DIR}/bundle/site-packages\") + ") +endif() diff --git a/src/serious_python_linux/linux/python_versions.properties b/src/serious_python_linux/linux/python_versions.properties new file mode 100644 index 00000000..7cc4bbe2 --- /dev/null +++ b/src/serious_python_linux/linux/python_versions.properties @@ -0,0 +1,8 @@ +# GENERATED by `dart run serious_python:gen_version_tables` from +# python-build manifest.json (release 20260614). Do not edit by hand. +default_python_version=3.14 +dart_bridge_version=1.4.0 +python_build_release_date=20260614 +3.12.full_version=3.12.13 +3.13.full_version=3.13.14 +3.14.full_version=3.14.6 diff --git a/src/serious_python_linux/linux/serious_python_linux_plugin.cc b/src/serious_python_linux/linux/serious_python_linux_plugin.cc index 33d4970d..e96f9191 100644 --- a/src/serious_python_linux/linux/serious_python_linux_plugin.cc +++ b/src/serious_python_linux/linux/serious_python_linux_plugin.cc @@ -2,22 +2,9 @@ #include #include -#include -#include -#include - -#include "serious_python_linux_plugin_private.h" - -#include - -// Defined by linux/CMakeLists.txt to match the bundled libpython -// (e.g. "3.13"). The fallback only matters if this file is ever compiled -// outside the plugin's own CMake — defaults to the same version CMakeLists -// falls back to when SERIOUS_PYTHON_VERSION env var is unset. -#ifndef SERIOUS_PYTHON_VERSION -#define SERIOUS_PYTHON_VERSION "3.14" -#endif +// Plugin-registration shell only — all method calls return NotImplemented. +// Python lifecycle lives in libdart_bridge.so, invoked from Dart via FFI. #define SERIOUS_PYTHON_LINUX_PLUGIN(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), serious_python_linux_plugin_get_type(), \ @@ -30,204 +17,15 @@ struct _SeriousPythonLinuxPlugin G_DEFINE_TYPE(SeriousPythonLinuxPlugin, serious_python_linux_plugin, g_object_get_type()) -// Called when a method call is received from Flutter. static void serious_python_linux_plugin_handle_method_call( SeriousPythonLinuxPlugin *self, FlMethodCall *method_call) { - g_autoptr(FlMethodResponse) response = nullptr; - - const gchar *method = fl_method_call_get_name(method_call); - FlValue *args = fl_method_call_get_args(method_call); - - if (strcmp(method, "getPlatformVersion") == 0) - { - response = get_platform_version(); - } - else if (strcmp(method, "runPython") == 0) - { - if (fl_value_get_type(args) != FL_VALUE_TYPE_MAP) - { - return; - } - - // exePath - FlValue *exe_path = fl_value_lookup_string(args, "exePath"); - if (exe_path == nullptr) - { - return; - } - - gchar *exe_dir = g_path_get_dirname(fl_value_to_string(exe_path)); - - // appPath - FlValue *app_path = fl_value_lookup_string(args, "appPath"); - if (app_path == nullptr) - { - return; - } - - gchar *app_dir = g_path_get_dirname(fl_value_to_string(app_path)); - - // script - FlValue *script = fl_value_lookup_string(args, "script"); - - // sync - bool sync = false; - g_autoptr(FlValue) sync_key = fl_value_new_string("sync"); - FlValue *sync_value = fl_value_lookup(args, sync_key); - if (sync_value != nullptr && fl_value_get_type(sync_value) == FL_VALUE_TYPE_BOOL) - { - sync = fl_value_get_bool(sync_value); - } - - // modulePaths - size_t module_paths_size = 0; - - g_autoptr(FlValue) module_paths_key = fl_value_new_string("modulePaths"); - FlValue *module_paths = fl_value_lookup(args, module_paths_key); - if (module_paths != nullptr && fl_value_get_type(module_paths) == FL_VALUE_TYPE_LIST) - { - module_paths_size = fl_value_get_length(module_paths); - printf("modulePaths is a LIST: %zu\n", module_paths_size); - } - - gchar **module_paths_str_array = g_new(gchar *, module_paths_size + 4 /* standard modules */ + 1 /* for the NULL at the end */); - - // user module paths - size_t i = 0; - if (module_paths_size > 0) - { - for (; i < module_paths_size; i++) - { - FlValue *v = fl_value_get_list_value(module_paths, i); - printf("modulePath: %s\n", fl_value_to_string(v)); - module_paths_str_array[i] = g_strdup(fl_value_to_string(v)); - } - } - - // system module paths - module_paths_str_array[i++] = g_strdup_printf("%s", app_dir); - module_paths_str_array[i++] = g_strdup_printf("%s/__pypackages__", app_dir); - module_paths_str_array[i++] = g_strdup_printf("%s/site-packages", exe_dir); - module_paths_str_array[i++] = - g_strdup_printf("%s/python" SERIOUS_PYTHON_VERSION, exe_dir); - module_paths_str_array[i++] = NULL; - - gchar *module_paths_str = g_strjoinv(":", module_paths_str_array); // join with comma and space as separators - printf("modulePaths joined string: %s\n", module_paths_str); - - // environmentVariables - g_setenv("PYTHONINSPECT", "1", TRUE); - g_setenv("PYTHONDONTWRITEBYTECODE", "1", TRUE); - g_setenv("PYTHONNOUSERSITE", "1", TRUE); - g_setenv("PYTHONUNBUFFERED", "1", TRUE); - g_setenv("LC_CTYPE", "UTF-8", TRUE); - g_setenv("PYTHONHOME", exe_dir, TRUE); - g_setenv("PYTHONPATH", module_paths_str, TRUE); - - g_autoptr(FlValue) env_vars_key = fl_value_new_string("environmentVariables"); - FlValue *env_vars_map = fl_value_lookup(args, env_vars_key); - if (env_vars_map != nullptr && fl_value_get_type(env_vars_map) == FL_VALUE_TYPE_MAP) - { - size_t size = fl_value_get_length(env_vars_map); - printf("environmentVariables is a MAP: %zu\n", size); - for (size_t i = 0; i < size; i++) - { - FlValue *key = fl_value_get_map_key(env_vars_map, i); - FlValue *val = fl_value_lookup(env_vars_map, key); - printf("env var %s=%s\n", fl_value_to_string(key), fl_value_to_string(val)); - g_setenv(fl_value_to_string(key), fl_value_to_string(val), TRUE); - } - } - - printf("exe_dir: %s\n", exe_dir); - printf("app_dir: %s\n", app_dir); - printf("sync: %s\n", sync ? "true" : "false"); - - g_strfreev(module_paths_str_array); // free the array and its elements - g_free(module_paths_str); // free the joined string - - if (sync) - { - if (script != nullptr) - { - run_python_script(fl_value_to_string(script)); - } - else - { - run_python_program(fl_value_to_string(app_path)); - } - } - else - { - if (script != nullptr) - { - g_thread_new(NULL, run_python_script_async, g_strdup(fl_value_to_string(script))); - } - else - { - g_thread_new(NULL, run_python_program_async, g_strdup(fl_value_to_string(app_path))); - } - } - - response = FL_METHOD_RESPONSE(fl_method_success_response_new(fl_value_new_string(""))); - } - else - { - response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new()); - } - + g_autoptr(FlMethodResponse) response = + FL_METHOD_RESPONSE(fl_method_not_implemented_response_new()); fl_method_call_respond(method_call, response, nullptr); } -void run_python_program(gchar *appPath) -{ - Py_Initialize(); - - FILE *file = fopen(appPath, "r"); - if (file != NULL) - { - PyRun_SimpleFileEx(file, appPath, 1); - } - else - { - printf("Failed to open Python app file: %s\n", appPath); - } - - Py_Finalize(); -} - -void run_python_script(gchar *script) -{ - Py_Initialize(); - - PyRun_SimpleString(script); - - Py_Finalize(); -} - -gpointer run_python_program_async(gpointer data) -{ - run_python_program((gchar *)data); - return NULL; -} - -gpointer run_python_script_async(gpointer data) -{ - run_python_script((gchar *)data); - return NULL; -} - -FlMethodResponse *get_platform_version() -{ - struct utsname uname_data = {}; - uname(&uname_data); - g_autofree gchar *version = g_strdup_printf("Linux %s", uname_data.version); - g_autoptr(FlValue) result = fl_value_new_string(version); - return FL_METHOD_RESPONSE(fl_method_success_response_new(result)); -} - static void serious_python_linux_plugin_dispose(GObject *object) { G_OBJECT_CLASS(serious_python_linux_plugin_parent_class)->dispose(object); diff --git a/src/serious_python_linux/linux/serious_python_linux_plugin_private.h b/src/serious_python_linux/linux/serious_python_linux_plugin_private.h deleted file mode 100644 index 3874fd2a..00000000 --- a/src/serious_python_linux/linux/serious_python_linux_plugin_private.h +++ /dev/null @@ -1,16 +0,0 @@ -#include - -#include "include/serious_python_linux/serious_python_linux_plugin.h" - -// This file exposes some plugin internals for unit testing. See -// https://github.com/flutter/flutter/issues/88724 for current limitations -// in the unit-testable API. - -// Handles the getPlatformVersion method call. -FlMethodResponse *get_platform_version(); - -void run_python_program(gchar *appPath); -gpointer run_python_program_async(gpointer data); - -void run_python_script(gchar *script); -gpointer run_python_script_async(gpointer data); \ No newline at end of file diff --git a/src/serious_python_linux/linux/test/serious_python_linux_plugin_test.cc b/src/serious_python_linux/linux/test/serious_python_linux_plugin_test.cc deleted file mode 100644 index f1a15537..00000000 --- a/src/serious_python_linux/linux/test/serious_python_linux_plugin_test.cc +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include - -#include "include/serious_python_linux/serious_python_linux_plugin.h" -#include "serious_python_linux_plugin_private.h" - -// This demonstrates a simple unit test of the C portion of this plugin's -// implementation. -// -// Once you have built the plugin's example app, you can run these tests -// from the command line. For instance, for a plugin called my_plugin -// built for x64 debug, run: -// $ build/linux/x64/debug/plugins/my_plugin/my_plugin_test - -namespace serious_python_linux { -namespace test { - -TEST(SeriousPythonLinuxPlugin, GetPlatformVersion) { - g_autoptr(FlMethodResponse) response = get_platform_version(); - ASSERT_NE(response, nullptr); - ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response)); - FlValue* result = fl_method_success_response_get_result( - FL_METHOD_SUCCESS_RESPONSE(response)); - ASSERT_EQ(fl_value_get_type(result), FL_VALUE_TYPE_STRING); - // The full string varies, so just validate that it has the right format. - EXPECT_THAT(fl_value_get_string(result), testing::StartsWith("Linux ")); -} - -} // namespace test -} // namespace serious_python_linux diff --git a/src/serious_python_linux/pubspec.yaml b/src/serious_python_linux/pubspec.yaml index 9a834cb7..9650b97d 100644 --- a/src/serious_python_linux/pubspec.yaml +++ b/src/serious_python_linux/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_linux description: Linux implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 2.0.0 +version: 3.0.0 environment: sdk: '>=3.1.3 <4.0.0' @@ -14,6 +14,7 @@ dependencies: plugin_platform_interface: ^2.1.8 serious_python_platform_interface: path: ../serious_python_platform_interface + path: ^1.9.0 dev_dependencies: flutter_test: diff --git a/src/serious_python_platform_interface/CHANGELOG.md b/src/serious_python_platform_interface/CHANGELOG.md index c9131d19..c5982886 100644 --- a/src/serious_python_platform_interface/CHANGELOG.md +++ b/src/serious_python_platform_interface/CHANGELOG.md @@ -1,3 +1,8 @@ +## 3.0.0 + +* Remove the scaffold `getPlatformVersion` method from the platform interface and its method-channel implementation. +* Version bump aligning with the `serious_python_*` 3.0.0 release (in-process `dart_bridge` FFI transport, Flutter 3.44.2). + ## 2.0.0 * Version bump aligning with the major release of the `serious_python_*` platform plugins (multi-version Python support, default Python now 3.14). No interface changes. diff --git a/src/serious_python_platform_interface/lib/serious_python_platform_interface.dart b/src/serious_python_platform_interface/lib/serious_python_platform_interface.dart index 17c63116..4c0a78f5 100644 --- a/src/serious_python_platform_interface/lib/serious_python_platform_interface.dart +++ b/src/serious_python_platform_interface/lib/serious_python_platform_interface.dart @@ -2,6 +2,7 @@ import 'package:plugin_platform_interface/plugin_platform_interface.dart'; import 'src/method_channel_serious_python.dart'; +export 'src/dart_bridge_ffi.dart'; export 'src/utils.dart'; abstract class SeriousPythonPlatform extends PlatformInterface { @@ -25,10 +26,6 @@ abstract class SeriousPythonPlatform extends PlatformInterface { _instance = instance; } - Future getPlatformVersion() { - throw UnimplementedError('platformVersion() has not been implemented.'); - } - Future run(String appPath, {String? script, List? modulePaths, diff --git a/src/serious_python_platform_interface/lib/src/dart_bridge_ffi.dart b/src/serious_python_platform_interface/lib/src/dart_bridge_ffi.dart new file mode 100644 index 00000000..acef515e --- /dev/null +++ b/src/serious_python_platform_interface/lib/src/dart_bridge_ffi.dart @@ -0,0 +1,297 @@ +import 'dart:ffi'; +import 'dart:io' show Platform; + +import 'package:ffi/ffi.dart'; +import 'package:flutter/foundation.dart' show kDebugMode; + +/// FFI bindings for the `dart_bridge` C library published by +/// [flet-dev/dart-bridge](https://github.com/flet-dev/dart-bridge). +/// +/// One binding lives in this platform-interface package so every +/// `serious_python_*` plugin can share it. The library handle resolution +/// differs by platform: +/// +/// - Apple (macOS/iOS): statically linked into the host app via +/// `dart_bridge.xcframework` — looked up through [DynamicLibrary.process]. +/// - Android: bundled as `libdart_bridge.so` in jniLibs — opened by name. +/// - Linux: bundled next to the executable — opened by name. +/// - Windows: bundled next to the .exe, with a separate Debug-CRT variant +/// `dart_bridge_d.dll` for `fvm flutter run`. +/// +/// Mirrors the C surface declared in +/// [dart-bridge/src/dart_bridge.c](https://github.com/flet-dev/dart-bridge/blob/main/src/dart_bridge.c) +/// and [dart-bridge/src/serious_python_run.c](https://github.com/flet-dev/dart-bridge/blob/main/src/serious_python_run.c). + +// --------------------------------------------------------------------------- +// C struct layout for serious_python_run +// --------------------------------------------------------------------------- + +final class SpRunConfig extends Struct { + @Int32() + external int mode; // SP_RUN_PATH=0, SP_RUN_SCRIPT=1 + + external Pointer appPath; + external Pointer scriptSource; + external Pointer programName; + external Pointer> modulePaths; // NULL-terminated + external Pointer> envKeys; // NULL-terminated + external Pointer> envValues; // parallel to envKeys + + @Int32() + external int sync; + + @Int64() + external int completionPort; +} + +const int spRunPath = 0; +const int spRunScript = 1; + +// --------------------------------------------------------------------------- +// Native + Dart function signatures +// --------------------------------------------------------------------------- + +typedef _SeriousPythonRunNative = Int32 Function(Pointer); +typedef _SeriousPythonRunDart = int Function(Pointer); + +typedef _DartBridgeInitDartApiDLNative = IntPtr Function(Pointer); +typedef _DartBridgeInitDartApiDLDart = int Function(Pointer); + +typedef _DartBridgeEnqueueMessageNative = Int32 Function( + Int64, Pointer, IntPtr); +typedef _DartBridgeEnqueueMessageDart = int Function( + int, Pointer, int); + +typedef _DartBridgeIsPythonInitializedNative = Int32 Function(); +typedef _DartBridgeIsPythonInitializedDart = int Function(); + +typedef _DartBridgeSignalDartSessionNative = Void Function( + Int32, Pointer>, Pointer); +typedef _DartBridgeSignalDartSessionDart = void Function( + int, Pointer>, Pointer); + +// --------------------------------------------------------------------------- +// Library binding +// --------------------------------------------------------------------------- + +/// Loaded dart_bridge symbols. Use [DartBridge.instance] for the default +/// per-platform handle, or [DartBridge.open] / [DartBridge.process] to load +/// from a specific source (mostly useful for tests). +class DartBridge { + DartBridge._(this._lib) { + _run = _lib + .lookup>('serious_python_run') + .asFunction<_SeriousPythonRunDart>(); + _initApiDL = _lib + .lookup>( + 'DartBridge_InitDartApiDL') + .asFunction<_DartBridgeInitDartApiDLDart>(); + _enqueueMessage = _lib + .lookup>( + 'DartBridge_EnqueueMessage') + .asFunction<_DartBridgeEnqueueMessageDart>(); + // dart_bridge >= 1.3.0 exports. Use lookupOrNull so older binaries + // still load (calls into the wrappers below become safe no-ops); + // makes the Dart/Python rollout decoupled from the libdart_bridge + // release cadence. + _isPythonInitialized = _lookupOrNull<_DartBridgeIsPythonInitializedNative, + _DartBridgeIsPythonInitializedDart>( + 'dart_bridge_is_python_initialized', + (f) => f.asFunction<_DartBridgeIsPythonInitializedDart>(), + ); + _signalDartSession = _lookupOrNull<_DartBridgeSignalDartSessionNative, + _DartBridgeSignalDartSessionDart>( + 'dart_bridge_signal_dart_session', + (f) => f.asFunction<_DartBridgeSignalDartSessionDart>(), + ); + } + + // Generic helper for soft symbol lookup — returns null if the binary + // doesn't export the symbol (e.g. running against a pre-1.3.0 + // libdart_bridge). + T? _lookupOrNull( + String name, T Function(Pointer>) bind) { + try { + final ptr = _lib.lookup>(name); + return bind(ptr); + } on ArgumentError { + return null; + } + } + + final DynamicLibrary _lib; + late final _SeriousPythonRunDart _run; + late final _DartBridgeInitDartApiDLDart _initApiDL; + late final _DartBridgeEnqueueMessageDart _enqueueMessage; + late final _DartBridgeIsPythonInitializedDart? _isPythonInitialized; + late final _DartBridgeSignalDartSessionDart? _signalDartSession; + + static DartBridge? _instance; + + /// Default per-platform loader. Cached after the first call. + static DartBridge get instance => _instance ??= DartBridge._(_loadDefault()); + + /// Test/override entry point: open a specific library path. Replaces the + /// cached instance. + static DartBridge open(String path) => + _instance = DartBridge._(DynamicLibrary.open(path)); + + /// Test/override entry point: resolve from the host process (Apple). + /// Replaces the cached instance. + static DartBridge process() => + _instance = DartBridge._(DynamicLibrary.process()); + + static DynamicLibrary _loadDefault() { + if (Platform.isMacOS || Platform.isIOS) { + return DynamicLibrary.process(); + } + if (Platform.isAndroid || Platform.isLinux) { + return DynamicLibrary.open('libdart_bridge.so'); + } + if (Platform.isWindows) { + return DynamicLibrary.open( + kDebugMode ? 'dart_bridge_d.dll' : 'dart_bridge.dll'); + } + throw UnsupportedError( + 'serious_python: dart_bridge has no binary for this platform'); + } + + /// Initialize the Dart Native API DL hooks so the worker thread spawned by + /// `serious_python_run` and `send_bytes` (Python→Dart) can post to ports. + /// Idempotent — calling more than once is a cheap no-op past the first. + bool _apiDLInitialized = false; + void initDartApiDL() { + if (_apiDLInitialized) return; + final rc = _initApiDL(NativeApi.initializeApiDLData); + if (rc != 0) { + throw StateError('DartBridge_InitDartApiDL failed with code $rc'); + } + _apiDLInitialized = true; + } + + /// Run a Python program (`appPath` mode) or source string (`script` mode). + /// See [SpRunConfig] / `serious_python_run`. + int run(Pointer cfg) => _run(cfg); + + /// Deliver bytes to the Python handler registered for [port]. Returns 0 on + /// successful delivery, -1 if no handler is registered (caller may retry), + /// or -2 if the interpreter is not initialized. + int enqueueMessage(int port, Pointer data, int len) => + _enqueueMessage(port, data, len); + + /// True if libdart_bridge has already brought up an embedded CPython. + /// On Android process reuse (OS keeps the process alive across a Dart + /// VM restart), this returns true on the second Dart VM's PythonBridge + /// construction. + /// + /// Returns false when running against a pre-1.3.0 libdart_bridge that + /// doesn't export the underlying C function — callers should treat that + /// as "fresh start path", which is the correct behaviour on every + /// platform that hasn't seen this binary update yet. + bool get isPythonInitialized { + final f = _isPythonInitialized; + if (f == null) return false; + return f() != 0; + } + + /// Signal the running Python program that a new Dart VM session is + /// active. On a fresh start where Python isn't loaded yet, this is a + /// cheap no-op inside libdart_bridge. On Android process reuse it fires + /// every Python callback registered via + /// `dart_bridge.add_session_restart_handler(...)`, carrying the new + /// native port numbers as a `{label: port}` map. + /// + /// [portMap] keys are arbitrary labels — current callers use + /// `"protocol"` and `"exit"` to match flet's build template wiring. + /// + /// No-op when running against a pre-1.3.0 libdart_bridge. + void signalDartSession(Map portMap) { + final f = _signalDartSession; + if (f == null || portMap.isEmpty) return; + using((Arena arena) { + final labels = arena>(portMap.length); + final ports = arena(portMap.length); + var i = 0; + for (final entry in portMap.entries) { + labels[i] = entry.key.toNativeUtf8(allocator: arena); + ports[i] = entry.value; + i++; + } + f(portMap.length, labels, ports); + }); + } +} + +// --------------------------------------------------------------------------- +// High-level helper: build SpRunConfig, run, free. +// --------------------------------------------------------------------------- + +/// Allocates a NULL-terminated `char**` for a list of strings using [arena]. +Pointer>? _toCStringArray(Arena arena, List? strings) { + if (strings == null) return null; + final ptr = arena>(strings.length + 1); + for (var i = 0; i < strings.length; i++) { + ptr[i] = strings[i].toNativeUtf8(allocator: arena); + } + ptr[strings.length] = nullptr; + return ptr; +} + +/// Run a Python program via dart_bridge. +/// +/// - `sync: false` (default): spawn a worker thread and return immediately +/// with 0 on successful spawn. The Python run continues in the background; +/// bridge traffic flows over Dart ↔ Python ports independently. +/// - `sync: true`: block the calling thread inside the Python interpreter +/// until the program finishes, then return its exit code. +/// +/// If [completionPort] is provided, the exit code is also posted to that +/// Dart port via `Dart_PostInteger_DL` when Python finishes. Default `0` +/// disables the post. +int runPython({ + required DartBridge bridge, + String? appPath, + String? script, + String? programName, + List? modulePaths, + Map? environmentVariables, + bool sync = false, + int completionPort = 0, +}) { + if ((appPath == null) == (script == null)) { + throw ArgumentError( + 'Provide exactly one of appPath / script (got both or neither)'); + } + + // Worker thread needs the Dart Native API DL hooks so it can post to a + // completion port. Idempotent past the first call; cheap to do every time. + bridge.initDartApiDL(); + + return using((Arena arena) { + final cfg = arena(); + cfg.ref + ..mode = script != null ? spRunScript : spRunPath + ..appPath = + appPath != null ? appPath.toNativeUtf8(allocator: arena) : nullptr + ..scriptSource = + script != null ? script.toNativeUtf8(allocator: arena) : nullptr + ..programName = programName != null + ? programName.toNativeUtf8(allocator: arena) + : nullptr + ..modulePaths = _toCStringArray(arena, modulePaths) ?? nullptr + ..sync = sync ? 1 : 0 + ..completionPort = completionPort; + + if (environmentVariables != null && environmentVariables.isNotEmpty) { + final keys = environmentVariables.keys.toList(); + final values = keys.map((k) => environmentVariables[k]!).toList(); + cfg.ref.envKeys = _toCStringArray(arena, keys)!; + cfg.ref.envValues = _toCStringArray(arena, values)!; + } else { + cfg.ref.envKeys = nullptr; + cfg.ref.envValues = nullptr; + } + + return bridge.run(cfg); + }); +} diff --git a/src/serious_python_platform_interface/lib/src/method_channel_serious_python.dart b/src/serious_python_platform_interface/lib/src/method_channel_serious_python.dart index 191cd349..64f3b100 100644 --- a/src/serious_python_platform_interface/lib/src/method_channel_serious_python.dart +++ b/src/serious_python_platform_interface/lib/src/method_channel_serious_python.dart @@ -9,11 +9,6 @@ class MethodChannelSeriousPython extends SeriousPythonPlatform { @visibleForTesting final methodChannel = const MethodChannel('serious_python'); - @override - Future getPlatformVersion() { - return methodChannel.invokeMethod('getPlatformVersion'); - } - @override Future run(String appPath, {String? script, diff --git a/src/serious_python_platform_interface/pubspec.yaml b/src/serious_python_platform_interface/pubspec.yaml index 22dbe9ee..0496dbda 100644 --- a/src/serious_python_platform_interface/pubspec.yaml +++ b/src/serious_python_platform_interface/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_platform_interface description: A common platform interface for the serious_python plugin. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 2.0.0 +version: 3.0.0 environment: sdk: ">=3.0.0 <4.0.0" @@ -15,6 +15,7 @@ dependencies: path_provider: ^2.1.3 archive: ^4.0.7 path: ^1.9.0 + ffi: ^2.1.2 dev_dependencies: flutter_test: diff --git a/src/serious_python_windows/CHANGELOG.md b/src/serious_python_windows/CHANGELOG.md index ca8b7b90..69db9e85 100644 --- a/src/serious_python_windows/CHANGELOG.md +++ b/src/serious_python_windows/CHANGELOG.md @@ -1,3 +1,10 @@ +## 3.0.0 + +* **In-process Python (dart_bridge FFI).** The Python lifecycle is absorbed into `dart_bridge.dll` / `dart_bridge.pyd` (from `flet-dev/dart-bridge` **1.4.0**) instead of a socket transport; both Release and Debug `dart_bridge.pyd` ship so 3.13/3.14 Debug builds resolve too. +* **Breaking change:** requires Flutter **3.44.2**. +* `CMakeLists.txt` resolves the Python version from the generated `python_versions.properties` (a snapshot of python-build's `manifest.json`): `SERIOUS_PYTHON_VERSION` selects the version; the full version and build date derive from the table, with `SERIOUS_PYTHON_FULL_VERSION` / `SERIOUS_PYTHON_BUILD_DATE` left as escape hatches. Downloads continue to use python-build's date-keyed release scheme. +* Remove the scaffold `getPlatformVersion` method. + ## 2.0.0 * **Breaking change:** default bundled Python version is now 3.14 (was 3.12). The plugin downloads `python-windows-for-dart-3.14.zip` and bundles `python314.dll` / `python314.lib` unless `SERIOUS_PYTHON_VERSION=3.12` is set in the build environment. diff --git a/src/serious_python_windows/lib/serious_python_windows.dart b/src/serious_python_windows/lib/serious_python_windows.dart index c0f48cf7..a7553bb2 100644 --- a/src/serious_python_windows/lib/serious_python_windows.dart +++ b/src/serious_python_windows/lib/serious_python_windows.dart @@ -1,40 +1,65 @@ import 'dart:io'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; +import 'package:path/path.dart' as p; import 'package:serious_python_platform_interface/serious_python_platform_interface.dart'; +/// Windows implementation of [SeriousPythonPlatform]. +/// +/// Python lifecycle (env, sys.path, Py_Initialize, run, finalize, sync/async) +/// lives in `serious_python_run`, packaged as `dart_bridge.dll` (Release CRT) +/// or `dart_bridge_d.dll` (Debug CRT) and bundled next to the .exe by this +/// plugin's CMakeLists.txt. The correct DLL is picked at runtime based on +/// [kDebugMode]. +/// +/// This class derives PYTHONHOME from `Platform.resolvedExecutable` (the +/// runner .exe directory, where the bundled CPython lives) and dispatches a +/// single FFI call to `serious_python_run`. class SeriousPythonWindows extends SeriousPythonPlatform { - /// The method channel used to interact with the native platform. - @visibleForTesting - final methodChannel = const MethodChannel('serious_python_windows'); - - /// Registers this class as the default instance of [SeriousPythonPlatform] static void registerWith() { SeriousPythonPlatform.instance = SeriousPythonWindows(); } - @override - Future getPlatformVersion() async { - final version = - await methodChannel.invokeMethod('getPlatformVersion'); - return "$version ${Platform.resolvedExecutable}"; - } - @override Future run(String appPath, {String? script, List? modulePaths, Map? environmentVariables, bool? sync}) async { - final Map arguments = { - 'exePath': Platform.resolvedExecutable, - 'appPath': appPath, - 'script': script, - 'modulePaths': modulePaths, - 'environmentVariables': environmentVariables, - 'sync': sync + final exeDir = p.dirname(Platform.resolvedExecutable); + final appDir = p.dirname(appPath); + + final pythonPaths = [ + ...?modulePaths, + appDir, + p.join(appDir, '__pypackages__'), + p.join(exeDir, 'site-packages'), + p.join(exeDir, 'DLLs'), + p.join(exeDir, 'Lib'), + p.join(exeDir, 'Lib', 'site-packages'), + ]; + + final env = { + 'PYTHONINSPECT': '1', + 'PYTHONDONTWRITEBYTECODE': '1', + 'PYTHONNOUSERSITE': '1', + 'PYTHONUNBUFFERED': '1', + 'LC_CTYPE': 'UTF-8', + 'PYTHONHOME': exeDir, + 'PYTHONPATH': pythonPaths.join(';'), + ...?environmentVariables, }; - return await methodChannel.invokeMethod('runPython', arguments); + + final rc = runPython( + bridge: DartBridge.instance, + appPath: script == null ? appPath : null, + script: script, + modulePaths: pythonPaths, + environmentVariables: env, + sync: sync ?? false, + ); + + // sync=true: rc is the Python exit code. sync=false: rc is the spawn + // result (0 = worker thread started successfully). + return rc != 0 ? 'Python exited with code $rc' : null; } } diff --git a/src/serious_python_windows/pubspec.yaml b/src/serious_python_windows/pubspec.yaml index f41422dd..0d44c07b 100644 --- a/src/serious_python_windows/pubspec.yaml +++ b/src/serious_python_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_windows description: Windows implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 2.0.0 +version: 3.0.0 environment: sdk: '>=3.1.3 <4.0.0' @@ -14,6 +14,7 @@ dependencies: plugin_platform_interface: ^2.1.8 serious_python_platform_interface: path: ../serious_python_platform_interface + path: ^1.9.0 dev_dependencies: flutter_test: diff --git a/src/serious_python_windows/windows/CMakeLists.txt b/src/serious_python_windows/windows/CMakeLists.txt index 53910244..274b83d4 100644 --- a/src/serious_python_windows/windows/CMakeLists.txt +++ b/src/serious_python_windows/windows/CMakeLists.txt @@ -6,12 +6,64 @@ cmake_minimum_required(VERSION 3.14) # Project-level configuration. set(PROJECT_NAME "serious_python_windows") +# Python runtime versions come from the generated python_versions.properties +# (a snapshot of python-build's manifest.json — see serious_python's +# gen_version_tables). SERIOUS_PYTHON_VERSION selects the version; the rest +# derive from the table. The per-field env vars are escape hatches. +set(_PV_FILE "${CMAKE_CURRENT_LIST_DIR}/python_versions.properties") +function(pv_get key out) + string(REPLACE "." "\\." _re "${key}") + file(STRINGS "${_PV_FILE}" _m REGEX "^${_re}=") + if(_m) + string(REGEX REPLACE "^[^=]*=" "" _v "${_m}") + set(${out} "${_v}" PARENT_SCOPE) + else() + set(${out} "" PARENT_SCOPE) + endif() +endfunction() + if(DEFINED ENV{SERIOUS_PYTHON_VERSION}) set(PYTHON_VERSION "$ENV{SERIOUS_PYTHON_VERSION}") else() - set(PYTHON_VERSION "3.14") + pv_get("default_python_version" PYTHON_VERSION) +endif() +if(DEFINED ENV{SERIOUS_PYTHON_FULL_VERSION}) + set(PYTHON_FULL_VERSION "$ENV{SERIOUS_PYTHON_FULL_VERSION}") +else() + pv_get("${PYTHON_VERSION}.full_version" PYTHON_FULL_VERSION) +endif() +if(DEFINED ENV{SERIOUS_PYTHON_BUILD_DATE}) + set(PYTHON_BUILD_DATE "$ENV{SERIOUS_PYTHON_BUILD_DATE}") +else() + pv_get("python_build_release_date" PYTHON_BUILD_DATE) +endif() +if(PYTHON_FULL_VERSION STREQUAL "") + message(FATAL_ERROR "serious_python: unknown SERIOUS_PYTHON_VERSION '${PYTHON_VERSION}'") endif() string(REPLACE "." "" PYTHON_VERSION_NODOT "${PYTHON_VERSION}") +if(DEFINED ENV{DART_BRIDGE_VERSION}) + set(DART_BRIDGE_VERSION "$ENV{DART_BRIDGE_VERSION}") +else() + pv_get("dart_bridge_version" DART_BRIDGE_VERSION) +endif() + +# Cross-plugin download cache. FLET_CACHE_DIR is the same env var used by the +# Android gradle task and the prepare_*.sh scripts on Darwin; defaulting to +# ~/.flet/cache (%USERPROFILE%\.flet\cache on Windows) keeps a single shared +# location across all plugins. Files land in versioned subdirs so a Python +# or dart_bridge version bump pulls a fresh artifact without invalidating the +# others. +if(DEFINED ENV{FLET_CACHE_DIR}) + set(FLET_CACHE_DIR "$ENV{FLET_CACHE_DIR}") +elseif(DEFINED ENV{USERPROFILE}) + set(FLET_CACHE_DIR "$ENV{USERPROFILE}/.flet/cache") +else() + set(FLET_CACHE_DIR "$ENV{HOME}/.flet/cache") +endif() +set(PB_CACHE "${FLET_CACHE_DIR}/python-build/v${PYTHON_FULL_VERSION}") +set(DB_CACHE "${FLET_CACHE_DIR}/dart-bridge/v${DART_BRIDGE_VERSION}") +file(MAKE_DIRECTORY "${PB_CACHE}" "${DB_CACHE}") + project(${PROJECT_NAME} LANGUAGES CXX) # Explicitly opt in to modern CMake behaviors to avoid warnings with recent @@ -22,14 +74,66 @@ cmake_policy(VERSION 3.14...3.25) # not be changed set(PLUGIN_NAME "serious_python_windows_plugin") +# ---- python-windows-for-dart (runtime DLLs + stdlib) ---------------------- +# python3X.dll, python3.dll, Lib/, DLLs/ — required at runtime so the embedded +# CPython (driven by libdart_bridge.dll) can find its stdlib and the abi3 stub +# python3.dll can forward to python3X.dll. We no longer need the .lib / headers +# here because no Python C API call sites live in this plugin anymore. set(PYTHON_PACKAGE ${CMAKE_BINARY_DIR}/python) -set(PYTHON_URL "https://github.com/flet-dev/python-build/releases/download/v${PYTHON_VERSION}/python-windows-for-dart-${PYTHON_VERSION}.zip") -set(PYTHON_FILE ${CMAKE_BINARY_DIR}/python-windows-for-dart.zip) -if (NOT EXISTS ${PYTHON_FILE}) - file(DOWNLOAD ${PYTHON_URL} ${PYTHON_FILE}) - file(ARCHIVE_EXTRACT INPUT ${PYTHON_FILE} DESTINATION ${PYTHON_PACKAGE}) +set(PYTHON_URL "https://github.com/flet-dev/python-build/releases/download/${PYTHON_BUILD_DATE}/python-windows-for-dart-${PYTHON_FULL_VERSION}.zip") +# Tarball lives in the shared cache; extraction targets the per-plugin build +# tree so a `flutter clean` doesn't force a re-download. +set(PYTHON_FILE "${PB_CACHE}/python-windows-for-dart-${PYTHON_FULL_VERSION}.zip") + +function(_sp_download url dest) + if(EXISTS "${dest}") + return() + endif() + message(STATUS "Downloading: ${url}") + # .tmp + rename so a Ctrl-C / network blip doesn't poison the cache. + file(DOWNLOAD "${url}" "${dest}.tmp" STATUS _dl_status SHOW_PROGRESS) + list(GET _dl_status 0 _dl_code) + list(GET _dl_status 1 _dl_message) + if(NOT _dl_code EQUAL 0) + file(REMOVE "${dest}.tmp") + message(FATAL_ERROR "Failed to download ${url}: ${_dl_message}") + endif() + file(RENAME "${dest}.tmp" "${dest}") +endfunction() + +_sp_download("${PYTHON_URL}" "${PYTHON_FILE}") +if(NOT EXISTS "${PYTHON_PACKAGE}/python.exe") + file(ARCHIVE_EXTRACT INPUT "${PYTHON_FILE}" DESTINATION "${PYTHON_PACKAGE}") endif() +# ---- dart_bridge prebuilt DLLs -------------------------------------------- +# Release CRT (.dll) is what Release Flutter builds consume; Debug CRT +# (_d.dll) is what `fvm flutter run` / Debug builds consume. Both ship in +# every release of flet-dev/dart-bridge; we bundle both and let Flutter's +# CONFIG-aware copy machinery pick the right one at app launch time. +# +# Cached under the upstream arch-qualified filenames so multiple flet-dev/ +# dart-bridge versions can coexist in $FLET_CACHE_DIR. Copied to stable +# unqualified names in the build tree because Flutter's bundled_libraries +# machinery preserves filenames as-is, and the Dart side opens the DLL by +# `dart_bridge[_d].dll` (no arch suffix). +set(DART_BRIDGE_RELEASE_CACHED "${DB_CACHE}/dart_bridge-windows-x86_64.dll") +set(DART_BRIDGE_DEBUG_CACHED "${DB_CACHE}/dart_bridge_d-windows-x86_64.dll") + +_sp_download( + "https://github.com/flet-dev/dart-bridge/releases/download/v${DART_BRIDGE_VERSION}/dart_bridge-windows-x86_64.dll" + "${DART_BRIDGE_RELEASE_CACHED}") +_sp_download( + "https://github.com/flet-dev/dart-bridge/releases/download/v${DART_BRIDGE_VERSION}/dart_bridge_d-windows-x86_64.dll" + "${DART_BRIDGE_DEBUG_CACHED}") + +set(DART_BRIDGE_DIR "${CMAKE_BINARY_DIR}/dart_bridge") +set(DART_BRIDGE_RELEASE_DLL "${DART_BRIDGE_DIR}/dart_bridge.dll") +set(DART_BRIDGE_DEBUG_DLL "${DART_BRIDGE_DIR}/dart_bridge_d.dll") +file(MAKE_DIRECTORY "${DART_BRIDGE_DIR}") +configure_file("${DART_BRIDGE_RELEASE_CACHED}" "${DART_BRIDGE_RELEASE_DLL}" COPYONLY) +configure_file("${DART_BRIDGE_DEBUG_CACHED}" "${DART_BRIDGE_DEBUG_DLL}" COPYONLY) + # Any new source files that you add to the plugin should be added here. list(APPEND PLUGIN_SOURCES "serious_python_windows_plugin.cpp" @@ -62,16 +166,8 @@ target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") -include_directories( - "${PYTHON_PACKAGE}/include" -) - target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) -target_link_libraries(${PLUGIN_NAME} PRIVATE - "${PYTHON_PACKAGE}/libs/python${PYTHON_VERSION_NODOT}$<$:_d>.lib" -) - # List of absolute paths to libraries that should be bundled with the plugin. # This list could contain prebuilt libraries, or libraries created by an # external build triggered from this build file. @@ -79,38 +175,44 @@ string(REPLACE "\\" "/" SERIOUS_PYTHON_WINDIR "$ENV{WINDIR}") set(serious_python_windows_bundled_libraries "${PYTHON_PACKAGE}/python${PYTHON_VERSION_NODOT}$<$:_d>.dll" "${PYTHON_PACKAGE}/python3$<$:_d>.dll" + "$,${DART_BRIDGE_DEBUG_DLL},${DART_BRIDGE_RELEASE_DLL}>" "${SERIOUS_PYTHON_WINDIR}/System32/msvcp140.dll" "${SERIOUS_PYTHON_WINDIR}/System32/vcruntime140.dll" "${SERIOUS_PYTHON_WINDIR}/System32/vcruntime140_1.dll" PARENT_SCOPE ) -# Copy Python libraries -add_custom_target(CopyPythonDLLs ALL DEPENDS PYTHON_PACKAGE_DOWNLOAD) +# Copy Python libraries. +# +# Replaced the prior cmd.exe `DEL` invocations with `cmake -E rm -f --` which +# is forgiving about missing globs / missing files. MSBuild's CustomBuild +# wrapper treats any non-zero exit code as a hard failure, and `DEL ` +# returns 1, which made the whole CopyPythonDLLs target fragile. +set(SP_RUNNER_OUT "${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>") +add_custom_target(CopyPythonDLLs ALL) add_custom_command(TARGET CopyPythonDLLs POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory - "${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>" - COMMAND ${CMAKE_COMMAND} -E copy_directory - "${PYTHON_PACKAGE}/Lib" - "${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>/Lib" - COMMAND ${CMAKE_COMMAND} -E copy_directory - "${PYTHON_PACKAGE}/DLLs" - "${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>/DLLs" - COMMAND IF \"$<$:release>\" == \"release\" DEL \"${CMAKE_BINARY_DIR}/runner/Release/DLLs\\*_d.*\" /S /Q - COMMAND DEL \"${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>/DLLs\\*.ico\" /S /Q - COMMAND DEL \"${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>/DLLs\\*.cat\" /S /Q - COMMAND DEL \"${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>/DLLs\\tcl86t.dll\" /Q - COMMAND DEL \"${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>/DLLs\\tk86t.dll\" /Q + COMMAND ${CMAKE_COMMAND} -E make_directory "${SP_RUNNER_OUT}" + COMMAND ${CMAKE_COMMAND} -E copy_directory "${PYTHON_PACKAGE}/Lib" "${SP_RUNNER_OUT}/Lib" + COMMAND ${CMAKE_COMMAND} -E copy_directory "${PYTHON_PACKAGE}/DLLs" "${SP_RUNNER_OUT}/DLLs" + # Strip Debug-only PYDs from Release builds (best effort — missing files OK). + COMMAND ${CMAKE_COMMAND} -E rm -f -- + "${SP_RUNNER_OUT}/DLLs/tcl86t.dll" + "${SP_RUNNER_OUT}/DLLs/tk86t.dll" + COMMAND ${CMAKE_COMMAND} -DDIR=${SP_RUNNER_OUT}/DLLs -DGLOBS=*.ico\;*.cat + -P "${CMAKE_CURRENT_SOURCE_DIR}/rm_globs.cmake" ) -if(DEFINED ENV{SERIOUS_PYTHON_SITE_PACKAGES}) +# Mirror the user's external site-packages dir into runner/site-packages if +# the env var is set AND points at an existing directory. (The CI env var +# may be set workflow-wide while specific jobs don't actually create the +# directory — `cmake -E copy_directory` against a missing source fails, +# which used to wedge CopyPythonDLLs.) +if(DEFINED ENV{SERIOUS_PYTHON_SITE_PACKAGES} AND EXISTS "$ENV{SERIOUS_PYTHON_SITE_PACKAGES}") add_custom_command(TARGET CopyPythonDLLs POST_BUILD - COMMAND ${CMAKE_COMMAND} -E remove_directory - "${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>/site-packages" - COMMAND ${CMAKE_COMMAND} -E make_directory - "${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>/site-packages" + COMMAND ${CMAKE_COMMAND} -E rm -rf "${SP_RUNNER_OUT}/site-packages" + COMMAND ${CMAKE_COMMAND} -E make_directory "${SP_RUNNER_OUT}/site-packages" COMMAND ${CMAKE_COMMAND} -E copy_directory "$ENV{SERIOUS_PYTHON_SITE_PACKAGES}" - "${CMAKE_BINARY_DIR}/runner/$<$:Release>$<$:Debug>/site-packages" + "${SP_RUNNER_OUT}/site-packages" ) endif() diff --git a/src/serious_python_windows/windows/python_versions.properties b/src/serious_python_windows/windows/python_versions.properties new file mode 100644 index 00000000..7cc4bbe2 --- /dev/null +++ b/src/serious_python_windows/windows/python_versions.properties @@ -0,0 +1,8 @@ +# GENERATED by `dart run serious_python:gen_version_tables` from +# python-build manifest.json (release 20260614). Do not edit by hand. +default_python_version=3.14 +dart_bridge_version=1.4.0 +python_build_release_date=20260614 +3.12.full_version=3.12.13 +3.13.full_version=3.13.14 +3.14.full_version=3.14.6 diff --git a/src/serious_python_windows/windows/rm_globs.cmake b/src/serious_python_windows/windows/rm_globs.cmake new file mode 100644 index 00000000..a52ca142 --- /dev/null +++ b/src/serious_python_windows/windows/rm_globs.cmake @@ -0,0 +1,14 @@ +# Helper invoked by CMakeLists.txt's CopyPythonDLLs target. +# Removes files matching semicolon-separated -DGLOBS=... under -DDIR=... +# without failing if the glob has no matches. + +if(NOT DEFINED DIR OR NOT DEFINED GLOBS) + message(FATAL_ERROR "rm_globs.cmake requires -DDIR and -DGLOBS") +endif() + +foreach(_pattern IN LISTS GLOBS) + file(GLOB _matches "${DIR}/${_pattern}") + if(_matches) + file(REMOVE ${_matches}) + endif() +endforeach() diff --git a/src/serious_python_windows/windows/serious_python_windows_plugin.cpp b/src/serious_python_windows/windows/serious_python_windows_plugin.cpp index 2b7ec85c..62f9a489 100644 --- a/src/serious_python_windows/windows/serious_python_windows_plugin.cpp +++ b/src/serious_python_windows/windows/serious_python_windows_plugin.cpp @@ -3,35 +3,15 @@ // This must be included before many other Windows headers. #include -// For getPlatformVersion; remove unless needed for your plugin implementation. -#include - #include #include #include #include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include namespace serious_python_windows { - using flutter::EncodableList; - using flutter::EncodableMap; - using flutter::EncodableValue; - // static void SeriousPythonWindowsPlugin::RegisterWithRegistrar( flutter::PluginRegistrarWindows *registrar) @@ -56,223 +36,13 @@ namespace serious_python_windows SeriousPythonWindowsPlugin::~SeriousPythonWindowsPlugin() {} + // Plugin-registration shell only — all method calls return NotImplemented. + // Python lifecycle lives in dart_bridge[_d].dll, invoked from Dart via FFI. void SeriousPythonWindowsPlugin::HandleMethodCall( const flutter::MethodCall &method_call, std::unique_ptr> result) { - const auto *arguments = std::get_if(method_call.arguments()); - - if (method_call.method_name().compare("getPlatformVersion") == 0) - { - std::ostringstream version_stream; - version_stream << "Windows "; - if (IsWindows10OrGreater()) - { - version_stream << "10+"; - } - else if (IsWindows8OrGreater()) - { - version_stream << "8"; - } - else if (IsWindows7OrGreater()) - { - version_stream << "7"; - } - - result->Success(flutter::EncodableValue(version_stream.str())); - } - else if (method_call.method_name().compare("runPython") == 0) - { - std::string exe_path; - std::string app_path; - std::string script; - flutter::EncodableList module_paths; - flutter::EncodableMap env_vars; - bool sync = false; - - if (arguments) - { - auto exe_path_it = arguments->find(EncodableValue("exePath")); - if (exe_path_it != arguments->end()) - { - exe_path = std::get(exe_path_it->second); - } - - auto app_path_it = arguments->find(EncodableValue("appPath")); - if (app_path_it != arguments->end()) - { - app_path = std::get(app_path_it->second); - } - - auto script_it = arguments->find(EncodableValue("script")); - if (script_it != arguments->end()) - { - script = std::get(script_it->second); - } - - auto module_paths_it = arguments->find(EncodableValue("modulePaths")); - if (module_paths_it != arguments->end() && !module_paths_it->second.IsNull()) - { - module_paths = std::get(module_paths_it->second); - } - - auto env_vars_it = arguments->find(EncodableValue("environmentVariables")); - if (env_vars_it != arguments->end() && !env_vars_it->second.IsNull()) - { - env_vars = std::get(env_vars_it->second); - } - - auto sync_it = arguments->find(EncodableValue("sync")); - if (sync_it != arguments->end() && !sync_it->second.IsNull()) - { - sync = std::get(sync_it->second); - } - } - else - { - result->Error("ARGUMENT_ERROR", "arguments is missing."); - return; - } - - std::string exe_dir = std::filesystem::path(exe_path).parent_path().string(); - std::string app_dir = std::filesystem::path(app_path).parent_path().string(); - - printf("exePath: %s\n", exe_path.c_str()); - printf("exeDir: %s\n", exe_dir.c_str()); - printf("appPath: %s\n", app_path.c_str()); - - std::vector python_paths; - - // add user module paths to the top - for (const auto &item : module_paths) - { - if (auto str_value = std::get_if(&item)) - { - printf("module_path: %s\n", str_value->c_str()); - python_paths.push_back(*str_value); - } - } - - // add system paths - python_paths.push_back(app_dir); - python_paths.push_back(app_dir + "\\__pypackages__"); - python_paths.push_back(exe_dir + "\\site-packages"); - python_paths.push_back(exe_dir + "\\DLLs"); - python_paths.push_back(exe_dir + "\\Lib"); - python_paths.push_back(exe_dir + "\\Lib\\site-packages"); - - std::string python_path; - for (int i = 0; i < python_paths.size(); i++) - { - python_path += python_paths[i]; - if (i < python_paths.size() - 1) - { // Don't add separator after the last element - python_path += ";"; - } - } - - printf("PYTHONPATH: %s\n", python_path.c_str()); - - // set python-related env vars - _putenv_s("PYTHONINSPECT", "1"); - _putenv_s("PYTHONDONTWRITEBYTECODE", "1"); - _putenv_s("PYTHONNOUSERSITE", "1"); - _putenv_s("PYTHONUNBUFFERED", "1"); - _putenv_s("LC_CTYPE", "UTF-8"); - _putenv_s("PYTHONHOME", exe_dir.c_str()); - _putenv_s("PYTHONPATH", python_path.c_str()); - - // set user environment variables - for (const auto &kv : env_vars) - { - auto key = kv.first; - auto value = kv.second; - if (auto str_key = std::get_if(&key); - auto str_value = std::get_if(&value)) - { - printf("env_var: %s=%s\n", str_key->c_str(), str_value->c_str()); - _putenv_s(str_key->c_str(), str_value->c_str()); - } - } - - printf("sync: %s\n", sync ? "true" : "false"); - - // run program - if (sync) - { - if (script.empty()) - { - printf("Running Python program synchronously..."); - RunPythonProgram(app_path); - } - else - { - printf("Running Python script synchronously..."); - RunPythonScript(script); - } - } - else - { - if (script.empty()) - { - printf("Running Python program asynchronously..."); - RunPythonProgramAsync(app_path); - } - else - { - printf("Running Python script asynchronously..."); - RunPythonScriptAsync(script); - } - } - - result->Success(flutter::EncodableValue(app_path)); - } - else - { - result->NotImplemented(); - } - } - - void SeriousPythonWindowsPlugin::RunPythonProgramAsync(std::string appPath) - { - // Create a new thread that runs the program - std::thread pyThread(&SeriousPythonWindowsPlugin::RunPythonProgram, this, appPath); - - // Detach the thread so it runs independently - pyThread.detach(); - } - - void SeriousPythonWindowsPlugin::RunPythonScriptAsync(std::string script) - { - // Create a new thread that runs the script - std::thread pyThread(&SeriousPythonWindowsPlugin::RunPythonScript, this, script); - - // Detach the thread so it runs independently - pyThread.detach(); - } - - void SeriousPythonWindowsPlugin::RunPythonProgram(std::string appPath) - { - Py_Initialize(); - - FILE *file; - errno_t err = fopen_s(&file, appPath.c_str(), "r"); - if (err == 0 && file != NULL) - { - PyRun_SimpleFileEx(file, appPath.c_str(), 1); - fclose(file); - } - - Py_Finalize(); - } - - void SeriousPythonWindowsPlugin::RunPythonScript(std::string script) - { - Py_Initialize(); - - PyRun_SimpleString(script.c_str()); - - Py_Finalize(); + result->NotImplemented(); } } // namespace serious_python_windows diff --git a/src/serious_python_windows/windows/serious_python_windows_plugin.h b/src/serious_python_windows/windows/serious_python_windows_plugin.h index dca611d7..52c1893b 100644 --- a/src/serious_python_windows/windows/serious_python_windows_plugin.h +++ b/src/serious_python_windows/windows/serious_python_windows_plugin.h @@ -26,12 +26,6 @@ namespace serious_python_windows void HandleMethodCall( const flutter::MethodCall &method_call, std::unique_ptr> result); - - void RunPythonProgram(std::string appPath); - void RunPythonProgramAsync(std::string appPath); - - void RunPythonScript(std::string script); - void RunPythonScriptAsync(std::string script); }; } // namespace serious_python_windows diff --git a/src/serious_python_windows/windows/test/serious_python_windows_plugin_test.cpp b/src/serious_python_windows/windows/test/serious_python_windows_plugin_test.cpp deleted file mode 100644 index a5414da6..00000000 --- a/src/serious_python_windows/windows/test/serious_python_windows_plugin_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "serious_python_windows_plugin.h" - -namespace serious_python_windows { -namespace test { - -namespace { - -using flutter::EncodableMap; -using flutter::EncodableValue; -using flutter::MethodCall; -using flutter::MethodResultFunctions; - -} // namespace - -TEST(SeriousPythonWindowsPlugin, GetPlatformVersion) { - SeriousPythonWindowsPlugin plugin; - // Save the reply value from the success callback. - std::string result_string; - plugin.HandleMethodCall( - MethodCall("getPlatformVersion", std::make_unique()), - std::make_unique>( - [&result_string](const EncodableValue* result) { - result_string = std::get(*result); - }, - nullptr, nullptr)); - - // Since the exact string varies by host, just ensure that it's a string - // with the expected format. - EXPECT_TRUE(result_string.rfind("Windows ", 0) == 0); -} - -} // namespace test -} // namespace serious_python_windows