diff --git a/.gitattributes b/.gitattributes index 08910ca3..11340e45 100644 --- a/.gitattributes +++ b/.gitattributes @@ -36,7 +36,7 @@ thermion_dart/native/lib/macos/debug/libmatlang.a filter=lfs diff=lfs merge=lfs thermion_dart/native/lib/macos/debug/libibl.a filter=lfs diff=lfs merge=lfs -text thermion_dart/native/lib/macos/debug/libmikktspace.a filter=lfs diff=lfs merge=lfs -text thermion_dart/native/lib/macos/libmatdbg_combined.a filter=lfs diff=lfs merge=lfs -text -thermion_dart/native/lib/macos/swift/ThermionDartTexture.h filter=lfs diff=lfs merge=lfs -text +thermion_dart/native/lib/macos/swift/ThermionTexture.h filter=lfs diff=lfs merge=lfs -text thermion_dart/native/lib/macos/debug/libfilamat_combined.a filter=lfs diff=lfs merge=lfs -text thermion_dart/native/lib/macos/debug/libfilament.a filter=lfs diff=lfs merge=lfs -text thermion_dart/native/lib/macos/libibl.a filter=lfs diff=lfs merge=lfs -text diff --git a/CHANGELOG.md b/CHANGELOG.md index 26f6e28b..dfe2cb4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,362 @@ # Change Log +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## 2024-10-10 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`thermion_dart` - `v0.2.1-dev.0.0.6`](#thermion_dart---v021-dev006) + - [`thermion_flutter_web` - `v0.1.0+7`](#thermion_flutter_web---v0107) + - [`thermion_flutter_platform_interface` - `v0.2.1-dev.5`](#thermion_flutter_platform_interface---v021-dev5) + - [`thermion_flutter` - `v0.2.1-dev.5`](#thermion_flutter---v021-dev5) + - [`thermion_flutter_ffi` - `v0.2.1-dev.5`](#thermion_flutter_ffi---v021-dev5) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `thermion_flutter_web` - `v0.1.0+7` + - `thermion_flutter_platform_interface` - `v0.2.1-dev.5` + - `thermion_flutter` - `v0.2.1-dev.5` + - `thermion_flutter_ffi` - `v0.2.1-dev.5` + +--- + +#### `thermion_dart` - `v0.2.1-dev.0.0.6` + + - Bump "thermion_dart" to `0.2.1-dev.0.0.6`. + + +## 2024-10-10 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`thermion_dart` - `v0.2.1-dev.0.0.5`](#thermion_dart---v021-dev005) + - [`thermion_flutter_platform_interface` - `v0.2.1-dev.4`](#thermion_flutter_platform_interface---v021-dev4) + - [`thermion_flutter_web` - `v0.1.0+6`](#thermion_flutter_web---v0106) + - [`thermion_flutter` - `v0.2.1-dev.4`](#thermion_flutter---v021-dev4) + - [`thermion_flutter_ffi` - `v0.2.1-dev.4`](#thermion_flutter_ffi---v021-dev4) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `thermion_flutter_platform_interface` - `v0.2.1-dev.4` + - `thermion_flutter_web` - `v0.1.0+6` + - `thermion_flutter` - `v0.2.1-dev.4` + - `thermion_flutter_ffi` - `v0.2.1-dev.4` + +--- + +#### `thermion_dart` - `v0.2.1-dev.0.0.5` + + - Bump "thermion_dart" to `0.2.1-dev.0.0.5`. + + +## 2024-10-02 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`thermion_dart` - `v0.2.1-dev.0.0.4`](#thermion_dart---v021-dev004) + - [`thermion_flutter_web` - `v0.1.0+5`](#thermion_flutter_web---v0105) + - [`thermion_flutter` - `v0.2.1-dev.3`](#thermion_flutter---v021-dev3) + - [`thermion_flutter_platform_interface` - `v0.2.1-dev.3`](#thermion_flutter_platform_interface---v021-dev3) + - [`thermion_flutter_ffi` - `v0.2.1-dev.3`](#thermion_flutter_ffi---v021-dev3) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `thermion_flutter_web` - `v0.1.0+5` + - `thermion_flutter` - `v0.2.1-dev.3` + - `thermion_flutter_platform_interface` - `v0.2.1-dev.3` + - `thermion_flutter_ffi` - `v0.2.1-dev.3` + +--- + +#### `thermion_dart` - `v0.2.1-dev.0.0.4` + + +## 2024-10-02 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`thermion_dart` - `v0.2.1-dev.0.0.3`](#thermion_dart---v021-dev003) + - [`thermion_flutter_web` - `v0.1.0+4`](#thermion_flutter_web---v0104) + - [`thermion_flutter` - `v0.2.1-dev.2`](#thermion_flutter---v021-dev2) + - [`thermion_flutter_platform_interface` - `v0.2.1-dev.2`](#thermion_flutter_platform_interface---v021-dev2) + - [`thermion_flutter_ffi` - `v0.2.1-dev.2`](#thermion_flutter_ffi---v021-dev2) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `thermion_flutter_web` - `v0.1.0+4` + - `thermion_flutter` - `v0.2.1-dev.2` + - `thermion_flutter_platform_interface` - `v0.2.1-dev.2` + - `thermion_flutter_ffi` - `v0.2.1-dev.2` + +--- + +#### `thermion_dart` - `v0.2.1-dev.0.0.3` + + - Bump "thermion_dart" to `0.2.1-dev.0.0.3`. + + +## 2024-10-02 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`thermion_dart` - `v0.2.1-dev.0.0.2`](#thermion_dart---v021-dev002) + - [`thermion_flutter_web` - `v0.1.0+3`](#thermion_flutter_web---v0103) + - [`thermion_flutter_ffi` - `v0.2.1-dev.1`](#thermion_flutter_ffi---v021-dev1) + - [`thermion_flutter` - `v0.2.1-dev.1`](#thermion_flutter---v021-dev1) + - [`thermion_flutter_platform_interface` - `v0.2.1-dev.1`](#thermion_flutter_platform_interface---v021-dev1) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `thermion_flutter_web` - `v0.1.0+3` + - `thermion_flutter_ffi` - `v0.2.1-dev.1` + - `thermion_flutter` - `v0.2.1-dev.1` + - `thermion_flutter_platform_interface` - `v0.2.1-dev.1` + +--- + +#### `thermion_dart` - `v0.2.1-dev.0.0.2` + + +## 2024-10-02 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`thermion_dart` - `v0.2.1-dev.0.0.1`](#thermion_dart---v021-dev001) + - [`thermion_flutter_web` - `v0.1.0+2`](#thermion_flutter_web---v0102) + - [`thermion_flutter` - `v0.2.1-dev.0`](#thermion_flutter---v021-dev0) + - [`thermion_flutter_platform_interface` - `v0.2.1-dev.0`](#thermion_flutter_platform_interface---v021-dev0) + - [`thermion_flutter_ffi` - `v0.2.1-dev.0`](#thermion_flutter_ffi---v021-dev0) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `thermion_flutter_web` - `v0.1.0+2` + - `thermion_flutter` - `v0.2.1-dev.0` + - `thermion_flutter_platform_interface` - `v0.2.1-dev.0` + - `thermion_flutter_ffi` - `v0.2.1-dev.0` + +--- + +#### `thermion_dart` - `v0.2.1-dev.0.0.1` + + +## 2024-10-02 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`thermion_dart` - `v0.2.1-dev.0.0.0`](#thermion_dart---v021-dev000) + - [`thermion_flutter` - `v0.2.1-dev.0.0.0`](#thermion_flutter---v021-dev000) + - [`thermion_flutter_ffi` - `v0.2.1-dev.0.0.0`](#thermion_flutter_ffi---v021-dev000) + - [`thermion_flutter_platform_interface` - `v0.2.1-dev.0.0.0`](#thermion_flutter_platform_interface---v021-dev000) + - [`thermion_flutter_web` - `v0.1.0+1`](#thermion_flutter_web---v0101) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `thermion_flutter_web` - `v0.1.0+1` + +--- + +#### `thermion_dart` - `v0.2.1-dev.0.0.0` + + - y + +#### `thermion_flutter` - `v0.2.1-dev.0.0.0` + + - y + +#### `thermion_flutter_ffi` - `v0.2.1-dev.0.0.0` + + - y + +#### `thermion_flutter_platform_interface` - `v0.2.1-dev.0.0.0` + + - y + + +## 2024-10-02 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`thermion_dart` - `v0.2.0`](#thermion_dart---v020) + - [`thermion_flutter` - `v0.2.0`](#thermion_flutter---v020) + - [`thermion_flutter_ffi` - `v0.2.0`](#thermion_flutter_ffi---v020) + - [`thermion_flutter_platform_interface` - `v0.2.0`](#thermion_flutter_platform_interface---v020) + - [`thermion_flutter_web` - `v0.1.0`](#thermion_flutter_web---v010) + +Packages graduated to a stable release (see pre-releases prior to the stable version for changelog entries): + + - `thermion_dart` - `v0.2.0` + - `thermion_flutter` - `v0.2.0` + - `thermion_flutter_ffi` - `v0.2.0` + - `thermion_flutter_platform_interface` - `v0.2.0` + - `thermion_flutter_web` - `v0.1.0` + +--- + +#### `thermion_dart` - `v0.2.0` + +#### `thermion_flutter` - `v0.2.0` + +#### `thermion_flutter_ffi` - `v0.2.0` + +#### `thermion_flutter_platform_interface` - `v0.2.0` + +#### `thermion_flutter_web` - `v0.1.0` + + +## 2024-10-02 + +### Changes + +--- + +Packages with breaking changes: + + - [`thermion_dart` - `v0.2.0-dev.8.0.0`](#thermion_dart---v020-dev800) + - [`thermion_flutter_ffi` - `v0.2.0-dev.8.0.0`](#thermion_flutter_ffi---v020-dev800) + +Packages with other changes: + + - [`thermion_flutter` - `v0.2.0-dev.8.0.0`](#thermion_flutter---v020-dev800) + - [`thermion_flutter_platform_interface` - `v0.2.0-dev.8.0.0`](#thermion_flutter_platform_interface---v020-dev800) + - [`thermion_flutter_web` - `v0.1.0-dev.8.0.0`](#thermion_flutter_web---v010-dev800) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `thermion_flutter_web` - `v0.1.0-dev.8.0.0` + +--- + +#### `thermion_dart` - `v0.2.0-dev.8.0.0` + + - **REFACTOR**: continual refactor to support multiple render targets. + - **FEAT**: camera and resizing improvements. + - **FEAT**: support multiple ThermionWidget on Android. + - **FEAT**: use imported texture on iOS. + - **FEAT**: working implementation of multiple widgets on macos. + - **FEAT**: more work on multiple views/swapchains. + - **FEAT**: add setParameterFloat2 method. + - **FEAT**: add setParameterFloat2 method. + - **FEAT**: add uvScale to unlit material. + - **FEAT**: add ThirdPersonCameraDelegate. + - **FEAT**: set camera model matrix directly. + - **FEAT**: expose more camera methods. + - **BREAKING** **REFACTOR**: refactor to support multiple Views/Render Targets. + - **BREAKING** **REFACTOR**: remove RenderThread methods no longer needed. + - **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms. + - **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms. + - **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms. + - **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms. + - **BREAKING** **FEAT**: big refactor to support multiple swapchains. + - **BREAKING** **FEAT**: set baseColorIndex to -1 by default in unlit materialss. + +#### `thermion_flutter_ffi` - `v0.2.0-dev.8.0.0` + + - **REFACTOR**: continual refactor to support multiple render targets. + - **FEAT**: support multiple ThermionWidget on Android. + - **FEAT**: use imported texture on iOS. + - **FEAT**: working implementation of multiple widgets on macos. + - **BREAKING** **REFACTOR**: refactor to support multiple Views/Render Targets. + - **BREAKING** **FEAT**: big refactor to support multiple swapchains. + +#### `thermion_flutter` - `v0.2.0-dev.8.0.0` + + - **REFACTOR**: continual refactor to support multiple render targets. + - **FEAT**: camera and resizing improvements. + - **FEAT**: support multiple ThermionWidget on Android. + - **FEAT**: use imported texture on iOS. + - **FEAT**: working implementation of multiple widgets on macos. + - **FEAT**: add rendering check to ThermionWidget ticker. + +#### `thermion_flutter_platform_interface` - `v0.2.0-dev.8.0.0` + + - **REFACTOR**: continual refactor to support multiple render targets. + - **FEAT**: support multiple ThermionWidget on Android. + - **FEAT**: working implementation of multiple widgets on macos. + +# Change Log + v0.2.0 - **BREAKING** Dart SDK 3.6.0 required diff --git a/Makefile b/Makefile index 0fce35c0..3c85a7be 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ flutter-example-web: dart-web-clean dart-web flutter-example-macos: cd thermion_flutter_federated/thermion_flutter/example/web && flutter run -d macos swift-bindings: + swiftc -c thermion_flutter/thermion_flutter/macos/Classes/ThermionTexture.swift -module-name swift_module -emit-objc-header-path thermion_dart/native/include/generated/ThermionTextureSwiftObjCAPI.h -emit-library -o thermion_dart/test/libThermionTextureSwift.dylib cd thermion_dart/ && dart --enable-experiment=native-assets run ffigen --config ffigen/swift.yaml bindings: cd thermion_dart/ && dart --enable-experiment=native-assets run ffigen --config ffigen/native.yaml diff --git a/docs/android.mdx b/docs/android.mdx index 4020b554..1279b9dc 100644 --- a/docs/android.mdx +++ b/docs/android.mdx @@ -1,5 +1,19 @@ ## Android +### Min SDK version + +Thermion requires Android SDK version 22, so change your `app/android/build.gradle` to match this version or higher: + +```groovy + defaultConfig { + ... + minSdk = 22 + ... + } +``` + +### Shrink/Minify Resources + In release mode, you must add the following to your `app/build.gradle`: ``` diff --git a/thermion_dart/CHANGELOG.md b/thermion_dart/CHANGELOG.md index a163d845..b30587bd 100644 --- a/thermion_dart/CHANGELOG.md +++ b/thermion_dart/CHANGELOG.md @@ -1,3 +1,54 @@ +## 0.2.1-dev.0.0.6 + + - Bump "thermion_dart" to `0.2.1-dev.0.0.6`. + +## 0.2.1-dev.0.0.5 + + - Bump "thermion_dart" to `0.2.1-dev.0.0.5`. + +## 0.2.1-dev.0.0.4 + +## 0.2.1-dev.0.0.3 + + - Bump "thermion_dart" to `0.2.1-dev.0.0.3`. + +## 0.2.1-dev.0.0.2 + +## 0.2.1-dev.0.0.1 + +## 0.2.1-dev.0.0.0 + + - y + +## 0.2.0 + + - Graduate package to a stable release. See pre-releases prior to this version for changelog entries. + +## 0.2.0-dev.8.0.0 + +> Note: This release has breaking changes. + + - **REFACTOR**: continual refactor to support multiple render targets. + - **FEAT**: camera and resizing improvements. + - **FEAT**: support multiple ThermionWidget on Android. + - **FEAT**: use imported texture on iOS. + - **FEAT**: working implementation of multiple widgets on macos. + - **FEAT**: more work on multiple views/swapchains. + - **FEAT**: add setParameterFloat2 method. + - **FEAT**: add setParameterFloat2 method. + - **FEAT**: add uvScale to unlit material. + - **FEAT**: add ThirdPersonCameraDelegate. + - **FEAT**: set camera model matrix directly. + - **FEAT**: expose more camera methods. + - **BREAKING** **REFACTOR**: refactor to support multiple Views/Render Targets. + - **BREAKING** **REFACTOR**: remove RenderThread methods no longer needed. + - **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms. + - **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms. + - **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms. + - **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms. + - **BREAKING** **FEAT**: big refactor to support multiple swapchains. + - **BREAKING** **FEAT**: set baseColorIndex to -1 by default in unlit materialss. + ## 0.2.0-dev.7.0 > Note: This release has breaking changes. diff --git a/thermion_dart/extras/windows/CMakeLists.txt b/thermion_dart/extras/windows/CMakeLists.txt new file mode 100644 index 00000000..8d239884 --- /dev/null +++ b/thermion_dart/extras/windows/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.14) +set(PROJECT_NAME "thermion_windows") +project(${PROJECT_NAME} LANGUAGES C CXX) + +cmake_policy(VERSION 3.14...3.25) + +add_compile_definitions(WGL_USE_BACKING_WINDOW) +add_compile_definitions(UNICODE) + +add_library(${PROJECT_NAME} SHARED + "thermion_window.cpp" +) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) +target_include_directories(${PROJECT_NAME} INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/include" + "${CMAKE_SOURCE_DIR}/../../../../thermion_dart/native/include/filament" + "${CMAKE_SOURCE_DIR}/../../../../thermion_dart/native/include" + ${CMAKE_CURRENT_SOURCE_DIR}/include +) + +target_link_libraries(${PROJECT_NAME} PRIVATE + Shlwapi + opengl32 + dwmapi + comctl32 +) + diff --git a/thermion_dart/extras/windows/thermion_window.cpp b/thermion_dart/extras/windows/thermion_window.cpp new file mode 100644 index 00000000..d189f6bc --- /dev/null +++ b/thermion_dart/extras/windows/thermion_window.cpp @@ -0,0 +1,244 @@ +#include "thermion_window.h" + +#include +#include +#include +#include + +#include +#include +#include + +#pragma comment(lib, "dwmapi.lib") +#pragma comment(lib, "comctl32.lib") + +namespace thermion { + +static constexpr auto kClassName = L"THERMION_WINDOW"; +static constexpr auto kWindowName = L"thermion_window"; +static bool was_window_hidden_due_to_minimize_ = false; +static WPARAM last_wm_size_wparam_ = SIZE_RESTORED; +uint64_t last_thread_time_ = 0; +static constexpr auto kNativeViewPositionAndShowDelay = 300; + +typedef enum _WINDOWCOMPOSITIONATTRIB { + WCA_UNDEFINED = 0, + WCA_NCRENDERING_ENABLED = 1, + WCA_NCRENDERING_POLICY = 2, + WCA_TRANSITIONS_FORCEDISABLED = 3, + WCA_ALLOW_NCPAINT = 4, + WCA_CAPTION_BUTTON_BOUNDS = 5, + WCA_NONCLIENT_RTL_LAYOUT = 6, + WCA_FORCE_ICONIC_REPRESENTATION = 7, + WCA_EXTENDED_FRAME_BOUNDS = 8, + WCA_HAS_ICONIC_BITMAP = 9, + WCA_THEME_ATTRIBUTES = 10, + WCA_NCRENDERING_EXILED = 11, + WCA_NCADORNMENTINFO = 12, + WCA_EXCLUDED_FROM_LIVEPREVIEW = 13, + WCA_VIDEO_OVERLAY_ACTIVE = 14, + WCA_FORCE_ACTIVEWINDOW_APPEARANCE = 15, + WCA_DISALLOW_PEEK = 16, + WCA_CLOAK = 17, + WCA_CLOAKED = 18, + WCA_ACCENT_POLICY = 19, + WCA_FREEZE_REPRESENTATION = 20, + WCA_EVER_UNCLOAKED = 21, + WCA_VISUAL_OWNER = 22, + WCA_HOLOGRAPHIC = 23, + WCA_EXCLUDED_FROM_DDA = 24, + WCA_PASSIVEUPDATEMODE = 25, + WCA_USEDARKMODECOLORS = 26, + WCA_LAST = 27 +} WINDOWCOMPOSITIONATTRIB; + +typedef struct _WINDOWCOMPOSITIONATTRIBDATA { + WINDOWCOMPOSITIONATTRIB Attrib; + PVOID pvData; + SIZE_T cbData; +} WINDOWCOMPOSITIONATTRIBDATA; + +typedef enum _ACCENT_STATE { + ACCENT_DISABLED = 0, + ACCENT_ENABLE_GRADIENT = 1, + ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, + ACCENT_ENABLE_BLURBEHIND = 3, + ACCENT_ENABLE_ACRYLICBLURBEHIND = 4, + ACCENT_ENABLE_HOSTBACKDROP = 5, + ACCENT_INVALID_STATE = 6 +} ACCENT_STATE; + +typedef struct _ACCENT_POLICY { + ACCENT_STATE AccentState; + DWORD AccentFlags; + DWORD GradientColor; + DWORD AnimationId; +} ACCENT_POLICY; + +typedef BOOL(WINAPI* _GetWindowCompositionAttribute)( + HWND, WINDOWCOMPOSITIONATTRIBDATA*); +typedef BOOL(WINAPI* _SetWindowCompositionAttribute)( + HWND, WINDOWCOMPOSITIONATTRIBDATA*); + +static _SetWindowCompositionAttribute g_set_window_composition_attribute = NULL; +static bool g_set_window_composition_attribute_initialized = false; + +typedef LONG NTSTATUS, *PNTSTATUS; +#define STATUS_SUCCESS (0x00000000) + +typedef NTSTATUS(WINAPI* RtlGetVersionPtr)(PRTL_OSVERSIONINFOW); + +RTL_OSVERSIONINFOW GetWindowsVersion() { + HMODULE hmodule = ::GetModuleHandleW(L"ntdll.dll"); + if (hmodule) { + RtlGetVersionPtr rtl_get_version_ptr = + (RtlGetVersionPtr)::GetProcAddress(hmodule, "RtlGetVersion"); + if (rtl_get_version_ptr != nullptr) { + RTL_OSVERSIONINFOW rovi = {0}; + rovi.dwOSVersionInfoSize = sizeof(rovi); + if (STATUS_SUCCESS == rtl_get_version_ptr(&rovi)) { + return rovi; + } + } + } + RTL_OSVERSIONINFOW rovi = {0}; + return rovi; +} + +void SetWindowComposition(HWND window, int32_t accent_state, + int32_t gradient_color) { + // TODO: Look for a better available API. + if (GetWindowsVersion().dwBuildNumber >= 18362) { + if (!g_set_window_composition_attribute_initialized) { + auto user32 = ::GetModuleHandleA("user32.dll"); + if (user32) { + g_set_window_composition_attribute = + reinterpret_cast<_SetWindowCompositionAttribute>( + ::GetProcAddress(user32, "SetWindowCompositionAttribute")); + if (g_set_window_composition_attribute) { + g_set_window_composition_attribute_initialized = true; + } + } + } + ACCENT_POLICY accent = {static_cast(accent_state), 2, + static_cast(gradient_color), 0}; + WINDOWCOMPOSITIONATTRIBDATA data; + data.Attrib = WCA_ACCENT_POLICY; + data.pvData = &accent; + data.cbData = sizeof(accent); + g_set_window_composition_attribute(window, &data); + } +} + + +LRESULT CALLBACK FilamentWindowProc(HWND const window, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + std::cout << message <(user_data); + ::SetForegroundWindow(flutterRootWindow); + LONG ex_style = ::GetWindowLong(flutterRootWindow, GWL_EXSTYLE); + ex_style &= ~(WS_EX_TRANSPARENT | WS_EX_LAYERED); + ::SetWindowLong(flutterRootWindow, GWL_EXSTYLE, ex_style); + } + break; + } + case WM_ERASEBKGND: { + HDC hdc = (HDC)wparam; + RECT rect; + GetClientRect(window, &rect); + + // Get the ThermionWindow instance associated with this window + ThermionWindow* thermionWindow = reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); + + if (thermionWindow) { + HBRUSH brush = CreateSolidBrush(RGB(0, 0, 255)); + FillRect(hdc, &rect, brush); + DeleteObject(brush); + } + + break; + } + case WM_SIZE: + break; + case WM_MOVE: + case WM_MOVING: + case WM_ACTIVATE: + case WM_WINDOWPOSCHANGED: { + // NativeViewCore::GetInstance()->SetHitTestBehavior(0); + auto user_data = ::GetWindowLongPtr(window, GWLP_USERDATA); + if (user_data) { + HWND flutterRootWindow = reinterpret_cast(user_data); + ::SetForegroundWindow(flutterRootWindow); + // NativeViewCore::GetInstance()->SetHitTestBehavior(0); + LONG ex_style = ::GetWindowLong(flutterRootWindow, GWL_EXSTYLE); + ex_style &= ~(WS_EX_TRANSPARENT | WS_EX_LAYERED); + ::SetWindowLong(flutterRootWindow, GWL_EXSTYLE, ex_style); + } + break; + } + default: + break; + } + return ::DefWindowProc(window, message, wparam, lparam); +} + +ThermionWindow::ThermionWindow(int width, + int height, + int left, + int top) : _width(width), _height(height), _left(left), _top(top) { + // create the HWND for Filament + auto window_class = WNDCLASSEX{}; + ::SecureZeroMemory(&window_class, sizeof(window_class)); + window_class.cbSize = sizeof(window_class); + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.lpfnWndProc = FilamentWindowProc; + window_class.hInstance = 0; + window_class.lpszClassName = kClassName; + window_class.hCursor = ::LoadCursorW(nullptr, IDC_ARROW); + window_class.hbrBackground = ::CreateSolidBrush(RGB(0,255,0)); + ::RegisterClassExW(&window_class); + _windowHandle = ::CreateWindow(kClassName, kWindowName, WS_OVERLAPPEDWINDOW, + 0, 0, _width, _height, nullptr, + nullptr, GetModuleHandle(nullptr), nullptr); + + // Disable DWM animations + auto disable_window_transitions = TRUE; + DwmSetWindowAttribute(_windowHandle, DWMWA_TRANSITIONS_FORCEDISABLED, + &disable_window_transitions, + sizeof(disable_window_transitions)); + + auto style = ::GetWindowLong(_windowHandle, GWL_STYLE); + style &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | + WS_EX_APPWINDOW); + ::SetWindowLong(_windowHandle, GWL_STYLE, style); + + // // remove taskbar entry for the window we created + // ITaskbarList3* taskbar = nullptr; + // ::CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, + // IID_PPV_ARGS(&taskbar)); + // taskbar->DeleteTab(_windowHandle); + // taskbar->Release(); + ::ShowWindow(_windowHandle, SW_SHOW); + UpdateWindow(_windowHandle); +} + +void ThermionWindow::Resize(int width, int height, int left, int top) { + _width = width; + _height = height; + _left = left; + _top = top; +} + +HWND ThermionWindow::GetHandle() { return _windowHandle; } +} // namespace thermion_flutter diff --git a/thermion_dart/extras/windows/thermion_window.h b/thermion_dart/extras/windows/thermion_window.h new file mode 100644 index 00000000..d22976d4 --- /dev/null +++ b/thermion_dart/extras/windows/thermion_window.h @@ -0,0 +1,57 @@ +#pragma once + +#ifdef _WIN32 +#ifdef IS_DLL +#define EMSCRIPTEN_KEEPALIVE __declspec(dllimport) +#else +#define EMSCRIPTEN_KEEPALIVE __declspec(dllexport) +#endif + +#include +#include +#include + +namespace thermion { + +/// +/// Instantiating a ThermionWindow creates a HWND that can be passed +/// to Filament to create a swapchain. +/// +/// +class ThermionWindow { + public: + ThermionWindow( + int width, + int height, + int left, + int top); + HWND GetHandle(); + void Resize(int width, int height, int left, int top); + private: + HWND _windowHandle; + uint32_t _width = 0; + uint32_t _height = 0; + uint32_t _left = 0; + uint32_t _top = 0; +}; + +static ThermionWindow* _window; + +extern "C" { + EMSCRIPTEN_KEEPALIVE intptr_t create_thermion_window(int width, int height, int left, int top) { + _window = new ThermionWindow(width, height, left, top); + return (intptr_t)_window->GetHandle(); + } + + EMSCRIPTEN_KEEPALIVE void update() { + MSG msg; + if(GetMessage(&msg, NULL, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } +} + +} +#endif \ No newline at end of file diff --git a/thermion_dart/ffigen/native.yaml b/thermion_dart/ffigen/native.yaml index 97d42410..bfb0c0d2 100644 --- a/thermion_dart/ffigen/native.yaml +++ b/thermion_dart/ffigen/native.yaml @@ -3,10 +3,16 @@ headers: entry-points: - '../native/include/ThermionDartRenderThreadApi.h' - '../native/include/ThermionDartApi.h' + - '../native/include/TView.h' + - '../native/include/TCamera.h' + - '../native/include/TGizmo.h' - '../native/include/ResourceBuffer.h' include-directives: - '../native/include/ThermionDartRenderThreadApi.h' - '../native/include/ThermionDartApi.h' + - '../native/include/TView.h' + - '../native/include/TCamera.h' + - '../native/include/TGizmo.h' - '../native/include/ResourceBuffer.h' - '../native/include/APIBoundaryTypes.h' ffi-native: diff --git a/thermion_dart/ffigen/swift.yaml b/thermion_dart/ffigen/swift.yaml index fae767e1..a207a3fd 100644 --- a/thermion_dart/ffigen/swift.yaml +++ b/thermion_dart/ffigen/swift.yaml @@ -1,15 +1,15 @@ -name: ThermionDartTexture -description: Bindings for ThermionDartTexture. +name: ThermionTextureSwift +description: Bindings for ThermionTexture. language: objc -output: 'lib/thermion_dart/swift/swift_bindings.g.dart' +output: '../lib/src/swift/swift_bindings.g.dart' exclude-all-by-default: true objc-interfaces: include: - - 'ThermionDartTexture' + - 'ThermionTextureSwift' module: - 'ThermionDartTexture': 'thermion_dart_texture' + 'ThermionTextureSwift': 'swift_module' headers: entry-points: - - 'native/lib/macos/swift/ThermionDartTexture.h' + - '../native/include/generated/ThermionTextureSwiftObjCAPI.h' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field, return_of_invalid_type, void_checks, annotate_overrides, no_leading_underscores_for_local_identifiers, library_private_types_in_public_apia \ No newline at end of file diff --git a/thermion_dart/hook/build.dart b/thermion_dart/hook/build.dart index 9b561f39..aecda6b2 100644 --- a/thermion_dart/hook/build.dart +++ b/thermion_dart/hook/build.dart @@ -32,19 +32,14 @@ void main(List args) async { final name = "thermion_dart.dart"; final libUri = config.outputDirectory .resolve(config.targetOS.libraryFileName(name, linkMode)); - output.addAssets( - [ - NativeCodeAsset( - package: config.packageName, - name: name, - file: libUri, - linkMode: linkMode, - os: config.targetOS, - architecture: config.dryRun ? null : config.targetArchitecture, - ) - ], - linkInPackage: null, - ); + output.addAsset(NativeCodeAsset( + package: config.packageName, + name: name, + file: libUri, + linkMode: linkMode, + os: config.targetOS, + architecture: config.dryRun ? null : config.targetArchitecture, + )); return; } @@ -58,7 +53,7 @@ void main(List args) async { .map((f) => f.path) .toList(); sources.addAll([ - "${config.packageRoot.toFilePath()}/native/include/material/gizmo.c", + "${config.packageRoot.toFilePath()}/native/include/material/gizmo_material.c", "${config.packageRoot.toFilePath()}/native/include/material/image.c", "${config.packageRoot.toFilePath()}/native/include/material/grid.c", "${config.packageRoot.toFilePath()}/native/include/material/unlit.c", @@ -92,7 +87,6 @@ void main(List args) async { "basis_transcoder" ]; - if (platform == "windows") { libDir = Directory(libDir).uri.toFilePath(); libs = libs.map((lib) => "${libDir}${lib}.lib").toList(); @@ -118,7 +112,12 @@ void main(List args) async { defines["WIN32"] = "1"; defines["_DEBUG"] = "1"; defines["_DLL"] = "1"; - flags.addAll(["/std:c++20", "/MDd"]); + flags.addAll([ + "/std:c++20", + "/MDd", + "/VERBOSE", + ...defines.keys.map((k) => "/D$k=${defines[k]}").toList() + ]); } if (platform == "ios") { @@ -149,16 +148,26 @@ void main(List args) async { name: packageName, language: Language.cpp, assetName: 'thermion_dart.dart', - sources: sources, - includes: ['native/include', 'native/include/filament'], - defines: defines, + sources: platform == "windows" ? [] : sources, + includes: platform == "windows" + ? [] + : ['native/include', 'native/include/filament'], + defines: platform == "windows" ? {} : defines, flags: [ if (platform == "macos") '-mmacosx-version-min=13.0', if (platform == "ios") '-mios-version-min=13.0', ...flags, ...frameworks, - ...libs.map((lib) => "-l$lib"), - "-L$libDir", + if (platform != "windows") ...libs.map((lib) => "-l$lib"), + if (platform != "windows") "-L$libDir", + if (platform == "windows") ...[ + "/I${config.packageRoot.toFilePath()}\\native\\include", + "/I${config.packageRoot.toFilePath()}native\\include\\filament", + ...sources, + '/link', + "/LIBPATH:$libDir", + '/DLL', + ] ], dartBuildFiles: ['hook/build.dart'], ); @@ -177,17 +186,24 @@ void main(List args) async { Architecture.ia32 => "i686-linux-android", _ => throw FormatException('Invalid') }; - + var compilerPath = config.cCompiler.compiler!.path; - - if(Platform.isWindows && compilerPath.startsWith("/")) { + + if (Platform.isWindows && compilerPath.startsWith("/")) { compilerPath = compilerPath.substring(1); } - - var ndkRoot = File(compilerPath).parent.parent.uri.toFilePath(windows:true); - var stlPath = - File([ndkRoot, "sysroot", "usr", "lib", archExtension, "libc++_shared.so"].join(Platform.pathSeparator)); + var ndkRoot = + File(compilerPath).parent.parent.uri.toFilePath(windows: true); + + var stlPath = File([ + ndkRoot, + "sysroot", + "usr", + "lib", + archExtension, + "libc++_shared.so" + ].join(Platform.pathSeparator)); output.addAsset(NativeCodeAsset( package: "thermion_dart", name: "libc++_shared.so", @@ -201,7 +217,7 @@ void main(List args) async { if (config.targetOS == "windows") { output.addAsset( NativeCodeAsset( - package: "thermion_dart", + package: config.packageName, name: "thermion_dart.dll", linkMode: DynamicLoadingBundled(), os: config.targetOS, diff --git a/thermion_dart/lib/src/entities/abstract_gizmo.dart b/thermion_dart/lib/src/entities/abstract_gizmo.dart deleted file mode 100644 index cebe9d42..00000000 --- a/thermion_dart/lib/src/entities/abstract_gizmo.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:vector_math/vector_math_64.dart'; - -import '../../thermion_dart.dart'; - -abstract class AbstractGizmo { - - bool get isVisible; - bool get isHovered; - - Future translate(double transX, double transY); - - void reset(); - - Future attach(ThermionEntity entity); - - Future detach(); - - Stream get boundingBox; - - void checkHover(double x, double y); -} diff --git a/thermion_dart/lib/src/input/input.dart b/thermion_dart/lib/src/input/input.dart index ec6dfc2d..1ac364f3 100644 --- a/thermion_dart/lib/src/input/input.dart +++ b/thermion_dart/lib/src/input/input.dart @@ -3,4 +3,5 @@ library; export 'src/input_handler.dart'; export 'src/delegates.dart'; export 'src/delegate_gesture_handler.dart'; +export 'src/implementations/default_pick_delegate.dart'; export 'src/implementations/third_person_camera_delegate.dart'; diff --git a/thermion_dart/lib/src/input/src/delegate_gesture_handler.dart b/thermion_dart/lib/src/input/src/delegate_gesture_handler.dart index 668d3ba2..5a53ed19 100644 --- a/thermion_dart/lib/src/input/src/delegate_gesture_handler.dart +++ b/thermion_dart/lib/src/input/src/delegate_gesture_handler.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:math'; import 'package:logging/logging.dart'; import 'package:thermion_dart/thermion_dart.dart'; import 'package:vector_math/vector_math_64.dart'; @@ -9,6 +10,12 @@ import 'implementations/free_flight_camera_delegate.dart'; class DelegateInputHandler implements InputHandler { final ThermionViewer viewer; + Stream> get gestures => _gesturesController.stream; + final _gesturesController = StreamController>.broadcast(); + + Stream get cameraUpdated => _cameraUpdatedController.stream; + final _cameraUpdatedController = StreamController.broadcast(); + final _logger = Logger("DelegateInputHandler"); InputHandlerDelegate? transformDelegate; @@ -20,6 +27,8 @@ class DelegateInputHandler implements InputHandler { Map _actions = { InputType.LMB_HOLD_AND_MOVE: InputAction.TRANSLATE, + InputType.SCALE1: InputAction.TRANSLATE, + InputType.SCALE2: InputAction.ZOOM, InputType.MMB_HOLD_AND_MOVE: InputAction.ROTATE, InputType.SCROLLWHEEL: InputAction.TRANSLATE, InputType.POINTER_MOVE: InputAction.NONE, @@ -54,7 +63,7 @@ class DelegateInputHandler implements InputHandler { factory DelegateInputHandler.fixedOrbit(ThermionViewer viewer, {double minimumDistance = 10.0, - double? Function(Vector3)? getDistanceToTarget, + Future Function(Vector3)? getDistanceToTarget, ThermionEntity? entity, PickDelegate? pickDelegate}) => DelegateInputHandler( @@ -69,11 +78,22 @@ class DelegateInputHandler implements InputHandler { }); factory DelegateInputHandler.flight(ThermionViewer viewer, - {PickDelegate? pickDelegate, bool freeLook=false, double? clampY, ThermionEntity? entity}) => + {PickDelegate? pickDelegate, + bool freeLook = false, + double panSensitivity = 0.1, + double movementSensitivity = 0.1, + double rotateSensitivity = 0.01, + double? clampY, + ThermionEntity? entity}) => DelegateInputHandler( viewer: viewer, pickDelegate: pickDelegate, - transformDelegate: FreeFlightInputHandlerDelegate(viewer, clampY:clampY, entity:entity), + transformDelegate: FreeFlightInputHandlerDelegate(viewer, + clampY: clampY, + entity: entity, + rotationSensitivity: rotateSensitivity, + panSensitivity: panSensitivity, + movementSensitivity: movementSensitivity), actions: { InputType.MMB_HOLD_AND_MOVE: InputAction.ROTATE, InputType.SCROLLWHEEL: InputAction.TRANSLATE, @@ -82,8 +102,9 @@ class DelegateInputHandler implements InputHandler { InputType.KEYDOWN_W: InputAction.TRANSLATE, InputType.KEYDOWN_S: InputAction.TRANSLATE, InputType.KEYDOWN_D: InputAction.TRANSLATE, - if(freeLook) - InputType.POINTER_MOVE: InputAction.ROTATE, + InputType.SCALE1: InputAction.TRANSLATE, + InputType.SCALE2: InputAction.ZOOM, + if (freeLook) InputType.POINTER_MOVE: InputAction.ROTATE, }); bool _processing = false; @@ -102,39 +123,53 @@ class DelegateInputHandler implements InputHandler { await transformDelegate?.queue(action, vector); } - + final keyTypes = []; for (final key in _pressedKeys) { InputAction? keyAction; + InputType? keyType = null; Vector3? vector; switch (key) { case PhysicalKey.W: - keyAction = _actions[InputType.KEYDOWN_W]; + keyType = InputType.KEYDOWN_W; vector = Vector3(0, 0, -1); break; case PhysicalKey.A: - keyAction = _actions[InputType.KEYDOWN_A]; + keyType = InputType.KEYDOWN_A; vector = Vector3(-1, 0, 0); break; case PhysicalKey.S: - keyAction = _actions[InputType.KEYDOWN_S]; + keyType = InputType.KEYDOWN_S; vector = Vector3(0, 0, 1); break; case PhysicalKey.D: - keyAction = _actions[InputType.KEYDOWN_D]; + keyType = InputType.KEYDOWN_D; vector = Vector3(1, 0, 0); break; } - if (keyAction != null) { - var transform = _axes[keyAction]; - if (transform != null) { - vector = transform * vector; + + // ignore: unnecessary_null_comparison + if (keyType != null) { + keyAction = _actions[keyType]; + + if (keyAction != null) { + var transform = _axes[keyAction]; + if (transform != null) { + vector = transform * vector; + } + transformDelegate?.queue(keyAction, vector!); + keyTypes.add(keyType); } - transformDelegate?.queue(keyAction, vector!); } } await transformDelegate?.execute(); + var updates = _inputDeltas.keys.followedBy(keyTypes).toList(); + if (updates.isNotEmpty) { + _gesturesController.add(updates); + _cameraUpdatedController.add(true); + } + _inputDeltas.clear(); _processing = false; } @@ -160,15 +195,13 @@ class DelegateInputHandler implements InputHandler { } if (isMiddle) { _inputDeltas[InputType.MMB_HOLD_AND_MOVE] = - (_inputDeltas[InputType.MMB_HOLD_AND_MOVE] ?? Vector3.zero()) + Vector3(delta.x, delta.y, 0.0); + (_inputDeltas[InputType.MMB_HOLD_AND_MOVE] ?? Vector3.zero()) + + Vector3(delta.x, delta.y, 0.0); } else { _inputDeltas[InputType.LMB_HOLD_AND_MOVE] = - (_inputDeltas[InputType.LMB_HOLD_AND_MOVE] ?? Vector3.zero()) + Vector3(delta.x, delta.y, 0.0); + (_inputDeltas[InputType.LMB_HOLD_AND_MOVE] ?? Vector3.zero()) + + Vector3(delta.x, delta.y, 0.0); } - // else { - // _inputDeltas[InputType.POINTER_MOVE] = - // (_inputDeltas[InputType.POINTER_MOVE] ?? Vector3.zero()) + delta; - // } } @override @@ -180,7 +213,8 @@ class DelegateInputHandler implements InputHandler { return; } _inputDeltas[InputType.POINTER_MOVE] = - (_inputDeltas[InputType.POINTER_MOVE] ?? Vector3.zero()) + Vector3(delta.x, delta.y, 0.0); + (_inputDeltas[InputType.POINTER_MOVE] ?? Vector3.zero()) + + Vector3(delta.x, delta.y, 0.0); } @override @@ -191,8 +225,8 @@ class DelegateInputHandler implements InputHandler { } try { _inputDeltas[InputType.SCROLLWHEEL] = - (_inputDeltas[InputType.SCROLLWHEEL] ?? Vector3.zero()) - + Vector3(0,0, scrollDelta > 0 ? 1 : -1); + (_inputDeltas[InputType.SCROLLWHEEL] ?? Vector3.zero()) + + Vector3(0, 0, scrollDelta > 0 ? 1 : -1); } catch (e) { _logger.warning("Error during scroll accumulation: $e"); } @@ -206,15 +240,6 @@ class DelegateInputHandler implements InputHandler { @override Future get initialized => viewer.initialized; - @override - Future onScaleEnd() async {} - - @override - Future onScaleStart() async {} - - @override - Future onScaleUpdate() async {} - @override void setActionForType(InputType gestureType, InputAction gestureAction) { _actions[gestureType] = gestureAction; @@ -232,4 +257,26 @@ class DelegateInputHandler implements InputHandler { void keyUp(PhysicalKey key) { _pressedKeys.remove(key); } + + @override + Future onScaleEnd(int pointerCount) async {} + + @override + Future onScaleStart(Vector2 localPosition, int pointerCount) async { + // noop + } + + @override + Future onScaleUpdate(Vector2 focalPoint, Vector2 focalPointDelta, + double horizontalScale, double verticalScale, double scale, int pointerCount) async { + if (pointerCount == 1) { + _inputDeltas[InputType.SCALE1] = + Vector3(focalPointDelta.x, focalPointDelta.y, 0); + } else if (pointerCount == 2) { + _inputDeltas[InputType.SCALE2] = + Vector3(0, 0, max(horizontalScale, verticalScale)); + } else { + throw UnimplementedError("Only pointerCount <= 2 supported"); + } + } } diff --git a/thermion_dart/lib/src/input/src/implementations/default_pick_delegate.dart b/thermion_dart/lib/src/input/src/implementations/default_pick_delegate.dart new file mode 100644 index 00000000..73835163 --- /dev/null +++ b/thermion_dart/lib/src/input/src/implementations/default_pick_delegate.dart @@ -0,0 +1,13 @@ +import 'package:thermion_dart/thermion_dart.dart'; +import 'package:vector_math/vector_math_64.dart'; + +class DefaultPickDelegate extends PickDelegate { + final ThermionViewer viewer; + + const DefaultPickDelegate(this.viewer); + + @override + void pick(Vector2 location) { + viewer.pick(location.x.toInt(), location.y.toInt()); + } +} diff --git a/thermion_dart/lib/src/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart b/thermion_dart/lib/src/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart index 047dba30..68aec940 100644 --- a/thermion_dart/lib/src/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart +++ b/thermion_dart/lib/src/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart @@ -9,7 +9,7 @@ class FixedOrbitRotateInputHandlerDelegate implements InputHandlerDelegate { final ThermionViewer viewer; late Future _camera; final double minimumDistance; - double? Function(Vector3)? getDistanceToTarget; + Future Function(Vector3)? getDistanceToTarget; Vector2 _queuedRotationDelta = Vector2.zero(); double _queuedZoomDelta = 0.0; @@ -22,7 +22,14 @@ class FixedOrbitRotateInputHandlerDelegate implements InputHandlerDelegate { this.getDistanceToTarget, this.minimumDistance = 10.0, }) { - _camera = viewer.getMainCamera(); + _camera = viewer.getMainCamera().then((Camera cam) async { + var viewMatrix = makeViewMatrix(Vector3(0.0, 0, -minimumDistance), + Vector3.zero(), Vector3(0.0, 1.0, 0.0)); + viewMatrix.invert(); + + await cam.setTransform(viewMatrix); + return cam; + }); } void dispose() { @@ -38,24 +45,36 @@ class FixedOrbitRotateInputHandlerDelegate implements InputHandlerDelegate { _queuedRotationDelta += Vector2(delta.x, delta.y); break; case InputAction.TRANSLATE: - _queuedZoomDelta += delta!.z; + _queuedZoomDelta += delta.z; break; case InputAction.PICK: - // Assuming PICK is used for zoom in this context - _queuedZoomDelta += delta.z; break; case InputAction.NONE: // Do nothing break; + case InputAction.ZOOM: + _queuedZoomDelta += delta.z; + break; } } + bool _executing = false; + @override Future execute() async { if (_queuedRotationDelta.length2 == 0.0 && _queuedZoomDelta == 0.0) { return; } + if (_executing) { + return; + } + + _executing = true; + + final view = await viewer.getViewAt(0); + final viewport = await view.getViewport(); + var viewMatrix = await viewer.getCameraViewMatrix(); var modelMatrix = await viewer.getCameraModelMatrix(); var projectionMatrix = await viewer.getCameraProjectionMatrix(); @@ -63,15 +82,22 @@ class FixedOrbitRotateInputHandlerDelegate implements InputHandlerDelegate { Vector3 currentPosition = modelMatrix.getTranslation(); Vector3 forward = -currentPosition.normalized(); + + if (forward.length == 0) { + forward = Vector3(0, 0, -1); + currentPosition = Vector3(0, 0, minimumDistance); + } + Vector3 right = _up.cross(forward).normalized(); Vector3 up = forward.cross(right); - // Calculate intersection point and depth - double radius = getDistanceToTarget?.call(currentPosition) ?? 1.0; - if (radius != 1.0) { - radius = currentPosition.length - radius; - } - Vector3 intersection = (-forward).scaled(radius); + // Calculate the point where the camera forward ray intersects with the + // surface of the target sphere + var distanceToTarget = + (await getDistanceToTarget?.call(currentPosition)) ?? 0; + + Vector3 intersection = + (-forward).scaled(currentPosition.length - distanceToTarget); final intersectionInViewSpace = viewMatrix * Vector4(intersection.x, intersection.y, intersection.z, 1.0); @@ -80,12 +106,8 @@ class FixedOrbitRotateInputHandlerDelegate implements InputHandlerDelegate { intersectionInClipSpace / intersectionInClipSpace.w; // Calculate new camera position based on rotation - final ndcX = 2 * - ((-_queuedRotationDelta.x * viewer.pixelRatio) / - viewer.viewportDimensions.$1); - final ndcY = 2 * - ((_queuedRotationDelta.y * viewer.pixelRatio) / - viewer.viewportDimensions.$2); + final ndcX = 2 * ((-_queuedRotationDelta.x) / viewport.width); + final ndcY = 2 * ((_queuedRotationDelta.y) / viewport.height); final ndc = Vector4(ndcX, ndcY, intersectionInNdcSpace.z, 1.0); var clipSpace = Vector4( @@ -99,17 +121,45 @@ class FixedOrbitRotateInputHandlerDelegate implements InputHandlerDelegate { var worldSpace3 = worldSpace.xyz.normalized() * currentPosition.length; currentPosition = worldSpace3; - // Apply zoom + // Zoom if (_queuedZoomDelta != 0.0) { - Vector3 toSurface = currentPosition - intersection; - currentPosition = - currentPosition + toSurface.scaled(_queuedZoomDelta * 0.1); - } + var distToIntersection = + (currentPosition - intersection).length - minimumDistance; - // Ensure minimum distance - if (currentPosition.length < radius + minimumDistance) { - currentPosition = - (currentPosition.normalized() * (radius + minimumDistance)); + // if we somehow overshot the minimum distance, reset the camera to the minimum distance + if (distToIntersection < 0) { + currentPosition += + (intersection.normalized().scaled(-distToIntersection * 10)); + } else { + bool zoomingOut = _queuedZoomDelta > 0; + late Vector3 offset; + + // when zooming, we don't always use fractions of the distance from + // the camera to the target (this is due to float precision issues at + // large distances, and also it doesn't work well for UI). + + // if we're zooming out and the distance is less than 10m, we zoom out by 1 unit + if (zoomingOut) { + if (distToIntersection < 10) { + offset = intersection.normalized(); + } else { + offset = intersection.normalized().scaled(distToIntersection / 10); + } + // if we're zooming in and the distance is less than 5m, zoom in by 1/2 the distance, + // otherwise 1/10 of the distance each time + } else { + if (distToIntersection < 5) { + offset = intersection.normalized().scaled(-distToIntersection / 2); + } else { + offset = intersection.normalized().scaled(-distToIntersection / 10); + } + + if (offset.length > distToIntersection) { + offset = Vector3.zero(); + } + } + currentPosition += offset; + } } // Calculate view matrix @@ -127,5 +177,7 @@ class FixedOrbitRotateInputHandlerDelegate implements InputHandlerDelegate { // Reset queued deltas _queuedRotationDelta = Vector2.zero(); _queuedZoomDelta = 0.0; + + _executing = false; } } diff --git a/thermion_dart/lib/src/input/src/implementations/free_flight_camera_delegate.dart b/thermion_dart/lib/src/input/src/implementations/free_flight_camera_delegate.dart index 04e35c66..ba36fe27 100644 --- a/thermion_dart/lib/src/input/src/implementations/free_flight_camera_delegate.dart +++ b/thermion_dart/lib/src/input/src/implementations/free_flight_camera_delegate.dart @@ -20,7 +20,7 @@ class FreeFlightInputHandlerDelegate implements InputHandlerDelegate { static final Vector3 _right = Vector3(1, 0, 0); Vector2 _queuedRotationDelta = Vector2.zero(); - Vector2 _queuedPanDelta = Vector2.zero(); + Vector3 _queuedTranslateDelta = Vector3.zero(); double _queuedZoomDelta = 0.0; Vector3 _queuedMoveDelta = Vector3.zero(); @@ -49,15 +49,15 @@ class FreeFlightInputHandlerDelegate implements InputHandlerDelegate { _queuedRotationDelta += Vector2(delta.x, delta.y); break; case InputAction.TRANSLATE: - _queuedPanDelta += Vector2(delta.x, delta.y); - _queuedZoomDelta += delta.z; + _queuedTranslateDelta += delta; break; case InputAction.PICK: - // Assuming PICK is used for zoom in this context _queuedZoomDelta += delta.z; break; case InputAction.NONE: - // Do nothing + break; + case InputAction.ZOOM: + _queuedZoomDelta += delta.z; break; } } @@ -73,7 +73,7 @@ class FreeFlightInputHandlerDelegate implements InputHandlerDelegate { _executing = true; if (_queuedRotationDelta.length2 == 0.0 && - _queuedPanDelta.length2 == 0.0 && + _queuedTranslateDelta.length2 == 0.0 && _queuedZoomDelta == 0.0 && _queuedMoveDelta.length2 == 0.0) { _executing = false; @@ -81,48 +81,43 @@ class FreeFlightInputHandlerDelegate implements InputHandlerDelegate { } final activeCamera = await viewer.getActiveCamera(); - Matrix4 currentViewMatrix = activeCamera.getViewMatrix(); - Matrix4 currentTransform = await viewer.getLocalTransform(await entity); - Vector3 currentPosition = currentTransform.getTranslation(); + Quaternion currentRotation = Quaternion.fromRotation(currentTransform.getRotation()); + // Calculate relative transform + Matrix4 relativeTransform = Matrix4.identity(); + Vector3 relativeTranslation = Vector3.zero(); + Quaternion relativeRotation = Quaternion.identity(); + // Apply rotation if (_queuedRotationDelta.length2 > 0.0) { - double deltaX = - _queuedRotationDelta.x * rotationSensitivity * viewer.pixelRatio; - double deltaY = - _queuedRotationDelta.y * rotationSensitivity * viewer.pixelRatio; + double deltaX = _queuedRotationDelta.x * rotationSensitivity; + double deltaY = _queuedRotationDelta.y * rotationSensitivity; Quaternion yawRotation = Quaternion.axisAngle(_up, -deltaX); Quaternion pitchRotation = Quaternion.axisAngle(_right, -deltaY); - currentRotation = currentRotation * pitchRotation * yawRotation; - currentRotation.normalize(); - + relativeRotation = pitchRotation * yawRotation; _queuedRotationDelta = Vector2.zero(); } // Apply pan - if (_queuedPanDelta.length2 > 0.0) { - Vector3 right = _right.clone()..applyQuaternion(currentRotation); - Vector3 up = _up.clone()..applyQuaternion(currentRotation); + if (_queuedTranslateDelta.length2 > 0.0) { + double deltaX = _queuedTranslateDelta.x * panSensitivity; + double deltaY = _queuedTranslateDelta.y * panSensitivity; + double deltaZ = -_queuedTranslateDelta.z * panSensitivity; - double deltaX = _queuedPanDelta.x * panSensitivity * viewer.pixelRatio; - double deltaY = _queuedPanDelta.y * panSensitivity * viewer.pixelRatio; - - Vector3 panOffset = right * deltaX + up * deltaY; - currentPosition += panOffset; - - _queuedPanDelta = Vector2.zero(); + relativeTranslation += _right * deltaX + _up * deltaY + _forward * deltaZ; + _queuedTranslateDelta = Vector3.zero(); } // Apply zoom if (_queuedZoomDelta != 0.0) { Vector3 forward = _forward.clone()..applyQuaternion(currentRotation); - currentPosition += forward * -_queuedZoomDelta * zoomSensitivity; + relativeTranslation += forward * -_queuedZoomDelta * zoomSensitivity; _queuedZoomDelta = 0.0; } @@ -132,21 +127,38 @@ class FreeFlightInputHandlerDelegate implements InputHandlerDelegate { Vector3 right = _right.clone()..applyQuaternion(currentRotation); Vector3 up = _up.clone()..applyQuaternion(currentRotation); - Vector3 moveOffset = right * _queuedMoveDelta.x + - up * _queuedMoveDelta.y + - forward * _queuedMoveDelta.z; - currentPosition += moveOffset; + relativeTranslation += (right * _queuedMoveDelta.x + + up * _queuedMoveDelta.y + + forward * _queuedMoveDelta.z) * + movementSensitivity; _queuedMoveDelta = Vector3.zero(); } - // Constrain position - currentPosition = _constrainPosition(currentPosition); + // If the managed entity is not the active camera, we need to apply the rotation from the current camera model matrix + // to the entity's translation + if (await entity != activeCamera.getEntity()) { + Matrix4 modelMatrix = await activeCamera.getModelMatrix(); + relativeTranslation = modelMatrix.getRotation() * relativeTranslation; + } + + // Compose relative transform + relativeTransform = Matrix4.compose( + relativeTranslation, relativeRotation, Vector3(1, 1, 1)); + + // Apply relative transform to current transform + Matrix4 newTransform = currentTransform * relativeTransform; + + // Extract new position and constrain it + Vector3 newPosition = newTransform.getTranslation(); + newPosition = _constrainPosition(newPosition); + + // Recompose final transform with constrained position + Matrix4 finalTransform = Matrix4.compose(newPosition, + Quaternion.fromRotation(newTransform.getRotation()), Vector3(1, 1, 1)); // Update camera - Matrix4 newModelMatrix = - Matrix4.compose(currentPosition, currentRotation, Vector3(1, 1, 1)); - await viewer.setTransform(await entity, newModelMatrix); + await viewer.setTransform(await entity, finalTransform); _executing = false; } diff --git a/thermion_dart/lib/src/input/src/implementations/third_person_camera_delegate.dart b/thermion_dart/lib/src/input/src/implementations/third_person_camera_delegate.dart index 5e69f15b..eaa73807 100644 --- a/thermion_dart/lib/src/input/src/implementations/third_person_camera_delegate.dart +++ b/thermion_dart/lib/src/input/src/implementations/third_person_camera_delegate.dart @@ -29,13 +29,16 @@ class OverTheShoulderCameraDelegate implements InputHandlerDelegate { final cameraUp = Vector3(0, 1, 0); var cameraLookAt = Vector3(0, 0.5, 3); + final void Function(Matrix4 transform)? onUpdate; + OverTheShoulderCameraDelegate(this.viewer, this.player, this.camera, {this.rotationSensitivity = 0.001, this.movementSensitivity = 0.1, this.zoomSensitivity = 0.1, this.panSensitivity = 0.1, this.clampY, - ThermionEntity? entity}) {} + ThermionEntity? entity, + this.onUpdate}) {} @override Future queue(InputAction action, Vector3? delta) async { @@ -53,6 +56,8 @@ class OverTheShoulderCameraDelegate implements InputHandlerDelegate { break; case InputAction.NONE: break; + case InputAction.ZOOM: + break; } } @@ -91,14 +96,15 @@ class OverTheShoulderCameraDelegate implements InputHandlerDelegate { var inverted = newPlayerTransform.clone()..invert(); // camera is always looking at -Z, whereas models generally face towards +Z - // therefore if (_queuedRotationDelta.length2 > 0.0) { double deltaX = - _queuedRotationDelta.x * rotationSensitivity * viewer.pixelRatio; + _queuedRotationDelta.x * rotationSensitivity; double deltaY = - _queuedRotationDelta.y * rotationSensitivity * viewer.pixelRatio; + _queuedRotationDelta.y * rotationSensitivity; - cameraLookAt = Matrix4.rotationY(-deltaX) * Matrix4.rotationX(-deltaY) * cameraLookAt; + cameraLookAt = Matrix4.rotationY(-deltaX) * + Matrix4.rotationX(-deltaY) * + cameraLookAt; _queuedRotationDelta = Vector2.zero(); } @@ -110,85 +116,7 @@ class OverTheShoulderCameraDelegate implements InputHandlerDelegate { await viewer.queueTransformUpdates( [camera.getEntity(), player], [newCameraTransform, newPlayerTransform]); - + onUpdate?.call(newPlayerTransform); _executing = false; } } - - - // Quaternion relativeCameraRotation = Quaternion.identity(); - - // // Apply rotation - - - // // transform the translation from player space to world space - // var rotation = (await camera.getModelMatrix()).getRotation(); - // // Extract yaw angle from the original matrix - // double yaw = atan2(rotation.entry(2, 0), rotation.entry(0, 0)); - - // // Create a new matrix with only the yaw rotation - // double cosYaw = cos(yaw); - // double sinYaw = sin(yaw); - - // rotation = Matrix3(cosYaw, 0, sinYaw, 0, 1, 0, -sinYaw, 0, cosYaw); - - // relativeTranslation = rotation * relativeTranslation; - - // // Compose relative transform - // relativeTransform = - // Matrix4.compose(relativeTranslation, currentRotation, Vector3(1, 1, 1)); - - // // Apply relative transform to current transform - // Matrix4 newTransform = currentTransform * relativeTransform; - - // // Extract new position and constrain it - // Vector3 newPosition = newTransform.getTranslation(); - - // // Recompose final transform with constrained position - // Matrix4 finalTransform = Matrix4.compose(newPosition, - // Quaternion.fromRotation(newTransform.getRotation()), Vector3(1, 1, 1)); - - // Quaternion relativeCameraRotation = Quaternion.identity(); - - // // Apply rotation - // if (_queuedRotationDelta.length2 > 0.0) { - // double deltaX = - // _queuedRotationDelta.x * rotationSensitivity * viewer.pixelRatio; - // double deltaY = - // _queuedRotationDelta.y * rotationSensitivity * viewer.pixelRatio; - - // Quaternion yawRotation = Quaternion.axisAngle(_up, -deltaX); - // Quaternion pitchRotation = Quaternion.axisAngle(_right, -deltaY); - - // relativeCameraRotation = pitchRotation * yawRotation; - // _queuedRotationDelta = Vector2.zero(); - // } - - // // transform the translation from player space to world space - // var rotation = (await camera.getModelMatrix()).getRotation(); - // // Extract yaw angle from the original matrix - // double yaw = atan2(rotation.entry(2, 0), rotation.entry(0, 0)); - - // // Create a new matrix with only the yaw rotation - // double cosYaw = cos(yaw); - // double sinYaw = sin(yaw); - - // rotation = Matrix3(cosYaw, 0, sinYaw, 0, 1, 0, -sinYaw, 0, cosYaw); - - // relativeTranslation = rotation * relativeTranslation; - - // // Compose relative transform - // relativeTransform = - // Matrix4.compose(relativeTranslation, currentRotation, Vector3(1, 1, 1)); - - // // Apply relative transform to current transform - // Matrix4 newTransform = currentTransform * relativeTransform; - - // // Extract new position and constrain it - // Vector3 newPosition = newTransform.getTranslation(); - - // // Recompose final transform with constrained position - // Matrix4 finalTransform = Matrix4.compose(newPosition, - // Quaternion.fromRotation(newTransform.getRotation()), Vector3(1, 1, 1)); - - // // Update camera \ No newline at end of file diff --git a/thermion_dart/lib/src/input/src/input_handler.dart b/thermion_dart/lib/src/input/src/input_handler.dart index 44096647..90983d48 100644 --- a/thermion_dart/lib/src/input/src/input_handler.dart +++ b/thermion_dart/lib/src/input/src/input_handler.dart @@ -24,18 +24,20 @@ enum InputType { enum PhysicalKey { W, A, S, D } -enum InputAction { TRANSLATE, ROTATE, PICK, NONE } +enum InputAction { TRANSLATE, ROTATE, PICK, ZOOM, NONE } abstract class InputHandler { - + Stream get cameraUpdated; + Future onPointerHover(Vector2 localPosition, Vector2 delta); Future onPointerScroll(Vector2 localPosition, double scrollDelta); Future onPointerDown(Vector2 localPosition, bool isMiddle); - Future onPointerMove(Vector2 localPosition, Vector2 delta, bool isMiddle); + Future onPointerMove( + Vector2 localPosition, Vector2 delta, bool isMiddle); Future onPointerUp(bool isMiddle); - Future onScaleStart(); - Future onScaleUpdate(); - Future onScaleEnd(); + Future onScaleStart(Vector2 focalPoint, int pointerCount); + Future onScaleUpdate(Vector2 focalPoint, Vector2 focalPointDelta, double horizontalScale, double verticalScale, double scale, int pointerCount); + Future onScaleEnd(int pointerCount); Future get initialized; Future dispose(); diff --git a/thermion_dart/lib/src/swift/swift_bindings.g.dart b/thermion_dart/lib/src/swift/swift_bindings.g.dart deleted file mode 100644 index 2c64a267..00000000 --- a/thermion_dart/lib/src/swift/swift_bindings.g.dart +++ /dev/null @@ -1,73832 +0,0 @@ -// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field, return_of_invalid_type, void_checks, annotate_overrides, no_leading_underscores_for_local_identifiers, library_private_types_in_public_apia -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -// ignore_for_file: type=lint -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// Bindings for ThermionDartTexture. -class ThermionDartTexture1 { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - ThermionDartTexture1(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - ThermionDartTexture1.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - if (clazz == ffi.nullptr) { - throw Exception('Failed to load Objective-C class: $name'); - } - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _objc_retain( - ffi.Pointer value, - ) { - return __objc_retain( - value, - ); - } - - late final __objc_retainPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_retain'); - late final __objc_retain = __objc_retainPtr - .asFunction Function(ffi.Pointer)>(); - - void _objc_release( - ffi.Pointer value, - ) { - return __objc_release( - value, - ); - } - - late final __objc_releasePtr = - _lookup)>>( - 'objc_release'); - late final __objc_release = - __objc_releasePtr.asFunction)>(); - - late final _objc_releaseFinalizer2 = - ffi.NativeFinalizer(__objc_releasePtr.cast()); - late final _class_NSObject1 = _getClass1("NSObject"); - late final _sel_load1 = _registerName1("load"); - void _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initialize1 = _registerName1("initialize"); - late final _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_2( - obj, - sel, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_new1 = _registerName1("new"); - late final _sel_allocWithZone_1 = _registerName1("allocWithZone:"); - instancetype _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_3( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final _sel_alloc1 = _registerName1("alloc"); - late final _sel_dealloc1 = _registerName1("dealloc"); - late final _sel_finalize1 = _registerName1("finalize"); - late final _sel_copy1 = _registerName1("copy"); - late final _sel_mutableCopy1 = _registerName1("mutableCopy"); - late final _sel_copyWithZone_1 = _registerName1("copyWithZone:"); - late final _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_4( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer clazz, - ) { - return __objc_msgSend_0( - obj, - sel, - clazz, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_isKindOfClass_1 = _registerName1("isKindOfClass:"); - late final _class_Protocol1 = _getClass1("Protocol"); - late final _sel_conformsToProtocol_1 = _registerName1("conformsToProtocol:"); - bool _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_5( - obj, - sel, - protocol, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_methodForSelector_1 = _registerName1("methodForSelector:"); - ffi.Pointer> _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - ffi.Pointer> Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_8( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSInvocation1 = _getClass1("NSInvocation"); - late final _class_NSMethodSignature1 = _getClass1("NSMethodSignature"); - late final _sel_signatureWithObjCTypes_1 = - _registerName1("signatureWithObjCTypes:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer types, - ) { - return __objc_msgSend_9( - obj, - sel, - types, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_numberOfArguments1 = _registerName1("numberOfArguments"); - int _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ); - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_getArgumentTypeAtIndex_1 = - _registerName1("getArgumentTypeAtIndex:"); - ffi.Pointer _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - int idx, - ) { - return __objc_msgSend_11( - obj, - sel, - idx, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_frameLength1 = _registerName1("frameLength"); - late final _sel_isOneway1 = _registerName1("isOneway"); - bool _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_12( - obj, - sel, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_methodReturnType1 = _registerName1("methodReturnType"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_methodReturnLength1 = _registerName1("methodReturnLength"); - late final _sel_cancelPreviousPerformRequestsWithTarget_selector_object_1 = - _registerName1( - "cancelPreviousPerformRequestsWithTarget:selector:object:"); - void _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aTarget, - ffi.Pointer aSelector, - ffi.Pointer anArgument, - ) { - return __objc_msgSend_14( - obj, - sel, - aTarget, - aSelector, - anArgument, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_cancelPreviousPerformRequestsWithTarget_1 = - _registerName1("cancelPreviousPerformRequestsWithTarget:"); - void _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aTarget, - ) { - return __objc_msgSend_15( - obj, - sel, - aTarget, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_accessInstanceVariablesDirectly1 = - _registerName1("accessInstanceVariablesDirectly"); - late final _sel_useStoredAccessor1 = _registerName1("useStoredAccessor"); - late final _class_NSSet1 = _getClass1("NSSet"); - late final _sel_count1 = _registerName1("count"); - late final _sel_member_1 = _registerName1("member:"); - ffi.Pointer _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - ) { - return __objc_msgSend_16( - obj, - sel, - object, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSEnumerator1 = _getClass1("NSEnumerator"); - late final _sel_nextObject1 = _registerName1("nextObject"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_17( - obj, - sel, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_allObjects1 = _registerName1("allObjects"); - late final _class_NSString1 = _getClass1("NSString"); - late final _sel_length1 = _registerName1("length"); - late final _sel_characterAtIndex_1 = _registerName1("characterAtIndex:"); - int _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_18( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedShort Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _class_NSCoder1 = _getClass1("NSCoder"); - late final _sel_encodeValueOfObjCType_at_1 = - _registerName1("encodeValueOfObjCType:at:"); - void _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer type, - ffi.Pointer addr, - ) { - return __objc_msgSend_19( - obj, - sel, - type, - addr, - ); - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSData1 = _getClass1("NSData"); - late final _sel_bytes1 = _registerName1("bytes"); - ffi.Pointer _objc_msgSend_20( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_20( - obj, - sel, - ); - } - - late final __objc_msgSend_20Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_description1 = _registerName1("description"); - ffi.Pointer _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_21( - obj, - sel, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_getBytes_length_1 = _registerName1("getBytes:length:"); - void _objc_msgSend_22( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int length, - ) { - return __objc_msgSend_22( - obj, - sel, - buffer, - length, - ); - } - - late final __objc_msgSend_22Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_getBytes_range_1 = _registerName1("getBytes:range:"); - void _objc_msgSend_23( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - _NSRange range, - ) { - return __objc_msgSend_23( - obj, - sel, - buffer, - range, - ); - } - - late final __objc_msgSend_23Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>(); - - late final _sel_isEqualToData_1 = _registerName1("isEqualToData:"); - bool _objc_msgSend_24( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - ) { - return __objc_msgSend_24( - obj, - sel, - other, - ); - } - - late final __objc_msgSend_24Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_subdataWithRange_1 = _registerName1("subdataWithRange:"); - ffi.Pointer _objc_msgSend_25( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_25( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_25Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_writeToFile_atomically_1 = - _registerName1("writeToFile:atomically:"); - bool _objc_msgSend_26( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool useAuxiliaryFile, - ) { - return __objc_msgSend_26( - obj, - sel, - path, - useAuxiliaryFile, - ); - } - - late final __objc_msgSend_26Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _class_NSURL1 = _getClass1("NSURL"); - late final _sel_initWithScheme_host_path_1 = - _registerName1("initWithScheme:host:path:"); - instancetype _objc_msgSend_27( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer scheme, - ffi.Pointer host, - ffi.Pointer path, - ) { - return __objc_msgSend_27( - obj, - sel, - scheme, - host, - path, - ); - } - - late final __objc_msgSend_27Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initFileURLWithPath_isDirectory_relativeToURL_1 = - _registerName1("initFileURLWithPath:isDirectory:relativeToURL:"); - instancetype _objc_msgSend_28( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_28( - obj, - sel, - path, - isDir, - baseURL, - ); - } - - late final __objc_msgSend_28Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool, ffi.Pointer)>(); - - late final _sel_initFileURLWithPath_relativeToURL_1 = - _registerName1("initFileURLWithPath:relativeToURL:"); - instancetype _objc_msgSend_29( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_29( - obj, - sel, - path, - baseURL, - ); - } - - late final __objc_msgSend_29Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initFileURLWithPath_isDirectory_1 = - _registerName1("initFileURLWithPath:isDirectory:"); - instancetype _objc_msgSend_30( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, - ) { - return __objc_msgSend_30( - obj, - sel, - path, - isDir, - ); - } - - late final __objc_msgSend_30Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_initFileURLWithPath_1 = - _registerName1("initFileURLWithPath:"); - instancetype _objc_msgSend_31( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ) { - return __objc_msgSend_31( - obj, - sel, - path, - ); - } - - late final __objc_msgSend_31Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_fileURLWithPath_isDirectory_relativeToURL_1 = - _registerName1("fileURLWithPath:isDirectory:relativeToURL:"); - ffi.Pointer _objc_msgSend_32( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_32( - obj, - sel, - path, - isDir, - baseURL, - ); - } - - late final __objc_msgSend_32Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer)>(); - - late final _sel_fileURLWithPath_relativeToURL_1 = - _registerName1("fileURLWithPath:relativeToURL:"); - ffi.Pointer _objc_msgSend_33( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_33( - obj, - sel, - path, - baseURL, - ); - } - - late final __objc_msgSend_33Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_fileURLWithPath_isDirectory_1 = - _registerName1("fileURLWithPath:isDirectory:"); - ffi.Pointer _objc_msgSend_34( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, - ) { - return __objc_msgSend_34( - obj, - sel, - path, - isDir, - ); - } - - late final __objc_msgSend_34Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_fileURLWithPath_1 = _registerName1("fileURLWithPath:"); - ffi.Pointer _objc_msgSend_35( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ) { - return __objc_msgSend_35( - obj, - sel, - path, - ); - } - - late final __objc_msgSend_35Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1 = - _registerName1( - "initFileURLWithFileSystemRepresentation:isDirectory:relativeToURL:"); - instancetype _objc_msgSend_36( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_36( - obj, - sel, - path, - isDir, - baseURL, - ); - } - - late final __objc_msgSend_36Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool, ffi.Pointer)>(); - - late final _sel_fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1 = - _registerName1( - "fileURLWithFileSystemRepresentation:isDirectory:relativeToURL:"); - ffi.Pointer _objc_msgSend_37( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_37( - obj, - sel, - path, - isDir, - baseURL, - ); - } - - late final __objc_msgSend_37Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer)>(); - - late final _sel_initWithString_1 = _registerName1("initWithString:"); - instancetype _objc_msgSend_38( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer URLString, - ) { - return __objc_msgSend_38( - obj, - sel, - URLString, - ); - } - - late final __objc_msgSend_38Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithString_relativeToURL_1 = - _registerName1("initWithString:relativeToURL:"); - instancetype _objc_msgSend_39( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer URLString, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_39( - obj, - sel, - URLString, - baseURL, - ); - } - - late final __objc_msgSend_39Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_URLWithString_1 = _registerName1("URLWithString:"); - late final _sel_URLWithString_relativeToURL_1 = - _registerName1("URLWithString:relativeToURL:"); - late final _sel_initWithDataRepresentation_relativeToURL_1 = - _registerName1("initWithDataRepresentation:relativeToURL:"); - instancetype _objc_msgSend_40( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_40( - obj, - sel, - data, - baseURL, - ); - } - - late final __objc_msgSend_40Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_URLWithDataRepresentation_relativeToURL_1 = - _registerName1("URLWithDataRepresentation:relativeToURL:"); - ffi.Pointer _objc_msgSend_41( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_41( - obj, - sel, - data, - baseURL, - ); - } - - late final __objc_msgSend_41Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initAbsoluteURLWithDataRepresentation_relativeToURL_1 = - _registerName1("initAbsoluteURLWithDataRepresentation:relativeToURL:"); - late final _sel_absoluteURLWithDataRepresentation_relativeToURL_1 = - _registerName1("absoluteURLWithDataRepresentation:relativeToURL:"); - late final _sel_dataRepresentation1 = _registerName1("dataRepresentation"); - ffi.Pointer _objc_msgSend_42( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_42( - obj, - sel, - ); - } - - late final __objc_msgSend_42Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_absoluteString1 = _registerName1("absoluteString"); - ffi.Pointer _objc_msgSend_43( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_43( - obj, - sel, - ); - } - - late final __objc_msgSend_43Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_relativeString1 = _registerName1("relativeString"); - late final _sel_baseURL1 = _registerName1("baseURL"); - ffi.Pointer _objc_msgSend_44( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_44( - obj, - sel, - ); - } - - late final __objc_msgSend_44Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_absoluteURL1 = _registerName1("absoluteURL"); - late final _sel_scheme1 = _registerName1("scheme"); - late final _sel_resourceSpecifier1 = _registerName1("resourceSpecifier"); - late final _sel_host1 = _registerName1("host"); - late final _class_NSNumber1 = _getClass1("NSNumber"); - late final _class_NSValue1 = _getClass1("NSValue"); - late final _sel_getValue_size_1 = _registerName1("getValue:size:"); - late final _sel_objCType1 = _registerName1("objCType"); - late final _sel_initWithBytes_objCType_1 = - _registerName1("initWithBytes:objCType:"); - instancetype _objc_msgSend_45( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, - ) { - return __objc_msgSend_45( - obj, - sel, - value, - type, - ); - } - - late final __objc_msgSend_45Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithCoder_1 = _registerName1("initWithCoder:"); - instancetype _objc_msgSend_46( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_46( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_46Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_valueWithBytes_objCType_1 = - _registerName1("valueWithBytes:objCType:"); - ffi.Pointer _objc_msgSend_47( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, - ) { - return __objc_msgSend_47( - obj, - sel, - value, - type, - ); - } - - late final __objc_msgSend_47Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_value_withObjCType_1 = _registerName1("value:withObjCType:"); - late final _sel_valueWithNonretainedObject_1 = - _registerName1("valueWithNonretainedObject:"); - ffi.Pointer _objc_msgSend_48( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_48( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_48Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_nonretainedObjectValue1 = - _registerName1("nonretainedObjectValue"); - late final _sel_valueWithPointer_1 = _registerName1("valueWithPointer:"); - ffi.Pointer _objc_msgSend_49( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer pointer, - ) { - return __objc_msgSend_49( - obj, - sel, - pointer, - ); - } - - late final __objc_msgSend_49Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_pointerValue1 = _registerName1("pointerValue"); - late final _sel_isEqualToValue_1 = _registerName1("isEqualToValue:"); - bool _objc_msgSend_50( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_50( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_50Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_getValue_1 = _registerName1("getValue:"); - void _objc_msgSend_51( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_51( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_51Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_valueWithRange_1 = _registerName1("valueWithRange:"); - ffi.Pointer _objc_msgSend_52( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_52( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_52Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_rangeValue1 = _registerName1("rangeValue"); - late final _objc_msgSend_useVariants1 = ffi.Abi.current() == ffi.Abi.iosX64 || - ffi.Abi.current() == ffi.Abi.macosX64; - _NSRange _objc_msgSend_53( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_53( - obj, - sel, - ); - } - - late final __objc_msgSend_53Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_53_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_53_stret( - stret, - obj, - sel, - ); - } - - late final __objc_msgSend_53_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_53_stret = __objc_msgSend_53_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_valueWithPoint_1 = _registerName1("valueWithPoint:"); - ffi.Pointer _objc_msgSend_54( - ffi.Pointer obj, - ffi.Pointer sel, - CGPoint point, - ) { - return __objc_msgSend_54( - obj, - sel, - point, - ); - } - - late final __objc_msgSend_54Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, CGPoint)>>('objc_msgSend'); - late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, CGPoint)>(); - - late final _sel_valueWithSize_1 = _registerName1("valueWithSize:"); - ffi.Pointer _objc_msgSend_55( - ffi.Pointer obj, - ffi.Pointer sel, - CGSize size, - ) { - return __objc_msgSend_55( - obj, - sel, - size, - ); - } - - late final __objc_msgSend_55Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, CGSize)>>('objc_msgSend'); - late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, CGSize)>(); - - late final _sel_valueWithRect_1 = _registerName1("valueWithRect:"); - ffi.Pointer _objc_msgSend_56( - ffi.Pointer obj, - ffi.Pointer sel, - CGRect rect, - ) { - return __objc_msgSend_56( - obj, - sel, - rect, - ); - } - - late final __objc_msgSend_56Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, CGRect)>>('objc_msgSend'); - late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, CGRect)>(); - - late final _sel_valueWithEdgeInsets_1 = - _registerName1("valueWithEdgeInsets:"); - ffi.Pointer _objc_msgSend_57( - ffi.Pointer obj, - ffi.Pointer sel, - NSEdgeInsets insets, - ) { - return __objc_msgSend_57( - obj, - sel, - insets, - ); - } - - late final __objc_msgSend_57Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSEdgeInsets)>>('objc_msgSend'); - late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSEdgeInsets)>(); - - late final _sel_pointValue1 = _registerName1("pointValue"); - CGPoint _objc_msgSend_58( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_58( - obj, - sel, - ); - } - - late final __objc_msgSend_58Ptr = _lookup< - ffi.NativeFunction< - CGPoint Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< - CGPoint Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_58_stret( - ffi.Pointer stret, - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_58_stret( - stret, - obj, - sel, - ); - } - - late final __objc_msgSend_58_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_58_stret = __objc_msgSend_58_stretPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_sizeValue1 = _registerName1("sizeValue"); - CGSize _objc_msgSend_59( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_59( - obj, - sel, - ); - } - - late final __objc_msgSend_59Ptr = _lookup< - ffi.NativeFunction< - CGSize Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< - CGSize Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_59_stret( - ffi.Pointer stret, - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_59_stret( - stret, - obj, - sel, - ); - } - - late final __objc_msgSend_59_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_59_stret = __objc_msgSend_59_stretPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_rectValue1 = _registerName1("rectValue"); - CGRect _objc_msgSend_60( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_60( - obj, - sel, - ); - } - - late final __objc_msgSend_60Ptr = _lookup< - ffi.NativeFunction< - CGRect Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< - CGRect Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_60_stret( - ffi.Pointer stret, - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_60_stret( - stret, - obj, - sel, - ); - } - - late final __objc_msgSend_60_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_60_stret = __objc_msgSend_60_stretPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_edgeInsetsValue1 = _registerName1("edgeInsetsValue"); - NSEdgeInsets _objc_msgSend_61( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_61( - obj, - sel, - ); - } - - late final __objc_msgSend_61Ptr = _lookup< - ffi.NativeFunction< - NSEdgeInsets Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< - NSEdgeInsets Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_61_stret( - ffi.Pointer stret, - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_61_stret( - stret, - obj, - sel, - ); - } - - late final __objc_msgSend_61_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_61_stret = __objc_msgSend_61_stretPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_keyPathsForValuesAffectingValueForKey_1 = - _registerName1("keyPathsForValuesAffectingValueForKey:"); - ffi.Pointer _objc_msgSend_62( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_62( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_62Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_automaticallyNotifiesObserversForKey_1 = - _registerName1("automaticallyNotifiesObserversForKey:"); - bool _objc_msgSend_63( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_63( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_63Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSArray1 = _getClass1("NSArray"); - late final _sel_objectAtIndex_1 = _registerName1("objectAtIndex:"); - ffi.Pointer _objc_msgSend_64( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_64( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_64Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithObjects_count_1 = - _registerName1("initWithObjects:count:"); - instancetype _objc_msgSend_65( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - int cnt, - ) { - return __objc_msgSend_65( - obj, - sel, - objects, - cnt, - ); - } - - late final __objc_msgSend_65Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, int)>(); - - late final _sel_arrayByAddingObject_1 = - _registerName1("arrayByAddingObject:"); - ffi.Pointer _objc_msgSend_66( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_66( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_66Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_arrayByAddingObjectsFromArray_1 = - _registerName1("arrayByAddingObjectsFromArray:"); - ffi.Pointer _objc_msgSend_67( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherArray, - ) { - return __objc_msgSend_67( - obj, - sel, - otherArray, - ); - } - - late final __objc_msgSend_67Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_componentsJoinedByString_1 = - _registerName1("componentsJoinedByString:"); - ffi.Pointer _objc_msgSend_68( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer separator, - ) { - return __objc_msgSend_68( - obj, - sel, - separator, - ); - } - - late final __objc_msgSend_68Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_containsObject_1 = _registerName1("containsObject:"); - late final _sel_descriptionWithLocale_1 = - _registerName1("descriptionWithLocale:"); - ffi.Pointer _objc_msgSend_69( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer locale, - ) { - return __objc_msgSend_69( - obj, - sel, - locale, - ); - } - - late final __objc_msgSend_69Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_descriptionWithLocale_indent_1 = - _registerName1("descriptionWithLocale:indent:"); - ffi.Pointer _objc_msgSend_70( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer locale, - int level, - ) { - return __objc_msgSend_70( - obj, - sel, - locale, - level, - ); - } - - late final __objc_msgSend_70Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_firstObjectCommonWithArray_1 = - _registerName1("firstObjectCommonWithArray:"); - ffi.Pointer _objc_msgSend_71( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherArray, - ) { - return __objc_msgSend_71( - obj, - sel, - otherArray, - ); - } - - late final __objc_msgSend_71Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_getObjects_range_1 = _registerName1("getObjects:range:"); - void _objc_msgSend_72( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - _NSRange range, - ) { - return __objc_msgSend_72( - obj, - sel, - objects, - range, - ); - } - - late final __objc_msgSend_72Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, _NSRange)>(); - - late final _sel_indexOfObject_1 = _registerName1("indexOfObject:"); - int _objc_msgSend_73( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_73( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_73Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_indexOfObject_inRange_1 = - _registerName1("indexOfObject:inRange:"); - int _objc_msgSend_74( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - _NSRange range, - ) { - return __objc_msgSend_74( - obj, - sel, - anObject, - range, - ); - } - - late final __objc_msgSend_74Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>(); - - late final _sel_indexOfObjectIdenticalTo_1 = - _registerName1("indexOfObjectIdenticalTo:"); - late final _sel_indexOfObjectIdenticalTo_inRange_1 = - _registerName1("indexOfObjectIdenticalTo:inRange:"); - late final _sel_isEqualToArray_1 = _registerName1("isEqualToArray:"); - bool _objc_msgSend_75( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherArray, - ) { - return __objc_msgSend_75( - obj, - sel, - otherArray, - ); - } - - late final __objc_msgSend_75Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_firstObject1 = _registerName1("firstObject"); - late final _sel_lastObject1 = _registerName1("lastObject"); - late final _sel_objectEnumerator1 = _registerName1("objectEnumerator"); - ffi.Pointer _objc_msgSend_76( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_76( - obj, - sel, - ); - } - - late final __objc_msgSend_76Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_reverseObjectEnumerator1 = - _registerName1("reverseObjectEnumerator"); - late final _sel_sortedArrayHint1 = _registerName1("sortedArrayHint"); - late final _sel_sortedArrayUsingFunction_context_1 = - _registerName1("sortedArrayUsingFunction:context:"); - ffi.Pointer _objc_msgSend_77( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - comparator, - ffi.Pointer context, - ) { - return __objc_msgSend_77( - obj, - sel, - comparator, - context, - ); - } - - late final __objc_msgSend_77Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>(); - - late final _sel_sortedArrayUsingFunction_context_hint_1 = - _registerName1("sortedArrayUsingFunction:context:hint:"); - ffi.Pointer _objc_msgSend_78( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - comparator, - ffi.Pointer context, - ffi.Pointer hint, - ) { - return __objc_msgSend_78( - obj, - sel, - comparator, - context, - hint, - ); - } - - late final __objc_msgSend_78Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_sortedArrayUsingSelector_1 = - _registerName1("sortedArrayUsingSelector:"); - ffi.Pointer _objc_msgSend_79( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer comparator, - ) { - return __objc_msgSend_79( - obj, - sel, - comparator, - ); - } - - late final __objc_msgSend_79Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_subarrayWithRange_1 = _registerName1("subarrayWithRange:"); - ffi.Pointer _objc_msgSend_80( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_80( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_80Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _class_NSError1 = _getClass1("NSError"); - late final _sel_initWithDomain_code_userInfo_1 = - _registerName1("initWithDomain:code:userInfo:"); - instancetype _objc_msgSend_81( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer domain, - int code, - ffi.Pointer dict, - ) { - return __objc_msgSend_81( - obj, - sel, - domain, - code, - dict, - ); - } - - late final __objc_msgSend_81Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_errorWithDomain_code_userInfo_1 = - _registerName1("errorWithDomain:code:userInfo:"); - late final _sel_domain1 = _registerName1("domain"); - late final _sel_code1 = _registerName1("code"); - int _objc_msgSend_82( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_82( - obj, - sel, - ); - } - - late final __objc_msgSend_82Ptr = _lookup< - ffi.NativeFunction< - ffi.Long Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_userInfo1 = _registerName1("userInfo"); - late final _sel_localizedDescription1 = - _registerName1("localizedDescription"); - late final _sel_localizedFailureReason1 = - _registerName1("localizedFailureReason"); - late final _sel_localizedRecoverySuggestion1 = - _registerName1("localizedRecoverySuggestion"); - late final _sel_localizedRecoveryOptions1 = - _registerName1("localizedRecoveryOptions"); - ffi.Pointer _objc_msgSend_83( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_83( - obj, - sel, - ); - } - - late final __objc_msgSend_83Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_recoveryAttempter1 = _registerName1("recoveryAttempter"); - late final _sel_helpAnchor1 = _registerName1("helpAnchor"); - late final _sel_underlyingErrors1 = _registerName1("underlyingErrors"); - ffi.Pointer _objc_msgSend_84( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_84( - obj, - sel, - ); - } - - late final __objc_msgSend_84Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { - final d = - pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); - d.ref.reserved = 0; - d.ref.size = ffi.sizeOf<_ObjCBlock>(); - d.ref.copy_helper = ffi.nullptr; - d.ref.dispose_helper = ffi.nullptr; - d.ref.signature = ffi.nullptr; - return d; - } - - late final _objc_block_desc1 = _newBlockDesc1(); - late final _objc_concrete_global_block1 = - _lookup('_NSConcreteGlobalBlock'); - ffi.Pointer<_ObjCBlock> _newBlock1( - ffi.Pointer invoke, ffi.Pointer target) { - final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); - b.ref.isa = _objc_concrete_global_block1; - b.ref.flags = 0; - b.ref.reserved = 0; - b.ref.invoke = invoke; - b.ref.target = target; - b.ref.descriptor = _objc_block_desc1; - final copy = _Block_copy(b.cast()).cast<_ObjCBlock>(); - pkg_ffi.calloc.free(b); - return copy; - } - - ffi.Pointer _Block_copy( - ffi.Pointer value, - ) { - return __Block_copy( - value, - ); - } - - late final __Block_copyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_Block_copy'); - late final __Block_copy = __Block_copyPtr - .asFunction Function(ffi.Pointer)>(); - - void _Block_release( - ffi.Pointer value, - ) { - return __Block_release( - value, - ); - } - - late final __Block_releasePtr = - _lookup)>>( - '_Block_release'); - late final __Block_release = - __Block_releasePtr.asFunction)>(); - - late final _objc_releaseFinalizer11 = - ffi.NativeFinalizer(__Block_releasePtr.cast()); - late final _sel_setUserInfoValueProviderForDomain_provider_1 = - _registerName1("setUserInfoValueProviderForDomain:provider:"); - void _objc_msgSend_85( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer errorDomain, - ffi.Pointer<_ObjCBlock> provider, - ) { - return __objc_msgSend_85( - obj, - sel, - errorDomain, - provider, - ); - } - - late final __objc_msgSend_85Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_userInfoValueProviderForDomain_1 = - _registerName1("userInfoValueProviderForDomain:"); - ffi.Pointer<_ObjCBlock> _objc_msgSend_86( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer err, - ffi.Pointer userInfoKey, - ffi.Pointer errorDomain, - ) { - return __objc_msgSend_86( - obj, - sel, - err, - userInfoKey, - errorDomain, - ); - } - - late final __objc_msgSend_86Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_setKeys_triggerChangeNotificationsForDependentKey_1 = - _registerName1("setKeys:triggerChangeNotificationsForDependentKey:"); - void _objc_msgSend_87( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keys, - ffi.Pointer dependentKey, - ) { - return __objc_msgSend_87( - obj, - sel, - keys, - dependentKey, - ); - } - - late final __objc_msgSend_87Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_classFallbacksForKeyedArchiver1 = - _registerName1("classFallbacksForKeyedArchiver"); - late final _sel_classForKeyedUnarchiver1 = - _registerName1("classForKeyedUnarchiver"); - late final _sel_writeToURL_error_1 = _registerName1("writeToURL:error:"); - bool _objc_msgSend_88( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> error, - ) { - return __objc_msgSend_88( - obj, - sel, - url, - error, - ); - } - - late final __objc_msgSend_88Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final _sel_makeObjectsPerformSelector_1 = - _registerName1("makeObjectsPerformSelector:"); - late final _sel_makeObjectsPerformSelector_withObject_1 = - _registerName1("makeObjectsPerformSelector:withObject:"); - void _objc_msgSend_89( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer argument, - ) { - return __objc_msgSend_89( - obj, - sel, - aSelector, - argument, - ); - } - - late final __objc_msgSend_89Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSIndexSet1 = _getClass1("NSIndexSet"); - late final _sel_indexSet1 = _registerName1("indexSet"); - late final _sel_indexSetWithIndex_1 = _registerName1("indexSetWithIndex:"); - late final _sel_indexSetWithIndexesInRange_1 = - _registerName1("indexSetWithIndexesInRange:"); - instancetype _objc_msgSend_90( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_90( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_90Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_initWithIndexesInRange_1 = - _registerName1("initWithIndexesInRange:"); - late final _sel_initWithIndexSet_1 = _registerName1("initWithIndexSet:"); - instancetype _objc_msgSend_91( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_91( - obj, - sel, - indexSet, - ); - } - - late final __objc_msgSend_91Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithIndex_1 = _registerName1("initWithIndex:"); - late final _sel_isEqualToIndexSet_1 = _registerName1("isEqualToIndexSet:"); - bool _objc_msgSend_92( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_92( - obj, - sel, - indexSet, - ); - } - - late final __objc_msgSend_92Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_firstIndex1 = _registerName1("firstIndex"); - late final _sel_lastIndex1 = _registerName1("lastIndex"); - late final _sel_indexGreaterThanIndex_1 = - _registerName1("indexGreaterThanIndex:"); - int _objc_msgSend_93( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_93( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_93Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_indexLessThanIndex_1 = _registerName1("indexLessThanIndex:"); - late final _sel_indexGreaterThanOrEqualToIndex_1 = - _registerName1("indexGreaterThanOrEqualToIndex:"); - late final _sel_indexLessThanOrEqualToIndex_1 = - _registerName1("indexLessThanOrEqualToIndex:"); - late final _sel_getIndexes_maxCount_inIndexRange_1 = - _registerName1("getIndexes:maxCount:inIndexRange:"); - int _objc_msgSend_94( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexBuffer, - int bufferSize, - ffi.Pointer<_NSRange> range, - ) { - return __objc_msgSend_94( - obj, - sel, - indexBuffer, - bufferSize, - range, - ); - } - - late final __objc_msgSend_94Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer<_NSRange>)>>('objc_msgSend'); - late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_NSRange>)>(); - - late final _sel_countOfIndexesInRange_1 = - _registerName1("countOfIndexesInRange:"); - int _objc_msgSend_95( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_95( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_95Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_containsIndex_1 = _registerName1("containsIndex:"); - bool _objc_msgSend_96( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_96( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_96Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_containsIndexesInRange_1 = - _registerName1("containsIndexesInRange:"); - bool _objc_msgSend_97( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_97( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_97Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_containsIndexes_1 = _registerName1("containsIndexes:"); - late final _sel_intersectsIndexesInRange_1 = - _registerName1("intersectsIndexesInRange:"); - late final _sel_enumerateIndexesUsingBlock_1 = - _registerName1("enumerateIndexesUsingBlock:"); - void _objc_msgSend_98( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_98( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_98Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_enumerateIndexesWithOptions_usingBlock_1 = - _registerName1("enumerateIndexesWithOptions:usingBlock:"); - void _objc_msgSend_99( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_99( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_99Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_enumerateIndexesInRange_options_usingBlock_1 = - _registerName1("enumerateIndexesInRange:options:usingBlock:"); - void _objc_msgSend_100( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_100( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_100Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexPassingTest_1 = _registerName1("indexPassingTest:"); - int _objc_msgSend_101( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_101( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_101Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexWithOptions_passingTest_1 = - _registerName1("indexWithOptions:passingTest:"); - int _objc_msgSend_102( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_102( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_102Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexInRange_options_passingTest_1 = - _registerName1("indexInRange:options:passingTest:"); - int _objc_msgSend_103( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_103( - obj, - sel, - range, - opts, - predicate, - ); - } - - late final __objc_msgSend_103Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, _NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexesPassingTest_1 = _registerName1("indexesPassingTest:"); - ffi.Pointer _objc_msgSend_104( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_104( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_104Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexesWithOptions_passingTest_1 = - _registerName1("indexesWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_105( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_105( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_105Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexesInRange_options_passingTest_1 = - _registerName1("indexesInRange:options:passingTest:"); - ffi.Pointer _objc_msgSend_106( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_106( - obj, - sel, - range, - opts, - predicate, - ); - } - - late final __objc_msgSend_106Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_enumerateRangesUsingBlock_1 = - _registerName1("enumerateRangesUsingBlock:"); - void _objc_msgSend_107( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_107( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_107Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_enumerateRangesWithOptions_usingBlock_1 = - _registerName1("enumerateRangesWithOptions:usingBlock:"); - void _objc_msgSend_108( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_108( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_108Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_enumerateRangesInRange_options_usingBlock_1 = - _registerName1("enumerateRangesInRange:options:usingBlock:"); - void _objc_msgSend_109( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_109( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_109Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_objectsAtIndexes_1 = _registerName1("objectsAtIndexes:"); - ffi.Pointer _objc_msgSend_110( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexes, - ) { - return __objc_msgSend_110( - obj, - sel, - indexes, - ); - } - - late final __objc_msgSend_110Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_objectAtIndexedSubscript_1 = - _registerName1("objectAtIndexedSubscript:"); - late final _sel_enumerateObjectsUsingBlock_1 = - _registerName1("enumerateObjectsUsingBlock:"); - void _objc_msgSend_111( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_111( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_111Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_enumerateObjectsWithOptions_usingBlock_1 = - _registerName1("enumerateObjectsWithOptions:usingBlock:"); - void _objc_msgSend_112( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_112( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_112Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = - _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); - void _objc_msgSend_113( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_113( - obj, - sel, - s, - opts, - block, - ); - } - - late final __objc_msgSend_113Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexOfObjectPassingTest_1 = - _registerName1("indexOfObjectPassingTest:"); - int _objc_msgSend_114( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_114( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_114Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexOfObjectWithOptions_passingTest_1 = - _registerName1("indexOfObjectWithOptions:passingTest:"); - int _objc_msgSend_115( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_115( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_115Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexOfObjectAtIndexes_options_passingTest_1 = - _registerName1("indexOfObjectAtIndexes:options:passingTest:"); - int _objc_msgSend_116( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_116( - obj, - sel, - s, - opts, - predicate, - ); - } - - late final __objc_msgSend_116Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexesOfObjectsPassingTest_1 = - _registerName1("indexesOfObjectsPassingTest:"); - ffi.Pointer _objc_msgSend_117( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_117( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_117Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexesOfObjectsWithOptions_passingTest_1 = - _registerName1("indexesOfObjectsWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_118( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_118( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_118Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = - _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); - ffi.Pointer _objc_msgSend_119( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_119( - obj, - sel, - s, - opts, - predicate, - ); - } - - late final __objc_msgSend_119Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_sortedArrayUsingComparator_1 = - _registerName1("sortedArrayUsingComparator:"); - ffi.Pointer _objc_msgSend_120( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> cmptr, - ) { - return __objc_msgSend_120( - obj, - sel, - cmptr, - ); - } - - late final __objc_msgSend_120Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_sortedArrayWithOptions_usingComparator_1 = - _registerName1("sortedArrayWithOptions:usingComparator:"); - ffi.Pointer _objc_msgSend_121( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> cmptr, - ) { - return __objc_msgSend_121( - obj, - sel, - opts, - cmptr, - ); - } - - late final __objc_msgSend_121Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexOfObject_inSortedRange_options_usingComparator_1 = - _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); - int _objc_msgSend_122( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer obj1, - _NSRange r, - int opts, - ffi.Pointer<_ObjCBlock> cmp, - ) { - return __objc_msgSend_122( - obj, - sel, - obj1, - r, - opts, - cmp, - ); - } - - late final __objc_msgSend_122Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_array1 = _registerName1("array"); - late final _sel_arrayWithObject_1 = _registerName1("arrayWithObject:"); - instancetype _objc_msgSend_123( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_123( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_123Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_arrayWithObjects_count_1 = - _registerName1("arrayWithObjects:count:"); - late final _sel_arrayWithObjects_1 = _registerName1("arrayWithObjects:"); - late final _sel_arrayWithArray_1 = _registerName1("arrayWithArray:"); - instancetype _objc_msgSend_124( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer array, - ) { - return __objc_msgSend_124( - obj, - sel, - array, - ); - } - - late final __objc_msgSend_124Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithObjects_1 = _registerName1("initWithObjects:"); - late final _sel_initWithArray_1 = _registerName1("initWithArray:"); - late final _sel_initWithArray_copyItems_1 = - _registerName1("initWithArray:copyItems:"); - instancetype _objc_msgSend_125( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer array, - bool flag, - ) { - return __objc_msgSend_125( - obj, - sel, - array, - flag, - ); - } - - late final __objc_msgSend_125Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_initWithContentsOfURL_error_1 = - _registerName1("initWithContentsOfURL:error:"); - ffi.Pointer _objc_msgSend_126( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> error, - ) { - return __objc_msgSend_126( - obj, - sel, - url, - error, - ); - } - - late final __objc_msgSend_126Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_arrayWithContentsOfURL_error_1 = - _registerName1("arrayWithContentsOfURL:error:"); - late final _sel_differenceFromArray_withOptions_usingEquivalenceTest_1 = - _registerName1("differenceFromArray:withOptions:usingEquivalenceTest:"); - ffi.Pointer _objc_msgSend_127( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - int options, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_127( - obj, - sel, - other, - options, - block, - ); - } - - late final __objc_msgSend_127Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_differenceFromArray_withOptions_1 = - _registerName1("differenceFromArray:withOptions:"); - ffi.Pointer _objc_msgSend_128( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - int options, - ) { - return __objc_msgSend_128( - obj, - sel, - other, - options, - ); - } - - late final __objc_msgSend_128Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_differenceFromArray_1 = - _registerName1("differenceFromArray:"); - late final _sel_arrayByApplyingDifference_1 = - _registerName1("arrayByApplyingDifference:"); - ffi.Pointer _objc_msgSend_129( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer difference, - ) { - return __objc_msgSend_129( - obj, - sel, - difference, - ); - } - - late final __objc_msgSend_129Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_getObjects_1 = _registerName1("getObjects:"); - void _objc_msgSend_130( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - ) { - return __objc_msgSend_130( - obj, - sel, - objects, - ); - } - - late final __objc_msgSend_130Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_arrayWithContentsOfFile_1 = - _registerName1("arrayWithContentsOfFile:"); - ffi.Pointer _objc_msgSend_131( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ) { - return __objc_msgSend_131( - obj, - sel, - path, - ); - } - - late final __objc_msgSend_131Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_arrayWithContentsOfURL_1 = - _registerName1("arrayWithContentsOfURL:"); - ffi.Pointer _objc_msgSend_132( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_132( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_132Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithContentsOfFile_1 = - _registerName1("initWithContentsOfFile:"); - late final _sel_initWithContentsOfURL_1 = - _registerName1("initWithContentsOfURL:"); - late final _sel_writeToURL_atomically_1 = - _registerName1("writeToURL:atomically:"); - bool _objc_msgSend_133( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - bool atomically, - ) { - return __objc_msgSend_133( - obj, - sel, - url, - atomically, - ); - } - - late final __objc_msgSend_133Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_pathsMatchingExtensions_1 = - _registerName1("pathsMatchingExtensions:"); - late final _sel_valueForKey_1 = _registerName1("valueForKey:"); - late final _sel_setValue_forKey_1 = _registerName1("setValue:forKey:"); - void _objc_msgSend_134( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer key, - ) { - return __objc_msgSend_134( - obj, - sel, - value, - key, - ); - } - - late final __objc_msgSend_134Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_addObserver_toObjectsAtIndexes_forKeyPath_options_context_1 = - _registerName1( - "addObserver:toObjectsAtIndexes:forKeyPath:options:context:"); - void _objc_msgSend_135( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer observer, - ffi.Pointer indexes, - ffi.Pointer keyPath, - int options, - ffi.Pointer context, - ) { - return __objc_msgSend_135( - obj, - sel, - observer, - indexes, - keyPath, - options, - context, - ); - } - - late final __objc_msgSend_135Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - late final _sel_removeObserver_fromObjectsAtIndexes_forKeyPath_context_1 = - _registerName1("removeObserver:fromObjectsAtIndexes:forKeyPath:context:"); - void _objc_msgSend_136( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer observer, - ffi.Pointer indexes, - ffi.Pointer keyPath, - ffi.Pointer context, - ) { - return __objc_msgSend_136( - obj, - sel, - observer, - indexes, - keyPath, - context, - ); - } - - late final __objc_msgSend_136Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removeObserver_fromObjectsAtIndexes_forKeyPath_1 = - _registerName1("removeObserver:fromObjectsAtIndexes:forKeyPath:"); - void _objc_msgSend_137( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer observer, - ffi.Pointer indexes, - ffi.Pointer keyPath, - ) { - return __objc_msgSend_137( - obj, - sel, - observer, - indexes, - keyPath, - ); - } - - late final __objc_msgSend_137Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_addObserver_forKeyPath_options_context_1 = - _registerName1("addObserver:forKeyPath:options:context:"); - void _objc_msgSend_138( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer observer, - ffi.Pointer keyPath, - int options, - ffi.Pointer context, - ) { - return __objc_msgSend_138( - obj, - sel, - observer, - keyPath, - options, - context, - ); - } - - late final __objc_msgSend_138Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - late final _sel_removeObserver_forKeyPath_context_1 = - _registerName1("removeObserver:forKeyPath:context:"); - void _objc_msgSend_139( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer observer, - ffi.Pointer keyPath, - ffi.Pointer context, - ) { - return __objc_msgSend_139( - obj, - sel, - observer, - keyPath, - context, - ); - } - - late final __objc_msgSend_139Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removeObserver_forKeyPath_1 = - _registerName1("removeObserver:forKeyPath:"); - void _objc_msgSend_140( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer observer, - ffi.Pointer keyPath, - ) { - return __objc_msgSend_140( - obj, - sel, - observer, - keyPath, - ); - } - - late final __objc_msgSend_140Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_sortedArrayUsingDescriptors_1 = - _registerName1("sortedArrayUsingDescriptors:"); - late final _class_NSPredicate1 = _getClass1("NSPredicate"); - late final _sel_predicateWithFormat_argumentArray_1 = - _registerName1("predicateWithFormat:argumentArray:"); - ffi.Pointer _objc_msgSend_141( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer predicateFormat, - ffi.Pointer arguments, - ) { - return __objc_msgSend_141( - obj, - sel, - predicateFormat, - arguments, - ); - } - - late final __objc_msgSend_141Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_predicateWithFormat_1 = - _registerName1("predicateWithFormat:"); - ffi.Pointer _objc_msgSend_142( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer predicateFormat, - ) { - return __objc_msgSend_142( - obj, - sel, - predicateFormat, - ); - } - - late final __objc_msgSend_142Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_predicateWithFormat_arguments_1 = - _registerName1("predicateWithFormat:arguments:"); - ffi.Pointer _objc_msgSend_143( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer predicateFormat, - ffi.Pointer argList, - ) { - return __objc_msgSend_143( - obj, - sel, - predicateFormat, - argList, - ); - } - - late final __objc_msgSend_143Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_predicateFromMetadataQueryString_1 = - _registerName1("predicateFromMetadataQueryString:"); - ffi.Pointer _objc_msgSend_144( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer queryString, - ) { - return __objc_msgSend_144( - obj, - sel, - queryString, - ); - } - - late final __objc_msgSend_144Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_predicateWithValue_1 = _registerName1("predicateWithValue:"); - ffi.Pointer _objc_msgSend_145( - ffi.Pointer obj, - ffi.Pointer sel, - bool value, - ) { - return __objc_msgSend_145( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_145Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _class_NSDictionary1 = _getClass1("NSDictionary"); - late final _sel_objectForKey_1 = _registerName1("objectForKey:"); - late final _sel_keyEnumerator1 = _registerName1("keyEnumerator"); - late final _sel_initWithObjects_forKeys_count_1 = - _registerName1("initWithObjects:forKeys:count:"); - instancetype _objc_msgSend_146( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - ffi.Pointer> keys, - int cnt, - ) { - return __objc_msgSend_146( - obj, - sel, - objects, - keys, - cnt, - ); - } - - late final __objc_msgSend_146Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - int)>(); - - late final _sel_allKeys1 = _registerName1("allKeys"); - late final _sel_allKeysForObject_1 = _registerName1("allKeysForObject:"); - late final _sel_allValues1 = _registerName1("allValues"); - late final _sel_descriptionInStringsFileFormat1 = - _registerName1("descriptionInStringsFileFormat"); - late final _sel_isEqualToDictionary_1 = - _registerName1("isEqualToDictionary:"); - bool _objc_msgSend_147( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherDictionary, - ) { - return __objc_msgSend_147( - obj, - sel, - otherDictionary, - ); - } - - late final __objc_msgSend_147Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_objectsForKeys_notFoundMarker_1 = - _registerName1("objectsForKeys:notFoundMarker:"); - ffi.Pointer _objc_msgSend_148( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keys, - ffi.Pointer marker, - ) { - return __objc_msgSend_148( - obj, - sel, - keys, - marker, - ); - } - - late final __objc_msgSend_148Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_keysSortedByValueUsingSelector_1 = - _registerName1("keysSortedByValueUsingSelector:"); - late final _sel_getObjects_andKeys_count_1 = - _registerName1("getObjects:andKeys:count:"); - void _objc_msgSend_149( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - ffi.Pointer> keys, - int count, - ) { - return __objc_msgSend_149( - obj, - sel, - objects, - keys, - count, - ); - } - - late final __objc_msgSend_149Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - int)>(); - - late final _sel_objectForKeyedSubscript_1 = - _registerName1("objectForKeyedSubscript:"); - late final _sel_enumerateKeysAndObjectsUsingBlock_1 = - _registerName1("enumerateKeysAndObjectsUsingBlock:"); - void _objc_msgSend_150( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_150( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_150Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_enumerateKeysAndObjectsWithOptions_usingBlock_1 = - _registerName1("enumerateKeysAndObjectsWithOptions:usingBlock:"); - void _objc_msgSend_151( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_151( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_151Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_keysSortedByValueUsingComparator_1 = - _registerName1("keysSortedByValueUsingComparator:"); - late final _sel_keysSortedByValueWithOptions_usingComparator_1 = - _registerName1("keysSortedByValueWithOptions:usingComparator:"); - late final _sel_keysOfEntriesPassingTest_1 = - _registerName1("keysOfEntriesPassingTest:"); - ffi.Pointer _objc_msgSend_152( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_152( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_152Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_keysOfEntriesWithOptions_passingTest_1 = - _registerName1("keysOfEntriesWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_153( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_153( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_153Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_getObjects_andKeys_1 = _registerName1("getObjects:andKeys:"); - void _objc_msgSend_154( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - ffi.Pointer> keys, - ) { - return __objc_msgSend_154( - obj, - sel, - objects, - keys, - ); - } - - late final __objc_msgSend_154Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _sel_dictionaryWithContentsOfFile_1 = - _registerName1("dictionaryWithContentsOfFile:"); - ffi.Pointer _objc_msgSend_155( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ) { - return __objc_msgSend_155( - obj, - sel, - path, - ); - } - - late final __objc_msgSend_155Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dictionaryWithContentsOfURL_1 = - _registerName1("dictionaryWithContentsOfURL:"); - ffi.Pointer _objc_msgSend_156( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_156( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_156Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_156 = __objc_msgSend_156Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dictionary1 = _registerName1("dictionary"); - late final _sel_dictionaryWithObject_forKey_1 = - _registerName1("dictionaryWithObject:forKey:"); - instancetype _objc_msgSend_157( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - ffi.Pointer key, - ) { - return __objc_msgSend_157( - obj, - sel, - object, - key, - ); - } - - late final __objc_msgSend_157Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_157 = __objc_msgSend_157Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dictionaryWithObjects_forKeys_count_1 = - _registerName1("dictionaryWithObjects:forKeys:count:"); - late final _sel_dictionaryWithObjectsAndKeys_1 = - _registerName1("dictionaryWithObjectsAndKeys:"); - late final _sel_dictionaryWithDictionary_1 = - _registerName1("dictionaryWithDictionary:"); - instancetype _objc_msgSend_158( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dict, - ) { - return __objc_msgSend_158( - obj, - sel, - dict, - ); - } - - late final __objc_msgSend_158Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_158 = __objc_msgSend_158Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_dictionaryWithObjects_forKeys_1 = - _registerName1("dictionaryWithObjects:forKeys:"); - instancetype _objc_msgSend_159( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer objects, - ffi.Pointer keys, - ) { - return __objc_msgSend_159( - obj, - sel, - objects, - keys, - ); - } - - late final __objc_msgSend_159Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_159 = __objc_msgSend_159Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithObjectsAndKeys_1 = - _registerName1("initWithObjectsAndKeys:"); - late final _sel_initWithDictionary_1 = _registerName1("initWithDictionary:"); - late final _sel_initWithDictionary_copyItems_1 = - _registerName1("initWithDictionary:copyItems:"); - instancetype _objc_msgSend_160( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherDictionary, - bool flag, - ) { - return __objc_msgSend_160( - obj, - sel, - otherDictionary, - flag, - ); - } - - late final __objc_msgSend_160Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_160 = __objc_msgSend_160Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_initWithObjects_forKeys_1 = - _registerName1("initWithObjects:forKeys:"); - ffi.Pointer _objc_msgSend_161( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> error, - ) { - return __objc_msgSend_161( - obj, - sel, - url, - error, - ); - } - - late final __objc_msgSend_161Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_161 = __objc_msgSend_161Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_dictionaryWithContentsOfURL_error_1 = - _registerName1("dictionaryWithContentsOfURL:error:"); - late final _sel_sharedKeySetForKeys_1 = - _registerName1("sharedKeySetForKeys:"); - late final _sel_countByEnumeratingWithState_objects_count_1 = - _registerName1("countByEnumeratingWithState:objects:count:"); - int _objc_msgSend_162( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer state, - ffi.Pointer> buffer, - int len, - ) { - return __objc_msgSend_162( - obj, - sel, - state, - buffer, - len, - ); - } - - late final __objc_msgSend_162Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_162 = __objc_msgSend_162Ptr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - int)>(); - - late final _sel_fileSize1 = _registerName1("fileSize"); - int _objc_msgSend_163( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_163( - obj, - sel, - ); - } - - late final __objc_msgSend_163Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_163 = __objc_msgSend_163Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSDate1 = _getClass1("NSDate"); - late final _sel_timeIntervalSinceReferenceDate1 = - _registerName1("timeIntervalSinceReferenceDate"); - double _objc_msgSend_164( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_164( - obj, - sel, - ); - } - - late final __objc_msgSend_164Ptr = _lookup< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_164 = __objc_msgSend_164Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - double _objc_msgSend_164_fpret( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_164_fpret( - obj, - sel, - ); - } - - late final __objc_msgSend_164_fpretPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); - late final __objc_msgSend_164_fpret = __objc_msgSend_164_fpretPtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithTimeIntervalSinceReferenceDate_1 = - _registerName1("initWithTimeIntervalSinceReferenceDate:"); - instancetype _objc_msgSend_165( - ffi.Pointer obj, - ffi.Pointer sel, - double ti, - ) { - return __objc_msgSend_165( - obj, - sel, - ti, - ); - } - - late final __objc_msgSend_165Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_165 = __objc_msgSend_165Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, double)>(); - - late final _sel_timeIntervalSinceDate_1 = - _registerName1("timeIntervalSinceDate:"); - double _objc_msgSend_166( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anotherDate, - ) { - return __objc_msgSend_166( - obj, - sel, - anotherDate, - ); - } - - late final __objc_msgSend_166Ptr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_166 = __objc_msgSend_166Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - double _objc_msgSend_166_fpret( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anotherDate, - ) { - return __objc_msgSend_166_fpret( - obj, - sel, - anotherDate, - ); - } - - late final __objc_msgSend_166_fpretPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); - late final __objc_msgSend_166_fpret = __objc_msgSend_166_fpretPtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_timeIntervalSinceNow1 = - _registerName1("timeIntervalSinceNow"); - late final _sel_timeIntervalSince19701 = - _registerName1("timeIntervalSince1970"); - late final _sel_addTimeInterval_1 = _registerName1("addTimeInterval:"); - late final _sel_dateByAddingTimeInterval_1 = - _registerName1("dateByAddingTimeInterval:"); - late final _sel_earlierDate_1 = _registerName1("earlierDate:"); - ffi.Pointer _objc_msgSend_167( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anotherDate, - ) { - return __objc_msgSend_167( - obj, - sel, - anotherDate, - ); - } - - late final __objc_msgSend_167Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_laterDate_1 = _registerName1("laterDate:"); - late final _sel_compare_1 = _registerName1("compare:"); - int _objc_msgSend_168( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - ) { - return __objc_msgSend_168( - obj, - sel, - other, - ); - } - - late final __objc_msgSend_168Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_168 = __objc_msgSend_168Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_isEqualToDate_1 = _registerName1("isEqualToDate:"); - bool _objc_msgSend_169( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherDate, - ) { - return __objc_msgSend_169( - obj, - sel, - otherDate, - ); - } - - late final __objc_msgSend_169Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_169 = __objc_msgSend_169Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_date1 = _registerName1("date"); - late final _sel_dateWithTimeIntervalSinceNow_1 = - _registerName1("dateWithTimeIntervalSinceNow:"); - late final _sel_dateWithTimeIntervalSinceReferenceDate_1 = - _registerName1("dateWithTimeIntervalSinceReferenceDate:"); - late final _sel_dateWithTimeIntervalSince1970_1 = - _registerName1("dateWithTimeIntervalSince1970:"); - late final _sel_dateWithTimeInterval_sinceDate_1 = - _registerName1("dateWithTimeInterval:sinceDate:"); - instancetype _objc_msgSend_170( - ffi.Pointer obj, - ffi.Pointer sel, - double secsToBeAdded, - ffi.Pointer date, - ) { - return __objc_msgSend_170( - obj, - sel, - secsToBeAdded, - date, - ); - } - - late final __objc_msgSend_170Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Double, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_170 = __objc_msgSend_170Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - double, ffi.Pointer)>(); - - late final _sel_distantFuture1 = _registerName1("distantFuture"); - ffi.Pointer _objc_msgSend_171( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_171( - obj, - sel, - ); - } - - late final __objc_msgSend_171Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_171 = __objc_msgSend_171Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_distantPast1 = _registerName1("distantPast"); - late final _sel_now1 = _registerName1("now"); - late final _sel_initWithTimeIntervalSinceNow_1 = - _registerName1("initWithTimeIntervalSinceNow:"); - late final _sel_initWithTimeIntervalSince1970_1 = - _registerName1("initWithTimeIntervalSince1970:"); - late final _sel_initWithTimeInterval_sinceDate_1 = - _registerName1("initWithTimeInterval:sinceDate:"); - late final _sel_dateWithNaturalLanguageString_locale_1 = - _registerName1("dateWithNaturalLanguageString:locale:"); - ffi.Pointer _objc_msgSend_172( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - ffi.Pointer locale, - ) { - return __objc_msgSend_172( - obj, - sel, - string, - locale, - ); - } - - late final __objc_msgSend_172Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_172 = __objc_msgSend_172Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_dateWithNaturalLanguageString_1 = - _registerName1("dateWithNaturalLanguageString:"); - late final _sel_dateWithString_1 = _registerName1("dateWithString:"); - late final _class_NSCalendarDate1 = _getClass1("NSCalendarDate"); - late final _sel_calendarDate1 = _registerName1("calendarDate"); - late final _sel_dateWithString_calendarFormat_locale_1 = - _registerName1("dateWithString:calendarFormat:locale:"); - ffi.Pointer _objc_msgSend_173( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer description, - ffi.Pointer format, - ffi.Pointer locale, - ) { - return __objc_msgSend_173( - obj, - sel, - description, - format, - locale, - ); - } - - late final __objc_msgSend_173Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_173 = __objc_msgSend_173Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_dateWithString_calendarFormat_1 = - _registerName1("dateWithString:calendarFormat:"); - ffi.Pointer _objc_msgSend_174( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer description, - ffi.Pointer format, - ) { - return __objc_msgSend_174( - obj, - sel, - description, - format, - ); - } - - late final __objc_msgSend_174Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_174 = __objc_msgSend_174Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSTimeZone1 = _getClass1("NSTimeZone"); - late final _sel_name1 = _registerName1("name"); - late final _sel_data1 = _registerName1("data"); - late final _sel_secondsFromGMTForDate_1 = - _registerName1("secondsFromGMTForDate:"); - int _objc_msgSend_175( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aDate, - ) { - return __objc_msgSend_175( - obj, - sel, - aDate, - ); - } - - late final __objc_msgSend_175Ptr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_175 = __objc_msgSend_175Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_abbreviationForDate_1 = - _registerName1("abbreviationForDate:"); - ffi.Pointer _objc_msgSend_176( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aDate, - ) { - return __objc_msgSend_176( - obj, - sel, - aDate, - ); - } - - late final __objc_msgSend_176Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_176 = __objc_msgSend_176Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_isDaylightSavingTimeForDate_1 = - _registerName1("isDaylightSavingTimeForDate:"); - late final _sel_daylightSavingTimeOffsetForDate_1 = - _registerName1("daylightSavingTimeOffsetForDate:"); - late final _sel_nextDaylightSavingTimeTransitionAfterDate_1 = - _registerName1("nextDaylightSavingTimeTransitionAfterDate:"); - ffi.Pointer _objc_msgSend_177( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aDate, - ) { - return __objc_msgSend_177( - obj, - sel, - aDate, - ); - } - - late final __objc_msgSend_177Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_177 = __objc_msgSend_177Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_systemTimeZone1 = _registerName1("systemTimeZone"); - ffi.Pointer _objc_msgSend_178( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_178( - obj, - sel, - ); - } - - late final __objc_msgSend_178Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_178 = __objc_msgSend_178Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_resetSystemTimeZone1 = _registerName1("resetSystemTimeZone"); - late final _sel_defaultTimeZone1 = _registerName1("defaultTimeZone"); - late final _sel_setDefaultTimeZone_1 = _registerName1("setDefaultTimeZone:"); - void _objc_msgSend_179( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_179( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_179Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_179 = __objc_msgSend_179Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_localTimeZone1 = _registerName1("localTimeZone"); - late final _sel_knownTimeZoneNames1 = _registerName1("knownTimeZoneNames"); - late final _sel_abbreviationDictionary1 = - _registerName1("abbreviationDictionary"); - ffi.Pointer _objc_msgSend_180( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_180( - obj, - sel, - ); - } - - late final __objc_msgSend_180Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_180 = __objc_msgSend_180Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setAbbreviationDictionary_1 = - _registerName1("setAbbreviationDictionary:"); - void _objc_msgSend_181( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_181( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_181Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_181 = __objc_msgSend_181Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_timeZoneDataVersion1 = _registerName1("timeZoneDataVersion"); - late final _sel_secondsFromGMT1 = _registerName1("secondsFromGMT"); - late final _sel_abbreviation1 = _registerName1("abbreviation"); - late final _sel_isDaylightSavingTime1 = - _registerName1("isDaylightSavingTime"); - late final _sel_daylightSavingTimeOffset1 = - _registerName1("daylightSavingTimeOffset"); - late final _sel_nextDaylightSavingTimeTransition1 = - _registerName1("nextDaylightSavingTimeTransition"); - ffi.Pointer _objc_msgSend_182( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_182( - obj, - sel, - ); - } - - late final __objc_msgSend_182Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_182 = __objc_msgSend_182Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_isEqualToTimeZone_1 = _registerName1("isEqualToTimeZone:"); - bool _objc_msgSend_183( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aTimeZone, - ) { - return __objc_msgSend_183( - obj, - sel, - aTimeZone, - ); - } - - late final __objc_msgSend_183Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_183 = __objc_msgSend_183Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSLocale1 = _getClass1("NSLocale"); - late final _sel_displayNameForKey_value_1 = - _registerName1("displayNameForKey:value:"); - ffi.Pointer _objc_msgSend_184( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ffi.Pointer value, - ) { - return __objc_msgSend_184( - obj, - sel, - key, - value, - ); - } - - late final __objc_msgSend_184Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_184 = __objc_msgSend_184Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithLocaleIdentifier_1 = - _registerName1("initWithLocaleIdentifier:"); - late final _sel_localeIdentifier1 = _registerName1("localeIdentifier"); - late final _sel_localizedStringForLocaleIdentifier_1 = - _registerName1("localizedStringForLocaleIdentifier:"); - late final _sel_languageCode1 = _registerName1("languageCode"); - late final _sel_localizedStringForLanguageCode_1 = - _registerName1("localizedStringForLanguageCode:"); - ffi.Pointer _objc_msgSend_185( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer languageCode, - ) { - return __objc_msgSend_185( - obj, - sel, - languageCode, - ); - } - - late final __objc_msgSend_185Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_185 = __objc_msgSend_185Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_countryCode1 = _registerName1("countryCode"); - late final _sel_localizedStringForCountryCode_1 = - _registerName1("localizedStringForCountryCode:"); - late final _sel_scriptCode1 = _registerName1("scriptCode"); - late final _sel_localizedStringForScriptCode_1 = - _registerName1("localizedStringForScriptCode:"); - late final _sel_variantCode1 = _registerName1("variantCode"); - late final _sel_localizedStringForVariantCode_1 = - _registerName1("localizedStringForVariantCode:"); - late final _class_NSCharacterSet1 = _getClass1("NSCharacterSet"); - late final _sel_controlCharacterSet1 = _registerName1("controlCharacterSet"); - ffi.Pointer _objc_msgSend_186( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_186( - obj, - sel, - ); - } - - late final __objc_msgSend_186Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_186 = __objc_msgSend_186Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_whitespaceCharacterSet1 = - _registerName1("whitespaceCharacterSet"); - late final _sel_whitespaceAndNewlineCharacterSet1 = - _registerName1("whitespaceAndNewlineCharacterSet"); - late final _sel_decimalDigitCharacterSet1 = - _registerName1("decimalDigitCharacterSet"); - late final _sel_letterCharacterSet1 = _registerName1("letterCharacterSet"); - late final _sel_lowercaseLetterCharacterSet1 = - _registerName1("lowercaseLetterCharacterSet"); - late final _sel_uppercaseLetterCharacterSet1 = - _registerName1("uppercaseLetterCharacterSet"); - late final _sel_nonBaseCharacterSet1 = _registerName1("nonBaseCharacterSet"); - late final _sel_alphanumericCharacterSet1 = - _registerName1("alphanumericCharacterSet"); - late final _sel_decomposableCharacterSet1 = - _registerName1("decomposableCharacterSet"); - late final _sel_illegalCharacterSet1 = _registerName1("illegalCharacterSet"); - late final _sel_punctuationCharacterSet1 = - _registerName1("punctuationCharacterSet"); - late final _sel_capitalizedLetterCharacterSet1 = - _registerName1("capitalizedLetterCharacterSet"); - late final _sel_symbolCharacterSet1 = _registerName1("symbolCharacterSet"); - late final _sel_newlineCharacterSet1 = _registerName1("newlineCharacterSet"); - late final _sel_characterSetWithRange_1 = - _registerName1("characterSetWithRange:"); - ffi.Pointer _objc_msgSend_187( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange aRange, - ) { - return __objc_msgSend_187( - obj, - sel, - aRange, - ); - } - - late final __objc_msgSend_187Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_187 = __objc_msgSend_187Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_characterSetWithCharactersInString_1 = - _registerName1("characterSetWithCharactersInString:"); - ffi.Pointer _objc_msgSend_188( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aString, - ) { - return __objc_msgSend_188( - obj, - sel, - aString, - ); - } - - late final __objc_msgSend_188Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_188 = __objc_msgSend_188Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_characterSetWithBitmapRepresentation_1 = - _registerName1("characterSetWithBitmapRepresentation:"); - ffi.Pointer _objc_msgSend_189( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ) { - return __objc_msgSend_189( - obj, - sel, - data, - ); - } - - late final __objc_msgSend_189Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_189 = __objc_msgSend_189Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_characterSetWithContentsOfFile_1 = - _registerName1("characterSetWithContentsOfFile:"); - ffi.Pointer _objc_msgSend_190( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer fName, - ) { - return __objc_msgSend_190( - obj, - sel, - fName, - ); - } - - late final __objc_msgSend_190Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_190 = __objc_msgSend_190Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - instancetype _objc_msgSend_191( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_191( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_191Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_191 = __objc_msgSend_191Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_characterIsMember_1 = _registerName1("characterIsMember:"); - bool _objc_msgSend_192( - ffi.Pointer obj, - ffi.Pointer sel, - int aCharacter, - ) { - return __objc_msgSend_192( - obj, - sel, - aCharacter, - ); - } - - late final __objc_msgSend_192Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedShort)>>('objc_msgSend'); - late final __objc_msgSend_192 = __objc_msgSend_192Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_bitmapRepresentation1 = - _registerName1("bitmapRepresentation"); - late final _sel_invertedSet1 = _registerName1("invertedSet"); - late final _sel_longCharacterIsMember_1 = - _registerName1("longCharacterIsMember:"); - bool _objc_msgSend_193( - ffi.Pointer obj, - ffi.Pointer sel, - int theLongChar, - ) { - return __objc_msgSend_193( - obj, - sel, - theLongChar, - ); - } - - late final __objc_msgSend_193Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_193 = __objc_msgSend_193Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_isSupersetOfSet_1 = _registerName1("isSupersetOfSet:"); - bool _objc_msgSend_194( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer theOtherSet, - ) { - return __objc_msgSend_194( - obj, - sel, - theOtherSet, - ); - } - - late final __objc_msgSend_194Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_194 = __objc_msgSend_194Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_hasMemberInPlane_1 = _registerName1("hasMemberInPlane:"); - bool _objc_msgSend_195( - ffi.Pointer obj, - ffi.Pointer sel, - int thePlane, - ) { - return __objc_msgSend_195( - obj, - sel, - thePlane, - ); - } - - late final __objc_msgSend_195Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_195 = __objc_msgSend_195Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_URLUserAllowedCharacterSet1 = - _registerName1("URLUserAllowedCharacterSet"); - late final _sel_URLPasswordAllowedCharacterSet1 = - _registerName1("URLPasswordAllowedCharacterSet"); - late final _sel_URLHostAllowedCharacterSet1 = - _registerName1("URLHostAllowedCharacterSet"); - late final _sel_URLPathAllowedCharacterSet1 = - _registerName1("URLPathAllowedCharacterSet"); - late final _sel_URLQueryAllowedCharacterSet1 = - _registerName1("URLQueryAllowedCharacterSet"); - late final _sel_URLFragmentAllowedCharacterSet1 = - _registerName1("URLFragmentAllowedCharacterSet"); - late final _sel_exemplarCharacterSet1 = - _registerName1("exemplarCharacterSet"); - late final _sel_calendarIdentifier1 = _registerName1("calendarIdentifier"); - late final _sel_localizedStringForCalendarIdentifier_1 = - _registerName1("localizedStringForCalendarIdentifier:"); - late final _sel_collationIdentifier1 = _registerName1("collationIdentifier"); - late final _sel_localizedStringForCollationIdentifier_1 = - _registerName1("localizedStringForCollationIdentifier:"); - late final _sel_usesMetricSystem1 = _registerName1("usesMetricSystem"); - late final _sel_decimalSeparator1 = _registerName1("decimalSeparator"); - late final _sel_groupingSeparator1 = _registerName1("groupingSeparator"); - late final _sel_currencySymbol1 = _registerName1("currencySymbol"); - late final _sel_currencyCode1 = _registerName1("currencyCode"); - late final _sel_localizedStringForCurrencyCode_1 = - _registerName1("localizedStringForCurrencyCode:"); - late final _sel_collatorIdentifier1 = _registerName1("collatorIdentifier"); - late final _sel_localizedStringForCollatorIdentifier_1 = - _registerName1("localizedStringForCollatorIdentifier:"); - late final _sel_quotationBeginDelimiter1 = - _registerName1("quotationBeginDelimiter"); - late final _sel_quotationEndDelimiter1 = - _registerName1("quotationEndDelimiter"); - late final _sel_alternateQuotationBeginDelimiter1 = - _registerName1("alternateQuotationBeginDelimiter"); - late final _sel_alternateQuotationEndDelimiter1 = - _registerName1("alternateQuotationEndDelimiter"); - late final _sel_autoupdatingCurrentLocale1 = - _registerName1("autoupdatingCurrentLocale"); - ffi.Pointer _objc_msgSend_196( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_196( - obj, - sel, - ); - } - - late final __objc_msgSend_196Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_196 = __objc_msgSend_196Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_currentLocale1 = _registerName1("currentLocale"); - late final _sel_systemLocale1 = _registerName1("systemLocale"); - late final _sel_localeWithLocaleIdentifier_1 = - _registerName1("localeWithLocaleIdentifier:"); - late final _sel_availableLocaleIdentifiers1 = - _registerName1("availableLocaleIdentifiers"); - late final _sel_ISOLanguageCodes1 = _registerName1("ISOLanguageCodes"); - late final _sel_ISOCountryCodes1 = _registerName1("ISOCountryCodes"); - late final _sel_ISOCurrencyCodes1 = _registerName1("ISOCurrencyCodes"); - late final _sel_commonISOCurrencyCodes1 = - _registerName1("commonISOCurrencyCodes"); - late final _sel_preferredLanguages1 = _registerName1("preferredLanguages"); - late final _sel_componentsFromLocaleIdentifier_1 = - _registerName1("componentsFromLocaleIdentifier:"); - ffi.Pointer _objc_msgSend_197( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - ) { - return __objc_msgSend_197( - obj, - sel, - string, - ); - } - - late final __objc_msgSend_197Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_197 = __objc_msgSend_197Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_localeIdentifierFromComponents_1 = - _registerName1("localeIdentifierFromComponents:"); - ffi.Pointer _objc_msgSend_198( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dict, - ) { - return __objc_msgSend_198( - obj, - sel, - dict, - ); - } - - late final __objc_msgSend_198Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_198 = __objc_msgSend_198Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_canonicalLocaleIdentifierFromString_1 = - _registerName1("canonicalLocaleIdentifierFromString:"); - late final _sel_canonicalLanguageIdentifierFromString_1 = - _registerName1("canonicalLanguageIdentifierFromString:"); - late final _sel_localeIdentifierFromWindowsLocaleCode_1 = - _registerName1("localeIdentifierFromWindowsLocaleCode:"); - ffi.Pointer _objc_msgSend_199( - ffi.Pointer obj, - ffi.Pointer sel, - int lcid, - ) { - return __objc_msgSend_199( - obj, - sel, - lcid, - ); - } - - late final __objc_msgSend_199Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Uint32)>>('objc_msgSend'); - late final __objc_msgSend_199 = __objc_msgSend_199Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_windowsLocaleCodeFromLocaleIdentifier_1 = - _registerName1("windowsLocaleCodeFromLocaleIdentifier:"); - int _objc_msgSend_200( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer localeIdentifier, - ) { - return __objc_msgSend_200( - obj, - sel, - localeIdentifier, - ); - } - - late final __objc_msgSend_200Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_200 = __objc_msgSend_200Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_characterDirectionForLanguage_1 = - _registerName1("characterDirectionForLanguage:"); - int _objc_msgSend_201( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer isoLangCode, - ) { - return __objc_msgSend_201( - obj, - sel, - isoLangCode, - ); - } - - late final __objc_msgSend_201Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_201 = __objc_msgSend_201Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_lineDirectionForLanguage_1 = - _registerName1("lineDirectionForLanguage:"); - late final _sel_localizedName_locale_1 = - _registerName1("localizedName:locale:"); - ffi.Pointer _objc_msgSend_202( - ffi.Pointer obj, - ffi.Pointer sel, - int style, - ffi.Pointer locale, - ) { - return __objc_msgSend_202( - obj, - sel, - style, - locale, - ); - } - - late final __objc_msgSend_202Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_202 = __objc_msgSend_202Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_timeZoneWithName_1 = _registerName1("timeZoneWithName:"); - late final _sel_timeZoneWithName_data_1 = - _registerName1("timeZoneWithName:data:"); - instancetype _objc_msgSend_203( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer tzName, - ffi.Pointer aData, - ) { - return __objc_msgSend_203( - obj, - sel, - tzName, - aData, - ); - } - - late final __objc_msgSend_203Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_203 = __objc_msgSend_203Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithName_1 = _registerName1("initWithName:"); - late final _sel_initWithName_data_1 = _registerName1("initWithName:data:"); - late final _sel_timeZoneForSecondsFromGMT_1 = - _registerName1("timeZoneForSecondsFromGMT:"); - instancetype _objc_msgSend_204( - ffi.Pointer obj, - ffi.Pointer sel, - int seconds, - ) { - return __objc_msgSend_204( - obj, - sel, - seconds, - ); - } - - late final __objc_msgSend_204Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_204 = __objc_msgSend_204Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_timeZoneWithAbbreviation_1 = - _registerName1("timeZoneWithAbbreviation:"); - late final _sel_dateWithYear_month_day_hour_minute_second_timeZone_1 = - _registerName1("dateWithYear:month:day:hour:minute:second:timeZone:"); - ffi.Pointer _objc_msgSend_205( - ffi.Pointer obj, - ffi.Pointer sel, - int year, - int month, - int day, - int hour, - int minute, - int second, - ffi.Pointer aTimeZone, - ) { - return __objc_msgSend_205( - obj, - sel, - year, - month, - day, - hour, - minute, - second, - aTimeZone, - ); - } - - late final __objc_msgSend_205Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_205 = __objc_msgSend_205Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - int, - int, - int, - ffi.Pointer)>(); - - late final _sel_dateByAddingYears_months_days_hours_minutes_seconds_1 = - _registerName1("dateByAddingYears:months:days:hours:minutes:seconds:"); - ffi.Pointer _objc_msgSend_206( - ffi.Pointer obj, - ffi.Pointer sel, - int year, - int month, - int day, - int hour, - int minute, - int second, - ) { - return __objc_msgSend_206( - obj, - sel, - year, - month, - day, - hour, - minute, - second, - ); - } - - late final __objc_msgSend_206Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_206 = __objc_msgSend_206Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int, int, int, int, int)>(); - - late final _sel_dayOfCommonEra1 = _registerName1("dayOfCommonEra"); - late final _sel_dayOfMonth1 = _registerName1("dayOfMonth"); - late final _sel_dayOfWeek1 = _registerName1("dayOfWeek"); - late final _sel_dayOfYear1 = _registerName1("dayOfYear"); - late final _sel_hourOfDay1 = _registerName1("hourOfDay"); - late final _sel_minuteOfHour1 = _registerName1("minuteOfHour"); - late final _sel_monthOfYear1 = _registerName1("monthOfYear"); - late final _sel_secondOfMinute1 = _registerName1("secondOfMinute"); - late final _sel_yearOfCommonEra1 = _registerName1("yearOfCommonEra"); - late final _sel_calendarFormat1 = _registerName1("calendarFormat"); - late final _sel_descriptionWithCalendarFormat_locale_1 = - _registerName1("descriptionWithCalendarFormat:locale:"); - ffi.Pointer _objc_msgSend_207( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer locale, - ) { - return __objc_msgSend_207( - obj, - sel, - format, - locale, - ); - } - - late final __objc_msgSend_207Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_207 = __objc_msgSend_207Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_descriptionWithCalendarFormat_1 = - _registerName1("descriptionWithCalendarFormat:"); - late final _sel_timeZone1 = _registerName1("timeZone"); - late final _sel_initWithString_calendarFormat_locale_1 = - _registerName1("initWithString:calendarFormat:locale:"); - late final _sel_initWithString_calendarFormat_1 = - _registerName1("initWithString:calendarFormat:"); - late final _sel_initWithYear_month_day_hour_minute_second_timeZone_1 = - _registerName1("initWithYear:month:day:hour:minute:second:timeZone:"); - late final _sel_setCalendarFormat_1 = _registerName1("setCalendarFormat:"); - void _objc_msgSend_208( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ) { - return __objc_msgSend_208( - obj, - sel, - format, - ); - } - - late final __objc_msgSend_208Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_208 = __objc_msgSend_208Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_setTimeZone_1 = _registerName1("setTimeZone:"); - void _objc_msgSend_209( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aTimeZone, - ) { - return __objc_msgSend_209( - obj, - sel, - aTimeZone, - ); - } - - late final __objc_msgSend_209Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_209 = __objc_msgSend_209Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_years_months_days_hours_minutes_seconds_sinceDate_1 = - _registerName1("years:months:days:hours:minutes:seconds:sinceDate:"); - void _objc_msgSend_210( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer yp, - ffi.Pointer mop, - ffi.Pointer dp, - ffi.Pointer hp, - ffi.Pointer mip, - ffi.Pointer sp, - ffi.Pointer date, - ) { - return __objc_msgSend_210( - obj, - sel, - yp, - mop, - dp, - hp, - mip, - sp, - date, - ); - } - - late final __objc_msgSend_210Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_210 = __objc_msgSend_210Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_dateWithCalendarFormat_timeZone_1 = - _registerName1("dateWithCalendarFormat:timeZone:"); - ffi.Pointer _objc_msgSend_211( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer aTimeZone, - ) { - return __objc_msgSend_211( - obj, - sel, - format, - aTimeZone, - ); - } - - late final __objc_msgSend_211Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_211 = __objc_msgSend_211Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_descriptionWithCalendarFormat_timeZone_locale_1 = - _registerName1("descriptionWithCalendarFormat:timeZone:locale:"); - ffi.Pointer _objc_msgSend_212( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer aTimeZone, - ffi.Pointer locale, - ) { - return __objc_msgSend_212( - obj, - sel, - format, - aTimeZone, - locale, - ); - } - - late final __objc_msgSend_212Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_212 = __objc_msgSend_212Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_fileModificationDate1 = - _registerName1("fileModificationDate"); - late final _sel_fileType1 = _registerName1("fileType"); - late final _sel_filePosixPermissions1 = - _registerName1("filePosixPermissions"); - late final _sel_fileOwnerAccountName1 = - _registerName1("fileOwnerAccountName"); - late final _sel_fileGroupOwnerAccountName1 = - _registerName1("fileGroupOwnerAccountName"); - late final _sel_fileSystemNumber1 = _registerName1("fileSystemNumber"); - late final _sel_fileSystemFileNumber1 = - _registerName1("fileSystemFileNumber"); - late final _sel_fileExtensionHidden1 = _registerName1("fileExtensionHidden"); - late final _sel_fileHFSCreatorCode1 = _registerName1("fileHFSCreatorCode"); - int _objc_msgSend_213( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_213( - obj, - sel, - ); - } - - late final __objc_msgSend_213Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_213 = __objc_msgSend_213Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_fileHFSTypeCode1 = _registerName1("fileHFSTypeCode"); - late final _sel_fileIsImmutable1 = _registerName1("fileIsImmutable"); - late final _sel_fileIsAppendOnly1 = _registerName1("fileIsAppendOnly"); - late final _sel_fileCreationDate1 = _registerName1("fileCreationDate"); - late final _sel_fileOwnerAccountID1 = _registerName1("fileOwnerAccountID"); - ffi.Pointer _objc_msgSend_214( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_214( - obj, - sel, - ); - } - - late final __objc_msgSend_214Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_214 = __objc_msgSend_214Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_fileGroupOwnerAccountID1 = - _registerName1("fileGroupOwnerAccountID"); - late final _sel_predicateWithBlock_1 = _registerName1("predicateWithBlock:"); - ffi.Pointer _objc_msgSend_215( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_215( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_215Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_215 = __objc_msgSend_215Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_predicateFormat1 = _registerName1("predicateFormat"); - late final _sel_predicateWithSubstitutionVariables_1 = - _registerName1("predicateWithSubstitutionVariables:"); - late final _sel_evaluateWithObject_1 = _registerName1("evaluateWithObject:"); - bool _objc_msgSend_216( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - ) { - return __objc_msgSend_216( - obj, - sel, - object, - ); - } - - late final __objc_msgSend_216Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_216 = __objc_msgSend_216Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_evaluateWithObject_substitutionVariables_1 = - _registerName1("evaluateWithObject:substitutionVariables:"); - bool _objc_msgSend_217( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - ffi.Pointer bindings, - ) { - return __objc_msgSend_217( - obj, - sel, - object, - bindings, - ); - } - - late final __objc_msgSend_217Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_217 = __objc_msgSend_217Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_allowEvaluation1 = _registerName1("allowEvaluation"); - late final _sel_filteredArrayUsingPredicate_1 = - _registerName1("filteredArrayUsingPredicate:"); - ffi.Pointer _objc_msgSend_218( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer predicate, - ) { - return __objc_msgSend_218( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_218Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_218 = __objc_msgSend_218Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithChar_1 = _registerName1("initWithChar:"); - ffi.Pointer _objc_msgSend_219( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_219( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_219Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Char)>>('objc_msgSend'); - late final __objc_msgSend_219 = __objc_msgSend_219Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithUnsignedChar_1 = - _registerName1("initWithUnsignedChar:"); - ffi.Pointer _objc_msgSend_220( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_220( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_220Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedChar)>>('objc_msgSend'); - late final __objc_msgSend_220 = __objc_msgSend_220Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithShort_1 = _registerName1("initWithShort:"); - ffi.Pointer _objc_msgSend_221( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_221( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_221Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Short)>>('objc_msgSend'); - late final __objc_msgSend_221 = __objc_msgSend_221Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithUnsignedShort_1 = - _registerName1("initWithUnsignedShort:"); - ffi.Pointer _objc_msgSend_222( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_222( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_222Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedShort)>>('objc_msgSend'); - late final __objc_msgSend_222 = __objc_msgSend_222Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithInt_1 = _registerName1("initWithInt:"); - ffi.Pointer _objc_msgSend_223( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_223( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_223Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_223 = __objc_msgSend_223Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithUnsignedInt_1 = - _registerName1("initWithUnsignedInt:"); - ffi.Pointer _objc_msgSend_224( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_224( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_224Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_224 = __objc_msgSend_224Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithLong_1 = _registerName1("initWithLong:"); - ffi.Pointer _objc_msgSend_225( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_225( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_225Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_225 = __objc_msgSend_225Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithUnsignedLong_1 = - _registerName1("initWithUnsignedLong:"); - ffi.Pointer _objc_msgSend_226( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_226( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_226Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_226 = __objc_msgSend_226Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithLongLong_1 = _registerName1("initWithLongLong:"); - ffi.Pointer _objc_msgSend_227( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_227( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_227Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.LongLong)>>('objc_msgSend'); - late final __objc_msgSend_227 = __objc_msgSend_227Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithUnsignedLongLong_1 = - _registerName1("initWithUnsignedLongLong:"); - ffi.Pointer _objc_msgSend_228( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_228( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_228Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLongLong)>>('objc_msgSend'); - late final __objc_msgSend_228 = __objc_msgSend_228Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithFloat_1 = _registerName1("initWithFloat:"); - ffi.Pointer _objc_msgSend_229( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_229( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_229Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>('objc_msgSend'); - late final __objc_msgSend_229 = __objc_msgSend_229Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - late final _sel_initWithDouble_1 = _registerName1("initWithDouble:"); - ffi.Pointer _objc_msgSend_230( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_230( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_230Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_230 = __objc_msgSend_230Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - late final _sel_initWithBool_1 = _registerName1("initWithBool:"); - ffi.Pointer _objc_msgSend_231( - ffi.Pointer obj, - ffi.Pointer sel, - bool value, - ) { - return __objc_msgSend_231( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_231Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_231 = __objc_msgSend_231Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_initWithInteger_1 = _registerName1("initWithInteger:"); - late final _sel_initWithUnsignedInteger_1 = - _registerName1("initWithUnsignedInteger:"); - late final _sel_charValue1 = _registerName1("charValue"); - int _objc_msgSend_232( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_232( - obj, - sel, - ); - } - - late final __objc_msgSend_232Ptr = _lookup< - ffi.NativeFunction< - ffi.Char Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_232 = __objc_msgSend_232Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_unsignedCharValue1 = _registerName1("unsignedCharValue"); - int _objc_msgSend_233( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_233( - obj, - sel, - ); - } - - late final __objc_msgSend_233Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedChar Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_233 = __objc_msgSend_233Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_shortValue1 = _registerName1("shortValue"); - int _objc_msgSend_234( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_234( - obj, - sel, - ); - } - - late final __objc_msgSend_234Ptr = _lookup< - ffi.NativeFunction< - ffi.Short Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_234 = __objc_msgSend_234Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_unsignedShortValue1 = _registerName1("unsignedShortValue"); - int _objc_msgSend_235( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_235( - obj, - sel, - ); - } - - late final __objc_msgSend_235Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedShort Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_235 = __objc_msgSend_235Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_intValue1 = _registerName1("intValue"); - int _objc_msgSend_236( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_236( - obj, - sel, - ); - } - - late final __objc_msgSend_236Ptr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_236 = __objc_msgSend_236Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_unsignedIntValue1 = _registerName1("unsignedIntValue"); - late final _sel_longValue1 = _registerName1("longValue"); - late final _sel_unsignedLongValue1 = _registerName1("unsignedLongValue"); - late final _sel_longLongValue1 = _registerName1("longLongValue"); - int _objc_msgSend_237( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_237( - obj, - sel, - ); - } - - late final __objc_msgSend_237Ptr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_237 = __objc_msgSend_237Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_unsignedLongLongValue1 = - _registerName1("unsignedLongLongValue"); - late final _sel_floatValue1 = _registerName1("floatValue"); - double _objc_msgSend_238( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_238( - obj, - sel, - ); - } - - late final __objc_msgSend_238Ptr = _lookup< - ffi.NativeFunction< - ffi.Float Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_238 = __objc_msgSend_238Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - double _objc_msgSend_238_fpret( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_238_fpret( - obj, - sel, - ); - } - - late final __objc_msgSend_238_fpretPtr = _lookup< - ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); - late final __objc_msgSend_238_fpret = __objc_msgSend_238_fpretPtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_doubleValue1 = _registerName1("doubleValue"); - late final _sel_boolValue1 = _registerName1("boolValue"); - late final _sel_integerValue1 = _registerName1("integerValue"); - late final _sel_unsignedIntegerValue1 = - _registerName1("unsignedIntegerValue"); - late final _sel_stringValue1 = _registerName1("stringValue"); - int _objc_msgSend_239( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherNumber, - ) { - return __objc_msgSend_239( - obj, - sel, - otherNumber, - ); - } - - late final __objc_msgSend_239Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_239 = __objc_msgSend_239Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_isEqualToNumber_1 = _registerName1("isEqualToNumber:"); - bool _objc_msgSend_240( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer number, - ) { - return __objc_msgSend_240( - obj, - sel, - number, - ); - } - - late final __objc_msgSend_240Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_240 = __objc_msgSend_240Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_numberWithChar_1 = _registerName1("numberWithChar:"); - late final _sel_numberWithUnsignedChar_1 = - _registerName1("numberWithUnsignedChar:"); - late final _sel_numberWithShort_1 = _registerName1("numberWithShort:"); - late final _sel_numberWithUnsignedShort_1 = - _registerName1("numberWithUnsignedShort:"); - late final _sel_numberWithInt_1 = _registerName1("numberWithInt:"); - late final _sel_numberWithUnsignedInt_1 = - _registerName1("numberWithUnsignedInt:"); - late final _sel_numberWithLong_1 = _registerName1("numberWithLong:"); - late final _sel_numberWithUnsignedLong_1 = - _registerName1("numberWithUnsignedLong:"); - late final _sel_numberWithLongLong_1 = _registerName1("numberWithLongLong:"); - late final _sel_numberWithUnsignedLongLong_1 = - _registerName1("numberWithUnsignedLongLong:"); - late final _sel_numberWithFloat_1 = _registerName1("numberWithFloat:"); - late final _sel_numberWithDouble_1 = _registerName1("numberWithDouble:"); - late final _sel_numberWithBool_1 = _registerName1("numberWithBool:"); - late final _sel_numberWithInteger_1 = _registerName1("numberWithInteger:"); - late final _sel_numberWithUnsignedInteger_1 = - _registerName1("numberWithUnsignedInteger:"); - late final _sel_port1 = _registerName1("port"); - late final _sel_user1 = _registerName1("user"); - late final _sel_password1 = _registerName1("password"); - late final _sel_path1 = _registerName1("path"); - late final _sel_fragment1 = _registerName1("fragment"); - late final _sel_parameterString1 = _registerName1("parameterString"); - late final _sel_query1 = _registerName1("query"); - late final _sel_relativePath1 = _registerName1("relativePath"); - late final _sel_hasDirectoryPath1 = _registerName1("hasDirectoryPath"); - late final _sel_getFileSystemRepresentation_maxLength_1 = - _registerName1("getFileSystemRepresentation:maxLength:"); - bool _objc_msgSend_241( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int maxBufferLength, - ) { - return __objc_msgSend_241( - obj, - sel, - buffer, - maxBufferLength, - ); - } - - late final __objc_msgSend_241Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_241 = __objc_msgSend_241Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_fileSystemRepresentation1 = - _registerName1("fileSystemRepresentation"); - late final _sel_isFileURL1 = _registerName1("isFileURL"); - late final _sel_standardizedURL1 = _registerName1("standardizedURL"); - late final _sel_checkResourceIsReachableAndReturnError_1 = - _registerName1("checkResourceIsReachableAndReturnError:"); - bool _objc_msgSend_242( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> error, - ) { - return __objc_msgSend_242( - obj, - sel, - error, - ); - } - - late final __objc_msgSend_242Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_242 = __objc_msgSend_242Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_isFileReferenceURL1 = _registerName1("isFileReferenceURL"); - late final _sel_fileReferenceURL1 = _registerName1("fileReferenceURL"); - late final _sel_filePathURL1 = _registerName1("filePathURL"); - late final _sel_getResourceValue_forKey_error_1 = - _registerName1("getResourceValue:forKey:error:"); - bool _objc_msgSend_243( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> value, - ffi.Pointer key, - ffi.Pointer> error, - ) { - return __objc_msgSend_243( - obj, - sel, - value, - key, - error, - ); - } - - late final __objc_msgSend_243Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_243 = __objc_msgSend_243Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_resourceValuesForKeys_error_1 = - _registerName1("resourceValuesForKeys:error:"); - ffi.Pointer _objc_msgSend_244( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keys, - ffi.Pointer> error, - ) { - return __objc_msgSend_244( - obj, - sel, - keys, - error, - ); - } - - late final __objc_msgSend_244Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_244 = __objc_msgSend_244Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_setResourceValue_forKey_error_1 = - _registerName1("setResourceValue:forKey:error:"); - bool _objc_msgSend_245( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer key, - ffi.Pointer> error, - ) { - return __objc_msgSend_245( - obj, - sel, - value, - key, - error, - ); - } - - late final __objc_msgSend_245Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_245 = __objc_msgSend_245Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_setResourceValues_error_1 = - _registerName1("setResourceValues:error:"); - bool _objc_msgSend_246( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keyedValues, - ffi.Pointer> error, - ) { - return __objc_msgSend_246( - obj, - sel, - keyedValues, - error, - ); - } - - late final __objc_msgSend_246Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_246 = __objc_msgSend_246Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final _sel_removeCachedResourceValueForKey_1 = - _registerName1("removeCachedResourceValueForKey:"); - void _objc_msgSend_247( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_247( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_247Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_247 = __objc_msgSend_247Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removeAllCachedResourceValues1 = - _registerName1("removeAllCachedResourceValues"); - late final _sel_setTemporaryResourceValue_forKey_1 = - _registerName1("setTemporaryResourceValue:forKey:"); - late final _sel_bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error_1 = - _registerName1( - "bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:"); - ffi.Pointer _objc_msgSend_248( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ffi.Pointer keys, - ffi.Pointer relativeURL, - ffi.Pointer> error, - ) { - return __objc_msgSend_248( - obj, - sel, - options, - keys, - relativeURL, - error, - ); - } - - late final __objc_msgSend_248Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_248 = __objc_msgSend_248Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1 = - _registerName1( - "initByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:"); - instancetype _objc_msgSend_249( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bookmarkData, - int options, - ffi.Pointer relativeURL, - ffi.Pointer isStale, - ffi.Pointer> error, - ) { - return __objc_msgSend_249( - obj, - sel, - bookmarkData, - options, - relativeURL, - isStale, - error, - ); - } - - late final __objc_msgSend_249Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_249 = __objc_msgSend_249Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1 = - _registerName1( - "URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:"); - late final _sel_resourceValuesForKeys_fromBookmarkData_1 = - _registerName1("resourceValuesForKeys:fromBookmarkData:"); - ffi.Pointer _objc_msgSend_250( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keys, - ffi.Pointer bookmarkData, - ) { - return __objc_msgSend_250( - obj, - sel, - keys, - bookmarkData, - ); - } - - late final __objc_msgSend_250Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_250 = __objc_msgSend_250Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_writeBookmarkData_toURL_options_error_1 = - _registerName1("writeBookmarkData:toURL:options:error:"); - bool _objc_msgSend_251( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bookmarkData, - ffi.Pointer bookmarkFileURL, - int options, - ffi.Pointer> error, - ) { - return __objc_msgSend_251( - obj, - sel, - bookmarkData, - bookmarkFileURL, - options, - error, - ); - } - - late final __objc_msgSend_251Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_251 = __objc_msgSend_251Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_bookmarkDataWithContentsOfURL_error_1 = - _registerName1("bookmarkDataWithContentsOfURL:error:"); - ffi.Pointer _objc_msgSend_252( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bookmarkFileURL, - ffi.Pointer> error, - ) { - return __objc_msgSend_252( - obj, - sel, - bookmarkFileURL, - error, - ); - } - - late final __objc_msgSend_252Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_252 = __objc_msgSend_252Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_URLByResolvingAliasFileAtURL_options_error_1 = - _registerName1("URLByResolvingAliasFileAtURL:options:error:"); - instancetype _objc_msgSend_253( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int options, - ffi.Pointer> error, - ) { - return __objc_msgSend_253( - obj, - sel, - url, - options, - error, - ); - } - - late final __objc_msgSend_253Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_253 = __objc_msgSend_253Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_startAccessingSecurityScopedResource1 = - _registerName1("startAccessingSecurityScopedResource"); - late final _sel_stopAccessingSecurityScopedResource1 = - _registerName1("stopAccessingSecurityScopedResource"); - late final _sel_getPromisedItemResourceValue_forKey_error_1 = - _registerName1("getPromisedItemResourceValue:forKey:error:"); - late final _sel_promisedItemResourceValuesForKeys_error_1 = - _registerName1("promisedItemResourceValuesForKeys:error:"); - ffi.Pointer _objc_msgSend_254( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keys, - ffi.Pointer> error, - ) { - return __objc_msgSend_254( - obj, - sel, - keys, - error, - ); - } - - late final __objc_msgSend_254Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_254 = __objc_msgSend_254Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_checkPromisedItemIsReachableAndReturnError_1 = - _registerName1("checkPromisedItemIsReachableAndReturnError:"); - late final _sel_fileURLWithPathComponents_1 = - _registerName1("fileURLWithPathComponents:"); - ffi.Pointer _objc_msgSend_255( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer components, - ) { - return __objc_msgSend_255( - obj, - sel, - components, - ); - } - - late final __objc_msgSend_255Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_255 = __objc_msgSend_255Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_pathComponents1 = _registerName1("pathComponents"); - late final _sel_lastPathComponent1 = _registerName1("lastPathComponent"); - late final _sel_pathExtension1 = _registerName1("pathExtension"); - late final _sel_URLByAppendingPathComponent_1 = - _registerName1("URLByAppendingPathComponent:"); - ffi.Pointer _objc_msgSend_256( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer pathComponent, - ) { - return __objc_msgSend_256( - obj, - sel, - pathComponent, - ); - } - - late final __objc_msgSend_256Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_256 = __objc_msgSend_256Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_URLByAppendingPathComponent_isDirectory_1 = - _registerName1("URLByAppendingPathComponent:isDirectory:"); - ffi.Pointer _objc_msgSend_257( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer pathComponent, - bool isDirectory, - ) { - return __objc_msgSend_257( - obj, - sel, - pathComponent, - isDirectory, - ); - } - - late final __objc_msgSend_257Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_257 = __objc_msgSend_257Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_URLByDeletingLastPathComponent1 = - _registerName1("URLByDeletingLastPathComponent"); - late final _sel_URLByAppendingPathExtension_1 = - _registerName1("URLByAppendingPathExtension:"); - late final _sel_URLByDeletingPathExtension1 = - _registerName1("URLByDeletingPathExtension"); - late final _sel_URLByStandardizingPath1 = - _registerName1("URLByStandardizingPath"); - late final _sel_URLByResolvingSymlinksInPath1 = - _registerName1("URLByResolvingSymlinksInPath"); - late final _sel_resourceDataUsingCache_1 = - _registerName1("resourceDataUsingCache:"); - ffi.Pointer _objc_msgSend_258( - ffi.Pointer obj, - ffi.Pointer sel, - bool shouldUseCache, - ) { - return __objc_msgSend_258( - obj, - sel, - shouldUseCache, - ); - } - - late final __objc_msgSend_258Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_258 = __objc_msgSend_258Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_loadResourceDataNotifyingClient_usingCache_1 = - _registerName1("loadResourceDataNotifyingClient:usingCache:"); - void _objc_msgSend_259( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer client, - bool shouldUseCache, - ) { - return __objc_msgSend_259( - obj, - sel, - client, - shouldUseCache, - ); - } - - late final __objc_msgSend_259Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_259 = __objc_msgSend_259Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_propertyForKey_1 = _registerName1("propertyForKey:"); - late final _sel_setResourceData_1 = _registerName1("setResourceData:"); - late final _sel_setProperty_forKey_1 = _registerName1("setProperty:forKey:"); - bool _objc_msgSend_260( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer property, - ffi.Pointer propertyKey, - ) { - return __objc_msgSend_260( - obj, - sel, - property, - propertyKey, - ); - } - - late final __objc_msgSend_260Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_260 = __objc_msgSend_260Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLHandle1 = _getClass1("NSURLHandle"); - late final _sel_registerURLHandleClass_1 = - _registerName1("registerURLHandleClass:"); - late final _sel_URLHandleClassForURL_1 = - _registerName1("URLHandleClassForURL:"); - ffi.Pointer _objc_msgSend_261( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anURL, - ) { - return __objc_msgSend_261( - obj, - sel, - anURL, - ); - } - - late final __objc_msgSend_261Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_261 = __objc_msgSend_261Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_status1 = _registerName1("status"); - int _objc_msgSend_262( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_262( - obj, - sel, - ); - } - - late final __objc_msgSend_262Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_262 = __objc_msgSend_262Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_failureReason1 = _registerName1("failureReason"); - late final _sel_addClient_1 = _registerName1("addClient:"); - late final _sel_removeClient_1 = _registerName1("removeClient:"); - late final _sel_loadInBackground1 = _registerName1("loadInBackground"); - late final _sel_cancelLoadInBackground1 = - _registerName1("cancelLoadInBackground"); - late final _sel_resourceData1 = _registerName1("resourceData"); - late final _sel_availableResourceData1 = - _registerName1("availableResourceData"); - late final _sel_expectedResourceDataSize1 = - _registerName1("expectedResourceDataSize"); - late final _sel_flushCachedData1 = _registerName1("flushCachedData"); - late final _sel_backgroundLoadDidFailWithReason_1 = - _registerName1("backgroundLoadDidFailWithReason:"); - late final _sel_didLoadBytes_loadComplete_1 = - _registerName1("didLoadBytes:loadComplete:"); - void _objc_msgSend_263( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer newBytes, - bool yorn, - ) { - return __objc_msgSend_263( - obj, - sel, - newBytes, - yorn, - ); - } - - late final __objc_msgSend_263Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_263 = __objc_msgSend_263Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_canInitWithURL_1 = _registerName1("canInitWithURL:"); - bool _objc_msgSend_264( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anURL, - ) { - return __objc_msgSend_264( - obj, - sel, - anURL, - ); - } - - late final __objc_msgSend_264Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_264 = __objc_msgSend_264Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_cachedHandleForURL_1 = _registerName1("cachedHandleForURL:"); - ffi.Pointer _objc_msgSend_265( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anURL, - ) { - return __objc_msgSend_265( - obj, - sel, - anURL, - ); - } - - late final __objc_msgSend_265Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_265 = __objc_msgSend_265Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithURL_cached_1 = _registerName1("initWithURL:cached:"); - ffi.Pointer _objc_msgSend_266( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anURL, - bool willCache, - ) { - return __objc_msgSend_266( - obj, - sel, - anURL, - willCache, - ); - } - - late final __objc_msgSend_266Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_266 = __objc_msgSend_266Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_propertyForKeyIfAvailable_1 = - _registerName1("propertyForKeyIfAvailable:"); - late final _sel_writeProperty_forKey_1 = - _registerName1("writeProperty:forKey:"); - late final _sel_writeData_1 = _registerName1("writeData:"); - late final _sel_loadInForeground1 = _registerName1("loadInForeground"); - late final _sel_beginLoadInBackground1 = - _registerName1("beginLoadInBackground"); - late final _sel_endLoadInBackground1 = _registerName1("endLoadInBackground"); - late final _sel_URLHandleUsingCache_1 = - _registerName1("URLHandleUsingCache:"); - ffi.Pointer _objc_msgSend_267( - ffi.Pointer obj, - ffi.Pointer sel, - bool shouldUseCache, - ) { - return __objc_msgSend_267( - obj, - sel, - shouldUseCache, - ); - } - - late final __objc_msgSend_267Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_267 = __objc_msgSend_267Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_writeToFile_options_error_1 = - _registerName1("writeToFile:options:error:"); - bool _objc_msgSend_268( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - int writeOptionsMask, - ffi.Pointer> errorPtr, - ) { - return __objc_msgSend_268( - obj, - sel, - path, - writeOptionsMask, - errorPtr, - ); - } - - late final __objc_msgSend_268Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_268 = __objc_msgSend_268Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_writeToURL_options_error_1 = - _registerName1("writeToURL:options:error:"); - bool _objc_msgSend_269( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int writeOptionsMask, - ffi.Pointer> errorPtr, - ) { - return __objc_msgSend_269( - obj, - sel, - url, - writeOptionsMask, - errorPtr, - ); - } - - late final __objc_msgSend_269Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_269 = __objc_msgSend_269Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_rangeOfData_options_range_1 = - _registerName1("rangeOfData:options:range:"); - _NSRange _objc_msgSend_270( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dataToFind, - int mask, - _NSRange searchRange, - ) { - return __objc_msgSend_270( - obj, - sel, - dataToFind, - mask, - searchRange, - ); - } - - late final __objc_msgSend_270Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_270 = __objc_msgSend_270Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange)>(); - - void _objc_msgSend_270_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dataToFind, - int mask, - _NSRange searchRange, - ) { - return __objc_msgSend_270_stret( - stret, - obj, - sel, - dataToFind, - mask, - searchRange, - ); - } - - late final __objc_msgSend_270_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_270_stret = __objc_msgSend_270_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); - - late final _sel_enumerateByteRangesUsingBlock_1 = - _registerName1("enumerateByteRangesUsingBlock:"); - void _objc_msgSend_271( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_271( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_271Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_271 = __objc_msgSend_271Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_dataWithBytes_length_1 = - _registerName1("dataWithBytes:length:"); - instancetype _objc_msgSend_272( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, - ) { - return __objc_msgSend_272( - obj, - sel, - bytes, - length, - ); - } - - late final __objc_msgSend_272Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_272 = __objc_msgSend_272Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_dataWithBytesNoCopy_length_1 = - _registerName1("dataWithBytesNoCopy:length:"); - late final _sel_dataWithBytesNoCopy_length_freeWhenDone_1 = - _registerName1("dataWithBytesNoCopy:length:freeWhenDone:"); - instancetype _objc_msgSend_273( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, - bool b, - ) { - return __objc_msgSend_273( - obj, - sel, - bytes, - length, - b, - ); - } - - late final __objc_msgSend_273Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_273 = __objc_msgSend_273Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, bool)>(); - - late final _sel_dataWithContentsOfFile_options_error_1 = - _registerName1("dataWithContentsOfFile:options:error:"); - instancetype _objc_msgSend_274( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - int readOptionsMask, - ffi.Pointer> errorPtr, - ) { - return __objc_msgSend_274( - obj, - sel, - path, - readOptionsMask, - errorPtr, - ); - } - - late final __objc_msgSend_274Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_274 = __objc_msgSend_274Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_dataWithContentsOfURL_options_error_1 = - _registerName1("dataWithContentsOfURL:options:error:"); - instancetype _objc_msgSend_275( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int readOptionsMask, - ffi.Pointer> errorPtr, - ) { - return __objc_msgSend_275( - obj, - sel, - url, - readOptionsMask, - errorPtr, - ); - } - - late final __objc_msgSend_275Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_275 = __objc_msgSend_275Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_dataWithContentsOfFile_1 = - _registerName1("dataWithContentsOfFile:"); - late final _sel_dataWithContentsOfURL_1 = - _registerName1("dataWithContentsOfURL:"); - instancetype _objc_msgSend_276( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_276( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_276Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_276 = __objc_msgSend_276Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithBytes_length_1 = - _registerName1("initWithBytes:length:"); - late final _sel_initWithBytesNoCopy_length_1 = - _registerName1("initWithBytesNoCopy:length:"); - late final _sel_initWithBytesNoCopy_length_freeWhenDone_1 = - _registerName1("initWithBytesNoCopy:length:freeWhenDone:"); - late final _sel_initWithBytesNoCopy_length_deallocator_1 = - _registerName1("initWithBytesNoCopy:length:deallocator:"); - instancetype _objc_msgSend_277( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, - ffi.Pointer<_ObjCBlock> deallocator, - ) { - return __objc_msgSend_277( - obj, - sel, - bytes, - length, - deallocator, - ); - } - - late final __objc_msgSend_277Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_277 = __objc_msgSend_277Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_initWithContentsOfFile_options_error_1 = - _registerName1("initWithContentsOfFile:options:error:"); - late final _sel_initWithContentsOfURL_options_error_1 = - _registerName1("initWithContentsOfURL:options:error:"); - late final _sel_initWithData_1 = _registerName1("initWithData:"); - instancetype _objc_msgSend_278( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ) { - return __objc_msgSend_278( - obj, - sel, - data, - ); - } - - late final __objc_msgSend_278Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_278 = __objc_msgSend_278Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_dataWithData_1 = _registerName1("dataWithData:"); - late final _sel_initWithBase64EncodedString_options_1 = - _registerName1("initWithBase64EncodedString:options:"); - instancetype _objc_msgSend_279( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer base64String, - int options, - ) { - return __objc_msgSend_279( - obj, - sel, - base64String, - options, - ); - } - - late final __objc_msgSend_279Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_279 = __objc_msgSend_279Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_base64EncodedStringWithOptions_1 = - _registerName1("base64EncodedStringWithOptions:"); - ffi.Pointer _objc_msgSend_280( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ) { - return __objc_msgSend_280( - obj, - sel, - options, - ); - } - - late final __objc_msgSend_280Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_280 = __objc_msgSend_280Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithBase64EncodedData_options_1 = - _registerName1("initWithBase64EncodedData:options:"); - instancetype _objc_msgSend_281( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer base64Data, - int options, - ) { - return __objc_msgSend_281( - obj, - sel, - base64Data, - options, - ); - } - - late final __objc_msgSend_281Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_281 = __objc_msgSend_281Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_base64EncodedDataWithOptions_1 = - _registerName1("base64EncodedDataWithOptions:"); - ffi.Pointer _objc_msgSend_282( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ) { - return __objc_msgSend_282( - obj, - sel, - options, - ); - } - - late final __objc_msgSend_282Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_282 = __objc_msgSend_282Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_decompressedDataUsingAlgorithm_error_1 = - _registerName1("decompressedDataUsingAlgorithm:error:"); - instancetype _objc_msgSend_283( - ffi.Pointer obj, - ffi.Pointer sel, - int algorithm, - ffi.Pointer> error, - ) { - return __objc_msgSend_283( - obj, - sel, - algorithm, - error, - ); - } - - late final __objc_msgSend_283Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_283 = __objc_msgSend_283Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer>)>(); - - late final _sel_compressedDataUsingAlgorithm_error_1 = - _registerName1("compressedDataUsingAlgorithm:error:"); - late final _sel_getBytes_1 = _registerName1("getBytes:"); - late final _sel_dataWithContentsOfMappedFile_1 = - _registerName1("dataWithContentsOfMappedFile:"); - late final _sel_initWithContentsOfMappedFile_1 = - _registerName1("initWithContentsOfMappedFile:"); - late final _sel_initWithBase64Encoding_1 = - _registerName1("initWithBase64Encoding:"); - late final _sel_base64Encoding1 = _registerName1("base64Encoding"); - late final _sel_encodeDataObject_1 = _registerName1("encodeDataObject:"); - void _objc_msgSend_284( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ) { - return __objc_msgSend_284( - obj, - sel, - data, - ); - } - - late final __objc_msgSend_284Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_284 = __objc_msgSend_284Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeDataObject1 = _registerName1("decodeDataObject"); - ffi.Pointer _objc_msgSend_285( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_285( - obj, - sel, - ); - } - - late final __objc_msgSend_285Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_285 = __objc_msgSend_285Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_decodeValueOfObjCType_at_size_1 = - _registerName1("decodeValueOfObjCType:at:size:"); - void _objc_msgSend_286( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer type, - ffi.Pointer data, - int size, - ) { - return __objc_msgSend_286( - obj, - sel, - type, - data, - size, - ); - } - - late final __objc_msgSend_286Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_286 = __objc_msgSend_286Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_versionForClassName_1 = - _registerName1("versionForClassName:"); - int _objc_msgSend_287( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer className, - ) { - return __objc_msgSend_287( - obj, - sel, - className, - ); - } - - late final __objc_msgSend_287Ptr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_287 = __objc_msgSend_287Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_encodeObject_1 = _registerName1("encodeObject:"); - void _objc_msgSend_288( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - ) { - return __objc_msgSend_288( - obj, - sel, - object, - ); - } - - late final __objc_msgSend_288Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_288 = __objc_msgSend_288Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_encodeRootObject_1 = _registerName1("encodeRootObject:"); - late final _sel_encodeBycopyObject_1 = _registerName1("encodeBycopyObject:"); - late final _sel_encodeByrefObject_1 = _registerName1("encodeByrefObject:"); - late final _sel_encodeConditionalObject_1 = - _registerName1("encodeConditionalObject:"); - late final _sel_encodeValuesOfObjCTypes_1 = - _registerName1("encodeValuesOfObjCTypes:"); - void _objc_msgSend_289( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer types, - ) { - return __objc_msgSend_289( - obj, - sel, - types, - ); - } - - late final __objc_msgSend_289Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_289 = __objc_msgSend_289Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_encodeArrayOfObjCType_count_at_1 = - _registerName1("encodeArrayOfObjCType:count:at:"); - void _objc_msgSend_290( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer type, - int count, - ffi.Pointer array, - ) { - return __objc_msgSend_290( - obj, - sel, - type, - count, - array, - ); - } - - late final __objc_msgSend_290Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_290 = __objc_msgSend_290Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_encodeBytes_length_1 = _registerName1("encodeBytes:length:"); - late final _sel_decodeObject1 = _registerName1("decodeObject"); - late final _sel_decodeTopLevelObjectAndReturnError_1 = - _registerName1("decodeTopLevelObjectAndReturnError:"); - ffi.Pointer _objc_msgSend_291( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> error, - ) { - return __objc_msgSend_291( - obj, - sel, - error, - ); - } - - late final __objc_msgSend_291Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_291 = __objc_msgSend_291Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final _sel_decodeValuesOfObjCTypes_1 = - _registerName1("decodeValuesOfObjCTypes:"); - late final _sel_decodeArrayOfObjCType_count_at_1 = - _registerName1("decodeArrayOfObjCType:count:at:"); - late final _sel_decodeBytesWithReturnedLength_1 = - _registerName1("decodeBytesWithReturnedLength:"); - ffi.Pointer _objc_msgSend_292( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer lengthp, - ) { - return __objc_msgSend_292( - obj, - sel, - lengthp, - ); - } - - late final __objc_msgSend_292Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_292 = __objc_msgSend_292Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_encodePropertyList_1 = _registerName1("encodePropertyList:"); - late final _sel_decodePropertyList1 = _registerName1("decodePropertyList"); - late final _sel_setObjectZone_1 = _registerName1("setObjectZone:"); - void _objc_msgSend_293( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_293( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_293Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_293 = __objc_msgSend_293Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final _sel_objectZone1 = _registerName1("objectZone"); - ffi.Pointer<_NSZone> _objc_msgSend_294( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_294( - obj, - sel, - ); - } - - late final __objc_msgSend_294Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer<_NSZone> Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_294 = __objc_msgSend_294Ptr.asFunction< - ffi.Pointer<_NSZone> Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_systemVersion1 = _registerName1("systemVersion"); - late final _sel_allowsKeyedCoding1 = _registerName1("allowsKeyedCoding"); - late final _sel_encodeObject_forKey_1 = - _registerName1("encodeObject:forKey:"); - late final _sel_encodeConditionalObject_forKey_1 = - _registerName1("encodeConditionalObject:forKey:"); - late final _sel_encodeBool_forKey_1 = _registerName1("encodeBool:forKey:"); - void _objc_msgSend_295( - ffi.Pointer obj, - ffi.Pointer sel, - bool value, - ffi.Pointer key, - ) { - return __objc_msgSend_295( - obj, - sel, - value, - key, - ); - } - - late final __objc_msgSend_295Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Bool, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_295 = __objc_msgSend_295Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, bool, - ffi.Pointer)>(); - - late final _sel_encodeInt_forKey_1 = _registerName1("encodeInt:forKey:"); - void _objc_msgSend_296( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ffi.Pointer key, - ) { - return __objc_msgSend_296( - obj, - sel, - value, - key, - ); - } - - late final __objc_msgSend_296Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_296 = __objc_msgSend_296Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _sel_encodeInt32_forKey_1 = _registerName1("encodeInt32:forKey:"); - void _objc_msgSend_297( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ffi.Pointer key, - ) { - return __objc_msgSend_297( - obj, - sel, - value, - key, - ); - } - - late final __objc_msgSend_297Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_297 = __objc_msgSend_297Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _sel_encodeInt64_forKey_1 = _registerName1("encodeInt64:forKey:"); - void _objc_msgSend_298( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ffi.Pointer key, - ) { - return __objc_msgSend_298( - obj, - sel, - value, - key, - ); - } - - late final __objc_msgSend_298Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int64, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_298 = __objc_msgSend_298Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _sel_encodeFloat_forKey_1 = _registerName1("encodeFloat:forKey:"); - void _objc_msgSend_299( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ffi.Pointer key, - ) { - return __objc_msgSend_299( - obj, - sel, - value, - key, - ); - } - - late final __objc_msgSend_299Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Float, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_299 = __objc_msgSend_299Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double, - ffi.Pointer)>(); - - late final _sel_encodeDouble_forKey_1 = - _registerName1("encodeDouble:forKey:"); - void _objc_msgSend_300( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ffi.Pointer key, - ) { - return __objc_msgSend_300( - obj, - sel, - value, - key, - ); - } - - late final __objc_msgSend_300Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Double, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_300 = __objc_msgSend_300Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double, - ffi.Pointer)>(); - - late final _sel_encodeBytes_length_forKey_1 = - _registerName1("encodeBytes:length:forKey:"); - void _objc_msgSend_301( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, - ffi.Pointer key, - ) { - return __objc_msgSend_301( - obj, - sel, - bytes, - length, - key, - ); - } - - late final __objc_msgSend_301Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_301 = __objc_msgSend_301Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_containsValueForKey_1 = - _registerName1("containsValueForKey:"); - late final _sel_decodeObjectForKey_1 = _registerName1("decodeObjectForKey:"); - late final _sel_decodeTopLevelObjectForKey_error_1 = - _registerName1("decodeTopLevelObjectForKey:error:"); - ffi.Pointer _objc_msgSend_302( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ffi.Pointer> error, - ) { - return __objc_msgSend_302( - obj, - sel, - key, - error, - ); - } - - late final __objc_msgSend_302Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_302 = __objc_msgSend_302Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_decodeBoolForKey_1 = _registerName1("decodeBoolForKey:"); - late final _sel_decodeIntForKey_1 = _registerName1("decodeIntForKey:"); - int _objc_msgSend_303( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_303( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_303Ptr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_303 = __objc_msgSend_303Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeInt32ForKey_1 = _registerName1("decodeInt32ForKey:"); - int _objc_msgSend_304( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_304( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_304Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_304 = __objc_msgSend_304Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeInt64ForKey_1 = _registerName1("decodeInt64ForKey:"); - int _objc_msgSend_305( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_305( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_305Ptr = _lookup< - ffi.NativeFunction< - ffi.Int64 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_305 = __objc_msgSend_305Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeFloatForKey_1 = _registerName1("decodeFloatForKey:"); - double _objc_msgSend_306( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_306( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_306Ptr = _lookup< - ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_306 = __objc_msgSend_306Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - double _objc_msgSend_306_fpret( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_306_fpret( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_306_fpretPtr = _lookup< - ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); - late final __objc_msgSend_306_fpret = __objc_msgSend_306_fpretPtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeDoubleForKey_1 = _registerName1("decodeDoubleForKey:"); - double _objc_msgSend_307( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_307( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_307Ptr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_307 = __objc_msgSend_307Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - double _objc_msgSend_307_fpret( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_307_fpret( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_307_fpretPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); - late final __objc_msgSend_307_fpret = __objc_msgSend_307_fpretPtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeBytesForKey_returnedLength_1 = - _registerName1("decodeBytesForKey:returnedLength:"); - ffi.Pointer _objc_msgSend_308( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ffi.Pointer lengthp, - ) { - return __objc_msgSend_308( - obj, - sel, - key, - lengthp, - ); - } - - late final __objc_msgSend_308Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_308 = __objc_msgSend_308Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_encodeInteger_forKey_1 = - _registerName1("encodeInteger:forKey:"); - void _objc_msgSend_309( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ffi.Pointer key, - ) { - return __objc_msgSend_309( - obj, - sel, - value, - key, - ); - } - - late final __objc_msgSend_309Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Long, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_309 = __objc_msgSend_309Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _sel_decodeIntegerForKey_1 = - _registerName1("decodeIntegerForKey:"); - late final _sel_requiresSecureCoding1 = - _registerName1("requiresSecureCoding"); - late final _sel_decodeObjectOfClass_forKey_1 = - _registerName1("decodeObjectOfClass:forKey:"); - ffi.Pointer _objc_msgSend_310( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ffi.Pointer key, - ) { - return __objc_msgSend_310( - obj, - sel, - aClass, - key, - ); - } - - late final __objc_msgSend_310Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_310 = __objc_msgSend_310Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeTopLevelObjectOfClass_forKey_error_1 = - _registerName1("decodeTopLevelObjectOfClass:forKey:error:"); - ffi.Pointer _objc_msgSend_311( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ffi.Pointer key, - ffi.Pointer> error, - ) { - return __objc_msgSend_311( - obj, - sel, - aClass, - key, - error, - ); - } - - late final __objc_msgSend_311Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_311 = __objc_msgSend_311Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_decodeArrayOfObjectsOfClass_forKey_1 = - _registerName1("decodeArrayOfObjectsOfClass:forKey:"); - ffi.Pointer _objc_msgSend_312( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cls, - ffi.Pointer key, - ) { - return __objc_msgSend_312( - obj, - sel, - cls, - key, - ); - } - - late final __objc_msgSend_312Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_312 = __objc_msgSend_312Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_1 = - _registerName1("decodeDictionaryWithKeysOfClass:objectsOfClass:forKey:"); - ffi.Pointer _objc_msgSend_313( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keyCls, - ffi.Pointer objectCls, - ffi.Pointer key, - ) { - return __objc_msgSend_313( - obj, - sel, - keyCls, - objectCls, - key, - ); - } - - late final __objc_msgSend_313Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_313 = __objc_msgSend_313Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeObjectOfClasses_forKey_1 = - _registerName1("decodeObjectOfClasses:forKey:"); - ffi.Pointer _objc_msgSend_314( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer classes, - ffi.Pointer key, - ) { - return __objc_msgSend_314( - obj, - sel, - classes, - key, - ); - } - - late final __objc_msgSend_314Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_314 = __objc_msgSend_314Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeTopLevelObjectOfClasses_forKey_error_1 = - _registerName1("decodeTopLevelObjectOfClasses:forKey:error:"); - ffi.Pointer _objc_msgSend_315( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer classes, - ffi.Pointer key, - ffi.Pointer> error, - ) { - return __objc_msgSend_315( - obj, - sel, - classes, - key, - error, - ); - } - - late final __objc_msgSend_315Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_315 = __objc_msgSend_315Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_decodeArrayOfObjectsOfClasses_forKey_1 = - _registerName1("decodeArrayOfObjectsOfClasses:forKey:"); - ffi.Pointer _objc_msgSend_316( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer classes, - ffi.Pointer key, - ) { - return __objc_msgSend_316( - obj, - sel, - classes, - key, - ); - } - - late final __objc_msgSend_316Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_316 = __objc_msgSend_316Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_1 = - _registerName1( - "decodeDictionaryWithKeysOfClasses:objectsOfClasses:forKey:"); - ffi.Pointer _objc_msgSend_317( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keyClasses, - ffi.Pointer objectClasses, - ffi.Pointer key, - ) { - return __objc_msgSend_317( - obj, - sel, - keyClasses, - objectClasses, - key, - ); - } - - late final __objc_msgSend_317Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_317 = __objc_msgSend_317Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodePropertyListForKey_1 = - _registerName1("decodePropertyListForKey:"); - late final _sel_allowedClasses1 = _registerName1("allowedClasses"); - ffi.Pointer _objc_msgSend_318( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_318( - obj, - sel, - ); - } - - late final __objc_msgSend_318Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_318 = __objc_msgSend_318Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_failWithError_1 = _registerName1("failWithError:"); - void _objc_msgSend_319( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer error, - ) { - return __objc_msgSend_319( - obj, - sel, - error, - ); - } - - late final __objc_msgSend_319Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_319 = __objc_msgSend_319Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodingFailurePolicy1 = - _registerName1("decodingFailurePolicy"); - int _objc_msgSend_320( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_320( - obj, - sel, - ); - } - - late final __objc_msgSend_320Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_320 = __objc_msgSend_320Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_error1 = _registerName1("error"); - ffi.Pointer _objc_msgSend_321( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_321( - obj, - sel, - ); - } - - late final __objc_msgSend_321Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_321 = __objc_msgSend_321Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_encodeNXObject_1 = _registerName1("encodeNXObject:"); - late final _sel_decodeNXObject1 = _registerName1("decodeNXObject"); - late final _sel_decodeValueOfObjCType_at_1 = - _registerName1("decodeValueOfObjCType:at:"); - late final _sel_encodePoint_1 = _registerName1("encodePoint:"); - void _objc_msgSend_322( - ffi.Pointer obj, - ffi.Pointer sel, - CGPoint point, - ) { - return __objc_msgSend_322( - obj, - sel, - point, - ); - } - - late final __objc_msgSend_322Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - CGPoint)>>('objc_msgSend'); - late final __objc_msgSend_322 = __objc_msgSend_322Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, CGPoint)>(); - - late final _sel_decodePoint1 = _registerName1("decodePoint"); - late final _sel_encodeSize_1 = _registerName1("encodeSize:"); - void _objc_msgSend_323( - ffi.Pointer obj, - ffi.Pointer sel, - CGSize size, - ) { - return __objc_msgSend_323( - obj, - sel, - size, - ); - } - - late final __objc_msgSend_323Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - CGSize)>>('objc_msgSend'); - late final __objc_msgSend_323 = __objc_msgSend_323Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, CGSize)>(); - - late final _sel_decodeSize1 = _registerName1("decodeSize"); - late final _sel_encodeRect_1 = _registerName1("encodeRect:"); - void _objc_msgSend_324( - ffi.Pointer obj, - ffi.Pointer sel, - CGRect rect, - ) { - return __objc_msgSend_324( - obj, - sel, - rect, - ); - } - - late final __objc_msgSend_324Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - CGRect)>>('objc_msgSend'); - late final __objc_msgSend_324 = __objc_msgSend_324Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, CGRect)>(); - - late final _sel_decodeRect1 = _registerName1("decodeRect"); - late final _sel_encodePoint_forKey_1 = _registerName1("encodePoint:forKey:"); - void _objc_msgSend_325( - ffi.Pointer obj, - ffi.Pointer sel, - CGPoint point, - ffi.Pointer key, - ) { - return __objc_msgSend_325( - obj, - sel, - point, - key, - ); - } - - late final __objc_msgSend_325Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - CGPoint, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_325 = __objc_msgSend_325Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, CGPoint, - ffi.Pointer)>(); - - late final _sel_encodeSize_forKey_1 = _registerName1("encodeSize:forKey:"); - void _objc_msgSend_326( - ffi.Pointer obj, - ffi.Pointer sel, - CGSize size, - ffi.Pointer key, - ) { - return __objc_msgSend_326( - obj, - sel, - size, - key, - ); - } - - late final __objc_msgSend_326Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - CGSize, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_326 = __objc_msgSend_326Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, CGSize, - ffi.Pointer)>(); - - late final _sel_encodeRect_forKey_1 = _registerName1("encodeRect:forKey:"); - void _objc_msgSend_327( - ffi.Pointer obj, - ffi.Pointer sel, - CGRect rect, - ffi.Pointer key, - ) { - return __objc_msgSend_327( - obj, - sel, - rect, - key, - ); - } - - late final __objc_msgSend_327Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - CGRect, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_327 = __objc_msgSend_327Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, CGRect, - ffi.Pointer)>(); - - late final _sel_decodePointForKey_1 = _registerName1("decodePointForKey:"); - CGPoint _objc_msgSend_328( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_328( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_328Ptr = _lookup< - ffi.NativeFunction< - CGPoint Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_328 = __objc_msgSend_328Ptr.asFunction< - CGPoint Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_328_stret( - ffi.Pointer stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_328_stret( - stret, - obj, - sel, - key, - ); - } - - late final __objc_msgSend_328_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_328_stret = __objc_msgSend_328_stretPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_decodeSizeForKey_1 = _registerName1("decodeSizeForKey:"); - CGSize _objc_msgSend_329( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_329( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_329Ptr = _lookup< - ffi.NativeFunction< - CGSize Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_329 = __objc_msgSend_329Ptr.asFunction< - CGSize Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_329_stret( - ffi.Pointer stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_329_stret( - stret, - obj, - sel, - key, - ); - } - - late final __objc_msgSend_329_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_329_stret = __objc_msgSend_329_stretPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_decodeRectForKey_1 = _registerName1("decodeRectForKey:"); - CGRect _objc_msgSend_330( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_330( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_330Ptr = _lookup< - ffi.NativeFunction< - CGRect Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_330 = __objc_msgSend_330Ptr.asFunction< - CGRect Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_330_stret( - ffi.Pointer stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_330_stret( - stret, - obj, - sel, - key, - ); - } - - late final __objc_msgSend_330_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_330_stret = __objc_msgSend_330_stretPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_substringFromIndex_1 = _registerName1("substringFromIndex:"); - ffi.Pointer _objc_msgSend_331( - ffi.Pointer obj, - ffi.Pointer sel, - int from, - ) { - return __objc_msgSend_331( - obj, - sel, - from, - ); - } - - late final __objc_msgSend_331Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_331 = __objc_msgSend_331Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_substringToIndex_1 = _registerName1("substringToIndex:"); - late final _sel_substringWithRange_1 = _registerName1("substringWithRange:"); - ffi.Pointer _objc_msgSend_332( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_332( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_332Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_332 = __objc_msgSend_332Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_getCharacters_range_1 = - _registerName1("getCharacters:range:"); - void _objc_msgSend_333( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - _NSRange range, - ) { - return __objc_msgSend_333( - obj, - sel, - buffer, - range, - ); - } - - late final __objc_msgSend_333Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_333 = __objc_msgSend_333Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>(); - - int _objc_msgSend_334( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - ) { - return __objc_msgSend_334( - obj, - sel, - string, - ); - } - - late final __objc_msgSend_334Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_334 = __objc_msgSend_334Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_compare_options_1 = _registerName1("compare:options:"); - int _objc_msgSend_335( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - ) { - return __objc_msgSend_335( - obj, - sel, - string, - mask, - ); - } - - late final __objc_msgSend_335Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_335 = __objc_msgSend_335Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_compare_options_range_1 = - _registerName1("compare:options:range:"); - int _objc_msgSend_336( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - _NSRange rangeOfReceiverToCompare, - ) { - return __objc_msgSend_336( - obj, - sel, - string, - mask, - rangeOfReceiverToCompare, - ); - } - - late final __objc_msgSend_336Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_336 = __objc_msgSend_336Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange)>(); - - late final _sel_compare_options_range_locale_1 = - _registerName1("compare:options:range:locale:"); - int _objc_msgSend_337( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - _NSRange rangeOfReceiverToCompare, - ffi.Pointer locale, - ) { - return __objc_msgSend_337( - obj, - sel, - string, - mask, - rangeOfReceiverToCompare, - locale, - ); - } - - late final __objc_msgSend_337Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_337 = __objc_msgSend_337Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange, ffi.Pointer)>(); - - late final _sel_caseInsensitiveCompare_1 = - _registerName1("caseInsensitiveCompare:"); - late final _sel_localizedCompare_1 = _registerName1("localizedCompare:"); - late final _sel_localizedCaseInsensitiveCompare_1 = - _registerName1("localizedCaseInsensitiveCompare:"); - late final _sel_localizedStandardCompare_1 = - _registerName1("localizedStandardCompare:"); - late final _sel_isEqualToString_1 = _registerName1("isEqualToString:"); - late final _sel_hasPrefix_1 = _registerName1("hasPrefix:"); - late final _sel_hasSuffix_1 = _registerName1("hasSuffix:"); - late final _sel_commonPrefixWithString_options_1 = - _registerName1("commonPrefixWithString:options:"); - ffi.Pointer _objc_msgSend_338( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - int mask, - ) { - return __objc_msgSend_338( - obj, - sel, - str, - mask, - ); - } - - late final __objc_msgSend_338Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_338 = __objc_msgSend_338Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_containsString_1 = _registerName1("containsString:"); - late final _sel_localizedCaseInsensitiveContainsString_1 = - _registerName1("localizedCaseInsensitiveContainsString:"); - late final _sel_localizedStandardContainsString_1 = - _registerName1("localizedStandardContainsString:"); - late final _sel_localizedStandardRangeOfString_1 = - _registerName1("localizedStandardRangeOfString:"); - _NSRange _objc_msgSend_339( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - ) { - return __objc_msgSend_339( - obj, - sel, - str, - ); - } - - late final __objc_msgSend_339Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_339 = __objc_msgSend_339Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_339_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - ) { - return __objc_msgSend_339_stret( - stret, - obj, - sel, - str, - ); - } - - late final __objc_msgSend_339_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_339_stret = __objc_msgSend_339_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_rangeOfString_1 = _registerName1("rangeOfString:"); - late final _sel_rangeOfString_options_1 = - _registerName1("rangeOfString:options:"); - _NSRange _objc_msgSend_340( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - ) { - return __objc_msgSend_340( - obj, - sel, - searchString, - mask, - ); - } - - late final __objc_msgSend_340Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_340 = __objc_msgSend_340Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - void _objc_msgSend_340_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - ) { - return __objc_msgSend_340_stret( - stret, - obj, - sel, - searchString, - mask, - ); - } - - late final __objc_msgSend_340_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend_stret'); - late final __objc_msgSend_340_stret = __objc_msgSend_340_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_rangeOfString_options_range_1 = - _registerName1("rangeOfString:options:range:"); - _NSRange _objc_msgSend_341( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - _NSRange rangeOfReceiverToSearch, - ) { - return __objc_msgSend_341( - obj, - sel, - searchString, - mask, - rangeOfReceiverToSearch, - ); - } - - late final __objc_msgSend_341Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_341 = __objc_msgSend_341Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange)>(); - - void _objc_msgSend_341_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - _NSRange rangeOfReceiverToSearch, - ) { - return __objc_msgSend_341_stret( - stret, - obj, - sel, - searchString, - mask, - rangeOfReceiverToSearch, - ); - } - - late final __objc_msgSend_341_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_341_stret = __objc_msgSend_341_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); - - late final _sel_rangeOfString_options_range_locale_1 = - _registerName1("rangeOfString:options:range:locale:"); - _NSRange _objc_msgSend_342( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - _NSRange rangeOfReceiverToSearch, - ffi.Pointer locale, - ) { - return __objc_msgSend_342( - obj, - sel, - searchString, - mask, - rangeOfReceiverToSearch, - locale, - ); - } - - late final __objc_msgSend_342Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_342 = __objc_msgSend_342Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange, ffi.Pointer)>(); - - void _objc_msgSend_342_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - _NSRange rangeOfReceiverToSearch, - ffi.Pointer locale, - ) { - return __objc_msgSend_342_stret( - stret, - obj, - sel, - searchString, - mask, - rangeOfReceiverToSearch, - locale, - ); - } - - late final __objc_msgSend_342_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_342_stret = __objc_msgSend_342_stretPtr.asFunction< - void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _NSRange, - ffi.Pointer)>(); - - late final _sel_rangeOfCharacterFromSet_1 = - _registerName1("rangeOfCharacterFromSet:"); - _NSRange _objc_msgSend_343( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchSet, - ) { - return __objc_msgSend_343( - obj, - sel, - searchSet, - ); - } - - late final __objc_msgSend_343Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_343 = __objc_msgSend_343Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_343_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchSet, - ) { - return __objc_msgSend_343_stret( - stret, - obj, - sel, - searchSet, - ); - } - - late final __objc_msgSend_343_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_343_stret = __objc_msgSend_343_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_rangeOfCharacterFromSet_options_1 = - _registerName1("rangeOfCharacterFromSet:options:"); - _NSRange _objc_msgSend_344( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchSet, - int mask, - ) { - return __objc_msgSend_344( - obj, - sel, - searchSet, - mask, - ); - } - - late final __objc_msgSend_344Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_344 = __objc_msgSend_344Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - void _objc_msgSend_344_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchSet, - int mask, - ) { - return __objc_msgSend_344_stret( - stret, - obj, - sel, - searchSet, - mask, - ); - } - - late final __objc_msgSend_344_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend_stret'); - late final __objc_msgSend_344_stret = __objc_msgSend_344_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_rangeOfCharacterFromSet_options_range_1 = - _registerName1("rangeOfCharacterFromSet:options:range:"); - _NSRange _objc_msgSend_345( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchSet, - int mask, - _NSRange rangeOfReceiverToSearch, - ) { - return __objc_msgSend_345( - obj, - sel, - searchSet, - mask, - rangeOfReceiverToSearch, - ); - } - - late final __objc_msgSend_345Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_345 = __objc_msgSend_345Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange)>(); - - void _objc_msgSend_345_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchSet, - int mask, - _NSRange rangeOfReceiverToSearch, - ) { - return __objc_msgSend_345_stret( - stret, - obj, - sel, - searchSet, - mask, - rangeOfReceiverToSearch, - ); - } - - late final __objc_msgSend_345_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_345_stret = __objc_msgSend_345_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); - - late final _sel_rangeOfComposedCharacterSequenceAtIndex_1 = - _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); - _NSRange _objc_msgSend_346( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_346( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_346Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_346 = __objc_msgSend_346Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); - - void _objc_msgSend_346_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_346_stret( - stret, - obj, - sel, - index, - ); - } - - late final __objc_msgSend_346_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend_stret'); - late final __objc_msgSend_346_stret = __objc_msgSend_346_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_rangeOfComposedCharacterSequencesForRange_1 = - _registerName1("rangeOfComposedCharacterSequencesForRange:"); - _NSRange _objc_msgSend_347( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_347( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_347Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_347 = __objc_msgSend_347Ptr.asFunction< - _NSRange Function( - ffi.Pointer, ffi.Pointer, _NSRange)>(); - - void _objc_msgSend_347_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_347_stret( - stret, - obj, - sel, - range, - ); - } - - late final __objc_msgSend_347_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_347_stret = __objc_msgSend_347_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, _NSRange)>(); - - late final _sel_stringByAppendingString_1 = - _registerName1("stringByAppendingString:"); - late final _sel_stringByAppendingFormat_1 = - _registerName1("stringByAppendingFormat:"); - late final _sel_uppercaseString1 = _registerName1("uppercaseString"); - late final _sel_lowercaseString1 = _registerName1("lowercaseString"); - late final _sel_capitalizedString1 = _registerName1("capitalizedString"); - late final _sel_localizedUppercaseString1 = - _registerName1("localizedUppercaseString"); - late final _sel_localizedLowercaseString1 = - _registerName1("localizedLowercaseString"); - late final _sel_localizedCapitalizedString1 = - _registerName1("localizedCapitalizedString"); - late final _sel_uppercaseStringWithLocale_1 = - _registerName1("uppercaseStringWithLocale:"); - ffi.Pointer _objc_msgSend_348( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer locale, - ) { - return __objc_msgSend_348( - obj, - sel, - locale, - ); - } - - late final __objc_msgSend_348Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_348 = __objc_msgSend_348Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_lowercaseStringWithLocale_1 = - _registerName1("lowercaseStringWithLocale:"); - late final _sel_capitalizedStringWithLocale_1 = - _registerName1("capitalizedStringWithLocale:"); - late final _sel_getLineStart_end_contentsEnd_forRange_1 = - _registerName1("getLineStart:end:contentsEnd:forRange:"); - void _objc_msgSend_349( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer startPtr, - ffi.Pointer lineEndPtr, - ffi.Pointer contentsEndPtr, - _NSRange range, - ) { - return __objc_msgSend_349( - obj, - sel, - startPtr, - lineEndPtr, - contentsEndPtr, - range, - ); - } - - late final __objc_msgSend_349Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_349 = __objc_msgSend_349Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - _NSRange)>(); - - late final _sel_lineRangeForRange_1 = _registerName1("lineRangeForRange:"); - late final _sel_getParagraphStart_end_contentsEnd_forRange_1 = - _registerName1("getParagraphStart:end:contentsEnd:forRange:"); - late final _sel_paragraphRangeForRange_1 = - _registerName1("paragraphRangeForRange:"); - late final _sel_enumerateSubstringsInRange_options_usingBlock_1 = - _registerName1("enumerateSubstringsInRange:options:usingBlock:"); - void _objc_msgSend_350( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_350( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_350Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_350 = __objc_msgSend_350Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_enumerateLinesUsingBlock_1 = - _registerName1("enumerateLinesUsingBlock:"); - void _objc_msgSend_351( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_351( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_351Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_351 = __objc_msgSend_351Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_UTF8String1 = _registerName1("UTF8String"); - late final _sel_fastestEncoding1 = _registerName1("fastestEncoding"); - late final _sel_smallestEncoding1 = _registerName1("smallestEncoding"); - late final _sel_dataUsingEncoding_allowLossyConversion_1 = - _registerName1("dataUsingEncoding:allowLossyConversion:"); - ffi.Pointer _objc_msgSend_352( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - bool lossy, - ) { - return __objc_msgSend_352( - obj, - sel, - encoding, - lossy, - ); - } - - late final __objc_msgSend_352Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_352 = __objc_msgSend_352Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int, bool)>(); - - late final _sel_dataUsingEncoding_1 = _registerName1("dataUsingEncoding:"); - ffi.Pointer _objc_msgSend_353( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - ) { - return __objc_msgSend_353( - obj, - sel, - encoding, - ); - } - - late final __objc_msgSend_353Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_353 = __objc_msgSend_353Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_canBeConvertedToEncoding_1 = - _registerName1("canBeConvertedToEncoding:"); - late final _sel_cStringUsingEncoding_1 = - _registerName1("cStringUsingEncoding:"); - late final _sel_getCString_maxLength_encoding_1 = - _registerName1("getCString:maxLength:encoding:"); - bool _objc_msgSend_354( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int maxBufferCount, - int encoding, - ) { - return __objc_msgSend_354( - obj, - sel, - buffer, - maxBufferCount, - encoding, - ); - } - - late final __objc_msgSend_354Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_354 = __objc_msgSend_354Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - late final _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1 = - _registerName1( - "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); - bool _objc_msgSend_355( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int maxBufferCount, - ffi.Pointer usedBufferCount, - int encoding, - int options, - _NSRange range, - ffi.Pointer<_NSRange> leftover, - ) { - return __objc_msgSend_355( - obj, - sel, - buffer, - maxBufferCount, - usedBufferCount, - encoding, - options, - range, - leftover, - ); - } - - late final __objc_msgSend_355Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Int32, - _NSRange, - ffi.Pointer<_NSRange>)>>('objc_msgSend'); - late final __objc_msgSend_355 = __objc_msgSend_355Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - int, - int, - _NSRange, - ffi.Pointer<_NSRange>)>(); - - late final _sel_maximumLengthOfBytesUsingEncoding_1 = - _registerName1("maximumLengthOfBytesUsingEncoding:"); - late final _sel_lengthOfBytesUsingEncoding_1 = - _registerName1("lengthOfBytesUsingEncoding:"); - late final _sel_availableStringEncodings1 = - _registerName1("availableStringEncodings"); - ffi.Pointer _objc_msgSend_356( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_356( - obj, - sel, - ); - } - - late final __objc_msgSend_356Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_356 = __objc_msgSend_356Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_localizedNameOfStringEncoding_1 = - _registerName1("localizedNameOfStringEncoding:"); - late final _sel_defaultCStringEncoding1 = - _registerName1("defaultCStringEncoding"); - late final _sel_decomposedStringWithCanonicalMapping1 = - _registerName1("decomposedStringWithCanonicalMapping"); - late final _sel_precomposedStringWithCanonicalMapping1 = - _registerName1("precomposedStringWithCanonicalMapping"); - late final _sel_decomposedStringWithCompatibilityMapping1 = - _registerName1("decomposedStringWithCompatibilityMapping"); - late final _sel_precomposedStringWithCompatibilityMapping1 = - _registerName1("precomposedStringWithCompatibilityMapping"); - late final _sel_componentsSeparatedByString_1 = - _registerName1("componentsSeparatedByString:"); - ffi.Pointer _objc_msgSend_357( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer separator, - ) { - return __objc_msgSend_357( - obj, - sel, - separator, - ); - } - - late final __objc_msgSend_357Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_357 = __objc_msgSend_357Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_componentsSeparatedByCharactersInSet_1 = - _registerName1("componentsSeparatedByCharactersInSet:"); - ffi.Pointer _objc_msgSend_358( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer separator, - ) { - return __objc_msgSend_358( - obj, - sel, - separator, - ); - } - - late final __objc_msgSend_358Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_358 = __objc_msgSend_358Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_stringByTrimmingCharactersInSet_1 = - _registerName1("stringByTrimmingCharactersInSet:"); - ffi.Pointer _objc_msgSend_359( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer set1, - ) { - return __objc_msgSend_359( - obj, - sel, - set1, - ); - } - - late final __objc_msgSend_359Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_359 = __objc_msgSend_359Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_stringByPaddingToLength_withString_startingAtIndex_1 = - _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); - ffi.Pointer _objc_msgSend_360( - ffi.Pointer obj, - ffi.Pointer sel, - int newLength, - ffi.Pointer padString, - int padIndex, - ) { - return __objc_msgSend_360( - obj, - sel, - newLength, - padString, - padIndex, - ); - } - - late final __objc_msgSend_360Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_360 = __objc_msgSend_360Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); - - late final _sel_stringByFoldingWithOptions_locale_1 = - _registerName1("stringByFoldingWithOptions:locale:"); - ffi.Pointer _objc_msgSend_361( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ffi.Pointer locale, - ) { - return __objc_msgSend_361( - obj, - sel, - options, - locale, - ); - } - - late final __objc_msgSend_361Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_361 = __objc_msgSend_361Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = - _registerName1( - "stringByReplacingOccurrencesOfString:withString:options:range:"); - ffi.Pointer _objc_msgSend_362( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - int options, - _NSRange searchRange, - ) { - return __objc_msgSend_362( - obj, - sel, - target, - replacement, - options, - searchRange, - ); - } - - late final __objc_msgSend_362Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_362 = __objc_msgSend_362Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _NSRange)>(); - - late final _sel_stringByReplacingOccurrencesOfString_withString_1 = - _registerName1("stringByReplacingOccurrencesOfString:withString:"); - ffi.Pointer _objc_msgSend_363( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - ) { - return __objc_msgSend_363( - obj, - sel, - target, - replacement, - ); - } - - late final __objc_msgSend_363Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_363 = __objc_msgSend_363Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_stringByReplacingCharactersInRange_withString_1 = - _registerName1("stringByReplacingCharactersInRange:withString:"); - ffi.Pointer _objc_msgSend_364( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer replacement, - ) { - return __objc_msgSend_364( - obj, - sel, - range, - replacement, - ); - } - - late final __objc_msgSend_364Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_364 = __objc_msgSend_364Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange, ffi.Pointer)>(); - - late final _sel_stringByApplyingTransform_reverse_1 = - _registerName1("stringByApplyingTransform:reverse:"); - ffi.Pointer _objc_msgSend_365( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer transform, - bool reverse, - ) { - return __objc_msgSend_365( - obj, - sel, - transform, - reverse, - ); - } - - late final __objc_msgSend_365Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_365 = __objc_msgSend_365Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_writeToURL_atomically_encoding_error_1 = - _registerName1("writeToURL:atomically:encoding:error:"); - bool _objc_msgSend_366( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_366( - obj, - sel, - url, - useAuxiliaryFile, - enc, - error, - ); - } - - late final __objc_msgSend_366Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.UnsignedLong, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_366 = __objc_msgSend_366Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - int, - ffi.Pointer>)>(); - - late final _sel_writeToFile_atomically_encoding_error_1 = - _registerName1("writeToFile:atomically:encoding:error:"); - bool _objc_msgSend_367( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_367( - obj, - sel, - path, - useAuxiliaryFile, - enc, - error, - ); - } - - late final __objc_msgSend_367Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.UnsignedLong, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_367 = __objc_msgSend_367Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - int, - ffi.Pointer>)>(); - - late final _sel_hash1 = _registerName1("hash"); - late final _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = - _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); - instancetype _objc_msgSend_368( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer characters, - int length, - bool freeBuffer, - ) { - return __objc_msgSend_368( - obj, - sel, - characters, - length, - freeBuffer, - ); - } - - late final __objc_msgSend_368Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_368 = __objc_msgSend_368Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, bool)>(); - - late final _sel_initWithCharactersNoCopy_length_deallocator_1 = - _registerName1("initWithCharactersNoCopy:length:deallocator:"); - instancetype _objc_msgSend_369( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer chars, - int len, - ffi.Pointer<_ObjCBlock> deallocator, - ) { - return __objc_msgSend_369( - obj, - sel, - chars, - len, - deallocator, - ); - } - - late final __objc_msgSend_369Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_369 = __objc_msgSend_369Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_initWithCharacters_length_1 = - _registerName1("initWithCharacters:length:"); - instancetype _objc_msgSend_370( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer characters, - int length, - ) { - return __objc_msgSend_370( - obj, - sel, - characters, - length, - ); - } - - late final __objc_msgSend_370Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_370 = __objc_msgSend_370Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_initWithUTF8String_1 = _registerName1("initWithUTF8String:"); - instancetype _objc_msgSend_371( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer nullTerminatedCString, - ) { - return __objc_msgSend_371( - obj, - sel, - nullTerminatedCString, - ); - } - - late final __objc_msgSend_371Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_371 = __objc_msgSend_371Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithFormat_1 = _registerName1("initWithFormat:"); - late final _sel_initWithFormat_arguments_1 = - _registerName1("initWithFormat:arguments:"); - instancetype _objc_msgSend_372( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer argList, - ) { - return __objc_msgSend_372( - obj, - sel, - format, - argList, - ); - } - - late final __objc_msgSend_372Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_372 = __objc_msgSend_372Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithFormat_locale_1 = - _registerName1("initWithFormat:locale:"); - instancetype _objc_msgSend_373( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer locale, - ) { - return __objc_msgSend_373( - obj, - sel, - format, - locale, - ); - } - - late final __objc_msgSend_373Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_373 = __objc_msgSend_373Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithFormat_locale_arguments_1 = - _registerName1("initWithFormat:locale:arguments:"); - instancetype _objc_msgSend_374( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer locale, - ffi.Pointer argList, - ) { - return __objc_msgSend_374( - obj, - sel, - format, - locale, - argList, - ); - } - - late final __objc_msgSend_374Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_374 = __objc_msgSend_374Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithValidatedFormat_validFormatSpecifiers_error_1 = - _registerName1("initWithValidatedFormat:validFormatSpecifiers:error:"); - instancetype _objc_msgSend_375( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer validFormatSpecifiers, - ffi.Pointer> error, - ) { - return __objc_msgSend_375( - obj, - sel, - format, - validFormatSpecifiers, - error, - ); - } - - late final __objc_msgSend_375Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_375 = __objc_msgSend_375Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1 = - _registerName1( - "initWithValidatedFormat:validFormatSpecifiers:locale:error:"); - instancetype _objc_msgSend_376( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer validFormatSpecifiers, - ffi.Pointer locale, - ffi.Pointer> error, - ) { - return __objc_msgSend_376( - obj, - sel, - format, - validFormatSpecifiers, - locale, - error, - ); - } - - late final __objc_msgSend_376Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_376 = __objc_msgSend_376Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1 = - _registerName1( - "initWithValidatedFormat:validFormatSpecifiers:arguments:error:"); - instancetype _objc_msgSend_377( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer validFormatSpecifiers, - ffi.Pointer argList, - ffi.Pointer> error, - ) { - return __objc_msgSend_377( - obj, - sel, - format, - validFormatSpecifiers, - argList, - error, - ); - } - - late final __objc_msgSend_377Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_377 = __objc_msgSend_377Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1 = - _registerName1( - "initWithValidatedFormat:validFormatSpecifiers:locale:arguments:error:"); - instancetype _objc_msgSend_378( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer validFormatSpecifiers, - ffi.Pointer locale, - ffi.Pointer argList, - ffi.Pointer> error, - ) { - return __objc_msgSend_378( - obj, - sel, - format, - validFormatSpecifiers, - locale, - argList, - error, - ); - } - - late final __objc_msgSend_378Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_378 = __objc_msgSend_378Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initWithData_encoding_1 = - _registerName1("initWithData:encoding:"); - instancetype _objc_msgSend_379( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - int encoding, - ) { - return __objc_msgSend_379( - obj, - sel, - data, - encoding, - ); - } - - late final __objc_msgSend_379Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_379 = __objc_msgSend_379Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_initWithBytes_length_encoding_1 = - _registerName1("initWithBytes:length:encoding:"); - instancetype _objc_msgSend_380( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - ) { - return __objc_msgSend_380( - obj, - sel, - bytes, - len, - encoding, - ); - } - - late final __objc_msgSend_380Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_380 = __objc_msgSend_380Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - late final _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = - _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); - instancetype _objc_msgSend_381( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - bool freeBuffer, - ) { - return __objc_msgSend_381( - obj, - sel, - bytes, - len, - encoding, - freeBuffer, - ); - } - - late final __objc_msgSend_381Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_381 = __objc_msgSend_381Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, bool)>(); - - late final _sel_initWithBytesNoCopy_length_encoding_deallocator_1 = - _registerName1("initWithBytesNoCopy:length:encoding:deallocator:"); - instancetype _objc_msgSend_382( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - ffi.Pointer<_ObjCBlock> deallocator, - ) { - return __objc_msgSend_382( - obj, - sel, - bytes, - len, - encoding, - deallocator, - ); - } - - late final __objc_msgSend_382Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_382 = __objc_msgSend_382Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_string1 = _registerName1("string"); - late final _sel_stringWithString_1 = _registerName1("stringWithString:"); - late final _sel_stringWithCharacters_length_1 = - _registerName1("stringWithCharacters:length:"); - late final _sel_stringWithUTF8String_1 = - _registerName1("stringWithUTF8String:"); - late final _sel_stringWithFormat_1 = _registerName1("stringWithFormat:"); - late final _sel_localizedStringWithFormat_1 = - _registerName1("localizedStringWithFormat:"); - late final _sel_stringWithValidatedFormat_validFormatSpecifiers_error_1 = - _registerName1("stringWithValidatedFormat:validFormatSpecifiers:error:"); - late final _sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1 = - _registerName1( - "localizedStringWithValidatedFormat:validFormatSpecifiers:error:"); - late final _sel_initWithCString_encoding_1 = - _registerName1("initWithCString:encoding:"); - instancetype _objc_msgSend_383( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer nullTerminatedCString, - int encoding, - ) { - return __objc_msgSend_383( - obj, - sel, - nullTerminatedCString, - encoding, - ); - } - - late final __objc_msgSend_383Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_383 = __objc_msgSend_383Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - late final _sel_initWithContentsOfURL_encoding_error_1 = - _registerName1("initWithContentsOfURL:encoding:error:"); - instancetype _objc_msgSend_384( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_384( - obj, - sel, - url, - enc, - error, - ); - } - - late final __objc_msgSend_384Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_384 = __objc_msgSend_384Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_initWithContentsOfFile_encoding_error_1 = - _registerName1("initWithContentsOfFile:encoding:error:"); - instancetype _objc_msgSend_385( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - int enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_385( - obj, - sel, - path, - enc, - error, - ); - } - - late final __objc_msgSend_385Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_385 = __objc_msgSend_385Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_stringWithContentsOfURL_encoding_error_1 = - _registerName1("stringWithContentsOfURL:encoding:error:"); - late final _sel_stringWithContentsOfFile_encoding_error_1 = - _registerName1("stringWithContentsOfFile:encoding:error:"); - late final _sel_initWithContentsOfURL_usedEncoding_error_1 = - _registerName1("initWithContentsOfURL:usedEncoding:error:"); - instancetype _objc_msgSend_386( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_386( - obj, - sel, - url, - enc, - error, - ); - } - - late final __objc_msgSend_386Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_386 = __objc_msgSend_386Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initWithContentsOfFile_usedEncoding_error_1 = - _registerName1("initWithContentsOfFile:usedEncoding:error:"); - instancetype _objc_msgSend_387( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_387( - obj, - sel, - path, - enc, - error, - ); - } - - late final __objc_msgSend_387Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_387 = __objc_msgSend_387Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_stringWithContentsOfURL_usedEncoding_error_1 = - _registerName1("stringWithContentsOfURL:usedEncoding:error:"); - late final _sel_stringWithContentsOfFile_usedEncoding_error_1 = - _registerName1("stringWithContentsOfFile:usedEncoding:error:"); - late final _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1 = - _registerName1( - "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); - int _objc_msgSend_388( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ffi.Pointer opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion, - ) { - return __objc_msgSend_388( - obj, - sel, - data, - opts, - string, - usedLossyConversion, - ); - } - - late final __objc_msgSend_388Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_388 = __objc_msgSend_388Ptr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>(); - - late final _sel_propertyList1 = _registerName1("propertyList"); - late final _sel_propertyListFromStringsFileFormat1 = - _registerName1("propertyListFromStringsFileFormat"); - ffi.Pointer _objc_msgSend_389( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_389( - obj, - sel, - ); - } - - late final __objc_msgSend_389Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_389 = __objc_msgSend_389Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_cString1 = _registerName1("cString"); - late final _sel_lossyCString1 = _registerName1("lossyCString"); - late final _sel_cStringLength1 = _registerName1("cStringLength"); - late final _sel_getCString_1 = _registerName1("getCString:"); - late final _sel_getCString_maxLength_1 = - _registerName1("getCString:maxLength:"); - void _objc_msgSend_390( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int maxLength, - ) { - return __objc_msgSend_390( - obj, - sel, - bytes, - maxLength, - ); - } - - late final __objc_msgSend_390Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_390 = __objc_msgSend_390Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_getCString_maxLength_range_remainingRange_1 = - _registerName1("getCString:maxLength:range:remainingRange:"); - void _objc_msgSend_391( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int maxLength, - _NSRange aRange, - ffi.Pointer<_NSRange> leftoverRange, - ) { - return __objc_msgSend_391( - obj, - sel, - bytes, - maxLength, - aRange, - leftoverRange, - ); - } - - late final __objc_msgSend_391Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - _NSRange, - ffi.Pointer<_NSRange>)>>('objc_msgSend'); - late final __objc_msgSend_391 = __objc_msgSend_391Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange, ffi.Pointer<_NSRange>)>(); - - late final _sel_stringWithContentsOfFile_1 = - _registerName1("stringWithContentsOfFile:"); - late final _sel_stringWithContentsOfURL_1 = - _registerName1("stringWithContentsOfURL:"); - late final _sel_initWithCStringNoCopy_length_freeWhenDone_1 = - _registerName1("initWithCStringNoCopy:length:freeWhenDone:"); - ffi.Pointer _objc_msgSend_392( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, - bool freeBuffer, - ) { - return __objc_msgSend_392( - obj, - sel, - bytes, - length, - freeBuffer, - ); - } - - late final __objc_msgSend_392Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_392 = __objc_msgSend_392Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, bool)>(); - - late final _sel_initWithCString_length_1 = - _registerName1("initWithCString:length:"); - late final _sel_initWithCString_1 = _registerName1("initWithCString:"); - late final _sel_stringWithCString_length_1 = - _registerName1("stringWithCString:length:"); - late final _sel_stringWithCString_1 = _registerName1("stringWithCString:"); - late final _sel_getCharacters_1 = _registerName1("getCharacters:"); - void _objc_msgSend_393( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - ) { - return __objc_msgSend_393( - obj, - sel, - buffer, - ); - } - - late final __objc_msgSend_393Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_393 = __objc_msgSend_393Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_variantFittingPresentationWidth_1 = - _registerName1("variantFittingPresentationWidth:"); - ffi.Pointer _objc_msgSend_394( - ffi.Pointer obj, - ffi.Pointer sel, - int width, - ) { - return __objc_msgSend_394( - obj, - sel, - width, - ); - } - - late final __objc_msgSend_394Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_394 = __objc_msgSend_394Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_pathWithComponents_1 = _registerName1("pathWithComponents:"); - ffi.Pointer _objc_msgSend_395( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer components, - ) { - return __objc_msgSend_395( - obj, - sel, - components, - ); - } - - late final __objc_msgSend_395Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_395 = __objc_msgSend_395Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_isAbsolutePath1 = _registerName1("isAbsolutePath"); - late final _sel_stringByDeletingLastPathComponent1 = - _registerName1("stringByDeletingLastPathComponent"); - late final _sel_stringByAppendingPathComponent_1 = - _registerName1("stringByAppendingPathComponent:"); - late final _sel_stringByDeletingPathExtension1 = - _registerName1("stringByDeletingPathExtension"); - late final _sel_stringByAppendingPathExtension_1 = - _registerName1("stringByAppendingPathExtension:"); - late final _sel_stringByAbbreviatingWithTildeInPath1 = - _registerName1("stringByAbbreviatingWithTildeInPath"); - late final _sel_stringByExpandingTildeInPath1 = - _registerName1("stringByExpandingTildeInPath"); - late final _sel_stringByStandardizingPath1 = - _registerName1("stringByStandardizingPath"); - late final _sel_stringByResolvingSymlinksInPath1 = - _registerName1("stringByResolvingSymlinksInPath"); - late final _sel_stringsByAppendingPaths_1 = - _registerName1("stringsByAppendingPaths:"); - late final _sel_completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_1 = - _registerName1( - "completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:"); - int _objc_msgSend_396( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> outputName, - bool flag, - ffi.Pointer> outputArray, - ffi.Pointer filterTypes, - ) { - return __objc_msgSend_396( - obj, - sel, - outputName, - flag, - outputArray, - filterTypes, - ); - } - - late final __objc_msgSend_396Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Bool, - ffi.Pointer>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_396 = __objc_msgSend_396Ptr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - bool, - ffi.Pointer>, - ffi.Pointer)>(); - - late final _sel_stringByAddingPercentEncodingWithAllowedCharacters_1 = - _registerName1("stringByAddingPercentEncodingWithAllowedCharacters:"); - ffi.Pointer _objc_msgSend_397( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer allowedCharacters, - ) { - return __objc_msgSend_397( - obj, - sel, - allowedCharacters, - ); - } - - late final __objc_msgSend_397Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_397 = __objc_msgSend_397Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_stringByRemovingPercentEncoding1 = - _registerName1("stringByRemovingPercentEncoding"); - late final _sel_stringByAddingPercentEscapesUsingEncoding_1 = - _registerName1("stringByAddingPercentEscapesUsingEncoding:"); - ffi.Pointer _objc_msgSend_398( - ffi.Pointer obj, - ffi.Pointer sel, - int enc, - ) { - return __objc_msgSend_398( - obj, - sel, - enc, - ); - } - - late final __objc_msgSend_398Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_398 = __objc_msgSend_398Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_stringByReplacingPercentEscapesUsingEncoding_1 = - _registerName1("stringByReplacingPercentEscapesUsingEncoding:"); - late final _class_NSOrthography1 = _getClass1("NSOrthography"); - late final _sel_dominantScript1 = _registerName1("dominantScript"); - late final _sel_languageMap1 = _registerName1("languageMap"); - late final _sel_initWithDominantScript_languageMap_1 = - _registerName1("initWithDominantScript:languageMap:"); - instancetype _objc_msgSend_399( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer script, - ffi.Pointer map, - ) { - return __objc_msgSend_399( - obj, - sel, - script, - map, - ); - } - - late final __objc_msgSend_399Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_399 = __objc_msgSend_399Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_languagesForScript_1 = _registerName1("languagesForScript:"); - late final _sel_dominantLanguageForScript_1 = - _registerName1("dominantLanguageForScript:"); - late final _sel_dominantLanguage1 = _registerName1("dominantLanguage"); - late final _sel_allScripts1 = _registerName1("allScripts"); - late final _sel_allLanguages1 = _registerName1("allLanguages"); - late final _sel_defaultOrthographyForLanguage_1 = - _registerName1("defaultOrthographyForLanguage:"); - late final _sel_orthographyWithDominantScript_languageMap_1 = - _registerName1("orthographyWithDominantScript:languageMap:"); - late final _sel_linguisticTagsInRange_scheme_options_orthography_tokenRanges_1 = - _registerName1( - "linguisticTagsInRange:scheme:options:orthography:tokenRanges:"); - ffi.Pointer _objc_msgSend_400( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer scheme, - int options, - ffi.Pointer orthography, - ffi.Pointer> tokenRanges, - ) { - return __objc_msgSend_400( - obj, - sel, - range, - scheme, - options, - orthography, - tokenRanges, - ); - } - - late final __objc_msgSend_400Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_400 = __objc_msgSend_400Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_1 = - _registerName1( - "enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:"); - void _objc_msgSend_401( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer scheme, - int options, - ffi.Pointer orthography, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_401( - obj, - sel, - range, - scheme, - options, - orthography, - block, - ); - } - - late final __objc_msgSend_401Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_401 = __objc_msgSend_401Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_anyObject1 = _registerName1("anyObject"); - late final _sel_intersectsSet_1 = _registerName1("intersectsSet:"); - bool _objc_msgSend_402( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherSet, - ) { - return __objc_msgSend_402( - obj, - sel, - otherSet, - ); - } - - late final __objc_msgSend_402Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_402 = __objc_msgSend_402Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_isEqualToSet_1 = _registerName1("isEqualToSet:"); - late final _sel_isSubsetOfSet_1 = _registerName1("isSubsetOfSet:"); - late final _sel_setByAddingObject_1 = _registerName1("setByAddingObject:"); - ffi.Pointer _objc_msgSend_403( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_403( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_403Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_403 = __objc_msgSend_403Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setByAddingObjectsFromSet_1 = - _registerName1("setByAddingObjectsFromSet:"); - ffi.Pointer _objc_msgSend_404( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - ) { - return __objc_msgSend_404( - obj, - sel, - other, - ); - } - - late final __objc_msgSend_404Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_404 = __objc_msgSend_404Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setByAddingObjectsFromArray_1 = - _registerName1("setByAddingObjectsFromArray:"); - ffi.Pointer _objc_msgSend_405( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - ) { - return __objc_msgSend_405( - obj, - sel, - other, - ); - } - - late final __objc_msgSend_405Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_405 = __objc_msgSend_405Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_406( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_406( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_406Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_406 = __objc_msgSend_406Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - void _objc_msgSend_407( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_407( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_407Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_407 = __objc_msgSend_407Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_objectsPassingTest_1 = _registerName1("objectsPassingTest:"); - ffi.Pointer _objc_msgSend_408( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_408( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_408Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_408 = __objc_msgSend_408Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_objectsWithOptions_passingTest_1 = - _registerName1("objectsWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_409( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_409( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_409Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_409 = __objc_msgSend_409Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_set1 = _registerName1("set"); - late final _sel_setWithObject_1 = _registerName1("setWithObject:"); - late final _sel_setWithObjects_count_1 = - _registerName1("setWithObjects:count:"); - late final _sel_setWithObjects_1 = _registerName1("setWithObjects:"); - late final _sel_setWithSet_1 = _registerName1("setWithSet:"); - instancetype _objc_msgSend_410( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer set1, - ) { - return __objc_msgSend_410( - obj, - sel, - set1, - ); - } - - late final __objc_msgSend_410Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_410 = __objc_msgSend_410Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_setWithArray_1 = _registerName1("setWithArray:"); - late final _sel_initWithSet_1 = _registerName1("initWithSet:"); - late final _sel_initWithSet_copyItems_1 = - _registerName1("initWithSet:copyItems:"); - instancetype _objc_msgSend_411( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer set1, - bool flag, - ) { - return __objc_msgSend_411( - obj, - sel, - set1, - flag, - ); - } - - late final __objc_msgSend_411Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_411 = __objc_msgSend_411Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_filteredSetUsingPredicate_1 = - _registerName1("filteredSetUsingPredicate:"); - ffi.Pointer _objc_msgSend_412( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer predicate, - ) { - return __objc_msgSend_412( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_412Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_412 = __objc_msgSend_412Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_invocationWithMethodSignature_1 = - _registerName1("invocationWithMethodSignature:"); - ffi.Pointer _objc_msgSend_413( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sig, - ) { - return __objc_msgSend_413( - obj, - sel, - sig, - ); - } - - late final __objc_msgSend_413Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_413 = __objc_msgSend_413Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_methodSignature1 = _registerName1("methodSignature"); - ffi.Pointer _objc_msgSend_414( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_414( - obj, - sel, - ); - } - - late final __objc_msgSend_414Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_414 = __objc_msgSend_414Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_retainArguments1 = _registerName1("retainArguments"); - late final _sel_argumentsRetained1 = _registerName1("argumentsRetained"); - late final _sel_target1 = _registerName1("target"); - late final _sel_setTarget_1 = _registerName1("setTarget:"); - void _objc_msgSend_415( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_415( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_415Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_415 = __objc_msgSend_415Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_selector1 = _registerName1("selector"); - ffi.Pointer _objc_msgSend_416( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_416( - obj, - sel, - ); - } - - late final __objc_msgSend_416Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_416 = __objc_msgSend_416Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setSelector_1 = _registerName1("setSelector:"); - void _objc_msgSend_417( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_417( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_417Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_417 = __objc_msgSend_417Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_getReturnValue_1 = _registerName1("getReturnValue:"); - late final _sel_setReturnValue_1 = _registerName1("setReturnValue:"); - late final _sel_getArgument_atIndex_1 = - _registerName1("getArgument:atIndex:"); - void _objc_msgSend_418( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer argumentLocation, - int idx, - ) { - return __objc_msgSend_418( - obj, - sel, - argumentLocation, - idx, - ); - } - - late final __objc_msgSend_418Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_418 = __objc_msgSend_418Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_setArgument_atIndex_1 = - _registerName1("setArgument:atIndex:"); - late final _sel_invoke1 = _registerName1("invoke"); - late final _sel_invokeWithTarget_1 = _registerName1("invokeWithTarget:"); - late final _sel_invokeUsingIMP_1 = _registerName1("invokeUsingIMP:"); - void _objc_msgSend_419( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> imp, - ) { - return __objc_msgSend_419( - obj, - sel, - imp, - ); - } - - late final __objc_msgSend_419Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>( - 'objc_msgSend'); - late final __objc_msgSend_419 = __objc_msgSend_419Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_forwardInvocation_1 = _registerName1("forwardInvocation:"); - void _objc_msgSend_420( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_420( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_420Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_420 = __objc_msgSend_420Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_421( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_421( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_421Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_421 = __objc_msgSend_421Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final _sel_allowsWeakReference1 = _registerName1("allowsWeakReference"); - late final _sel_retainWeakReference1 = _registerName1("retainWeakReference"); - late final _sel_isSubclassOfClass_1 = _registerName1("isSubclassOfClass:"); - late final _sel_resolveClassMethod_1 = _registerName1("resolveClassMethod:"); - late final _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final _sel_superclass1 = _registerName1("superclass"); - late final _sel_class1 = _registerName1("class"); - late final _sel_debugDescription1 = _registerName1("debugDescription"); - late final _sel_version1 = _registerName1("version"); - late final _sel_setVersion_1 = _registerName1("setVersion:"); - void _objc_msgSend_422( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_422( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_422Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_422 = __objc_msgSend_422Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_classForCoder1 = _registerName1("classForCoder"); - late final _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - late final _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final _sel_poseAsClass_1 = _registerName1("poseAsClass:"); - late final _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_1 = - _registerName1( - "attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:"); - void _objc_msgSend_423( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer error, - int recoveryOptionIndex, - ffi.Pointer delegate, - ffi.Pointer didRecoverSelector, - ffi.Pointer contextInfo, - ) { - return __objc_msgSend_423( - obj, - sel, - error, - recoveryOptionIndex, - delegate, - didRecoverSelector, - contextInfo, - ); - } - - late final __objc_msgSend_423Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_423 = __objc_msgSend_423Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_attemptRecoveryFromError_optionIndex_1 = - _registerName1("attemptRecoveryFromError:optionIndex:"); - bool _objc_msgSend_424( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer error, - int recoveryOptionIndex, - ) { - return __objc_msgSend_424( - obj, - sel, - error, - recoveryOptionIndex, - ); - } - - late final __objc_msgSend_424Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_424 = __objc_msgSend_424Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_performSelector_withObject_afterDelay_inModes_1 = - _registerName1("performSelector:withObject:afterDelay:inModes:"); - void _objc_msgSend_425( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer anArgument, - double delay, - ffi.Pointer modes, - ) { - return __objc_msgSend_425( - obj, - sel, - aSelector, - anArgument, - delay, - modes, - ); - } - - late final __objc_msgSend_425Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_425 = __objc_msgSend_425Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer)>(); - - late final _sel_performSelector_withObject_afterDelay_1 = - _registerName1("performSelector:withObject:afterDelay:"); - void _objc_msgSend_426( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer anArgument, - double delay, - ) { - return __objc_msgSend_426( - obj, - sel, - aSelector, - anArgument, - delay, - ); - } - - late final __objc_msgSend_426Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_426 = __objc_msgSend_426Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, double)>(); - - late final _sel_URL_resourceDataDidBecomeAvailable_1 = - _registerName1("URL:resourceDataDidBecomeAvailable:"); - void _objc_msgSend_427( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sender, - ffi.Pointer newBytes, - ) { - return __objc_msgSend_427( - obj, - sel, - sender, - newBytes, - ); - } - - late final __objc_msgSend_427Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_427 = __objc_msgSend_427Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_URLResourceDidFinishLoading_1 = - _registerName1("URLResourceDidFinishLoading:"); - void _objc_msgSend_428( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sender, - ) { - return __objc_msgSend_428( - obj, - sel, - sender, - ); - } - - late final __objc_msgSend_428Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_428 = __objc_msgSend_428Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_URLResourceDidCancelLoading_1 = - _registerName1("URLResourceDidCancelLoading:"); - late final _sel_URL_resourceDidFailLoadingWithReason_1 = - _registerName1("URL:resourceDidFailLoadingWithReason:"); - void _objc_msgSend_429( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sender, - ffi.Pointer reason, - ) { - return __objc_msgSend_429( - obj, - sel, - sender, - reason, - ); - } - - late final __objc_msgSend_429Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_429 = __objc_msgSend_429Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSFileManager1 = _getClass1("NSFileManager"); - late final _sel_defaultManager1 = _registerName1("defaultManager"); - ffi.Pointer _objc_msgSend_430( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_430( - obj, - sel, - ); - } - - late final __objc_msgSend_430Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_430 = __objc_msgSend_430Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_1 = - _registerName1( - "mountedVolumeURLsIncludingResourceValuesForKeys:options:"); - ffi.Pointer _objc_msgSend_431( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer propertyKeys, - int options, - ) { - return __objc_msgSend_431( - obj, - sel, - propertyKeys, - options, - ); - } - - late final __objc_msgSend_431Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_431 = __objc_msgSend_431Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_unmountVolumeAtURL_options_completionHandler_1 = - _registerName1("unmountVolumeAtURL:options:completionHandler:"); - void _objc_msgSend_432( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int mask, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_432( - obj, - sel, - url, - mask, - completionHandler, - ); - } - - late final __objc_msgSend_432Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_432 = __objc_msgSend_432Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_1 = - _registerName1( - "contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:"); - ffi.Pointer _objc_msgSend_433( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer keys, - int mask, - ffi.Pointer> error, - ) { - return __objc_msgSend_433( - obj, - sel, - url, - keys, - mask, - error, - ); - } - - late final __objc_msgSend_433Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_433 = __objc_msgSend_433Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_URLsForDirectory_inDomains_1 = - _registerName1("URLsForDirectory:inDomains:"); - ffi.Pointer _objc_msgSend_434( - ffi.Pointer obj, - ffi.Pointer sel, - int directory, - int domainMask, - ) { - return __objc_msgSend_434( - obj, - sel, - directory, - domainMask, - ); - } - - late final __objc_msgSend_434Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_434 = __objc_msgSend_434Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int, int)>(); - - late final _sel_URLForDirectory_inDomain_appropriateForURL_create_error_1 = - _registerName1( - "URLForDirectory:inDomain:appropriateForURL:create:error:"); - ffi.Pointer _objc_msgSend_435( - ffi.Pointer obj, - ffi.Pointer sel, - int directory, - int domain, - ffi.Pointer url, - bool shouldCreate, - ffi.Pointer> error, - ) { - return __objc_msgSend_435( - obj, - sel, - directory, - domain, - url, - shouldCreate, - error, - ); - } - - late final __objc_msgSend_435Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer, - ffi.Bool, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_435 = __objc_msgSend_435Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer, - bool, - ffi.Pointer>)>(); - - late final _sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_1 = - _registerName1("getRelationship:ofDirectoryAtURL:toItemAtURL:error:"); - bool _objc_msgSend_436( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer outRelationship, - ffi.Pointer directoryURL, - ffi.Pointer otherURL, - ffi.Pointer> error, - ) { - return __objc_msgSend_436( - obj, - sel, - outRelationship, - directoryURL, - otherURL, - error, - ); - } - - late final __objc_msgSend_436Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_436 = __objc_msgSend_436Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_1 = - _registerName1("getRelationship:ofDirectory:inDomain:toItemAtURL:error:"); - bool _objc_msgSend_437( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer outRelationship, - int directory, - int domainMask, - ffi.Pointer url, - ffi.Pointer> error, - ) { - return __objc_msgSend_437( - obj, - sel, - outRelationship, - directory, - domainMask, - url, - error, - ); - } - - late final __objc_msgSend_437Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_437 = __objc_msgSend_437Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_1 = - _registerName1( - "createDirectoryAtURL:withIntermediateDirectories:attributes:error:"); - bool _objc_msgSend_438( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - bool createIntermediates, - ffi.Pointer attributes, - ffi.Pointer> error, - ) { - return __objc_msgSend_438( - obj, - sel, - url, - createIntermediates, - attributes, - error, - ); - } - - late final __objc_msgSend_438Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_438 = __objc_msgSend_438Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_createSymbolicLinkAtURL_withDestinationURL_error_1 = - _registerName1("createSymbolicLinkAtURL:withDestinationURL:error:"); - bool _objc_msgSend_439( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer destURL, - ffi.Pointer> error, - ) { - return __objc_msgSend_439( - obj, - sel, - url, - destURL, - error, - ); - } - - late final __objc_msgSend_439Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_439 = __objc_msgSend_439Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_delegate1 = _registerName1("delegate"); - late final _sel_setDelegate_1 = _registerName1("setDelegate:"); - late final _sel_setAttributes_ofItemAtPath_error_1 = - _registerName1("setAttributes:ofItemAtPath:error:"); - bool _objc_msgSend_440( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer attributes, - ffi.Pointer path, - ffi.Pointer> error, - ) { - return __objc_msgSend_440( - obj, - sel, - attributes, - path, - error, - ); - } - - late final __objc_msgSend_440Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_440 = __objc_msgSend_440Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_1 = - _registerName1( - "createDirectoryAtPath:withIntermediateDirectories:attributes:error:"); - bool _objc_msgSend_441( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool createIntermediates, - ffi.Pointer attributes, - ffi.Pointer> error, - ) { - return __objc_msgSend_441( - obj, - sel, - path, - createIntermediates, - attributes, - error, - ); - } - - late final __objc_msgSend_441Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_441 = __objc_msgSend_441Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_contentsOfDirectoryAtPath_error_1 = - _registerName1("contentsOfDirectoryAtPath:error:"); - ffi.Pointer _objc_msgSend_442( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer> error, - ) { - return __objc_msgSend_442( - obj, - sel, - path, - error, - ); - } - - late final __objc_msgSend_442Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_442 = __objc_msgSend_442Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_subpathsOfDirectoryAtPath_error_1 = - _registerName1("subpathsOfDirectoryAtPath:error:"); - late final _sel_attributesOfItemAtPath_error_1 = - _registerName1("attributesOfItemAtPath:error:"); - ffi.Pointer _objc_msgSend_443( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer> error, - ) { - return __objc_msgSend_443( - obj, - sel, - path, - error, - ); - } - - late final __objc_msgSend_443Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_443 = __objc_msgSend_443Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_attributesOfFileSystemForPath_error_1 = - _registerName1("attributesOfFileSystemForPath:error:"); - late final _sel_createSymbolicLinkAtPath_withDestinationPath_error_1 = - _registerName1("createSymbolicLinkAtPath:withDestinationPath:error:"); - bool _objc_msgSend_444( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer destPath, - ffi.Pointer> error, - ) { - return __objc_msgSend_444( - obj, - sel, - path, - destPath, - error, - ); - } - - late final __objc_msgSend_444Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_444 = __objc_msgSend_444Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_destinationOfSymbolicLinkAtPath_error_1 = - _registerName1("destinationOfSymbolicLinkAtPath:error:"); - ffi.Pointer _objc_msgSend_445( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer> error, - ) { - return __objc_msgSend_445( - obj, - sel, - path, - error, - ); - } - - late final __objc_msgSend_445Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_445 = __objc_msgSend_445Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_copyItemAtPath_toPath_error_1 = - _registerName1("copyItemAtPath:toPath:error:"); - late final _sel_moveItemAtPath_toPath_error_1 = - _registerName1("moveItemAtPath:toPath:error:"); - late final _sel_linkItemAtPath_toPath_error_1 = - _registerName1("linkItemAtPath:toPath:error:"); - late final _sel_removeItemAtPath_error_1 = - _registerName1("removeItemAtPath:error:"); - bool _objc_msgSend_446( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer> error, - ) { - return __objc_msgSend_446( - obj, - sel, - path, - error, - ); - } - - late final __objc_msgSend_446Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_446 = __objc_msgSend_446Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final _sel_copyItemAtURL_toURL_error_1 = - _registerName1("copyItemAtURL:toURL:error:"); - late final _sel_moveItemAtURL_toURL_error_1 = - _registerName1("moveItemAtURL:toURL:error:"); - late final _sel_linkItemAtURL_toURL_error_1 = - _registerName1("linkItemAtURL:toURL:error:"); - late final _sel_removeItemAtURL_error_1 = - _registerName1("removeItemAtURL:error:"); - late final _sel_trashItemAtURL_resultingItemURL_error_1 = - _registerName1("trashItemAtURL:resultingItemURL:error:"); - bool _objc_msgSend_447( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> outResultingURL, - ffi.Pointer> error, - ) { - return __objc_msgSend_447( - obj, - sel, - url, - outResultingURL, - error, - ); - } - - late final __objc_msgSend_447Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_447 = __objc_msgSend_447Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _sel_fileAttributesAtPath_traverseLink_1 = - _registerName1("fileAttributesAtPath:traverseLink:"); - ffi.Pointer _objc_msgSend_448( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool yorn, - ) { - return __objc_msgSend_448( - obj, - sel, - path, - yorn, - ); - } - - late final __objc_msgSend_448Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_448 = __objc_msgSend_448Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_changeFileAttributes_atPath_1 = - _registerName1("changeFileAttributes:atPath:"); - bool _objc_msgSend_449( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer attributes, - ffi.Pointer path, - ) { - return __objc_msgSend_449( - obj, - sel, - attributes, - path, - ); - } - - late final __objc_msgSend_449Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_449 = __objc_msgSend_449Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_directoryContentsAtPath_1 = - _registerName1("directoryContentsAtPath:"); - late final _sel_fileSystemAttributesAtPath_1 = - _registerName1("fileSystemAttributesAtPath:"); - late final _sel_pathContentOfSymbolicLinkAtPath_1 = - _registerName1("pathContentOfSymbolicLinkAtPath:"); - late final _sel_createSymbolicLinkAtPath_pathContent_1 = - _registerName1("createSymbolicLinkAtPath:pathContent:"); - bool _objc_msgSend_450( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer otherpath, - ) { - return __objc_msgSend_450( - obj, - sel, - path, - otherpath, - ); - } - - late final __objc_msgSend_450Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_450 = __objc_msgSend_450Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_createDirectoryAtPath_attributes_1 = - _registerName1("createDirectoryAtPath:attributes:"); - bool _objc_msgSend_451( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer attributes, - ) { - return __objc_msgSend_451( - obj, - sel, - path, - attributes, - ); - } - - late final __objc_msgSend_451Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_451 = __objc_msgSend_451Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_linkPath_toPath_handler_1 = - _registerName1("linkPath:toPath:handler:"); - bool _objc_msgSend_452( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer src, - ffi.Pointer dest, - ffi.Pointer handler, - ) { - return __objc_msgSend_452( - obj, - sel, - src, - dest, - handler, - ); - } - - late final __objc_msgSend_452Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_452 = __objc_msgSend_452Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_copyPath_toPath_handler_1 = - _registerName1("copyPath:toPath:handler:"); - late final _sel_movePath_toPath_handler_1 = - _registerName1("movePath:toPath:handler:"); - late final _sel_removeFileAtPath_handler_1 = - _registerName1("removeFileAtPath:handler:"); - bool _objc_msgSend_453( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer handler, - ) { - return __objc_msgSend_453( - obj, - sel, - path, - handler, - ); - } - - late final __objc_msgSend_453Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_453 = __objc_msgSend_453Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_currentDirectoryPath1 = - _registerName1("currentDirectoryPath"); - late final _sel_changeCurrentDirectoryPath_1 = - _registerName1("changeCurrentDirectoryPath:"); - late final _sel_fileExistsAtPath_1 = _registerName1("fileExistsAtPath:"); - late final _sel_fileExistsAtPath_isDirectory_1 = - _registerName1("fileExistsAtPath:isDirectory:"); - bool _objc_msgSend_454( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer isDirectory, - ) { - return __objc_msgSend_454( - obj, - sel, - path, - isDirectory, - ); - } - - late final __objc_msgSend_454Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_454 = __objc_msgSend_454Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_isReadableFileAtPath_1 = - _registerName1("isReadableFileAtPath:"); - late final _sel_isWritableFileAtPath_1 = - _registerName1("isWritableFileAtPath:"); - late final _sel_isExecutableFileAtPath_1 = - _registerName1("isExecutableFileAtPath:"); - late final _sel_isDeletableFileAtPath_1 = - _registerName1("isDeletableFileAtPath:"); - late final _sel_contentsEqualAtPath_andPath_1 = - _registerName1("contentsEqualAtPath:andPath:"); - late final _sel_displayNameAtPath_1 = _registerName1("displayNameAtPath:"); - late final _sel_componentsToDisplayForPath_1 = - _registerName1("componentsToDisplayForPath:"); - late final _sel_enumeratorAtPath_1 = _registerName1("enumeratorAtPath:"); - late final _sel_enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_1 = - _registerName1( - "enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:"); - ffi.Pointer _objc_msgSend_455( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer keys, - int mask, - ffi.Pointer<_ObjCBlock> handler, - ) { - return __objc_msgSend_455( - obj, - sel, - url, - keys, - mask, - handler, - ); - } - - late final __objc_msgSend_455Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_455 = __objc_msgSend_455Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_subpathsAtPath_1 = _registerName1("subpathsAtPath:"); - late final _sel_contentsAtPath_1 = _registerName1("contentsAtPath:"); - ffi.Pointer _objc_msgSend_456( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ) { - return __objc_msgSend_456( - obj, - sel, - path, - ); - } - - late final __objc_msgSend_456Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_456 = __objc_msgSend_456Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_createFileAtPath_contents_attributes_1 = - _registerName1("createFileAtPath:contents:attributes:"); - bool _objc_msgSend_457( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer data, - ffi.Pointer attr, - ) { - return __objc_msgSend_457( - obj, - sel, - path, - data, - attr, - ); - } - - late final __objc_msgSend_457Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_457 = __objc_msgSend_457Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_fileSystemRepresentationWithPath_1 = - _registerName1("fileSystemRepresentationWithPath:"); - ffi.Pointer _objc_msgSend_458( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ) { - return __objc_msgSend_458( - obj, - sel, - path, - ); - } - - late final __objc_msgSend_458Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_458 = __objc_msgSend_458Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_stringWithFileSystemRepresentation_length_1 = - _registerName1("stringWithFileSystemRepresentation:length:"); - ffi.Pointer _objc_msgSend_459( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - int len, - ) { - return __objc_msgSend_459( - obj, - sel, - str, - len, - ); - } - - late final __objc_msgSend_459Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_459 = __objc_msgSend_459Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_1 = - _registerName1( - "replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:"); - bool _objc_msgSend_460( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer originalItemURL, - ffi.Pointer newItemURL, - ffi.Pointer backupItemName, - int options, - ffi.Pointer> resultingURL, - ffi.Pointer> error, - ) { - return __objc_msgSend_460( - obj, - sel, - originalItemURL, - newItemURL, - backupItemName, - options, - resultingURL, - error, - ); - } - - late final __objc_msgSend_460Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_460 = __objc_msgSend_460Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _sel_setUbiquitous_itemAtURL_destinationURL_error_1 = - _registerName1("setUbiquitous:itemAtURL:destinationURL:error:"); - bool _objc_msgSend_461( - ffi.Pointer obj, - ffi.Pointer sel, - bool flag, - ffi.Pointer url, - ffi.Pointer destinationURL, - ffi.Pointer> error, - ) { - return __objc_msgSend_461( - obj, - sel, - flag, - url, - destinationURL, - error, - ); - } - - late final __objc_msgSend_461Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_461 = __objc_msgSend_461Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_isUbiquitousItemAtURL_1 = - _registerName1("isUbiquitousItemAtURL:"); - late final _sel_startDownloadingUbiquitousItemAtURL_error_1 = - _registerName1("startDownloadingUbiquitousItemAtURL:error:"); - late final _sel_evictUbiquitousItemAtURL_error_1 = - _registerName1("evictUbiquitousItemAtURL:error:"); - late final _sel_URLForUbiquityContainerIdentifier_1 = - _registerName1("URLForUbiquityContainerIdentifier:"); - ffi.Pointer _objc_msgSend_462( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer containerIdentifier, - ) { - return __objc_msgSend_462( - obj, - sel, - containerIdentifier, - ); - } - - late final __objc_msgSend_462Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_462 = __objc_msgSend_462Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_URLForPublishingUbiquitousItemAtURL_expirationDate_error_1 = - _registerName1( - "URLForPublishingUbiquitousItemAtURL:expirationDate:error:"); - ffi.Pointer _objc_msgSend_463( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> outDate, - ffi.Pointer> error, - ) { - return __objc_msgSend_463( - obj, - sel, - url, - outDate, - error, - ); - } - - late final __objc_msgSend_463Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_463 = __objc_msgSend_463Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _sel_ubiquityIdentityToken1 = - _registerName1("ubiquityIdentityToken"); - late final _sel_getFileProviderServicesForItemAtURL_completionHandler_1 = - _registerName1("getFileProviderServicesForItemAtURL:completionHandler:"); - void _objc_msgSend_464( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_464( - obj, - sel, - url, - completionHandler, - ); - } - - late final __objc_msgSend_464Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_464 = __objc_msgSend_464Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_containerURLForSecurityApplicationGroupIdentifier_1 = - _registerName1("containerURLForSecurityApplicationGroupIdentifier:"); - late final _sel_homeDirectoryForCurrentUser1 = - _registerName1("homeDirectoryForCurrentUser"); - ffi.Pointer _objc_msgSend_465( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_465( - obj, - sel, - ); - } - - late final __objc_msgSend_465Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_465 = __objc_msgSend_465Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_temporaryDirectory1 = _registerName1("temporaryDirectory"); - late final _sel_homeDirectoryForUser_1 = - _registerName1("homeDirectoryForUser:"); - late final _sel_fileManager_shouldProceedAfterError_1 = - _registerName1("fileManager:shouldProceedAfterError:"); - bool _objc_msgSend_466( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer fm, - ffi.Pointer errorInfo, - ) { - return __objc_msgSend_466( - obj, - sel, - fm, - errorInfo, - ); - } - - late final __objc_msgSend_466Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_466 = __objc_msgSend_466Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_fileManager_willProcessPath_1 = - _registerName1("fileManager:willProcessPath:"); - void _objc_msgSend_467( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer fm, - ffi.Pointer path, - ) { - return __objc_msgSend_467( - obj, - sel, - fm, - path, - ); - } - - late final __objc_msgSend_467Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_467 = __objc_msgSend_467Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_validateValue_forKey_error_1 = - _registerName1("validateValue:forKey:error:"); - late final _class_NSMutableArray1 = _getClass1("NSMutableArray"); - late final _sel_addObject_1 = _registerName1("addObject:"); - late final _sel_insertObject_atIndex_1 = - _registerName1("insertObject:atIndex:"); - void _objc_msgSend_468( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int index, - ) { - return __objc_msgSend_468( - obj, - sel, - anObject, - index, - ); - } - - late final __objc_msgSend_468Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_468 = __objc_msgSend_468Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_removeLastObject1 = _registerName1("removeLastObject"); - late final _sel_removeObjectAtIndex_1 = - _registerName1("removeObjectAtIndex:"); - void _objc_msgSend_469( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_469( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_469Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_469 = __objc_msgSend_469Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_replaceObjectAtIndex_withObject_1 = - _registerName1("replaceObjectAtIndex:withObject:"); - void _objc_msgSend_470( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer anObject, - ) { - return __objc_msgSend_470( - obj, - sel, - index, - anObject, - ); - } - - late final __objc_msgSend_470Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_470 = __objc_msgSend_470Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _sel_initWithCapacity_1 = _registerName1("initWithCapacity:"); - late final _sel_addObjectsFromArray_1 = - _registerName1("addObjectsFromArray:"); - void _objc_msgSend_471( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherArray, - ) { - return __objc_msgSend_471( - obj, - sel, - otherArray, - ); - } - - late final __objc_msgSend_471Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_471 = __objc_msgSend_471Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = - _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); - void _objc_msgSend_472( - ffi.Pointer obj, - ffi.Pointer sel, - int idx1, - int idx2, - ) { - return __objc_msgSend_472( - obj, - sel, - idx1, - idx2, - ); - } - - late final __objc_msgSend_472Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_472 = __objc_msgSend_472Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - late final _sel_removeAllObjects1 = _registerName1("removeAllObjects"); - late final _sel_removeObject_inRange_1 = - _registerName1("removeObject:inRange:"); - void _objc_msgSend_473( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - _NSRange range, - ) { - return __objc_msgSend_473( - obj, - sel, - anObject, - range, - ); - } - - late final __objc_msgSend_473Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_473 = __objc_msgSend_473Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>(); - - late final _sel_removeObject_1 = _registerName1("removeObject:"); - late final _sel_removeObjectIdenticalTo_inRange_1 = - _registerName1("removeObjectIdenticalTo:inRange:"); - late final _sel_removeObjectIdenticalTo_1 = - _registerName1("removeObjectIdenticalTo:"); - late final _sel_removeObjectsFromIndices_numIndices_1 = - _registerName1("removeObjectsFromIndices:numIndices:"); - void _objc_msgSend_474( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indices, - int cnt, - ) { - return __objc_msgSend_474( - obj, - sel, - indices, - cnt, - ); - } - - late final __objc_msgSend_474Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_474 = __objc_msgSend_474Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_removeObjectsInArray_1 = - _registerName1("removeObjectsInArray:"); - late final _sel_removeObjectsInRange_1 = - _registerName1("removeObjectsInRange:"); - void _objc_msgSend_475( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_475( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_475Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_475 = __objc_msgSend_475Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = - _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); - void _objc_msgSend_476( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer otherArray, - _NSRange otherRange, - ) { - return __objc_msgSend_476( - obj, - sel, - range, - otherArray, - otherRange, - ); - } - - late final __objc_msgSend_476Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange, ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_476 = __objc_msgSend_476Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - ffi.Pointer, _NSRange)>(); - - late final _sel_replaceObjectsInRange_withObjectsFromArray_1 = - _registerName1("replaceObjectsInRange:withObjectsFromArray:"); - void _objc_msgSend_477( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer otherArray, - ) { - return __objc_msgSend_477( - obj, - sel, - range, - otherArray, - ); - } - - late final __objc_msgSend_477Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_477 = __objc_msgSend_477Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - ffi.Pointer)>(); - - late final _sel_setArray_1 = _registerName1("setArray:"); - late final _sel_sortUsingFunction_context_1 = - _registerName1("sortUsingFunction:context:"); - void _objc_msgSend_478( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - compare, - ffi.Pointer context, - ) { - return __objc_msgSend_478( - obj, - sel, - compare, - context, - ); - } - - late final __objc_msgSend_478Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_478 = __objc_msgSend_478Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>(); - - late final _sel_sortUsingSelector_1 = _registerName1("sortUsingSelector:"); - late final _sel_insertObjects_atIndexes_1 = - _registerName1("insertObjects:atIndexes:"); - void _objc_msgSend_479( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer objects, - ffi.Pointer indexes, - ) { - return __objc_msgSend_479( - obj, - sel, - objects, - indexes, - ); - } - - late final __objc_msgSend_479Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_479 = __objc_msgSend_479Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_removeObjectsAtIndexes_1 = - _registerName1("removeObjectsAtIndexes:"); - void _objc_msgSend_480( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexes, - ) { - return __objc_msgSend_480( - obj, - sel, - indexes, - ); - } - - late final __objc_msgSend_480Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_480 = __objc_msgSend_480Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_replaceObjectsAtIndexes_withObjects_1 = - _registerName1("replaceObjectsAtIndexes:withObjects:"); - void _objc_msgSend_481( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexes, - ffi.Pointer objects, - ) { - return __objc_msgSend_481( - obj, - sel, - indexes, - objects, - ); - } - - late final __objc_msgSend_481Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_481 = __objc_msgSend_481Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setObject_atIndexedSubscript_1 = - _registerName1("setObject:atIndexedSubscript:"); - late final _sel_sortUsingComparator_1 = - _registerName1("sortUsingComparator:"); - void _objc_msgSend_482( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> cmptr, - ) { - return __objc_msgSend_482( - obj, - sel, - cmptr, - ); - } - - late final __objc_msgSend_482Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_482 = __objc_msgSend_482Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_sortWithOptions_usingComparator_1 = - _registerName1("sortWithOptions:usingComparator:"); - void _objc_msgSend_483( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> cmptr, - ) { - return __objc_msgSend_483( - obj, - sel, - opts, - cmptr, - ); - } - - late final __objc_msgSend_483Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_483 = __objc_msgSend_483Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_arrayWithCapacity_1 = _registerName1("arrayWithCapacity:"); - ffi.Pointer _objc_msgSend_484( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ) { - return __objc_msgSend_484( - obj, - sel, - path, - ); - } - - late final __objc_msgSend_484Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_484 = __objc_msgSend_484Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_485( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_485( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_485Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_485 = __objc_msgSend_485Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_applyDifference_1 = _registerName1("applyDifference:"); - late final _sel_sortUsingDescriptors_1 = - _registerName1("sortUsingDescriptors:"); - late final _sel_filterUsingPredicate_1 = - _registerName1("filterUsingPredicate:"); - void _objc_msgSend_486( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer predicate, - ) { - return __objc_msgSend_486( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_486Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_486 = __objc_msgSend_486Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_mutableArrayValueForKey_1 = - _registerName1("mutableArrayValueForKey:"); - ffi.Pointer _objc_msgSend_487( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_487( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_487Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_487 = __objc_msgSend_487Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSMutableOrderedSet1 = _getClass1("NSMutableOrderedSet"); - late final _class_NSOrderedSet1 = _getClass1("NSOrderedSet"); - late final _sel_isEqualToOrderedSet_1 = - _registerName1("isEqualToOrderedSet:"); - bool _objc_msgSend_488( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - ) { - return __objc_msgSend_488( - obj, - sel, - other, - ); - } - - late final __objc_msgSend_488Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_488 = __objc_msgSend_488Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_intersectsOrderedSet_1 = - _registerName1("intersectsOrderedSet:"); - late final _sel_isSubsetOfOrderedSet_1 = - _registerName1("isSubsetOfOrderedSet:"); - late final _sel_reversedOrderedSet1 = _registerName1("reversedOrderedSet"); - ffi.Pointer _objc_msgSend_489( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_489( - obj, - sel, - ); - } - - late final __objc_msgSend_489Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_489 = __objc_msgSend_489Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_490( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_490( - obj, - sel, - ); - } - - late final __objc_msgSend_490Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_490 = __objc_msgSend_490Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_orderedSet1 = _registerName1("orderedSet"); - late final _sel_orderedSetWithObject_1 = - _registerName1("orderedSetWithObject:"); - late final _sel_orderedSetWithObjects_count_1 = - _registerName1("orderedSetWithObjects:count:"); - late final _sel_orderedSetWithObjects_1 = - _registerName1("orderedSetWithObjects:"); - late final _sel_orderedSetWithOrderedSet_1 = - _registerName1("orderedSetWithOrderedSet:"); - instancetype _objc_msgSend_491( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer set1, - ) { - return __objc_msgSend_491( - obj, - sel, - set1, - ); - } - - late final __objc_msgSend_491Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_491 = __objc_msgSend_491Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_orderedSetWithOrderedSet_range_copyItems_1 = - _registerName1("orderedSetWithOrderedSet:range:copyItems:"); - instancetype _objc_msgSend_492( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer set1, - _NSRange range, - bool flag, - ) { - return __objc_msgSend_492( - obj, - sel, - set1, - range, - flag, - ); - } - - late final __objc_msgSend_492Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_492 = __objc_msgSend_492Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange, bool)>(); - - late final _sel_orderedSetWithArray_1 = - _registerName1("orderedSetWithArray:"); - late final _sel_orderedSetWithArray_range_copyItems_1 = - _registerName1("orderedSetWithArray:range:copyItems:"); - instancetype _objc_msgSend_493( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer array, - _NSRange range, - bool flag, - ) { - return __objc_msgSend_493( - obj, - sel, - array, - range, - flag, - ); - } - - late final __objc_msgSend_493Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_493 = __objc_msgSend_493Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange, bool)>(); - - late final _sel_orderedSetWithSet_1 = _registerName1("orderedSetWithSet:"); - late final _sel_orderedSetWithSet_copyItems_1 = - _registerName1("orderedSetWithSet:copyItems:"); - late final _sel_initWithObject_1 = _registerName1("initWithObject:"); - late final _sel_initWithOrderedSet_1 = _registerName1("initWithOrderedSet:"); - late final _sel_initWithOrderedSet_copyItems_1 = - _registerName1("initWithOrderedSet:copyItems:"); - instancetype _objc_msgSend_494( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer set1, - bool flag, - ) { - return __objc_msgSend_494( - obj, - sel, - set1, - flag, - ); - } - - late final __objc_msgSend_494Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_494 = __objc_msgSend_494Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_initWithOrderedSet_range_copyItems_1 = - _registerName1("initWithOrderedSet:range:copyItems:"); - late final _sel_initWithArray_range_copyItems_1 = - _registerName1("initWithArray:range:copyItems:"); - late final _sel_differenceFromOrderedSet_withOptions_usingEquivalenceTest_1 = - _registerName1( - "differenceFromOrderedSet:withOptions:usingEquivalenceTest:"); - ffi.Pointer _objc_msgSend_495( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - int options, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_495( - obj, - sel, - other, - options, - block, - ); - } - - late final __objc_msgSend_495Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_495 = __objc_msgSend_495Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_differenceFromOrderedSet_withOptions_1 = - _registerName1("differenceFromOrderedSet:withOptions:"); - ffi.Pointer _objc_msgSend_496( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - int options, - ) { - return __objc_msgSend_496( - obj, - sel, - other, - options, - ); - } - - late final __objc_msgSend_496Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_496 = __objc_msgSend_496Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_differenceFromOrderedSet_1 = - _registerName1("differenceFromOrderedSet:"); - late final _sel_orderedSetByApplyingDifference_1 = - _registerName1("orderedSetByApplyingDifference:"); - ffi.Pointer _objc_msgSend_497( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer difference, - ) { - return __objc_msgSend_497( - obj, - sel, - difference, - ); - } - - late final __objc_msgSend_497Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_497 = __objc_msgSend_497Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_filteredOrderedSetUsingPredicate_1 = - _registerName1("filteredOrderedSetUsingPredicate:"); - ffi.Pointer _objc_msgSend_498( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer p, - ) { - return __objc_msgSend_498( - obj, - sel, - p, - ); - } - - late final __objc_msgSend_498Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_498 = __objc_msgSend_498Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_addObjects_count_1 = _registerName1("addObjects:count:"); - void _objc_msgSend_499( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - int count, - ) { - return __objc_msgSend_499( - obj, - sel, - objects, - count, - ); - } - - late final __objc_msgSend_499Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_499 = __objc_msgSend_499Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, int)>(); - - late final _sel_moveObjectsAtIndexes_toIndex_1 = - _registerName1("moveObjectsAtIndexes:toIndex:"); - void _objc_msgSend_500( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexes, - int idx, - ) { - return __objc_msgSend_500( - obj, - sel, - indexes, - idx, - ); - } - - late final __objc_msgSend_500Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_500 = __objc_msgSend_500Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_setObject_atIndex_1 = _registerName1("setObject:atIndex:"); - late final _sel_replaceObjectsInRange_withObjects_count_1 = - _registerName1("replaceObjectsInRange:withObjects:count:"); - void _objc_msgSend_501( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer> objects, - int count, - ) { - return __objc_msgSend_501( - obj, - sel, - range, - objects, - count, - ); - } - - late final __objc_msgSend_501Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer>, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_501 = __objc_msgSend_501Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - ffi.Pointer>, int)>(); - - late final _sel_intersectOrderedSet_1 = - _registerName1("intersectOrderedSet:"); - void _objc_msgSend_502( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - ) { - return __objc_msgSend_502( - obj, - sel, - other, - ); - } - - late final __objc_msgSend_502Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_502 = __objc_msgSend_502Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_minusOrderedSet_1 = _registerName1("minusOrderedSet:"); - late final _sel_unionOrderedSet_1 = _registerName1("unionOrderedSet:"); - late final _sel_intersectSet_1 = _registerName1("intersectSet:"); - void _objc_msgSend_503( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - ) { - return __objc_msgSend_503( - obj, - sel, - other, - ); - } - - late final __objc_msgSend_503Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_503 = __objc_msgSend_503Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_minusSet_1 = _registerName1("minusSet:"); - late final _sel_unionSet_1 = _registerName1("unionSet:"); - late final _sel_sortRange_options_usingComparator_1 = - _registerName1("sortRange:options:usingComparator:"); - void _objc_msgSend_504( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> cmptr, - ) { - return __objc_msgSend_504( - obj, - sel, - range, - opts, - cmptr, - ); - } - - late final __objc_msgSend_504Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_504 = __objc_msgSend_504Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_orderedSetWithCapacity_1 = - _registerName1("orderedSetWithCapacity:"); - late final _sel_mutableOrderedSetValueForKey_1 = - _registerName1("mutableOrderedSetValueForKey:"); - ffi.Pointer _objc_msgSend_505( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_505( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_505Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_505 = __objc_msgSend_505Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSMutableSet1 = _getClass1("NSMutableSet"); - late final _sel_setSet_1 = _registerName1("setSet:"); - late final _sel_setWithCapacity_1 = _registerName1("setWithCapacity:"); - late final _sel_mutableSetValueForKey_1 = - _registerName1("mutableSetValueForKey:"); - ffi.Pointer _objc_msgSend_506( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_506( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_506Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_506 = __objc_msgSend_506Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_valueForKeyPath_1 = _registerName1("valueForKeyPath:"); - late final _sel_setValue_forKeyPath_1 = - _registerName1("setValue:forKeyPath:"); - late final _sel_validateValue_forKeyPath_error_1 = - _registerName1("validateValue:forKeyPath:error:"); - late final _sel_mutableArrayValueForKeyPath_1 = - _registerName1("mutableArrayValueForKeyPath:"); - late final _sel_mutableOrderedSetValueForKeyPath_1 = - _registerName1("mutableOrderedSetValueForKeyPath:"); - late final _sel_mutableSetValueForKeyPath_1 = - _registerName1("mutableSetValueForKeyPath:"); - late final _sel_valueForUndefinedKey_1 = - _registerName1("valueForUndefinedKey:"); - late final _sel_setValue_forUndefinedKey_1 = - _registerName1("setValue:forUndefinedKey:"); - late final _sel_setNilValueForKey_1 = _registerName1("setNilValueForKey:"); - late final _sel_dictionaryWithValuesForKeys_1 = - _registerName1("dictionaryWithValuesForKeys:"); - ffi.Pointer _objc_msgSend_507( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keys, - ) { - return __objc_msgSend_507( - obj, - sel, - keys, - ); - } - - late final __objc_msgSend_507Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_507 = __objc_msgSend_507Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setValuesForKeysWithDictionary_1 = - _registerName1("setValuesForKeysWithDictionary:"); - void _objc_msgSend_508( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keyedValues, - ) { - return __objc_msgSend_508( - obj, - sel, - keyedValues, - ); - } - - late final __objc_msgSend_508Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_508 = __objc_msgSend_508Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_storedValueForKey_1 = _registerName1("storedValueForKey:"); - late final _sel_takeStoredValue_forKey_1 = - _registerName1("takeStoredValue:forKey:"); - late final _sel_takeValue_forKey_1 = _registerName1("takeValue:forKey:"); - late final _sel_takeValue_forKeyPath_1 = - _registerName1("takeValue:forKeyPath:"); - late final _sel_handleQueryWithUnboundKey_1 = - _registerName1("handleQueryWithUnboundKey:"); - late final _sel_handleTakeValue_forUnboundKey_1 = - _registerName1("handleTakeValue:forUnboundKey:"); - late final _sel_unableToSetNilForKey_1 = - _registerName1("unableToSetNilForKey:"); - late final _sel_valuesForKeys_1 = _registerName1("valuesForKeys:"); - late final _sel_takeValuesFromDictionary_1 = - _registerName1("takeValuesFromDictionary:"); - late final _sel_observeValueForKeyPath_ofObject_change_context_1 = - _registerName1("observeValueForKeyPath:ofObject:change:context:"); - void _objc_msgSend_509( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keyPath, - ffi.Pointer object, - ffi.Pointer change, - ffi.Pointer context, - ) { - return __objc_msgSend_509( - obj, - sel, - keyPath, - object, - change, - context, - ); - } - - late final __objc_msgSend_509Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_509 = __objc_msgSend_509Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_willChangeValueForKey_1 = - _registerName1("willChangeValueForKey:"); - late final _sel_didChangeValueForKey_1 = - _registerName1("didChangeValueForKey:"); - late final _sel_willChange_valuesAtIndexes_forKey_1 = - _registerName1("willChange:valuesAtIndexes:forKey:"); - void _objc_msgSend_510( - ffi.Pointer obj, - ffi.Pointer sel, - int changeKind, - ffi.Pointer indexes, - ffi.Pointer key, - ) { - return __objc_msgSend_510( - obj, - sel, - changeKind, - indexes, - key, - ); - } - - late final __objc_msgSend_510Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_510 = __objc_msgSend_510Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_didChange_valuesAtIndexes_forKey_1 = - _registerName1("didChange:valuesAtIndexes:forKey:"); - late final _sel_willChangeValueForKey_withSetMutation_usingObjects_1 = - _registerName1("willChangeValueForKey:withSetMutation:usingObjects:"); - void _objc_msgSend_511( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - int mutationKind, - ffi.Pointer objects, - ) { - return __objc_msgSend_511( - obj, - sel, - key, - mutationKind, - objects, - ); - } - - late final __objc_msgSend_511Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_511 = __objc_msgSend_511Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_didChangeValueForKey_withSetMutation_usingObjects_1 = - _registerName1("didChangeValueForKey:withSetMutation:usingObjects:"); - late final _sel_observationInfo1 = _registerName1("observationInfo"); - late final _sel_setObservationInfo_1 = _registerName1("setObservationInfo:"); - void _objc_msgSend_512( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_512( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_512Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_512 = __objc_msgSend_512Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_classForKeyedArchiver1 = - _registerName1("classForKeyedArchiver"); - late final _class_NSKeyedArchiver1 = _getClass1("NSKeyedArchiver"); - late final _sel_initRequiringSecureCoding_1 = - _registerName1("initRequiringSecureCoding:"); - instancetype _objc_msgSend_513( - ffi.Pointer obj, - ffi.Pointer sel, - bool requiresSecureCoding, - ) { - return __objc_msgSend_513( - obj, - sel, - requiresSecureCoding, - ); - } - - late final __objc_msgSend_513Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_513 = __objc_msgSend_513Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_archivedDataWithRootObject_requiringSecureCoding_error_1 = - _registerName1("archivedDataWithRootObject:requiringSecureCoding:error:"); - ffi.Pointer _objc_msgSend_514( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - bool requiresSecureCoding, - ffi.Pointer> error, - ) { - return __objc_msgSend_514( - obj, - sel, - object, - requiresSecureCoding, - error, - ); - } - - late final __objc_msgSend_514Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_514 = __objc_msgSend_514Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer>)>(); - - late final _class_NSMutableData1 = _getClass1("NSMutableData"); - late final _sel_mutableBytes1 = _registerName1("mutableBytes"); - late final _sel_setLength_1 = _registerName1("setLength:"); - void _objc_msgSend_515( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_515( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_515Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_515 = __objc_msgSend_515Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_appendBytes_length_1 = _registerName1("appendBytes:length:"); - late final _sel_appendData_1 = _registerName1("appendData:"); - late final _sel_increaseLengthBy_1 = _registerName1("increaseLengthBy:"); - late final _sel_replaceBytesInRange_withBytes_1 = - _registerName1("replaceBytesInRange:withBytes:"); - void _objc_msgSend_516( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer bytes, - ) { - return __objc_msgSend_516( - obj, - sel, - range, - bytes, - ); - } - - late final __objc_msgSend_516Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_516 = __objc_msgSend_516Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - ffi.Pointer)>(); - - late final _sel_resetBytesInRange_1 = _registerName1("resetBytesInRange:"); - late final _sel_setData_1 = _registerName1("setData:"); - late final _sel_replaceBytesInRange_withBytes_length_1 = - _registerName1("replaceBytesInRange:withBytes:length:"); - void _objc_msgSend_517( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer replacementBytes, - int replacementLength, - ) { - return __objc_msgSend_517( - obj, - sel, - range, - replacementBytes, - replacementLength, - ); - } - - late final __objc_msgSend_517Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_517 = __objc_msgSend_517Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - ffi.Pointer, int)>(); - - late final _sel_dataWithCapacity_1 = _registerName1("dataWithCapacity:"); - instancetype _objc_msgSend_518( - ffi.Pointer obj, - ffi.Pointer sel, - int aNumItems, - ) { - return __objc_msgSend_518( - obj, - sel, - aNumItems, - ); - } - - late final __objc_msgSend_518Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_518 = __objc_msgSend_518Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_dataWithLength_1 = _registerName1("dataWithLength:"); - late final _sel_initWithLength_1 = _registerName1("initWithLength:"); - late final _sel_decompressUsingAlgorithm_error_1 = - _registerName1("decompressUsingAlgorithm:error:"); - bool _objc_msgSend_519( - ffi.Pointer obj, - ffi.Pointer sel, - int algorithm, - ffi.Pointer> error, - ) { - return __objc_msgSend_519( - obj, - sel, - algorithm, - error, - ); - } - - late final __objc_msgSend_519Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_519 = __objc_msgSend_519Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer>)>(); - - late final _sel_compressUsingAlgorithm_error_1 = - _registerName1("compressUsingAlgorithm:error:"); - late final _sel_initForWritingWithMutableData_1 = - _registerName1("initForWritingWithMutableData:"); - instancetype _objc_msgSend_520( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ) { - return __objc_msgSend_520( - obj, - sel, - data, - ); - } - - late final __objc_msgSend_520Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_520 = __objc_msgSend_520Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_archivedDataWithRootObject_1 = - _registerName1("archivedDataWithRootObject:"); - ffi.Pointer _objc_msgSend_521( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer rootObject, - ) { - return __objc_msgSend_521( - obj, - sel, - rootObject, - ); - } - - late final __objc_msgSend_521Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_521 = __objc_msgSend_521Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_archiveRootObject_toFile_1 = - _registerName1("archiveRootObject:toFile:"); - late final _sel_outputFormat1 = _registerName1("outputFormat"); - int _objc_msgSend_522( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_522( - obj, - sel, - ); - } - - late final __objc_msgSend_522Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_522 = __objc_msgSend_522Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setOutputFormat_1 = _registerName1("setOutputFormat:"); - void _objc_msgSend_523( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_523( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_523Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_523 = __objc_msgSend_523Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_encodedData1 = _registerName1("encodedData"); - late final _sel_finishEncoding1 = _registerName1("finishEncoding"); - late final _sel_setClassName_forClass_1 = - _registerName1("setClassName:forClass:"); - void _objc_msgSend_524( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer codedName, - ffi.Pointer cls, - ) { - return __objc_msgSend_524( - obj, - sel, - codedName, - cls, - ); - } - - late final __objc_msgSend_524Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_524 = __objc_msgSend_524Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_classNameForClass_1 = _registerName1("classNameForClass:"); - ffi.Pointer _objc_msgSend_525( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cls, - ) { - return __objc_msgSend_525( - obj, - sel, - cls, - ); - } - - late final __objc_msgSend_525Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_525 = __objc_msgSend_525Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setRequiresSecureCoding_1 = - _registerName1("setRequiresSecureCoding:"); - void _objc_msgSend_526( - ffi.Pointer obj, - ffi.Pointer sel, - bool value, - ) { - return __objc_msgSend_526( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_526Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_526 = __objc_msgSend_526Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_replacementObjectForKeyedArchiver_1 = - _registerName1("replacementObjectForKeyedArchiver:"); - ffi.Pointer _objc_msgSend_527( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer archiver, - ) { - return __objc_msgSend_527( - obj, - sel, - archiver, - ); - } - - late final __objc_msgSend_527Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_527 = __objc_msgSend_527Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_performSelectorOnMainThread_withObject_waitUntilDone_modes_1 = - _registerName1( - "performSelectorOnMainThread:withObject:waitUntilDone:modes:"); - void _objc_msgSend_528( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer arg, - bool wait, - ffi.Pointer array, - ) { - return __objc_msgSend_528( - obj, - sel, - aSelector, - arg, - wait, - array, - ); - } - - late final __objc_msgSend_528Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_528 = __objc_msgSend_528Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer)>(); - - late final _sel_performSelectorOnMainThread_withObject_waitUntilDone_1 = - _registerName1("performSelectorOnMainThread:withObject:waitUntilDone:"); - void _objc_msgSend_529( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer arg, - bool wait, - ) { - return __objc_msgSend_529( - obj, - sel, - aSelector, - arg, - wait, - ); - } - - late final __objc_msgSend_529Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_529 = __objc_msgSend_529Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _class_NSThread1 = _getClass1("NSThread"); - late final _sel_currentThread1 = _registerName1("currentThread"); - ffi.Pointer _objc_msgSend_530( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_530( - obj, - sel, - ); - } - - late final __objc_msgSend_530Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_530 = __objc_msgSend_530Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_detachNewThreadWithBlock_1 = - _registerName1("detachNewThreadWithBlock:"); - void _objc_msgSend_531( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_531( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_531Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_531 = __objc_msgSend_531Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_detachNewThreadSelector_toTarget_withObject_1 = - _registerName1("detachNewThreadSelector:toTarget:withObject:"); - void _objc_msgSend_532( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer selector, - ffi.Pointer target, - ffi.Pointer argument, - ) { - return __objc_msgSend_532( - obj, - sel, - selector, - target, - argument, - ); - } - - late final __objc_msgSend_532Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_532 = __objc_msgSend_532Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_isMultiThreaded1 = _registerName1("isMultiThreaded"); - late final _class_NSMutableDictionary1 = _getClass1("NSMutableDictionary"); - late final _sel_removeObjectForKey_1 = _registerName1("removeObjectForKey:"); - late final _sel_setObject_forKey_1 = _registerName1("setObject:forKey:"); - void _objc_msgSend_533( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ffi.Pointer aKey, - ) { - return __objc_msgSend_533( - obj, - sel, - anObject, - aKey, - ); - } - - late final __objc_msgSend_533Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_533 = __objc_msgSend_533Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_addEntriesFromDictionary_1 = - _registerName1("addEntriesFromDictionary:"); - late final _sel_removeObjectsForKeys_1 = - _registerName1("removeObjectsForKeys:"); - late final _sel_setDictionary_1 = _registerName1("setDictionary:"); - late final _sel_setObject_forKeyedSubscript_1 = - _registerName1("setObject:forKeyedSubscript:"); - void _objc_msgSend_534( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer obj1, - ffi.Pointer key, - ) { - return __objc_msgSend_534( - obj, - sel, - obj1, - key, - ); - } - - late final __objc_msgSend_534Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_534 = __objc_msgSend_534Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dictionaryWithCapacity_1 = - _registerName1("dictionaryWithCapacity:"); - ffi.Pointer _objc_msgSend_535( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ) { - return __objc_msgSend_535( - obj, - sel, - path, - ); - } - - late final __objc_msgSend_535Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_535 = __objc_msgSend_535Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_536( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_536( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_536Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_536 = __objc_msgSend_536Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dictionaryWithSharedKeySet_1 = - _registerName1("dictionaryWithSharedKeySet:"); - ffi.Pointer _objc_msgSend_537( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keyset, - ) { - return __objc_msgSend_537( - obj, - sel, - keyset, - ); - } - - late final __objc_msgSend_537Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_537 = __objc_msgSend_537Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_threadDictionary1 = _registerName1("threadDictionary"); - ffi.Pointer _objc_msgSend_538( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_538( - obj, - sel, - ); - } - - late final __objc_msgSend_538Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_538 = __objc_msgSend_538Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_sleepUntilDate_1 = _registerName1("sleepUntilDate:"); - void _objc_msgSend_539( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, - ) { - return __objc_msgSend_539( - obj, - sel, - date, - ); - } - - late final __objc_msgSend_539Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_539 = __objc_msgSend_539Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_sleepForTimeInterval_1 = - _registerName1("sleepForTimeInterval:"); - void _objc_msgSend_540( - ffi.Pointer obj, - ffi.Pointer sel, - double ti, - ) { - return __objc_msgSend_540( - obj, - sel, - ti, - ); - } - - late final __objc_msgSend_540Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_540 = __objc_msgSend_540Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); - - late final _sel_exit1 = _registerName1("exit"); - late final _sel_threadPriority1 = _registerName1("threadPriority"); - late final _sel_setThreadPriority_1 = _registerName1("setThreadPriority:"); - void _objc_msgSend_541( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_541( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_541Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_541 = __objc_msgSend_541Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); - - late final _sel_qualityOfService1 = _registerName1("qualityOfService"); - int _objc_msgSend_542( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_542( - obj, - sel, - ); - } - - late final __objc_msgSend_542Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_542 = __objc_msgSend_542Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setQualityOfService_1 = - _registerName1("setQualityOfService:"); - void _objc_msgSend_543( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_543( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_543Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_543 = __objc_msgSend_543Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_callStackReturnAddresses1 = - _registerName1("callStackReturnAddresses"); - late final _sel_callStackSymbols1 = _registerName1("callStackSymbols"); - late final _sel_setName_1 = _registerName1("setName:"); - void _objc_msgSend_544( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_544( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_544Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_544 = __objc_msgSend_544Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_stackSize1 = _registerName1("stackSize"); - late final _sel_setStackSize_1 = _registerName1("setStackSize:"); - late final _sel_isMainThread1 = _registerName1("isMainThread"); - late final _sel_mainThread1 = _registerName1("mainThread"); - late final _sel_initWithTarget_selector_object_1 = - _registerName1("initWithTarget:selector:object:"); - instancetype _objc_msgSend_545( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer selector, - ffi.Pointer argument, - ) { - return __objc_msgSend_545( - obj, - sel, - target, - selector, - argument, - ); - } - - late final __objc_msgSend_545Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_545 = __objc_msgSend_545Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithBlock_1 = _registerName1("initWithBlock:"); - instancetype _objc_msgSend_546( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_546( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_546Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_546 = __objc_msgSend_546Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_isExecuting1 = _registerName1("isExecuting"); - late final _sel_isFinished1 = _registerName1("isFinished"); - late final _sel_isCancelled1 = _registerName1("isCancelled"); - late final _sel_cancel1 = _registerName1("cancel"); - late final _sel_start1 = _registerName1("start"); - late final _sel_main1 = _registerName1("main"); - late final _sel_performSelector_onThread_withObject_waitUntilDone_modes_1 = - _registerName1( - "performSelector:onThread:withObject:waitUntilDone:modes:"); - void _objc_msgSend_547( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer thr, - ffi.Pointer arg, - bool wait, - ffi.Pointer array, - ) { - return __objc_msgSend_547( - obj, - sel, - aSelector, - thr, - arg, - wait, - array, - ); - } - - late final __objc_msgSend_547Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_547 = __objc_msgSend_547Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer)>(); - - late final _sel_performSelector_onThread_withObject_waitUntilDone_1 = - _registerName1("performSelector:onThread:withObject:waitUntilDone:"); - void _objc_msgSend_548( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer thr, - ffi.Pointer arg, - bool wait, - ) { - return __objc_msgSend_548( - obj, - sel, - aSelector, - thr, - arg, - wait, - ); - } - - late final __objc_msgSend_548Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_548 = __objc_msgSend_548Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); - - late final _sel_performSelectorInBackground_withObject_1 = - _registerName1("performSelectorInBackground:withObject:"); - late final _sel_classForArchiver1 = _registerName1("classForArchiver"); - late final _class_NSArchiver1 = _getClass1("NSArchiver"); - late final _sel_archiverData1 = _registerName1("archiverData"); - ffi.Pointer _objc_msgSend_549( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_549( - obj, - sel, - ); - } - - late final __objc_msgSend_549Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_549 = __objc_msgSend_549Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_encodeClassName_intoClassName_1 = - _registerName1("encodeClassName:intoClassName:"); - void _objc_msgSend_550( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer trueName, - ffi.Pointer inArchiveName, - ) { - return __objc_msgSend_550( - obj, - sel, - trueName, - inArchiveName, - ); - } - - late final __objc_msgSend_550Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_550 = __objc_msgSend_550Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_classNameEncodedForTrueClassName_1 = - _registerName1("classNameEncodedForTrueClassName:"); - late final _sel_replaceObject_withObject_1 = - _registerName1("replaceObject:withObject:"); - late final _sel_replacementObjectForArchiver_1 = - _registerName1("replacementObjectForArchiver:"); - ffi.Pointer _objc_msgSend_551( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer archiver, - ) { - return __objc_msgSend_551( - obj, - sel, - archiver, - ); - } - - late final __objc_msgSend_551Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_551 = __objc_msgSend_551Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_classForPortCoder1 = _registerName1("classForPortCoder"); - late final _class_NSPortCoder1 = _getClass1("NSPortCoder"); - late final _sel_isBycopy1 = _registerName1("isBycopy"); - late final _sel_isByref1 = _registerName1("isByref"); - late final _class_NSPort1 = _getClass1("NSPort"); - ffi.Pointer _objc_msgSend_552( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_552( - obj, - sel, - ); - } - - late final __objc_msgSend_552Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_552 = __objc_msgSend_552Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_invalidate1 = _registerName1("invalidate"); - late final _sel_isValid1 = _registerName1("isValid"); - late final _class_NSRunLoop1 = _getClass1("NSRunLoop"); - late final _sel_currentRunLoop1 = _registerName1("currentRunLoop"); - ffi.Pointer _objc_msgSend_553( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_553( - obj, - sel, - ); - } - - late final __objc_msgSend_553Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_553 = __objc_msgSend_553Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_mainRunLoop1 = _registerName1("mainRunLoop"); - late final _sel_currentMode1 = _registerName1("currentMode"); - late final _sel_getCFRunLoop1 = _registerName1("getCFRunLoop"); - ffi.Pointer<__CFRunLoop> _objc_msgSend_554( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_554( - obj, - sel, - ); - } - - late final __objc_msgSend_554Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer<__CFRunLoop> Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_554 = __objc_msgSend_554Ptr.asFunction< - ffi.Pointer<__CFRunLoop> Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSTimer1 = _getClass1("NSTimer"); - late final _sel_timerWithTimeInterval_invocation_repeats_1 = - _registerName1("timerWithTimeInterval:invocation:repeats:"); - ffi.Pointer _objc_msgSend_555( - ffi.Pointer obj, - ffi.Pointer sel, - double ti, - ffi.Pointer invocation, - bool yesOrNo, - ) { - return __objc_msgSend_555( - obj, - sel, - ti, - invocation, - yesOrNo, - ); - } - - late final __objc_msgSend_555Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_555 = __objc_msgSend_555Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, double, ffi.Pointer, bool)>(); - - late final _sel_scheduledTimerWithTimeInterval_invocation_repeats_1 = - _registerName1("scheduledTimerWithTimeInterval:invocation:repeats:"); - late final _sel_timerWithTimeInterval_target_selector_userInfo_repeats_1 = - _registerName1("timerWithTimeInterval:target:selector:userInfo:repeats:"); - ffi.Pointer _objc_msgSend_556( - ffi.Pointer obj, - ffi.Pointer sel, - double ti, - ffi.Pointer aTarget, - ffi.Pointer aSelector, - ffi.Pointer userInfo, - bool yesOrNo, - ) { - return __objc_msgSend_556( - obj, - sel, - ti, - aTarget, - aSelector, - userInfo, - yesOrNo, - ); - } - - late final __objc_msgSend_556Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_556 = __objc_msgSend_556Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); - - late final _sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_1 = - _registerName1( - "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"); - late final _sel_timerWithTimeInterval_repeats_block_1 = - _registerName1("timerWithTimeInterval:repeats:block:"); - ffi.Pointer _objc_msgSend_557( - ffi.Pointer obj, - ffi.Pointer sel, - double interval, - bool repeats, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_557( - obj, - sel, - interval, - repeats, - block, - ); - } - - late final __objc_msgSend_557Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Bool, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_557 = __objc_msgSend_557Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, double, bool, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_scheduledTimerWithTimeInterval_repeats_block_1 = - _registerName1("scheduledTimerWithTimeInterval:repeats:block:"); - late final _sel_initWithFireDate_interval_repeats_block_1 = - _registerName1("initWithFireDate:interval:repeats:block:"); - instancetype _objc_msgSend_558( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, - double interval, - bool repeats, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_558( - obj, - sel, - date, - interval, - repeats, - block, - ); - } - - late final __objc_msgSend_558Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Bool, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_558 = __objc_msgSend_558Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, double, bool, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_initWithFireDate_interval_target_selector_userInfo_repeats_1 = - _registerName1( - "initWithFireDate:interval:target:selector:userInfo:repeats:"); - instancetype _objc_msgSend_559( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, - double ti, - ffi.Pointer t, - ffi.Pointer s, - ffi.Pointer ui, - bool rep, - ) { - return __objc_msgSend_559( - obj, - sel, - date, - ti, - t, - s, - ui, - rep, - ); - } - - late final __objc_msgSend_559Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_559 = __objc_msgSend_559Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); - - late final _sel_fire1 = _registerName1("fire"); - late final _sel_fireDate1 = _registerName1("fireDate"); - late final _sel_setFireDate_1 = _registerName1("setFireDate:"); - void _objc_msgSend_560( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_560( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_560Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_560 = __objc_msgSend_560Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_timeInterval1 = _registerName1("timeInterval"); - late final _sel_tolerance1 = _registerName1("tolerance"); - late final _sel_setTolerance_1 = _registerName1("setTolerance:"); - late final _sel_addTimer_forMode_1 = _registerName1("addTimer:forMode:"); - void _objc_msgSend_561( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer timer, - ffi.Pointer mode, - ) { - return __objc_msgSend_561( - obj, - sel, - timer, - mode, - ); - } - - late final __objc_msgSend_561Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_561 = __objc_msgSend_561Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_addPort_forMode_1 = _registerName1("addPort:forMode:"); - void _objc_msgSend_562( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aPort, - ffi.Pointer mode, - ) { - return __objc_msgSend_562( - obj, - sel, - aPort, - mode, - ); - } - - late final __objc_msgSend_562Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_562 = __objc_msgSend_562Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_removePort_forMode_1 = _registerName1("removePort:forMode:"); - late final _sel_limitDateForMode_1 = _registerName1("limitDateForMode:"); - ffi.Pointer _objc_msgSend_563( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer mode, - ) { - return __objc_msgSend_563( - obj, - sel, - mode, - ); - } - - late final __objc_msgSend_563Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_563 = __objc_msgSend_563Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_acceptInputForMode_beforeDate_1 = - _registerName1("acceptInputForMode:beforeDate:"); - void _objc_msgSend_564( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer mode, - ffi.Pointer limitDate, - ) { - return __objc_msgSend_564( - obj, - sel, - mode, - limitDate, - ); - } - - late final __objc_msgSend_564Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_564 = __objc_msgSend_564Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_run1 = _registerName1("run"); - late final _sel_runUntilDate_1 = _registerName1("runUntilDate:"); - late final _sel_runMode_beforeDate_1 = _registerName1("runMode:beforeDate:"); - bool _objc_msgSend_565( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer mode, - ffi.Pointer limitDate, - ) { - return __objc_msgSend_565( - obj, - sel, - mode, - limitDate, - ); - } - - late final __objc_msgSend_565Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_565 = __objc_msgSend_565Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_configureAsServer1 = _registerName1("configureAsServer"); - late final _sel_performInModes_block_1 = - _registerName1("performInModes:block:"); - void _objc_msgSend_566( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer modes, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_566( - obj, - sel, - modes, - block, - ); - } - - late final __objc_msgSend_566Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_566 = __objc_msgSend_566Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_performBlock_1 = _registerName1("performBlock:"); - late final _sel_performSelector_target_argument_order_modes_1 = - _registerName1("performSelector:target:argument:order:modes:"); - void _objc_msgSend_567( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer target, - ffi.Pointer arg, - int order, - ffi.Pointer modes, - ) { - return __objc_msgSend_567( - obj, - sel, - aSelector, - target, - arg, - order, - modes, - ); - } - - late final __objc_msgSend_567Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_567 = __objc_msgSend_567Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - late final _sel_cancelPerformSelector_target_argument_1 = - _registerName1("cancelPerformSelector:target:argument:"); - late final _sel_cancelPerformSelectorsWithTarget_1 = - _registerName1("cancelPerformSelectorsWithTarget:"); - late final _sel_scheduleInRunLoop_forMode_1 = - _registerName1("scheduleInRunLoop:forMode:"); - void _objc_msgSend_568( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer runLoop, - ffi.Pointer mode, - ) { - return __objc_msgSend_568( - obj, - sel, - runLoop, - mode, - ); - } - - late final __objc_msgSend_568Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_568 = __objc_msgSend_568Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_removeFromRunLoop_forMode_1 = - _registerName1("removeFromRunLoop:forMode:"); - late final _sel_reservedSpaceLength1 = _registerName1("reservedSpaceLength"); - late final _sel_sendBeforeDate_components_from_reserved_1 = - _registerName1("sendBeforeDate:components:from:reserved:"); - bool _objc_msgSend_569( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer limitDate, - ffi.Pointer components, - ffi.Pointer receivePort, - int headerSpaceReserved, - ) { - return __objc_msgSend_569( - obj, - sel, - limitDate, - components, - receivePort, - headerSpaceReserved, - ); - } - - late final __objc_msgSend_569Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_569 = __objc_msgSend_569Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - - late final _sel_sendBeforeDate_msgid_components_from_reserved_1 = - _registerName1("sendBeforeDate:msgid:components:from:reserved:"); - bool _objc_msgSend_570( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer limitDate, - int msgID, - ffi.Pointer components, - ffi.Pointer receivePort, - int headerSpaceReserved, - ) { - return __objc_msgSend_570( - obj, - sel, - limitDate, - msgID, - components, - receivePort, - headerSpaceReserved, - ); - } - - late final __objc_msgSend_570Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_570 = __objc_msgSend_570Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - int)>(); - - late final _class_NSConnection1 = _getClass1("NSConnection"); - late final _sel_statistics1 = _registerName1("statistics"); - late final _sel_allConnections1 = _registerName1("allConnections"); - late final _sel_defaultConnection1 = _registerName1("defaultConnection"); - ffi.Pointer _objc_msgSend_571( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_571( - obj, - sel, - ); - } - - late final __objc_msgSend_571Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_571 = __objc_msgSend_571Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_connectionWithRegisteredName_host_1 = - _registerName1("connectionWithRegisteredName:host:"); - instancetype _objc_msgSend_572( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer hostName, - ) { - return __objc_msgSend_572( - obj, - sel, - name, - hostName, - ); - } - - late final __objc_msgSend_572Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_572 = __objc_msgSend_572Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSPortNameServer1 = _getClass1("NSPortNameServer"); - late final _sel_systemDefaultPortNameServer1 = - _registerName1("systemDefaultPortNameServer"); - ffi.Pointer _objc_msgSend_573( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_573( - obj, - sel, - ); - } - - late final __objc_msgSend_573Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_573 = __objc_msgSend_573Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_portForName_1 = _registerName1("portForName:"); - ffi.Pointer _objc_msgSend_574( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ) { - return __objc_msgSend_574( - obj, - sel, - name, - ); - } - - late final __objc_msgSend_574Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_574 = __objc_msgSend_574Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_portForName_host_1 = _registerName1("portForName:host:"); - ffi.Pointer _objc_msgSend_575( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer host, - ) { - return __objc_msgSend_575( - obj, - sel, - name, - host, - ); - } - - late final __objc_msgSend_575Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_575 = __objc_msgSend_575Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_registerPort_name_1 = _registerName1("registerPort:name:"); - bool _objc_msgSend_576( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer port, - ffi.Pointer name, - ) { - return __objc_msgSend_576( - obj, - sel, - port, - name, - ); - } - - late final __objc_msgSend_576Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_576 = __objc_msgSend_576Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_removePortForName_1 = _registerName1("removePortForName:"); - late final _sel_connectionWithRegisteredName_host_usingNameServer_1 = - _registerName1("connectionWithRegisteredName:host:usingNameServer:"); - instancetype _objc_msgSend_577( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer hostName, - ffi.Pointer server, - ) { - return __objc_msgSend_577( - obj, - sel, - name, - hostName, - server, - ); - } - - late final __objc_msgSend_577Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_577 = __objc_msgSend_577Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSDistantObject1 = _getClass1("NSDistantObject"); - late final _class_NSProxy1 = _getClass1("NSProxy"); - ffi.Pointer _objc_msgSend_578( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_578( - obj, - sel, - sel1, - ); - } - - late final __objc_msgSend_578Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_578 = __objc_msgSend_578Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_respondsToSelector_1 = _registerName1("respondsToSelector:"); - late final _sel_proxyWithTarget_connection_1 = - _registerName1("proxyWithTarget:connection:"); - ffi.Pointer _objc_msgSend_579( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer connection, - ) { - return __objc_msgSend_579( - obj, - sel, - target, - connection, - ); - } - - late final __objc_msgSend_579Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_579 = __objc_msgSend_579Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithTarget_connection_1 = - _registerName1("initWithTarget:connection:"); - late final _sel_proxyWithLocal_connection_1 = - _registerName1("proxyWithLocal:connection:"); - ffi.Pointer _objc_msgSend_580( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer connection, - ) { - return __objc_msgSend_580( - obj, - sel, - target, - connection, - ); - } - - late final __objc_msgSend_580Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_580 = __objc_msgSend_580Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithLocal_connection_1 = - _registerName1("initWithLocal:connection:"); - late final _sel_setProtocolForProxy_1 = - _registerName1("setProtocolForProxy:"); - void _objc_msgSend_581( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer proto, - ) { - return __objc_msgSend_581( - obj, - sel, - proto, - ); - } - - late final __objc_msgSend_581Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_581 = __objc_msgSend_581Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_connectionForProxy1 = _registerName1("connectionForProxy"); - late final _sel_rootProxyForConnectionWithRegisteredName_host_1 = - _registerName1("rootProxyForConnectionWithRegisteredName:host:"); - ffi.Pointer _objc_msgSend_582( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer hostName, - ) { - return __objc_msgSend_582( - obj, - sel, - name, - hostName, - ); - } - - late final __objc_msgSend_582Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_582 = __objc_msgSend_582Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_1 = - _registerName1( - "rootProxyForConnectionWithRegisteredName:host:usingNameServer:"); - ffi.Pointer _objc_msgSend_583( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer hostName, - ffi.Pointer server, - ) { - return __objc_msgSend_583( - obj, - sel, - name, - hostName, - server, - ); - } - - late final __objc_msgSend_583Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_583 = __objc_msgSend_583Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_serviceConnectionWithName_rootObject_usingNameServer_1 = - _registerName1("serviceConnectionWithName:rootObject:usingNameServer:"); - instancetype _objc_msgSend_584( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer root, - ffi.Pointer server, - ) { - return __objc_msgSend_584( - obj, - sel, - name, - root, - server, - ); - } - - late final __objc_msgSend_584Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_584 = __objc_msgSend_584Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_serviceConnectionWithName_rootObject_1 = - _registerName1("serviceConnectionWithName:rootObject:"); - instancetype _objc_msgSend_585( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer root, - ) { - return __objc_msgSend_585( - obj, - sel, - name, - root, - ); - } - - late final __objc_msgSend_585Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_585 = __objc_msgSend_585Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_requestTimeout1 = _registerName1("requestTimeout"); - late final _sel_setRequestTimeout_1 = _registerName1("setRequestTimeout:"); - late final _sel_replyTimeout1 = _registerName1("replyTimeout"); - late final _sel_setReplyTimeout_1 = _registerName1("setReplyTimeout:"); - late final _sel_rootObject1 = _registerName1("rootObject"); - late final _sel_setRootObject_1 = _registerName1("setRootObject:"); - late final _sel_independentConversationQueueing1 = - _registerName1("independentConversationQueueing"); - late final _sel_setIndependentConversationQueueing_1 = - _registerName1("setIndependentConversationQueueing:"); - late final _sel_rootProxy1 = _registerName1("rootProxy"); - ffi.Pointer _objc_msgSend_586( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_586( - obj, - sel, - ); - } - - late final __objc_msgSend_586Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_586 = __objc_msgSend_586Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_addRequestMode_1 = _registerName1("addRequestMode:"); - late final _sel_removeRequestMode_1 = _registerName1("removeRequestMode:"); - late final _sel_requestModes1 = _registerName1("requestModes"); - late final _sel_registerName_1 = _registerName1("registerName:"); - bool _objc_msgSend_587( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ) { - return __objc_msgSend_587( - obj, - sel, - name, - ); - } - - late final __objc_msgSend_587Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_587 = __objc_msgSend_587Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_registerName_withNameServer_1 = - _registerName1("registerName:withNameServer:"); - bool _objc_msgSend_588( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer server, - ) { - return __objc_msgSend_588( - obj, - sel, - name, - server, - ); - } - - late final __objc_msgSend_588Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_588 = __objc_msgSend_588Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_connectionWithReceivePort_sendPort_1 = - _registerName1("connectionWithReceivePort:sendPort:"); - instancetype _objc_msgSend_589( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer receivePort, - ffi.Pointer sendPort, - ) { - return __objc_msgSend_589( - obj, - sel, - receivePort, - sendPort, - ); - } - - late final __objc_msgSend_589Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_589 = __objc_msgSend_589Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_currentConversation1 = _registerName1("currentConversation"); - late final _sel_initWithReceivePort_sendPort_1 = - _registerName1("initWithReceivePort:sendPort:"); - late final _sel_sendPort1 = _registerName1("sendPort"); - late final _sel_receivePort1 = _registerName1("receivePort"); - late final _sel_enableMultipleThreads1 = - _registerName1("enableMultipleThreads"); - late final _sel_multipleThreadsEnabled1 = - _registerName1("multipleThreadsEnabled"); - late final _sel_addRunLoop_1 = _registerName1("addRunLoop:"); - void _objc_msgSend_590( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer runloop, - ) { - return __objc_msgSend_590( - obj, - sel, - runloop, - ); - } - - late final __objc_msgSend_590Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_590 = __objc_msgSend_590Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removeRunLoop_1 = _registerName1("removeRunLoop:"); - late final _sel_runInNewThread1 = _registerName1("runInNewThread"); - late final _sel_remoteObjects1 = _registerName1("remoteObjects"); - late final _sel_localObjects1 = _registerName1("localObjects"); - late final _sel_dispatchWithComponents_1 = - _registerName1("dispatchWithComponents:"); - late final _sel_addConnection_toRunLoop_forMode_1 = - _registerName1("addConnection:toRunLoop:forMode:"); - void _objc_msgSend_591( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer conn, - ffi.Pointer runLoop, - ffi.Pointer mode, - ) { - return __objc_msgSend_591( - obj, - sel, - conn, - runLoop, - mode, - ); - } - - late final __objc_msgSend_591Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_591 = __objc_msgSend_591Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removeConnection_fromRunLoop_forMode_1 = - _registerName1("removeConnection:fromRunLoop:forMode:"); - late final _sel_encodePortObject_1 = _registerName1("encodePortObject:"); - void _objc_msgSend_592( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aport, - ) { - return __objc_msgSend_592( - obj, - sel, - aport, - ); - } - - late final __objc_msgSend_592Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_592 = __objc_msgSend_592Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_decodePortObject1 = _registerName1("decodePortObject"); - ffi.Pointer _objc_msgSend_593( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_593( - obj, - sel, - ); - } - - late final __objc_msgSend_593Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_593 = __objc_msgSend_593Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_connection1 = _registerName1("connection"); - ffi.Pointer _objc_msgSend_594( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_594( - obj, - sel, - ); - } - - late final __objc_msgSend_594Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_594 = __objc_msgSend_594Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_portCoderWithReceivePort_sendPort_components_1 = - _registerName1("portCoderWithReceivePort:sendPort:components:"); - ffi.Pointer _objc_msgSend_595( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer rcvPort, - ffi.Pointer sndPort, - ffi.Pointer comps, - ) { - return __objc_msgSend_595( - obj, - sel, - rcvPort, - sndPort, - comps, - ); - } - - late final __objc_msgSend_595Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_595 = __objc_msgSend_595Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithReceivePort_sendPort_components_1 = - _registerName1("initWithReceivePort:sendPort:components:"); - late final _sel_dispatch1 = _registerName1("dispatch"); - late final _sel_replacementObjectForPortCoder_1 = - _registerName1("replacementObjectForPortCoder:"); - ffi.Pointer _objc_msgSend_596( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_596( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_596Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_596 = __objc_msgSend_596Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSClassDescription1 = _getClass1("NSClassDescription"); - late final _sel_registerClassDescription_forClass_1 = - _registerName1("registerClassDescription:forClass:"); - void _objc_msgSend_597( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer description, - ffi.Pointer aClass, - ) { - return __objc_msgSend_597( - obj, - sel, - description, - aClass, - ); - } - - late final __objc_msgSend_597Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_597 = __objc_msgSend_597Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_invalidateClassDescriptionCache1 = - _registerName1("invalidateClassDescriptionCache"); - late final _sel_classDescriptionForClass_1 = - _registerName1("classDescriptionForClass:"); - ffi.Pointer _objc_msgSend_598( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ) { - return __objc_msgSend_598( - obj, - sel, - aClass, - ); - } - - late final __objc_msgSend_598Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_598 = __objc_msgSend_598Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_attributeKeys1 = _registerName1("attributeKeys"); - late final _sel_toOneRelationshipKeys1 = - _registerName1("toOneRelationshipKeys"); - late final _sel_toManyRelationshipKeys1 = - _registerName1("toManyRelationshipKeys"); - late final _sel_inverseForRelationshipKey_1 = - _registerName1("inverseForRelationshipKey:"); - late final _sel_classDescription1 = _registerName1("classDescription"); - ffi.Pointer _objc_msgSend_599( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_599( - obj, - sel, - ); - } - - late final __objc_msgSend_599Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_599 = __objc_msgSend_599Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSScriptObjectSpecifier1 = - _getClass1("NSScriptObjectSpecifier"); - late final _class_NSAppleEventDescriptor1 = - _getClass1("NSAppleEventDescriptor"); - late final _sel_nullDescriptor1 = _registerName1("nullDescriptor"); - ffi.Pointer _objc_msgSend_600( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_600( - obj, - sel, - ); - } - - late final __objc_msgSend_600Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_600 = __objc_msgSend_600Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_descriptorWithDescriptorType_bytes_length_1 = - _registerName1("descriptorWithDescriptorType:bytes:length:"); - ffi.Pointer _objc_msgSend_601( - ffi.Pointer obj, - ffi.Pointer sel, - int descriptorType, - ffi.Pointer bytes, - int byteCount, - ) { - return __objc_msgSend_601( - obj, - sel, - descriptorType, - bytes, - byteCount, - ); - } - - late final __objc_msgSend_601Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_601 = __objc_msgSend_601Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); - - late final _sel_descriptorWithDescriptorType_data_1 = - _registerName1("descriptorWithDescriptorType:data:"); - ffi.Pointer _objc_msgSend_602( - ffi.Pointer obj, - ffi.Pointer sel, - int descriptorType, - ffi.Pointer data, - ) { - return __objc_msgSend_602( - obj, - sel, - descriptorType, - data, - ); - } - - late final __objc_msgSend_602Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_602 = __objc_msgSend_602Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_descriptorWithBoolean_1 = - _registerName1("descriptorWithBoolean:"); - ffi.Pointer _objc_msgSend_603( - ffi.Pointer obj, - ffi.Pointer sel, - int boolean, - ) { - return __objc_msgSend_603( - obj, - sel, - boolean, - ); - } - - late final __objc_msgSend_603Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedChar)>>('objc_msgSend'); - late final __objc_msgSend_603 = __objc_msgSend_603Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_descriptorWithEnumCode_1 = - _registerName1("descriptorWithEnumCode:"); - ffi.Pointer _objc_msgSend_604( - ffi.Pointer obj, - ffi.Pointer sel, - int enumerator, - ) { - return __objc_msgSend_604( - obj, - sel, - enumerator, - ); - } - - late final __objc_msgSend_604Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_604 = __objc_msgSend_604Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_descriptorWithInt32_1 = - _registerName1("descriptorWithInt32:"); - ffi.Pointer _objc_msgSend_605( - ffi.Pointer obj, - ffi.Pointer sel, - int signedInt, - ) { - return __objc_msgSend_605( - obj, - sel, - signedInt, - ); - } - - late final __objc_msgSend_605Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_605 = __objc_msgSend_605Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_descriptorWithDouble_1 = - _registerName1("descriptorWithDouble:"); - ffi.Pointer _objc_msgSend_606( - ffi.Pointer obj, - ffi.Pointer sel, - double doubleValue, - ) { - return __objc_msgSend_606( - obj, - sel, - doubleValue, - ); - } - - late final __objc_msgSend_606Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_606 = __objc_msgSend_606Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - late final _sel_descriptorWithTypeCode_1 = - _registerName1("descriptorWithTypeCode:"); - late final _sel_descriptorWithString_1 = - _registerName1("descriptorWithString:"); - ffi.Pointer _objc_msgSend_607( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - ) { - return __objc_msgSend_607( - obj, - sel, - string, - ); - } - - late final __objc_msgSend_607Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_607 = __objc_msgSend_607Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_descriptorWithDate_1 = _registerName1("descriptorWithDate:"); - ffi.Pointer _objc_msgSend_608( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, - ) { - return __objc_msgSend_608( - obj, - sel, - date, - ); - } - - late final __objc_msgSend_608Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_608 = __objc_msgSend_608Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_descriptorWithFileURL_1 = - _registerName1("descriptorWithFileURL:"); - ffi.Pointer _objc_msgSend_609( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer fileURL, - ) { - return __objc_msgSend_609( - obj, - sel, - fileURL, - ); - } - - late final __objc_msgSend_609Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_609 = __objc_msgSend_609Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_1 = - _registerName1( - "appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); - ffi.Pointer _objc_msgSend_610( - ffi.Pointer obj, - ffi.Pointer sel, - int eventClass, - int eventID, - ffi.Pointer targetDescriptor, - int returnID, - int transactionID, - ) { - return __objc_msgSend_610( - obj, - sel, - eventClass, - eventID, - targetDescriptor, - returnID, - transactionID, - ); - } - - late final __objc_msgSend_610Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.UnsignedInt, - ffi.Pointer, - ffi.Short, - ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_610 = __objc_msgSend_610Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer, int, int)>(); - - late final _sel_listDescriptor1 = _registerName1("listDescriptor"); - late final _sel_recordDescriptor1 = _registerName1("recordDescriptor"); - late final _sel_currentProcessDescriptor1 = - _registerName1("currentProcessDescriptor"); - late final _sel_descriptorWithProcessIdentifier_1 = - _registerName1("descriptorWithProcessIdentifier:"); - late final _sel_descriptorWithBundleIdentifier_1 = - _registerName1("descriptorWithBundleIdentifier:"); - late final _sel_descriptorWithApplicationURL_1 = - _registerName1("descriptorWithApplicationURL:"); - late final _sel_initWithAEDescNoCopy_1 = - _registerName1("initWithAEDescNoCopy:"); - instancetype _objc_msgSend_611( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aeDesc, - ) { - return __objc_msgSend_611( - obj, - sel, - aeDesc, - ); - } - - late final __objc_msgSend_611Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_611 = __objc_msgSend_611Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithDescriptorType_bytes_length_1 = - _registerName1("initWithDescriptorType:bytes:length:"); - instancetype _objc_msgSend_612( - ffi.Pointer obj, - ffi.Pointer sel, - int descriptorType, - ffi.Pointer bytes, - int byteCount, - ) { - return __objc_msgSend_612( - obj, - sel, - descriptorType, - bytes, - byteCount, - ); - } - - late final __objc_msgSend_612Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_612 = __objc_msgSend_612Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, int)>(); - - late final _sel_initWithDescriptorType_data_1 = - _registerName1("initWithDescriptorType:data:"); - instancetype _objc_msgSend_613( - ffi.Pointer obj, - ffi.Pointer sel, - int descriptorType, - ffi.Pointer data, - ) { - return __objc_msgSend_613( - obj, - sel, - descriptorType, - data, - ); - } - - late final __objc_msgSend_613Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedInt, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_613 = __objc_msgSend_613Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_1 = - _registerName1( - "initWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); - instancetype _objc_msgSend_614( - ffi.Pointer obj, - ffi.Pointer sel, - int eventClass, - int eventID, - ffi.Pointer targetDescriptor, - int returnID, - int transactionID, - ) { - return __objc_msgSend_614( - obj, - sel, - eventClass, - eventID, - targetDescriptor, - returnID, - transactionID, - ); - } - - late final __objc_msgSend_614Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.UnsignedInt, - ffi.Pointer, - ffi.Short, - ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_614 = __objc_msgSend_614Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, int, - int, ffi.Pointer, int, int)>(); - - late final _sel_initListDescriptor1 = _registerName1("initListDescriptor"); - late final _sel_initRecordDescriptor1 = - _registerName1("initRecordDescriptor"); - late final _sel_aeDesc1 = _registerName1("aeDesc"); - ffi.Pointer _objc_msgSend_615( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_615( - obj, - sel, - ); - } - - late final __objc_msgSend_615Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_615 = __objc_msgSend_615Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_descriptorType1 = _registerName1("descriptorType"); - late final _sel_booleanValue1 = _registerName1("booleanValue"); - late final _sel_enumCodeValue1 = _registerName1("enumCodeValue"); - late final _sel_int32Value1 = _registerName1("int32Value"); - late final _sel_typeCodeValue1 = _registerName1("typeCodeValue"); - late final _sel_dateValue1 = _registerName1("dateValue"); - late final _sel_fileURLValue1 = _registerName1("fileURLValue"); - late final _sel_eventClass1 = _registerName1("eventClass"); - late final _sel_eventID1 = _registerName1("eventID"); - late final _sel_returnID1 = _registerName1("returnID"); - late final _sel_transactionID1 = _registerName1("transactionID"); - late final _sel_setParamDescriptor_forKeyword_1 = - _registerName1("setParamDescriptor:forKeyword:"); - void _objc_msgSend_616( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer descriptor, - int keyword, - ) { - return __objc_msgSend_616( - obj, - sel, - descriptor, - keyword, - ); - } - - late final __objc_msgSend_616Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_616 = __objc_msgSend_616Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_paramDescriptorForKeyword_1 = - _registerName1("paramDescriptorForKeyword:"); - ffi.Pointer _objc_msgSend_617( - ffi.Pointer obj, - ffi.Pointer sel, - int keyword, - ) { - return __objc_msgSend_617( - obj, - sel, - keyword, - ); - } - - late final __objc_msgSend_617Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_617 = __objc_msgSend_617Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_removeParamDescriptorWithKeyword_1 = - _registerName1("removeParamDescriptorWithKeyword:"); - void _objc_msgSend_618( - ffi.Pointer obj, - ffi.Pointer sel, - int keyword, - ) { - return __objc_msgSend_618( - obj, - sel, - keyword, - ); - } - - late final __objc_msgSend_618Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_618 = __objc_msgSend_618Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_setAttributeDescriptor_forKeyword_1 = - _registerName1("setAttributeDescriptor:forKeyword:"); - late final _sel_attributeDescriptorForKeyword_1 = - _registerName1("attributeDescriptorForKeyword:"); - late final _sel_sendEventWithOptions_timeout_error_1 = - _registerName1("sendEventWithOptions:timeout:error:"); - ffi.Pointer _objc_msgSend_619( - ffi.Pointer obj, - ffi.Pointer sel, - int sendOptions, - double timeoutInSeconds, - ffi.Pointer> error, - ) { - return __objc_msgSend_619( - obj, - sel, - sendOptions, - timeoutInSeconds, - error, - ); - } - - late final __objc_msgSend_619Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Double, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_619 = __objc_msgSend_619Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - double, - ffi.Pointer>)>(); - - late final _sel_isRecordDescriptor1 = _registerName1("isRecordDescriptor"); - late final _sel_numberOfItems1 = _registerName1("numberOfItems"); - late final _sel_insertDescriptor_atIndex_1 = - _registerName1("insertDescriptor:atIndex:"); - void _objc_msgSend_620( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer descriptor, - int index, - ) { - return __objc_msgSend_620( - obj, - sel, - descriptor, - index, - ); - } - - late final __objc_msgSend_620Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_620 = __objc_msgSend_620Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_descriptorAtIndex_1 = _registerName1("descriptorAtIndex:"); - ffi.Pointer _objc_msgSend_621( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_621( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_621Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_621 = __objc_msgSend_621Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_removeDescriptorAtIndex_1 = - _registerName1("removeDescriptorAtIndex:"); - late final _sel_setDescriptor_forKeyword_1 = - _registerName1("setDescriptor:forKeyword:"); - late final _sel_descriptorForKeyword_1 = - _registerName1("descriptorForKeyword:"); - late final _sel_removeDescriptorWithKeyword_1 = - _registerName1("removeDescriptorWithKeyword:"); - late final _sel_keywordForDescriptorAtIndex_1 = - _registerName1("keywordForDescriptorAtIndex:"); - int _objc_msgSend_622( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_622( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_622Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_622 = __objc_msgSend_622Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_coerceToDescriptorType_1 = - _registerName1("coerceToDescriptorType:"); - late final _sel_objectSpecifierWithDescriptor_1 = - _registerName1("objectSpecifierWithDescriptor:"); - ffi.Pointer _objc_msgSend_623( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer descriptor, - ) { - return __objc_msgSend_623( - obj, - sel, - descriptor, - ); - } - - late final __objc_msgSend_623Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_623 = __objc_msgSend_623Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithContainerSpecifier_key_1 = - _registerName1("initWithContainerSpecifier:key:"); - instancetype _objc_msgSend_624( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer container, - ffi.Pointer property, - ) { - return __objc_msgSend_624( - obj, - sel, - container, - property, - ); - } - - late final __objc_msgSend_624Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_624 = __objc_msgSend_624Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSScriptClassDescription1 = - _getClass1("NSScriptClassDescription"); - ffi.Pointer _objc_msgSend_625( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ) { - return __objc_msgSend_625( - obj, - sel, - aClass, - ); - } - - late final __objc_msgSend_625Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_625 = __objc_msgSend_625Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithSuiteName_className_dictionary_1 = - _registerName1("initWithSuiteName:className:dictionary:"); - instancetype _objc_msgSend_626( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer suiteName, - ffi.Pointer className, - ffi.Pointer classDeclaration, - ) { - return __objc_msgSend_626( - obj, - sel, - suiteName, - className, - classDeclaration, - ); - } - - late final __objc_msgSend_626Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_626 = __objc_msgSend_626Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_suiteName1 = _registerName1("suiteName"); - late final _sel_className1 = _registerName1("className"); - late final _sel_implementationClassName1 = - _registerName1("implementationClassName"); - late final _sel_superclassDescription1 = - _registerName1("superclassDescription"); - ffi.Pointer _objc_msgSend_627( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_627( - obj, - sel, - ); - } - - late final __objc_msgSend_627Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_627 = __objc_msgSend_627Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_appleEventCode1 = _registerName1("appleEventCode"); - late final _sel_matchesAppleEventCode_1 = - _registerName1("matchesAppleEventCode:"); - late final _class_NSScriptCommandDescription1 = - _getClass1("NSScriptCommandDescription"); - late final _sel_initWithSuiteName_commandName_dictionary_1 = - _registerName1("initWithSuiteName:commandName:dictionary:"); - late final _sel_commandName1 = _registerName1("commandName"); - late final _sel_appleEventClassCode1 = _registerName1("appleEventClassCode"); - late final _sel_commandClassName1 = _registerName1("commandClassName"); - late final _sel_returnType1 = _registerName1("returnType"); - late final _sel_appleEventCodeForReturnType1 = - _registerName1("appleEventCodeForReturnType"); - late final _sel_argumentNames1 = _registerName1("argumentNames"); - late final _sel_typeForArgumentWithName_1 = - _registerName1("typeForArgumentWithName:"); - late final _sel_appleEventCodeForArgumentWithName_1 = - _registerName1("appleEventCodeForArgumentWithName:"); - int _objc_msgSend_628( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer argumentName, - ) { - return __objc_msgSend_628( - obj, - sel, - argumentName, - ); - } - - late final __objc_msgSend_628Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_628 = __objc_msgSend_628Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_isOptionalArgumentWithName_1 = - _registerName1("isOptionalArgumentWithName:"); - late final _class_NSScriptCommand1 = _getClass1("NSScriptCommand"); - late final _sel_initWithCommandDescription_1 = - _registerName1("initWithCommandDescription:"); - instancetype _objc_msgSend_629( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer commandDef, - ) { - return __objc_msgSend_629( - obj, - sel, - commandDef, - ); - } - - late final __objc_msgSend_629Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_629 = __objc_msgSend_629Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_commandDescription1 = _registerName1("commandDescription"); - ffi.Pointer _objc_msgSend_630( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_630( - obj, - sel, - ); - } - - late final __objc_msgSend_630Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_630 = __objc_msgSend_630Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_directParameter1 = _registerName1("directParameter"); - late final _sel_setDirectParameter_1 = _registerName1("setDirectParameter:"); - late final _sel_receiversSpecifier1 = _registerName1("receiversSpecifier"); - ffi.Pointer _objc_msgSend_631( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_631( - obj, - sel, - ); - } - - late final __objc_msgSend_631Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_631 = __objc_msgSend_631Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setReceiversSpecifier_1 = - _registerName1("setReceiversSpecifier:"); - void _objc_msgSend_632( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_632( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_632Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_632 = __objc_msgSend_632Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_evaluatedReceivers1 = _registerName1("evaluatedReceivers"); - late final _sel_arguments1 = _registerName1("arguments"); - late final _sel_setArguments_1 = _registerName1("setArguments:"); - void _objc_msgSend_633( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_633( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_633Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_633 = __objc_msgSend_633Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_evaluatedArguments1 = _registerName1("evaluatedArguments"); - late final _sel_isWellFormed1 = _registerName1("isWellFormed"); - late final _sel_performDefaultImplementation1 = - _registerName1("performDefaultImplementation"); - late final _sel_executeCommand1 = _registerName1("executeCommand"); - late final _sel_scriptErrorNumber1 = _registerName1("scriptErrorNumber"); - late final _sel_setScriptErrorNumber_1 = - _registerName1("setScriptErrorNumber:"); - void _objc_msgSend_634( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_634( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_634Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_634 = __objc_msgSend_634Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_scriptErrorOffendingObjectDescriptor1 = - _registerName1("scriptErrorOffendingObjectDescriptor"); - ffi.Pointer _objc_msgSend_635( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_635( - obj, - sel, - ); - } - - late final __objc_msgSend_635Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_635 = __objc_msgSend_635Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setScriptErrorOffendingObjectDescriptor_1 = - _registerName1("setScriptErrorOffendingObjectDescriptor:"); - void _objc_msgSend_636( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_636( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_636Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_636 = __objc_msgSend_636Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_scriptErrorExpectedTypeDescriptor1 = - _registerName1("scriptErrorExpectedTypeDescriptor"); - late final _sel_setScriptErrorExpectedTypeDescriptor_1 = - _registerName1("setScriptErrorExpectedTypeDescriptor:"); - late final _sel_scriptErrorString1 = _registerName1("scriptErrorString"); - late final _sel_setScriptErrorString_1 = - _registerName1("setScriptErrorString:"); - late final _sel_currentCommand1 = _registerName1("currentCommand"); - ffi.Pointer _objc_msgSend_637( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_637( - obj, - sel, - ); - } - - late final __objc_msgSend_637Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_637 = __objc_msgSend_637Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_appleEvent1 = _registerName1("appleEvent"); - late final _sel_suspendExecution1 = _registerName1("suspendExecution"); - late final _sel_resumeExecutionWithResult_1 = - _registerName1("resumeExecutionWithResult:"); - late final _sel_createCommandInstance1 = - _registerName1("createCommandInstance"); - ffi.Pointer _objc_msgSend_638( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_638( - obj, - sel, - ); - } - - late final __objc_msgSend_638Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_638 = __objc_msgSend_638Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_createCommandInstanceWithZone_1 = - _registerName1("createCommandInstanceWithZone:"); - ffi.Pointer _objc_msgSend_639( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_639( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_639Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_639 = __objc_msgSend_639Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - late final _sel_supportsCommand_1 = _registerName1("supportsCommand:"); - bool _objc_msgSend_640( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer commandDescription, - ) { - return __objc_msgSend_640( - obj, - sel, - commandDescription, - ); - } - - late final __objc_msgSend_640Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_640 = __objc_msgSend_640Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_selectorForCommand_1 = _registerName1("selectorForCommand:"); - ffi.Pointer _objc_msgSend_641( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer commandDescription, - ) { - return __objc_msgSend_641( - obj, - sel, - commandDescription, - ); - } - - late final __objc_msgSend_641Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_641 = __objc_msgSend_641Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_typeForKey_1 = _registerName1("typeForKey:"); - late final _sel_classDescriptionForKey_1 = - _registerName1("classDescriptionForKey:"); - ffi.Pointer _objc_msgSend_642( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ) { - return __objc_msgSend_642( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_642Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_642 = __objc_msgSend_642Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_appleEventCodeForKey_1 = - _registerName1("appleEventCodeForKey:"); - late final _sel_keyWithAppleEventCode_1 = - _registerName1("keyWithAppleEventCode:"); - ffi.Pointer _objc_msgSend_643( - ffi.Pointer obj, - ffi.Pointer sel, - int appleEventCode, - ) { - return __objc_msgSend_643( - obj, - sel, - appleEventCode, - ); - } - - late final __objc_msgSend_643Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_643 = __objc_msgSend_643Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_defaultSubcontainerAttributeKey1 = - _registerName1("defaultSubcontainerAttributeKey"); - late final _sel_isLocationRequiredToCreateForKey_1 = - _registerName1("isLocationRequiredToCreateForKey:"); - late final _sel_hasPropertyForKey_1 = _registerName1("hasPropertyForKey:"); - late final _sel_hasOrderedToManyRelationshipForKey_1 = - _registerName1("hasOrderedToManyRelationshipForKey:"); - late final _sel_hasReadablePropertyForKey_1 = - _registerName1("hasReadablePropertyForKey:"); - late final _sel_hasWritablePropertyForKey_1 = - _registerName1("hasWritablePropertyForKey:"); - late final _sel_isReadOnlyKey_1 = _registerName1("isReadOnlyKey:"); - late final _sel_initWithContainerClassDescription_containerSpecifier_key_1 = - _registerName1( - "initWithContainerClassDescription:containerSpecifier:key:"); - instancetype _objc_msgSend_644( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer classDesc, - ffi.Pointer container, - ffi.Pointer property, - ) { - return __objc_msgSend_644( - obj, - sel, - classDesc, - container, - property, - ); - } - - late final __objc_msgSend_644Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_644 = __objc_msgSend_644Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_childSpecifier1 = _registerName1("childSpecifier"); - late final _sel_setChildSpecifier_1 = _registerName1("setChildSpecifier:"); - late final _sel_containerSpecifier1 = _registerName1("containerSpecifier"); - late final _sel_setContainerSpecifier_1 = - _registerName1("setContainerSpecifier:"); - late final _sel_containerIsObjectBeingTested1 = - _registerName1("containerIsObjectBeingTested"); - late final _sel_setContainerIsObjectBeingTested_1 = - _registerName1("setContainerIsObjectBeingTested:"); - late final _sel_containerIsRangeContainerObject1 = - _registerName1("containerIsRangeContainerObject"); - late final _sel_setContainerIsRangeContainerObject_1 = - _registerName1("setContainerIsRangeContainerObject:"); - late final _sel_key1 = _registerName1("key"); - late final _sel_setKey_1 = _registerName1("setKey:"); - void _objc_msgSend_645( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_645( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_645Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_645 = __objc_msgSend_645Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_containerClassDescription1 = - _registerName1("containerClassDescription"); - late final _sel_setContainerClassDescription_1 = - _registerName1("setContainerClassDescription:"); - void _objc_msgSend_646( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_646( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_646Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_646 = __objc_msgSend_646Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_keyClassDescription1 = _registerName1("keyClassDescription"); - late final _sel_indicesOfObjectsByEvaluatingWithContainer_count_1 = - _registerName1("indicesOfObjectsByEvaluatingWithContainer:count:"); - ffi.Pointer _objc_msgSend_647( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer container, - ffi.Pointer count, - ) { - return __objc_msgSend_647( - obj, - sel, - container, - count, - ); - } - - late final __objc_msgSend_647Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_647 = __objc_msgSend_647Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_objectsByEvaluatingWithContainers_1 = - _registerName1("objectsByEvaluatingWithContainers:"); - late final _sel_objectsByEvaluatingSpecifier1 = - _registerName1("objectsByEvaluatingSpecifier"); - late final _sel_evaluationErrorNumber1 = - _registerName1("evaluationErrorNumber"); - late final _sel_setEvaluationErrorNumber_1 = - _registerName1("setEvaluationErrorNumber:"); - late final _sel_evaluationErrorSpecifier1 = - _registerName1("evaluationErrorSpecifier"); - late final _sel_descriptor1 = _registerName1("descriptor"); - late final _sel_scriptingValueForSpecifier_1 = - _registerName1("scriptingValueForSpecifier:"); - ffi.Pointer _objc_msgSend_648( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer objectSpecifier, - ) { - return __objc_msgSend_648( - obj, - sel, - objectSpecifier, - ); - } - - late final __objc_msgSend_648Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_648 = __objc_msgSend_648Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_scriptingProperties1 = _registerName1("scriptingProperties"); - late final _sel_setScriptingProperties_1 = - _registerName1("setScriptingProperties:"); - late final _sel_copyScriptingValue_forKey_withProperties_1 = - _registerName1("copyScriptingValue:forKey:withProperties:"); - ffi.Pointer _objc_msgSend_649( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer key, - ffi.Pointer properties, - ) { - return __objc_msgSend_649( - obj, - sel, - value, - key, - properties, - ); - } - - late final __objc_msgSend_649Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_649 = __objc_msgSend_649Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_1 = - _registerName1( - "newScriptingObjectOfClass:forValueForKey:withContentsValue:properties:"); - ffi.Pointer _objc_msgSend_650( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer objectClass, - ffi.Pointer key, - ffi.Pointer contentsValue, - ffi.Pointer properties, - ) { - return __objc_msgSend_650( - obj, - sel, - objectClass, - key, - contentsValue, - properties, - ); - } - - late final __objc_msgSend_650Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_650 = __objc_msgSend_650Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_classCode1 = _registerName1("classCode"); - late final _sel_valueAtIndex_inPropertyWithKey_1 = - _registerName1("valueAtIndex:inPropertyWithKey:"); - ffi.Pointer _objc_msgSend_651( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer key, - ) { - return __objc_msgSend_651( - obj, - sel, - index, - key, - ); - } - - late final __objc_msgSend_651Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_651 = __objc_msgSend_651Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_valueWithName_inPropertyWithKey_1 = - _registerName1("valueWithName:inPropertyWithKey:"); - late final _sel_valueWithUniqueID_inPropertyWithKey_1 = - _registerName1("valueWithUniqueID:inPropertyWithKey:"); - late final _sel_insertValue_atIndex_inPropertyWithKey_1 = - _registerName1("insertValue:atIndex:inPropertyWithKey:"); - void _objc_msgSend_652( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - int index, - ffi.Pointer key, - ) { - return __objc_msgSend_652( - obj, - sel, - value, - index, - key, - ); - } - - late final __objc_msgSend_652Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_652 = __objc_msgSend_652Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_removeValueAtIndex_fromPropertyWithKey_1 = - _registerName1("removeValueAtIndex:fromPropertyWithKey:"); - void _objc_msgSend_653( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer key, - ) { - return __objc_msgSend_653( - obj, - sel, - index, - key, - ); - } - - late final __objc_msgSend_653Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_653 = __objc_msgSend_653Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _sel_replaceValueAtIndex_inPropertyWithKey_withValue_1 = - _registerName1("replaceValueAtIndex:inPropertyWithKey:withValue:"); - void _objc_msgSend_654( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer key, - ffi.Pointer value, - ) { - return __objc_msgSend_654( - obj, - sel, - index, - key, - value, - ); - } - - late final __objc_msgSend_654Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_654 = __objc_msgSend_654Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_insertValue_inPropertyWithKey_1 = - _registerName1("insertValue:inPropertyWithKey:"); - void _objc_msgSend_655( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer key, - ) { - return __objc_msgSend_655( - obj, - sel, - value, - key, - ); - } - - late final __objc_msgSend_655Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_655 = __objc_msgSend_655Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_coerceValue_forKey_1 = _registerName1("coerceValue:forKey:"); - ffi.Pointer _objc_msgSend_656( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer key, - ) { - return __objc_msgSend_656( - obj, - sel, - value, - key, - ); - } - - late final __objc_msgSend_656Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_656 = __objc_msgSend_656Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_objectSpecifier1 = _registerName1("objectSpecifier"); - late final _sel_indicesOfObjectsByEvaluatingObjectSpecifier_1 = - _registerName1("indicesOfObjectsByEvaluatingObjectSpecifier:"); - ffi.Pointer _objc_msgSend_657( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer specifier, - ) { - return __objc_msgSend_657( - obj, - sel, - specifier, - ); - } - - late final __objc_msgSend_657Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_657 = __objc_msgSend_657Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_isEqualTo_1 = _registerName1("isEqualTo:"); - late final _sel_isLessThanOrEqualTo_1 = - _registerName1("isLessThanOrEqualTo:"); - late final _sel_isLessThan_1 = _registerName1("isLessThan:"); - late final _sel_isGreaterThanOrEqualTo_1 = - _registerName1("isGreaterThanOrEqualTo:"); - late final _sel_isGreaterThan_1 = _registerName1("isGreaterThan:"); - late final _sel_isNotEqualTo_1 = _registerName1("isNotEqualTo:"); - late final _sel_doesContain_1 = _registerName1("doesContain:"); - late final _sel_isLike_1 = _registerName1("isLike:"); - late final _sel_isCaseInsensitiveLike_1 = - _registerName1("isCaseInsensitiveLike:"); - late final _sel_scriptingIsEqualTo_1 = _registerName1("scriptingIsEqualTo:"); - late final _sel_scriptingIsLessThanOrEqualTo_1 = - _registerName1("scriptingIsLessThanOrEqualTo:"); - late final _sel_scriptingIsLessThan_1 = - _registerName1("scriptingIsLessThan:"); - late final _sel_scriptingIsGreaterThanOrEqualTo_1 = - _registerName1("scriptingIsGreaterThanOrEqualTo:"); - late final _sel_scriptingIsGreaterThan_1 = - _registerName1("scriptingIsGreaterThan:"); - late final _sel_scriptingBeginsWith_1 = - _registerName1("scriptingBeginsWith:"); - late final _sel_scriptingEndsWith_1 = _registerName1("scriptingEndsWith:"); - late final _sel_scriptingContains_1 = _registerName1("scriptingContains:"); - late final _class_NSItemProvider1 = _getClass1("NSItemProvider"); - late final _class_NSProgress1 = _getClass1("NSProgress"); - late final _sel_currentProgress1 = _registerName1("currentProgress"); - ffi.Pointer _objc_msgSend_658( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_658( - obj, - sel, - ); - } - - late final __objc_msgSend_658Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_658 = __objc_msgSend_658Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_progressWithTotalUnitCount_1 = - _registerName1("progressWithTotalUnitCount:"); - ffi.Pointer _objc_msgSend_659( - ffi.Pointer obj, - ffi.Pointer sel, - int unitCount, - ) { - return __objc_msgSend_659( - obj, - sel, - unitCount, - ); - } - - late final __objc_msgSend_659Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_659 = __objc_msgSend_659Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_discreteProgressWithTotalUnitCount_1 = - _registerName1("discreteProgressWithTotalUnitCount:"); - late final _sel_progressWithTotalUnitCount_parent_pendingUnitCount_1 = - _registerName1("progressWithTotalUnitCount:parent:pendingUnitCount:"); - ffi.Pointer _objc_msgSend_660( - ffi.Pointer obj, - ffi.Pointer sel, - int unitCount, - ffi.Pointer parent, - int portionOfParentTotalUnitCount, - ) { - return __objc_msgSend_660( - obj, - sel, - unitCount, - parent, - portionOfParentTotalUnitCount, - ); - } - - late final __objc_msgSend_660Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_660 = __objc_msgSend_660Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); - - late final _sel_initWithParent_userInfo_1 = - _registerName1("initWithParent:userInfo:"); - instancetype _objc_msgSend_661( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer parentProgressOrNil, - ffi.Pointer userInfoOrNil, - ) { - return __objc_msgSend_661( - obj, - sel, - parentProgressOrNil, - userInfoOrNil, - ); - } - - late final __objc_msgSend_661Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_661 = __objc_msgSend_661Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_becomeCurrentWithPendingUnitCount_1 = - _registerName1("becomeCurrentWithPendingUnitCount:"); - void _objc_msgSend_662( - ffi.Pointer obj, - ffi.Pointer sel, - int unitCount, - ) { - return __objc_msgSend_662( - obj, - sel, - unitCount, - ); - } - - late final __objc_msgSend_662Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_662 = __objc_msgSend_662Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_1 = - _registerName1("performAsCurrentWithPendingUnitCount:usingBlock:"); - void _objc_msgSend_663( - ffi.Pointer obj, - ffi.Pointer sel, - int unitCount, - ffi.Pointer<_ObjCBlock> work, - ) { - return __objc_msgSend_663( - obj, - sel, - unitCount, - work, - ); - } - - late final __objc_msgSend_663Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int64, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_663 = __objc_msgSend_663Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_resignCurrent1 = _registerName1("resignCurrent"); - late final _sel_addChild_withPendingUnitCount_1 = - _registerName1("addChild:withPendingUnitCount:"); - void _objc_msgSend_664( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer child, - int inUnitCount, - ) { - return __objc_msgSend_664( - obj, - sel, - child, - inUnitCount, - ); - } - - late final __objc_msgSend_664Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_664 = __objc_msgSend_664Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_totalUnitCount1 = _registerName1("totalUnitCount"); - int _objc_msgSend_665( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_665( - obj, - sel, - ); - } - - late final __objc_msgSend_665Ptr = _lookup< - ffi.NativeFunction< - ffi.Int64 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_665 = __objc_msgSend_665Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setTotalUnitCount_1 = _registerName1("setTotalUnitCount:"); - void _objc_msgSend_666( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_666( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_666Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_666 = __objc_msgSend_666Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_completedUnitCount1 = _registerName1("completedUnitCount"); - late final _sel_setCompletedUnitCount_1 = - _registerName1("setCompletedUnitCount:"); - late final _sel_setLocalizedDescription_1 = - _registerName1("setLocalizedDescription:"); - late final _sel_localizedAdditionalDescription1 = - _registerName1("localizedAdditionalDescription"); - late final _sel_setLocalizedAdditionalDescription_1 = - _registerName1("setLocalizedAdditionalDescription:"); - late final _sel_isCancellable1 = _registerName1("isCancellable"); - late final _sel_setCancellable_1 = _registerName1("setCancellable:"); - late final _sel_isPausable1 = _registerName1("isPausable"); - late final _sel_setPausable_1 = _registerName1("setPausable:"); - late final _sel_isPaused1 = _registerName1("isPaused"); - late final _sel_cancellationHandler1 = _registerName1("cancellationHandler"); - ffi.Pointer<_ObjCBlock> _objc_msgSend_667( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_667( - obj, - sel, - ); - } - - late final __objc_msgSend_667Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_667 = __objc_msgSend_667Ptr.asFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setCancellationHandler_1 = - _registerName1("setCancellationHandler:"); - void _objc_msgSend_668( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> value, - ) { - return __objc_msgSend_668( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_668Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_668 = __objc_msgSend_668Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_pausingHandler1 = _registerName1("pausingHandler"); - late final _sel_setPausingHandler_1 = _registerName1("setPausingHandler:"); - late final _sel_resumingHandler1 = _registerName1("resumingHandler"); - late final _sel_setResumingHandler_1 = _registerName1("setResumingHandler:"); - late final _sel_setUserInfoObject_forKey_1 = - _registerName1("setUserInfoObject:forKey:"); - late final _sel_isIndeterminate1 = _registerName1("isIndeterminate"); - late final _sel_fractionCompleted1 = _registerName1("fractionCompleted"); - late final _sel_pause1 = _registerName1("pause"); - late final _sel_resume1 = _registerName1("resume"); - late final _sel_kind1 = _registerName1("kind"); - late final _sel_setKind_1 = _registerName1("setKind:"); - late final _sel_estimatedTimeRemaining1 = - _registerName1("estimatedTimeRemaining"); - late final _sel_setEstimatedTimeRemaining_1 = - _registerName1("setEstimatedTimeRemaining:"); - void _objc_msgSend_669( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_669( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_669Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_669 = __objc_msgSend_669Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_throughput1 = _registerName1("throughput"); - late final _sel_setThroughput_1 = _registerName1("setThroughput:"); - late final _sel_fileOperationKind1 = _registerName1("fileOperationKind"); - late final _sel_setFileOperationKind_1 = - _registerName1("setFileOperationKind:"); - late final _sel_fileURL1 = _registerName1("fileURL"); - late final _sel_setFileURL_1 = _registerName1("setFileURL:"); - void _objc_msgSend_670( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_670( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_670Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_670 = __objc_msgSend_670Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_fileTotalCount1 = _registerName1("fileTotalCount"); - late final _sel_setFileTotalCount_1 = _registerName1("setFileTotalCount:"); - late final _sel_fileCompletedCount1 = _registerName1("fileCompletedCount"); - late final _sel_setFileCompletedCount_1 = - _registerName1("setFileCompletedCount:"); - late final _sel_publish1 = _registerName1("publish"); - late final _sel_unpublish1 = _registerName1("unpublish"); - late final _sel_addSubscriberForFileURL_withPublishingHandler_1 = - _registerName1("addSubscriberForFileURL:withPublishingHandler:"); - ffi.Pointer _objc_msgSend_671( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer<_ObjCBlock> publishingHandler, - ) { - return __objc_msgSend_671( - obj, - sel, - url, - publishingHandler, - ); - } - - late final __objc_msgSend_671Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_671 = __objc_msgSend_671Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_removeSubscriber_1 = _registerName1("removeSubscriber:"); - late final _sel_isOld1 = _registerName1("isOld"); - late final _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = - _registerName1( - "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); - void _objc_msgSend_672( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int visibility, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_672( - obj, - sel, - typeIdentifier, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_672Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_672 = __objc_msgSend_672Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = - _registerName1( - "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); - void _objc_msgSend_673( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - int visibility, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_673( - obj, - sel, - typeIdentifier, - fileOptions, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_673Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_673 = __objc_msgSend_673Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_registeredTypeIdentifiers1 = - _registerName1("registeredTypeIdentifiers"); - late final _sel_registeredTypeIdentifiersWithFileOptions_1 = - _registerName1("registeredTypeIdentifiersWithFileOptions:"); - ffi.Pointer _objc_msgSend_674( - ffi.Pointer obj, - ffi.Pointer sel, - int fileOptions, - ) { - return __objc_msgSend_674( - obj, - sel, - fileOptions, - ); - } - - late final __objc_msgSend_674Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_674 = __objc_msgSend_674Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_hasItemConformingToTypeIdentifier_1 = - _registerName1("hasItemConformingToTypeIdentifier:"); - late final _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = - _registerName1( - "hasRepresentationConformingToTypeIdentifier:fileOptions:"); - bool _objc_msgSend_675( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - ) { - return __objc_msgSend_675( - obj, - sel, - typeIdentifier, - fileOptions, - ); - } - - late final __objc_msgSend_675Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_675 = __objc_msgSend_675Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadDataRepresentationForTypeIdentifier:completionHandler:"); - ffi.Pointer _objc_msgSend_676( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_676( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_676Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_676 = __objc_msgSend_676Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadFileRepresentationForTypeIdentifier:completionHandler:"); - ffi.Pointer _objc_msgSend_677( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_677( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_677Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_677 = __objc_msgSend_677Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); - ffi.Pointer _objc_msgSend_678( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_678( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_678Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_678 = __objc_msgSend_678Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_suggestedName1 = _registerName1("suggestedName"); - late final _sel_setSuggestedName_1 = _registerName1("setSuggestedName:"); - late final _sel_registerObject_visibility_1 = - _registerName1("registerObject:visibility:"); - void _objc_msgSend_679( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - int visibility, - ) { - return __objc_msgSend_679( - obj, - sel, - object, - visibility, - ); - } - - late final __objc_msgSend_679Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_679 = __objc_msgSend_679Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_registerObjectOfClass_visibility_loadHandler_1 = - _registerName1("registerObjectOfClass:visibility:loadHandler:"); - void _objc_msgSend_680( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - int visibility, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_680( - obj, - sel, - aClass, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_680Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_680 = __objc_msgSend_680Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_canLoadObjectOfClass_1 = - _registerName1("canLoadObjectOfClass:"); - late final _sel_loadObjectOfClass_completionHandler_1 = - _registerName1("loadObjectOfClass:completionHandler:"); - ffi.Pointer _objc_msgSend_681( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_681( - obj, - sel, - aClass, - completionHandler, - ); - } - - late final __objc_msgSend_681Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_681 = __objc_msgSend_681Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_initWithItem_typeIdentifier_1 = - _registerName1("initWithItem:typeIdentifier:"); - instancetype _objc_msgSend_682( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer item, - ffi.Pointer typeIdentifier, - ) { - return __objc_msgSend_682( - obj, - sel, - item, - typeIdentifier, - ); - } - - late final __objc_msgSend_682Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_682 = __objc_msgSend_682Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_registerItemForTypeIdentifier_loadHandler_1 = - _registerName1("registerItemForTypeIdentifier:loadHandler:"); - void _objc_msgSend_683( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_683( - obj, - sel, - typeIdentifier, - loadHandler, - ); - } - - late final __objc_msgSend_683Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_683 = __objc_msgSend_683Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_loadItemForTypeIdentifier_options_completionHandler_1 = - _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); - void _objc_msgSend_684( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer options, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_684( - obj, - sel, - typeIdentifier, - options, - completionHandler, - ); - } - - late final __objc_msgSend_684Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_684 = __objc_msgSend_684Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_previewImageHandler1 = _registerName1("previewImageHandler"); - ffi.Pointer<_ObjCBlock> _objc_msgSend_685( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_685( - obj, - sel, - ); - } - - late final __objc_msgSend_685Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_685 = __objc_msgSend_685Ptr.asFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setPreviewImageHandler_1 = - _registerName1("setPreviewImageHandler:"); - void _objc_msgSend_686( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> value, - ) { - return __objc_msgSend_686( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_686Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_686 = __objc_msgSend_686Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_loadPreviewImageWithOptions_completionHandler_1 = - _registerName1("loadPreviewImageWithOptions:completionHandler:"); - void _objc_msgSend_687( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer options, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_687( - obj, - sel, - options, - completionHandler, - ); - } - - late final __objc_msgSend_687Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_687 = __objc_msgSend_687Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _class_NSMutableString1 = _getClass1("NSMutableString"); - late final _sel_replaceCharactersInRange_withString_1 = - _registerName1("replaceCharactersInRange:withString:"); - void _objc_msgSend_688( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer aString, - ) { - return __objc_msgSend_688( - obj, - sel, - range, - aString, - ); - } - - late final __objc_msgSend_688Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_688 = __objc_msgSend_688Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - ffi.Pointer)>(); - - late final _sel_insertString_atIndex_1 = - _registerName1("insertString:atIndex:"); - void _objc_msgSend_689( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aString, - int loc, - ) { - return __objc_msgSend_689( - obj, - sel, - aString, - loc, - ); - } - - late final __objc_msgSend_689Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_689 = __objc_msgSend_689Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_deleteCharactersInRange_1 = - _registerName1("deleteCharactersInRange:"); - late final _sel_appendString_1 = _registerName1("appendString:"); - late final _sel_appendFormat_1 = _registerName1("appendFormat:"); - late final _sel_setString_1 = _registerName1("setString:"); - late final _sel_replaceOccurrencesOfString_withString_options_range_1 = - _registerName1("replaceOccurrencesOfString:withString:options:range:"); - int _objc_msgSend_690( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - int options, - _NSRange searchRange, - ) { - return __objc_msgSend_690( - obj, - sel, - target, - replacement, - options, - searchRange, - ); - } - - late final __objc_msgSend_690Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_690 = __objc_msgSend_690Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); - - late final _sel_applyTransform_reverse_range_updatedRange_1 = - _registerName1("applyTransform:reverse:range:updatedRange:"); - bool _objc_msgSend_691( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer transform, - bool reverse, - _NSRange range, - ffi.Pointer<_NSRange> resultingRange, - ) { - return __objc_msgSend_691( - obj, - sel, - transform, - reverse, - range, - resultingRange, - ); - } - - late final __objc_msgSend_691Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - _NSRange, - ffi.Pointer<_NSRange>)>>('objc_msgSend'); - late final __objc_msgSend_691 = __objc_msgSend_691Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool, _NSRange, ffi.Pointer<_NSRange>)>(); - - ffi.Pointer _objc_msgSend_692( - ffi.Pointer obj, - ffi.Pointer sel, - int capacity, - ) { - return __objc_msgSend_692( - obj, - sel, - capacity, - ); - } - - late final __objc_msgSend_692Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_692 = __objc_msgSend_692Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_stringWithCapacity_1 = _registerName1("stringWithCapacity:"); - late final _class_NSNotification1 = _getClass1("NSNotification"); - late final _sel_object1 = _registerName1("object"); - late final _sel_initWithName_object_userInfo_1 = - _registerName1("initWithName:object:userInfo:"); - instancetype _objc_msgSend_693( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer object, - ffi.Pointer userInfo, - ) { - return __objc_msgSend_693( - obj, - sel, - name, - object, - userInfo, - ); - } - - late final __objc_msgSend_693Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_693 = __objc_msgSend_693Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_notificationWithName_object_1 = - _registerName1("notificationWithName:object:"); - late final _sel_notificationWithName_object_userInfo_1 = - _registerName1("notificationWithName:object:userInfo:"); - late final _class_NSBundle1 = _getClass1("NSBundle"); - late final _sel_mainBundle1 = _registerName1("mainBundle"); - ffi.Pointer _objc_msgSend_694( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_694( - obj, - sel, - ); - } - - late final __objc_msgSend_694Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_694 = __objc_msgSend_694Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_bundleWithPath_1 = _registerName1("bundleWithPath:"); - late final _sel_initWithPath_1 = _registerName1("initWithPath:"); - late final _sel_bundleWithURL_1 = _registerName1("bundleWithURL:"); - late final _sel_initWithURL_1 = _registerName1("initWithURL:"); - late final _sel_bundleForClass_1 = _registerName1("bundleForClass:"); - ffi.Pointer _objc_msgSend_695( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ) { - return __objc_msgSend_695( - obj, - sel, - aClass, - ); - } - - late final __objc_msgSend_695Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_695 = __objc_msgSend_695Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_bundleWithIdentifier_1 = - _registerName1("bundleWithIdentifier:"); - ffi.Pointer _objc_msgSend_696( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer identifier, - ) { - return __objc_msgSend_696( - obj, - sel, - identifier, - ); - } - - late final __objc_msgSend_696Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_696 = __objc_msgSend_696Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_allBundles1 = _registerName1("allBundles"); - late final _sel_allFrameworks1 = _registerName1("allFrameworks"); - late final _sel_isLoaded1 = _registerName1("isLoaded"); - late final _sel_unload1 = _registerName1("unload"); - late final _sel_preflightAndReturnError_1 = - _registerName1("preflightAndReturnError:"); - late final _sel_loadAndReturnError_1 = _registerName1("loadAndReturnError:"); - late final _sel_bundleURL1 = _registerName1("bundleURL"); - late final _sel_resourceURL1 = _registerName1("resourceURL"); - late final _sel_executableURL1 = _registerName1("executableURL"); - late final _sel_URLForAuxiliaryExecutable_1 = - _registerName1("URLForAuxiliaryExecutable:"); - late final _sel_privateFrameworksURL1 = - _registerName1("privateFrameworksURL"); - late final _sel_sharedFrameworksURL1 = _registerName1("sharedFrameworksURL"); - late final _sel_sharedSupportURL1 = _registerName1("sharedSupportURL"); - late final _sel_builtInPlugInsURL1 = _registerName1("builtInPlugInsURL"); - late final _sel_appStoreReceiptURL1 = _registerName1("appStoreReceiptURL"); - late final _sel_bundlePath1 = _registerName1("bundlePath"); - late final _sel_resourcePath1 = _registerName1("resourcePath"); - late final _sel_executablePath1 = _registerName1("executablePath"); - late final _sel_pathForAuxiliaryExecutable_1 = - _registerName1("pathForAuxiliaryExecutable:"); - late final _sel_privateFrameworksPath1 = - _registerName1("privateFrameworksPath"); - late final _sel_sharedFrameworksPath1 = - _registerName1("sharedFrameworksPath"); - late final _sel_sharedSupportPath1 = _registerName1("sharedSupportPath"); - late final _sel_builtInPlugInsPath1 = _registerName1("builtInPlugInsPath"); - late final _sel_URLForResource_withExtension_subdirectory_inBundleWithURL_1 = - _registerName1( - "URLForResource:withExtension:subdirectory:inBundleWithURL:"); - ffi.Pointer _objc_msgSend_697( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer ext, - ffi.Pointer subpath, - ffi.Pointer bundleURL, - ) { - return __objc_msgSend_697( - obj, - sel, - name, - ext, - subpath, - bundleURL, - ); - } - - late final __objc_msgSend_697Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_697 = __objc_msgSend_697Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_URLsForResourcesWithExtension_subdirectory_inBundleWithURL_1 = - _registerName1( - "URLsForResourcesWithExtension:subdirectory:inBundleWithURL:"); - ffi.Pointer _objc_msgSend_698( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer ext, - ffi.Pointer subpath, - ffi.Pointer bundleURL, - ) { - return __objc_msgSend_698( - obj, - sel, - ext, - subpath, - bundleURL, - ); - } - - late final __objc_msgSend_698Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_698 = __objc_msgSend_698Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_URLForResource_withExtension_1 = - _registerName1("URLForResource:withExtension:"); - ffi.Pointer _objc_msgSend_699( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer ext, - ) { - return __objc_msgSend_699( - obj, - sel, - name, - ext, - ); - } - - late final __objc_msgSend_699Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_699 = __objc_msgSend_699Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_URLForResource_withExtension_subdirectory_1 = - _registerName1("URLForResource:withExtension:subdirectory:"); - ffi.Pointer _objc_msgSend_700( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer ext, - ffi.Pointer subpath, - ) { - return __objc_msgSend_700( - obj, - sel, - name, - ext, - subpath, - ); - } - - late final __objc_msgSend_700Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_700 = __objc_msgSend_700Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_URLForResource_withExtension_subdirectory_localization_1 = - _registerName1("URLForResource:withExtension:subdirectory:localization:"); - ffi.Pointer _objc_msgSend_701( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer ext, - ffi.Pointer subpath, - ffi.Pointer localizationName, - ) { - return __objc_msgSend_701( - obj, - sel, - name, - ext, - subpath, - localizationName, - ); - } - - late final __objc_msgSend_701Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_701 = __objc_msgSend_701Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_URLsForResourcesWithExtension_subdirectory_1 = - _registerName1("URLsForResourcesWithExtension:subdirectory:"); - ffi.Pointer _objc_msgSend_702( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer ext, - ffi.Pointer subpath, - ) { - return __objc_msgSend_702( - obj, - sel, - ext, - subpath, - ); - } - - late final __objc_msgSend_702Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_702 = __objc_msgSend_702Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_URLsForResourcesWithExtension_subdirectory_localization_1 = - _registerName1( - "URLsForResourcesWithExtension:subdirectory:localization:"); - ffi.Pointer _objc_msgSend_703( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer ext, - ffi.Pointer subpath, - ffi.Pointer localizationName, - ) { - return __objc_msgSend_703( - obj, - sel, - ext, - subpath, - localizationName, - ); - } - - late final __objc_msgSend_703Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_703 = __objc_msgSend_703Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_pathForResource_ofType_inDirectory_1 = - _registerName1("pathForResource:ofType:inDirectory:"); - ffi.Pointer _objc_msgSend_704( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer ext, - ffi.Pointer bundlePath, - ) { - return __objc_msgSend_704( - obj, - sel, - name, - ext, - bundlePath, - ); - } - - late final __objc_msgSend_704Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_704 = __objc_msgSend_704Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_pathsForResourcesOfType_inDirectory_1 = - _registerName1("pathsForResourcesOfType:inDirectory:"); - ffi.Pointer _objc_msgSend_705( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer ext, - ffi.Pointer bundlePath, - ) { - return __objc_msgSend_705( - obj, - sel, - ext, - bundlePath, - ); - } - - late final __objc_msgSend_705Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_705 = __objc_msgSend_705Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_pathForResource_ofType_1 = - _registerName1("pathForResource:ofType:"); - ffi.Pointer _objc_msgSend_706( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer ext, - ) { - return __objc_msgSend_706( - obj, - sel, - name, - ext, - ); - } - - late final __objc_msgSend_706Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_706 = __objc_msgSend_706Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_pathForResource_ofType_inDirectory_forLocalization_1 = - _registerName1("pathForResource:ofType:inDirectory:forLocalization:"); - ffi.Pointer _objc_msgSend_707( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer ext, - ffi.Pointer subpath, - ffi.Pointer localizationName, - ) { - return __objc_msgSend_707( - obj, - sel, - name, - ext, - subpath, - localizationName, - ); - } - - late final __objc_msgSend_707Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_707 = __objc_msgSend_707Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_pathsForResourcesOfType_inDirectory_forLocalization_1 = - _registerName1("pathsForResourcesOfType:inDirectory:forLocalization:"); - ffi.Pointer _objc_msgSend_708( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer ext, - ffi.Pointer subpath, - ffi.Pointer localizationName, - ) { - return __objc_msgSend_708( - obj, - sel, - ext, - subpath, - localizationName, - ); - } - - late final __objc_msgSend_708Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_708 = __objc_msgSend_708Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_localizedStringForKey_value_table_1 = - _registerName1("localizedStringForKey:value:table:"); - ffi.Pointer _objc_msgSend_709( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ffi.Pointer value, - ffi.Pointer tableName, - ) { - return __objc_msgSend_709( - obj, - sel, - key, - value, - tableName, - ); - } - - late final __objc_msgSend_709Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_709 = __objc_msgSend_709Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSAttributedString1 = _getClass1("NSAttributedString"); - late final _sel_attributesAtIndex_effectiveRange_1 = - _registerName1("attributesAtIndex:effectiveRange:"); - ffi.Pointer _objc_msgSend_710( - ffi.Pointer obj, - ffi.Pointer sel, - int location, - ffi.Pointer<_NSRange> range, - ) { - return __objc_msgSend_710( - obj, - sel, - location, - range, - ); - } - - late final __objc_msgSend_710Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer<_NSRange>)>>('objc_msgSend'); - late final __objc_msgSend_710 = __objc_msgSend_710Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_NSRange>)>(); - - late final _sel_attribute_atIndex_effectiveRange_1 = - _registerName1("attribute:atIndex:effectiveRange:"); - ffi.Pointer _objc_msgSend_711( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer attrName, - int location, - ffi.Pointer<_NSRange> range, - ) { - return __objc_msgSend_711( - obj, - sel, - attrName, - location, - range, - ); - } - - late final __objc_msgSend_711Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer<_NSRange>)>>('objc_msgSend'); - late final __objc_msgSend_711 = __objc_msgSend_711Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_NSRange>)>(); - - late final _sel_attributedSubstringFromRange_1 = - _registerName1("attributedSubstringFromRange:"); - ffi.Pointer _objc_msgSend_712( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_712( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_712Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_712 = __objc_msgSend_712Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_attributesAtIndex_longestEffectiveRange_inRange_1 = - _registerName1("attributesAtIndex:longestEffectiveRange:inRange:"); - ffi.Pointer _objc_msgSend_713( - ffi.Pointer obj, - ffi.Pointer sel, - int location, - ffi.Pointer<_NSRange> range, - _NSRange rangeLimit, - ) { - return __objc_msgSend_713( - obj, - sel, - location, - range, - rangeLimit, - ); - } - - late final __objc_msgSend_713Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer<_NSRange>, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_713 = __objc_msgSend_713Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_NSRange>, _NSRange)>(); - - late final _sel_attribute_atIndex_longestEffectiveRange_inRange_1 = - _registerName1("attribute:atIndex:longestEffectiveRange:inRange:"); - ffi.Pointer _objc_msgSend_714( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer attrName, - int location, - ffi.Pointer<_NSRange> range, - _NSRange rangeLimit, - ) { - return __objc_msgSend_714( - obj, - sel, - attrName, - location, - range, - rangeLimit, - ); - } - - late final __objc_msgSend_714Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer<_NSRange>, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_714 = __objc_msgSend_714Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_NSRange>, - _NSRange)>(); - - late final _sel_isEqualToAttributedString_1 = - _registerName1("isEqualToAttributedString:"); - bool _objc_msgSend_715( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - ) { - return __objc_msgSend_715( - obj, - sel, - other, - ); - } - - late final __objc_msgSend_715Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_715 = __objc_msgSend_715Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithString_attributes_1 = - _registerName1("initWithString:attributes:"); - instancetype _objc_msgSend_716( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - ffi.Pointer attrs, - ) { - return __objc_msgSend_716( - obj, - sel, - str, - attrs, - ); - } - - late final __objc_msgSend_716Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_716 = __objc_msgSend_716Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithAttributedString_1 = - _registerName1("initWithAttributedString:"); - instancetype _objc_msgSend_717( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer attrStr, - ) { - return __objc_msgSend_717( - obj, - sel, - attrStr, - ); - } - - late final __objc_msgSend_717Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_717 = __objc_msgSend_717Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_enumerateAttributesInRange_options_usingBlock_1 = - _registerName1("enumerateAttributesInRange:options:usingBlock:"); - void _objc_msgSend_718( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange enumerationRange, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_718( - obj, - sel, - enumerationRange, - opts, - block, - ); - } - - late final __objc_msgSend_718Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_718 = __objc_msgSend_718Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_enumerateAttribute_inRange_options_usingBlock_1 = - _registerName1("enumerateAttribute:inRange:options:usingBlock:"); - void _objc_msgSend_719( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer attrName, - _NSRange enumerationRange, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_719( - obj, - sel, - attrName, - enumerationRange, - opts, - block, - ); - } - - late final __objc_msgSend_719Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_719 = __objc_msgSend_719Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _class_NSAttributedStringMarkdownParsingOptions1 = - _getClass1("NSAttributedStringMarkdownParsingOptions"); - late final _sel_allowsExtendedAttributes1 = - _registerName1("allowsExtendedAttributes"); - late final _sel_setAllowsExtendedAttributes_1 = - _registerName1("setAllowsExtendedAttributes:"); - late final _sel_interpretedSyntax1 = _registerName1("interpretedSyntax"); - int _objc_msgSend_720( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_720( - obj, - sel, - ); - } - - late final __objc_msgSend_720Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_720 = __objc_msgSend_720Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setInterpretedSyntax_1 = - _registerName1("setInterpretedSyntax:"); - void _objc_msgSend_721( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_721( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_721Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_721 = __objc_msgSend_721Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_failurePolicy1 = _registerName1("failurePolicy"); - int _objc_msgSend_722( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_722( - obj, - sel, - ); - } - - late final __objc_msgSend_722Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_722 = __objc_msgSend_722Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setFailurePolicy_1 = _registerName1("setFailurePolicy:"); - void _objc_msgSend_723( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_723( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_723Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_723 = __objc_msgSend_723Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_setLanguageCode_1 = _registerName1("setLanguageCode:"); - late final _sel_appliesSourcePositionAttributes1 = - _registerName1("appliesSourcePositionAttributes"); - late final _sel_setAppliesSourcePositionAttributes_1 = - _registerName1("setAppliesSourcePositionAttributes:"); - late final _sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_1 = - _registerName1( - "initWithContentsOfMarkdownFileAtURL:options:baseURL:error:"); - instancetype _objc_msgSend_724( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer markdownFile, - ffi.Pointer options, - ffi.Pointer baseURL, - ffi.Pointer> error, - ) { - return __objc_msgSend_724( - obj, - sel, - markdownFile, - options, - baseURL, - error, - ); - } - - late final __objc_msgSend_724Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_724 = __objc_msgSend_724Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initWithMarkdown_options_baseURL_error_1 = - _registerName1("initWithMarkdown:options:baseURL:error:"); - instancetype _objc_msgSend_725( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer markdown, - ffi.Pointer options, - ffi.Pointer baseURL, - ffi.Pointer> error, - ) { - return __objc_msgSend_725( - obj, - sel, - markdown, - options, - baseURL, - error, - ); - } - - late final __objc_msgSend_725Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_725 = __objc_msgSend_725Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initWithMarkdownString_options_baseURL_error_1 = - _registerName1("initWithMarkdownString:options:baseURL:error:"); - instancetype _objc_msgSend_726( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer markdownString, - ffi.Pointer options, - ffi.Pointer baseURL, - ffi.Pointer> error, - ) { - return __objc_msgSend_726( - obj, - sel, - markdownString, - options, - baseURL, - error, - ); - } - - late final __objc_msgSend_726Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_726 = __objc_msgSend_726Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initWithFormat_options_locale_1 = - _registerName1("initWithFormat:options:locale:"); - instancetype _objc_msgSend_727( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - int options, - ffi.Pointer locale, - ) { - return __objc_msgSend_727( - obj, - sel, - format, - options, - locale, - ); - } - - late final __objc_msgSend_727Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_727 = __objc_msgSend_727Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_initWithFormat_options_locale_arguments_1 = - _registerName1("initWithFormat:options:locale:arguments:"); - instancetype _objc_msgSend_728( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - int options, - ffi.Pointer locale, - ffi.Pointer arguments, - ) { - return __objc_msgSend_728( - obj, - sel, - format, - options, - locale, - arguments, - ); - } - - late final __objc_msgSend_728Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_728 = __objc_msgSend_728Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_localizedAttributedStringWithFormat_1 = - _registerName1("localizedAttributedStringWithFormat:"); - late final _sel_localizedAttributedStringWithFormat_options_1 = - _registerName1("localizedAttributedStringWithFormat:options:"); - instancetype _objc_msgSend_729( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - int options, - ) { - return __objc_msgSend_729( - obj, - sel, - format, - options, - ); - } - - late final __objc_msgSend_729Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_729 = __objc_msgSend_729Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_attributedStringByInflectingString1 = - _registerName1("attributedStringByInflectingString"); - ffi.Pointer _objc_msgSend_730( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_730( - obj, - sel, - ); - } - - late final __objc_msgSend_730Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_730 = __objc_msgSend_730Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_localizedAttributedStringForKey_value_table_1 = - _registerName1("localizedAttributedStringForKey:value:table:"); - ffi.Pointer _objc_msgSend_731( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ffi.Pointer value, - ffi.Pointer tableName, - ) { - return __objc_msgSend_731( - obj, - sel, - key, - value, - tableName, - ); - } - - late final __objc_msgSend_731Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_731 = __objc_msgSend_731Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_bundleIdentifier1 = _registerName1("bundleIdentifier"); - late final _sel_infoDictionary1 = _registerName1("infoDictionary"); - late final _sel_localizedInfoDictionary1 = - _registerName1("localizedInfoDictionary"); - late final _sel_objectForInfoDictionaryKey_1 = - _registerName1("objectForInfoDictionaryKey:"); - late final _sel_classNamed_1 = _registerName1("classNamed:"); - late final _sel_principalClass1 = _registerName1("principalClass"); - late final _sel_preferredLocalizations1 = - _registerName1("preferredLocalizations"); - late final _sel_localizations1 = _registerName1("localizations"); - late final _sel_developmentLocalization1 = - _registerName1("developmentLocalization"); - late final _sel_preferredLocalizationsFromArray_1 = - _registerName1("preferredLocalizationsFromArray:"); - late final _sel_preferredLocalizationsFromArray_forPreferences_1 = - _registerName1("preferredLocalizationsFromArray:forPreferences:"); - ffi.Pointer _objc_msgSend_732( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer localizationsArray, - ffi.Pointer preferencesArray, - ) { - return __objc_msgSend_732( - obj, - sel, - localizationsArray, - preferencesArray, - ); - } - - late final __objc_msgSend_732Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_732 = __objc_msgSend_732Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_executableArchitectures1 = - _registerName1("executableArchitectures"); - late final _sel_setPreservationPriority_forTags_1 = - _registerName1("setPreservationPriority:forTags:"); - void _objc_msgSend_733( - ffi.Pointer obj, - ffi.Pointer sel, - double priority, - ffi.Pointer tags, - ) { - return __objc_msgSend_733( - obj, - sel, - priority, - tags, - ); - } - - late final __objc_msgSend_733Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Double, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_733 = __objc_msgSend_733Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double, - ffi.Pointer)>(); - - late final _sel_preservationPriorityForTag_1 = - _registerName1("preservationPriorityForTag:"); - late final _class_NSMutableAttributedString1 = - _getClass1("NSMutableAttributedString"); - late final _sel_setAttributes_range_1 = - _registerName1("setAttributes:range:"); - void _objc_msgSend_734( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer attrs, - _NSRange range, - ) { - return __objc_msgSend_734( - obj, - sel, - attrs, - range, - ); - } - - late final __objc_msgSend_734Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_734 = __objc_msgSend_734Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>(); - - late final _sel_mutableString1 = _registerName1("mutableString"); - ffi.Pointer _objc_msgSend_735( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_735( - obj, - sel, - ); - } - - late final __objc_msgSend_735Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_735 = __objc_msgSend_735Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_addAttribute_value_range_1 = - _registerName1("addAttribute:value:range:"); - void _objc_msgSend_736( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer value, - _NSRange range, - ) { - return __objc_msgSend_736( - obj, - sel, - name, - value, - range, - ); - } - - late final __objc_msgSend_736Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_736 = __objc_msgSend_736Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_addAttributes_range_1 = - _registerName1("addAttributes:range:"); - void _objc_msgSend_737( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer attrs, - _NSRange range, - ) { - return __objc_msgSend_737( - obj, - sel, - attrs, - range, - ); - } - - late final __objc_msgSend_737Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_737 = __objc_msgSend_737Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>(); - - late final _sel_removeAttribute_range_1 = - _registerName1("removeAttribute:range:"); - void _objc_msgSend_738( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - _NSRange range, - ) { - return __objc_msgSend_738( - obj, - sel, - name, - range, - ); - } - - late final __objc_msgSend_738Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_738 = __objc_msgSend_738Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>(); - - late final _sel_replaceCharactersInRange_withAttributedString_1 = - _registerName1("replaceCharactersInRange:withAttributedString:"); - void _objc_msgSend_739( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer attrString, - ) { - return __objc_msgSend_739( - obj, - sel, - range, - attrString, - ); - } - - late final __objc_msgSend_739Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - _NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_739 = __objc_msgSend_739Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, _NSRange, - ffi.Pointer)>(); - - late final _sel_insertAttributedString_atIndex_1 = - _registerName1("insertAttributedString:atIndex:"); - void _objc_msgSend_740( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer attrString, - int loc, - ) { - return __objc_msgSend_740( - obj, - sel, - attrString, - loc, - ); - } - - late final __objc_msgSend_740Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_740 = __objc_msgSend_740Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_appendAttributedString_1 = - _registerName1("appendAttributedString:"); - void _objc_msgSend_741( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer attrString, - ) { - return __objc_msgSend_741( - obj, - sel, - attrString, - ); - } - - late final __objc_msgSend_741Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_741 = __objc_msgSend_741Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_setAttributedString_1 = - _registerName1("setAttributedString:"); - late final _sel_beginEditing1 = _registerName1("beginEditing"); - late final _sel_endEditing1 = _registerName1("endEditing"); - late final _sel_appendLocalizedFormat_1 = - _registerName1("appendLocalizedFormat:"); - late final _class_NSDateFormatter1 = _getClass1("NSDateFormatter"); - late final _class_NSFormatter1 = _getClass1("NSFormatter"); - late final _sel_stringForObjectValue_1 = - _registerName1("stringForObjectValue:"); - ffi.Pointer _objc_msgSend_742( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer obj1, - ) { - return __objc_msgSend_742( - obj, - sel, - obj1, - ); - } - - late final __objc_msgSend_742Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_742 = __objc_msgSend_742Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_attributedStringForObjectValue_withDefaultAttributes_1 = - _registerName1("attributedStringForObjectValue:withDefaultAttributes:"); - ffi.Pointer _objc_msgSend_743( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer obj1, - ffi.Pointer attrs, - ) { - return __objc_msgSend_743( - obj, - sel, - obj1, - attrs, - ); - } - - late final __objc_msgSend_743Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_743 = __objc_msgSend_743Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_editingStringForObjectValue_1 = - _registerName1("editingStringForObjectValue:"); - late final _sel_getObjectValue_forString_errorDescription_1 = - _registerName1("getObjectValue:forString:errorDescription:"); - bool _objc_msgSend_744( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> obj1, - ffi.Pointer string, - ffi.Pointer> error, - ) { - return __objc_msgSend_744( - obj, - sel, - obj1, - string, - error, - ); - } - - late final __objc_msgSend_744Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_744 = __objc_msgSend_744Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_isPartialStringValid_newEditingString_errorDescription_1 = - _registerName1("isPartialStringValid:newEditingString:errorDescription:"); - bool _objc_msgSend_745( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer partialString, - ffi.Pointer> newString, - ffi.Pointer> error, - ) { - return __objc_msgSend_745( - obj, - sel, - partialString, - newString, - error, - ); - } - - late final __objc_msgSend_745Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_745 = __objc_msgSend_745Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _sel_isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_1 = - _registerName1( - "isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:"); - bool _objc_msgSend_746( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> partialStringPtr, - ffi.Pointer<_NSRange> proposedSelRangePtr, - ffi.Pointer origString, - _NSRange origSelRange, - ffi.Pointer> error, - ) { - return __objc_msgSend_746( - obj, - sel, - partialStringPtr, - proposedSelRangePtr, - origString, - origSelRange, - error, - ); - } - - late final __objc_msgSend_746Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer<_NSRange>, - ffi.Pointer, - _NSRange, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_746 = __objc_msgSend_746Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer<_NSRange>, - ffi.Pointer, - _NSRange, - ffi.Pointer>)>(); - - late final _sel_formattingContext1 = _registerName1("formattingContext"); - int _objc_msgSend_747( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_747( - obj, - sel, - ); - } - - late final __objc_msgSend_747Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_747 = __objc_msgSend_747Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setFormattingContext_1 = - _registerName1("setFormattingContext:"); - void _objc_msgSend_748( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_748( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_748Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_748 = __objc_msgSend_748Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_getObjectValue_forString_range_error_1 = - _registerName1("getObjectValue:forString:range:error:"); - bool _objc_msgSend_749( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> obj1, - ffi.Pointer string, - ffi.Pointer<_NSRange> rangep, - ffi.Pointer> error, - ) { - return __objc_msgSend_749( - obj, - sel, - obj1, - string, - rangep, - error, - ); - } - - late final __objc_msgSend_749Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer<_NSRange>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_749 = __objc_msgSend_749Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer<_NSRange>, - ffi.Pointer>)>(); - - late final _sel_stringFromDate_1 = _registerName1("stringFromDate:"); - ffi.Pointer _objc_msgSend_750( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, - ) { - return __objc_msgSend_750( - obj, - sel, - date, - ); - } - - late final __objc_msgSend_750Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_750 = __objc_msgSend_750Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dateFromString_1 = _registerName1("dateFromString:"); - late final _sel_localizedStringFromDate_dateStyle_timeStyle_1 = - _registerName1("localizedStringFromDate:dateStyle:timeStyle:"); - ffi.Pointer _objc_msgSend_751( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, - int dstyle, - int tstyle, - ) { - return __objc_msgSend_751( - obj, - sel, - date, - dstyle, - tstyle, - ); - } - - late final __objc_msgSend_751Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_751 = __objc_msgSend_751Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, int)>(); - - late final _sel_dateFormatFromTemplate_options_locale_1 = - _registerName1("dateFormatFromTemplate:options:locale:"); - ffi.Pointer _objc_msgSend_752( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer tmplate, - int opts, - ffi.Pointer locale, - ) { - return __objc_msgSend_752( - obj, - sel, - tmplate, - opts, - locale, - ); - } - - late final __objc_msgSend_752Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_752 = __objc_msgSend_752Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - late final _sel_defaultFormatterBehavior1 = - _registerName1("defaultFormatterBehavior"); - int _objc_msgSend_753( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_753( - obj, - sel, - ); - } - - late final __objc_msgSend_753Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_753 = __objc_msgSend_753Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setDefaultFormatterBehavior_1 = - _registerName1("setDefaultFormatterBehavior:"); - void _objc_msgSend_754( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_754( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_754Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_754 = __objc_msgSend_754Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_setLocalizedDateFormatFromTemplate_1 = - _registerName1("setLocalizedDateFormatFromTemplate:"); - late final _sel_dateFormat1 = _registerName1("dateFormat"); - late final _sel_setDateFormat_1 = _registerName1("setDateFormat:"); - late final _sel_dateStyle1 = _registerName1("dateStyle"); - int _objc_msgSend_755( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_755( - obj, - sel, - ); - } - - late final __objc_msgSend_755Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_755 = __objc_msgSend_755Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setDateStyle_1 = _registerName1("setDateStyle:"); - void _objc_msgSend_756( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_756( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_756Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_756 = __objc_msgSend_756Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_timeStyle1 = _registerName1("timeStyle"); - late final _sel_setTimeStyle_1 = _registerName1("setTimeStyle:"); - late final _sel_locale1 = _registerName1("locale"); - late final _sel_setLocale_1 = _registerName1("setLocale:"); - void _objc_msgSend_757( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_757( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_757Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_757 = __objc_msgSend_757Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_generatesCalendarDates1 = - _registerName1("generatesCalendarDates"); - late final _sel_setGeneratesCalendarDates_1 = - _registerName1("setGeneratesCalendarDates:"); - late final _sel_formatterBehavior1 = _registerName1("formatterBehavior"); - late final _sel_setFormatterBehavior_1 = - _registerName1("setFormatterBehavior:"); - late final _class_NSCalendar1 = _getClass1("NSCalendar"); - late final _sel_currentCalendar1 = _registerName1("currentCalendar"); - ffi.Pointer _objc_msgSend_758( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_758( - obj, - sel, - ); - } - - late final __objc_msgSend_758Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_758 = __objc_msgSend_758Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_autoupdatingCurrentCalendar1 = - _registerName1("autoupdatingCurrentCalendar"); - late final _sel_calendarWithIdentifier_1 = - _registerName1("calendarWithIdentifier:"); - ffi.Pointer _objc_msgSend_759( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer calendarIdentifierConstant, - ) { - return __objc_msgSend_759( - obj, - sel, - calendarIdentifierConstant, - ); - } - - late final __objc_msgSend_759Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_759 = __objc_msgSend_759Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithCalendarIdentifier_1 = - _registerName1("initWithCalendarIdentifier:"); - ffi.Pointer _objc_msgSend_760( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_760( - obj, - sel, - ); - } - - late final __objc_msgSend_760Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_760 = __objc_msgSend_760Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_761( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_761( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_761Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_761 = __objc_msgSend_761Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_firstWeekday1 = _registerName1("firstWeekday"); - late final _sel_setFirstWeekday_1 = _registerName1("setFirstWeekday:"); - late final _sel_minimumDaysInFirstWeek1 = - _registerName1("minimumDaysInFirstWeek"); - late final _sel_setMinimumDaysInFirstWeek_1 = - _registerName1("setMinimumDaysInFirstWeek:"); - late final _sel_eraSymbols1 = _registerName1("eraSymbols"); - late final _sel_longEraSymbols1 = _registerName1("longEraSymbols"); - late final _sel_monthSymbols1 = _registerName1("monthSymbols"); - late final _sel_shortMonthSymbols1 = _registerName1("shortMonthSymbols"); - late final _sel_veryShortMonthSymbols1 = - _registerName1("veryShortMonthSymbols"); - late final _sel_standaloneMonthSymbols1 = - _registerName1("standaloneMonthSymbols"); - late final _sel_shortStandaloneMonthSymbols1 = - _registerName1("shortStandaloneMonthSymbols"); - late final _sel_veryShortStandaloneMonthSymbols1 = - _registerName1("veryShortStandaloneMonthSymbols"); - late final _sel_weekdaySymbols1 = _registerName1("weekdaySymbols"); - late final _sel_shortWeekdaySymbols1 = _registerName1("shortWeekdaySymbols"); - late final _sel_veryShortWeekdaySymbols1 = - _registerName1("veryShortWeekdaySymbols"); - late final _sel_standaloneWeekdaySymbols1 = - _registerName1("standaloneWeekdaySymbols"); - late final _sel_shortStandaloneWeekdaySymbols1 = - _registerName1("shortStandaloneWeekdaySymbols"); - late final _sel_veryShortStandaloneWeekdaySymbols1 = - _registerName1("veryShortStandaloneWeekdaySymbols"); - late final _sel_quarterSymbols1 = _registerName1("quarterSymbols"); - late final _sel_shortQuarterSymbols1 = _registerName1("shortQuarterSymbols"); - late final _sel_standaloneQuarterSymbols1 = - _registerName1("standaloneQuarterSymbols"); - late final _sel_shortStandaloneQuarterSymbols1 = - _registerName1("shortStandaloneQuarterSymbols"); - late final _sel_AMSymbol1 = _registerName1("AMSymbol"); - late final _sel_PMSymbol1 = _registerName1("PMSymbol"); - late final _sel_minimumRangeOfUnit_1 = _registerName1("minimumRangeOfUnit:"); - _NSRange _objc_msgSend_762( - ffi.Pointer obj, - ffi.Pointer sel, - int unit, - ) { - return __objc_msgSend_762( - obj, - sel, - unit, - ); - } - - late final __objc_msgSend_762Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_762 = __objc_msgSend_762Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); - - void _objc_msgSend_762_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - int unit, - ) { - return __objc_msgSend_762_stret( - stret, - obj, - sel, - unit, - ); - } - - late final __objc_msgSend_762_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend_stret'); - late final __objc_msgSend_762_stret = __objc_msgSend_762_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_maximumRangeOfUnit_1 = _registerName1("maximumRangeOfUnit:"); - late final _sel_rangeOfUnit_inUnit_forDate_1 = - _registerName1("rangeOfUnit:inUnit:forDate:"); - _NSRange _objc_msgSend_763( - ffi.Pointer obj, - ffi.Pointer sel, - int smaller, - int larger, - ffi.Pointer date, - ) { - return __objc_msgSend_763( - obj, - sel, - smaller, - larger, - date, - ); - } - - late final __objc_msgSend_763Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_763 = __objc_msgSend_763Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, int, int, - ffi.Pointer)>(); - - void _objc_msgSend_763_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - int smaller, - int larger, - ffi.Pointer date, - ) { - return __objc_msgSend_763_stret( - stret, - obj, - sel, - smaller, - larger, - date, - ); - } - - late final __objc_msgSend_763_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_763_stret = __objc_msgSend_763_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); - - late final _sel_ordinalityOfUnit_inUnit_forDate_1 = - _registerName1("ordinalityOfUnit:inUnit:forDate:"); - int _objc_msgSend_764( - ffi.Pointer obj, - ffi.Pointer sel, - int smaller, - int larger, - ffi.Pointer date, - ) { - return __objc_msgSend_764( - obj, - sel, - smaller, - larger, - date, - ); - } - - late final __objc_msgSend_764Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_764 = __objc_msgSend_764Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int, - ffi.Pointer)>(); - - late final _sel_rangeOfUnit_startDate_interval_forDate_1 = - _registerName1("rangeOfUnit:startDate:interval:forDate:"); - bool _objc_msgSend_765( - ffi.Pointer obj, - ffi.Pointer sel, - int unit, - ffi.Pointer> datep, - ffi.Pointer tip, - ffi.Pointer date, - ) { - return __objc_msgSend_765( - obj, - sel, - unit, - datep, - tip, - date, - ); - } - - late final __objc_msgSend_765Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_765 = __objc_msgSend_765Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSDateComponents1 = _getClass1("NSDateComponents"); - late final _sel_calendar1 = _registerName1("calendar"); - ffi.Pointer _objc_msgSend_766( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_766( - obj, - sel, - ); - } - - late final __objc_msgSend_766Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_766 = __objc_msgSend_766Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setCalendar_1 = _registerName1("setCalendar:"); - void _objc_msgSend_767( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_767( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_767Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_767 = __objc_msgSend_767Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_768( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_768( - obj, - sel, - ); - } - - late final __objc_msgSend_768Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_768 = __objc_msgSend_768Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_769( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_769( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_769Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_769 = __objc_msgSend_769Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_era1 = _registerName1("era"); - late final _sel_setEra_1 = _registerName1("setEra:"); - late final _sel_year1 = _registerName1("year"); - late final _sel_setYear_1 = _registerName1("setYear:"); - late final _sel_month1 = _registerName1("month"); - late final _sel_setMonth_1 = _registerName1("setMonth:"); - late final _sel_day1 = _registerName1("day"); - late final _sel_setDay_1 = _registerName1("setDay:"); - late final _sel_hour1 = _registerName1("hour"); - late final _sel_setHour_1 = _registerName1("setHour:"); - late final _sel_minute1 = _registerName1("minute"); - late final _sel_setMinute_1 = _registerName1("setMinute:"); - late final _sel_second1 = _registerName1("second"); - late final _sel_setSecond_1 = _registerName1("setSecond:"); - late final _sel_nanosecond1 = _registerName1("nanosecond"); - late final _sel_setNanosecond_1 = _registerName1("setNanosecond:"); - late final _sel_weekday1 = _registerName1("weekday"); - late final _sel_setWeekday_1 = _registerName1("setWeekday:"); - late final _sel_weekdayOrdinal1 = _registerName1("weekdayOrdinal"); - late final _sel_setWeekdayOrdinal_1 = _registerName1("setWeekdayOrdinal:"); - late final _sel_quarter1 = _registerName1("quarter"); - late final _sel_setQuarter_1 = _registerName1("setQuarter:"); - late final _sel_weekOfMonth1 = _registerName1("weekOfMonth"); - late final _sel_setWeekOfMonth_1 = _registerName1("setWeekOfMonth:"); - late final _sel_weekOfYear1 = _registerName1("weekOfYear"); - late final _sel_setWeekOfYear_1 = _registerName1("setWeekOfYear:"); - late final _sel_yearForWeekOfYear1 = _registerName1("yearForWeekOfYear"); - late final _sel_setYearForWeekOfYear_1 = - _registerName1("setYearForWeekOfYear:"); - late final _sel_isLeapMonth1 = _registerName1("isLeapMonth"); - late final _sel_setLeapMonth_1 = _registerName1("setLeapMonth:"); - late final _sel_week1 = _registerName1("week"); - late final _sel_setWeek_1 = _registerName1("setWeek:"); - late final _sel_setValue_forComponent_1 = - _registerName1("setValue:forComponent:"); - void _objc_msgSend_770( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - int unit, - ) { - return __objc_msgSend_770( - obj, - sel, - value, - unit, - ); - } - - late final __objc_msgSend_770Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Long, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_770 = __objc_msgSend_770Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - late final _sel_valueForComponent_1 = _registerName1("valueForComponent:"); - int _objc_msgSend_771( - ffi.Pointer obj, - ffi.Pointer sel, - int unit, - ) { - return __objc_msgSend_771( - obj, - sel, - unit, - ); - } - - late final __objc_msgSend_771Ptr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_771 = __objc_msgSend_771Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_isValidDate1 = _registerName1("isValidDate"); - late final _sel_isValidDateInCalendar_1 = - _registerName1("isValidDateInCalendar:"); - bool _objc_msgSend_772( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer calendar, - ) { - return __objc_msgSend_772( - obj, - sel, - calendar, - ); - } - - late final __objc_msgSend_772Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_772 = __objc_msgSend_772Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_dateFromComponents_1 = _registerName1("dateFromComponents:"); - ffi.Pointer _objc_msgSend_773( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer comps, - ) { - return __objc_msgSend_773( - obj, - sel, - comps, - ); - } - - late final __objc_msgSend_773Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_773 = __objc_msgSend_773Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_components_fromDate_1 = - _registerName1("components:fromDate:"); - ffi.Pointer _objc_msgSend_774( - ffi.Pointer obj, - ffi.Pointer sel, - int unitFlags, - ffi.Pointer date, - ) { - return __objc_msgSend_774( - obj, - sel, - unitFlags, - date, - ); - } - - late final __objc_msgSend_774Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_774 = __objc_msgSend_774Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_dateByAddingComponents_toDate_options_1 = - _registerName1("dateByAddingComponents:toDate:options:"); - ffi.Pointer _objc_msgSend_775( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer comps, - ffi.Pointer date, - int opts, - ) { - return __objc_msgSend_775( - obj, - sel, - comps, - date, - opts, - ); - } - - late final __objc_msgSend_775Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_775 = __objc_msgSend_775Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - - late final _sel_components_fromDate_toDate_options_1 = - _registerName1("components:fromDate:toDate:options:"); - ffi.Pointer _objc_msgSend_776( - ffi.Pointer obj, - ffi.Pointer sel, - int unitFlags, - ffi.Pointer startingDate, - ffi.Pointer resultDate, - int opts, - ) { - return __objc_msgSend_776( - obj, - sel, - unitFlags, - startingDate, - resultDate, - opts, - ); - } - - late final __objc_msgSend_776Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_776 = __objc_msgSend_776Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - int)>(); - - late final _sel_getEra_year_month_day_fromDate_1 = - _registerName1("getEra:year:month:day:fromDate:"); - void _objc_msgSend_777( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer eraValuePointer, - ffi.Pointer yearValuePointer, - ffi.Pointer monthValuePointer, - ffi.Pointer dayValuePointer, - ffi.Pointer date, - ) { - return __objc_msgSend_777( - obj, - sel, - eraValuePointer, - yearValuePointer, - monthValuePointer, - dayValuePointer, - date, - ); - } - - late final __objc_msgSend_777Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_777 = __objc_msgSend_777Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_1 = - _registerName1("getEra:yearForWeekOfYear:weekOfYear:weekday:fromDate:"); - late final _sel_getHour_minute_second_nanosecond_fromDate_1 = - _registerName1("getHour:minute:second:nanosecond:fromDate:"); - late final _sel_component_fromDate_1 = _registerName1("component:fromDate:"); - int _objc_msgSend_778( - ffi.Pointer obj, - ffi.Pointer sel, - int unit, - ffi.Pointer date, - ) { - return __objc_msgSend_778( - obj, - sel, - unit, - date, - ); - } - - late final __objc_msgSend_778Ptr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_778 = __objc_msgSend_778Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _sel_dateWithEra_year_month_day_hour_minute_second_nanosecond_1 = - _registerName1( - "dateWithEra:year:month:day:hour:minute:second:nanosecond:"); - ffi.Pointer _objc_msgSend_779( - ffi.Pointer obj, - ffi.Pointer sel, - int eraValue, - int yearValue, - int monthValue, - int dayValue, - int hourValue, - int minuteValue, - int secondValue, - int nanosecondValue, - ) { - return __objc_msgSend_779( - obj, - sel, - eraValue, - yearValue, - monthValue, - dayValue, - hourValue, - minuteValue, - secondValue, - nanosecondValue, - ); - } - - late final __objc_msgSend_779Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_779 = __objc_msgSend_779Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int, int, int, int, int, int, int)>(); - - late final _sel_dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_1 = - _registerName1( - "dateWithEra:yearForWeekOfYear:weekOfYear:weekday:hour:minute:second:nanosecond:"); - late final _sel_startOfDayForDate_1 = _registerName1("startOfDayForDate:"); - late final _sel_componentsInTimeZone_fromDate_1 = - _registerName1("componentsInTimeZone:fromDate:"); - ffi.Pointer _objc_msgSend_780( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer timezone, - ffi.Pointer date, - ) { - return __objc_msgSend_780( - obj, - sel, - timezone, - date, - ); - } - - late final __objc_msgSend_780Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_780 = __objc_msgSend_780Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_compareDate_toDate_toUnitGranularity_1 = - _registerName1("compareDate:toDate:toUnitGranularity:"); - int _objc_msgSend_781( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date1, - ffi.Pointer date2, - int unit, - ) { - return __objc_msgSend_781( - obj, - sel, - date1, - date2, - unit, - ); - } - - late final __objc_msgSend_781Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_781 = __objc_msgSend_781Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_isDate_equalToDate_toUnitGranularity_1 = - _registerName1("isDate:equalToDate:toUnitGranularity:"); - bool _objc_msgSend_782( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date1, - ffi.Pointer date2, - int unit, - ) { - return __objc_msgSend_782( - obj, - sel, - date1, - date2, - unit, - ); - } - - late final __objc_msgSend_782Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_782 = __objc_msgSend_782Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_isDate_inSameDayAsDate_1 = - _registerName1("isDate:inSameDayAsDate:"); - bool _objc_msgSend_783( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date1, - ffi.Pointer date2, - ) { - return __objc_msgSend_783( - obj, - sel, - date1, - date2, - ); - } - - late final __objc_msgSend_783Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_783 = __objc_msgSend_783Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_isDateInToday_1 = _registerName1("isDateInToday:"); - late final _sel_isDateInYesterday_1 = _registerName1("isDateInYesterday:"); - late final _sel_isDateInTomorrow_1 = _registerName1("isDateInTomorrow:"); - late final _sel_isDateInWeekend_1 = _registerName1("isDateInWeekend:"); - late final _sel_rangeOfWeekendStartDate_interval_containingDate_1 = - _registerName1("rangeOfWeekendStartDate:interval:containingDate:"); - bool _objc_msgSend_784( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> datep, - ffi.Pointer tip, - ffi.Pointer date, - ) { - return __objc_msgSend_784( - obj, - sel, - datep, - tip, - date, - ); - } - - late final __objc_msgSend_784Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_784 = __objc_msgSend_784Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_nextWeekendStartDate_interval_options_afterDate_1 = - _registerName1("nextWeekendStartDate:interval:options:afterDate:"); - bool _objc_msgSend_785( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> datep, - ffi.Pointer tip, - int options, - ffi.Pointer date, - ) { - return __objc_msgSend_785( - obj, - sel, - datep, - tip, - options, - date, - ); - } - - late final __objc_msgSend_785Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_785 = __objc_msgSend_785Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - int, - ffi.Pointer)>(); - - late final _sel_components_fromDateComponents_toDateComponents_options_1 = - _registerName1("components:fromDateComponents:toDateComponents:options:"); - ffi.Pointer _objc_msgSend_786( - ffi.Pointer obj, - ffi.Pointer sel, - int unitFlags, - ffi.Pointer startingDateComp, - ffi.Pointer resultDateComp, - int options, - ) { - return __objc_msgSend_786( - obj, - sel, - unitFlags, - startingDateComp, - resultDateComp, - options, - ); - } - - late final __objc_msgSend_786Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_786 = __objc_msgSend_786Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - int)>(); - - late final _sel_dateByAddingUnit_value_toDate_options_1 = - _registerName1("dateByAddingUnit:value:toDate:options:"); - ffi.Pointer _objc_msgSend_787( - ffi.Pointer obj, - ffi.Pointer sel, - int unit, - int value, - ffi.Pointer date, - int options, - ) { - return __objc_msgSend_787( - obj, - sel, - unit, - value, - date, - options, - ); - } - - late final __objc_msgSend_787Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Long, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_787 = __objc_msgSend_787Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer, int)>(); - - late final _sel_enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_1 = - _registerName1( - "enumerateDatesStartingAfterDate:matchingComponents:options:usingBlock:"); - void _objc_msgSend_788( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer start, - ffi.Pointer comps, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_788( - obj, - sel, - start, - comps, - opts, - block, - ); - } - - late final __objc_msgSend_788Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_788 = __objc_msgSend_788Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_nextDateAfterDate_matchingComponents_options_1 = - _registerName1("nextDateAfterDate:matchingComponents:options:"); - ffi.Pointer _objc_msgSend_789( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, - ffi.Pointer comps, - int options, - ) { - return __objc_msgSend_789( - obj, - sel, - date, - comps, - options, - ); - } - - late final __objc_msgSend_789Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_789 = __objc_msgSend_789Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - - late final _sel_nextDateAfterDate_matchingUnit_value_options_1 = - _registerName1("nextDateAfterDate:matchingUnit:value:options:"); - ffi.Pointer _objc_msgSend_790( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, - int unit, - int value, - int options, - ) { - return __objc_msgSend_790( - obj, - sel, - date, - unit, - value, - options, - ); - } - - late final __objc_msgSend_790Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Long, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_790 = __objc_msgSend_790Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, int, int)>(); - - late final _sel_nextDateAfterDate_matchingHour_minute_second_options_1 = - _registerName1("nextDateAfterDate:matchingHour:minute:second:options:"); - ffi.Pointer _objc_msgSend_791( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, - int hourValue, - int minuteValue, - int secondValue, - int options, - ) { - return __objc_msgSend_791( - obj, - sel, - date, - hourValue, - minuteValue, - secondValue, - options, - ); - } - - late final __objc_msgSend_791Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_791 = __objc_msgSend_791Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, int, int, int)>(); - - late final _sel_dateBySettingUnit_value_ofDate_options_1 = - _registerName1("dateBySettingUnit:value:ofDate:options:"); - late final _sel_dateBySettingHour_minute_second_ofDate_options_1 = - _registerName1("dateBySettingHour:minute:second:ofDate:options:"); - ffi.Pointer _objc_msgSend_792( - ffi.Pointer obj, - ffi.Pointer sel, - int h, - int m, - int s, - ffi.Pointer date, - int opts, - ) { - return __objc_msgSend_792( - obj, - sel, - h, - m, - s, - date, - opts, - ); - } - - late final __objc_msgSend_792Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_792 = __objc_msgSend_792Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int, int, ffi.Pointer, int)>(); - - late final _sel_date_matchesComponents_1 = - _registerName1("date:matchesComponents:"); - bool _objc_msgSend_793( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, - ffi.Pointer components, - ) { - return __objc_msgSend_793( - obj, - sel, - date, - components, - ); - } - - late final __objc_msgSend_793Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_793 = __objc_msgSend_793Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_794( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_794( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_794Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_794 = __objc_msgSend_794Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_isLenient1 = _registerName1("isLenient"); - late final _sel_setLenient_1 = _registerName1("setLenient:"); - late final _sel_twoDigitStartDate1 = _registerName1("twoDigitStartDate"); - late final _sel_setTwoDigitStartDate_1 = - _registerName1("setTwoDigitStartDate:"); - void _objc_msgSend_795( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_795( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_795Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_795 = __objc_msgSend_795Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_defaultDate1 = _registerName1("defaultDate"); - late final _sel_setDefaultDate_1 = _registerName1("setDefaultDate:"); - late final _sel_setEraSymbols_1 = _registerName1("setEraSymbols:"); - void _objc_msgSend_796( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_796( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_796Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_796 = __objc_msgSend_796Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_setMonthSymbols_1 = _registerName1("setMonthSymbols:"); - late final _sel_setShortMonthSymbols_1 = - _registerName1("setShortMonthSymbols:"); - late final _sel_setWeekdaySymbols_1 = _registerName1("setWeekdaySymbols:"); - late final _sel_setShortWeekdaySymbols_1 = - _registerName1("setShortWeekdaySymbols:"); - late final _sel_setAMSymbol_1 = _registerName1("setAMSymbol:"); - late final _sel_setPMSymbol_1 = _registerName1("setPMSymbol:"); - late final _sel_setLongEraSymbols_1 = _registerName1("setLongEraSymbols:"); - late final _sel_setVeryShortMonthSymbols_1 = - _registerName1("setVeryShortMonthSymbols:"); - late final _sel_setStandaloneMonthSymbols_1 = - _registerName1("setStandaloneMonthSymbols:"); - late final _sel_setShortStandaloneMonthSymbols_1 = - _registerName1("setShortStandaloneMonthSymbols:"); - late final _sel_setVeryShortStandaloneMonthSymbols_1 = - _registerName1("setVeryShortStandaloneMonthSymbols:"); - late final _sel_setVeryShortWeekdaySymbols_1 = - _registerName1("setVeryShortWeekdaySymbols:"); - late final _sel_setStandaloneWeekdaySymbols_1 = - _registerName1("setStandaloneWeekdaySymbols:"); - late final _sel_setShortStandaloneWeekdaySymbols_1 = - _registerName1("setShortStandaloneWeekdaySymbols:"); - late final _sel_setVeryShortStandaloneWeekdaySymbols_1 = - _registerName1("setVeryShortStandaloneWeekdaySymbols:"); - late final _sel_setQuarterSymbols_1 = _registerName1("setQuarterSymbols:"); - late final _sel_setShortQuarterSymbols_1 = - _registerName1("setShortQuarterSymbols:"); - late final _sel_setStandaloneQuarterSymbols_1 = - _registerName1("setStandaloneQuarterSymbols:"); - late final _sel_setShortStandaloneQuarterSymbols_1 = - _registerName1("setShortStandaloneQuarterSymbols:"); - late final _sel_gregorianStartDate1 = _registerName1("gregorianStartDate"); - late final _sel_setGregorianStartDate_1 = - _registerName1("setGregorianStartDate:"); - late final _sel_doesRelativeDateFormatting1 = - _registerName1("doesRelativeDateFormatting"); - late final _sel_setDoesRelativeDateFormatting_1 = - _registerName1("setDoesRelativeDateFormatting:"); - late final _sel_initWithDateFormat_allowNaturalLanguage_1 = - _registerName1("initWithDateFormat:allowNaturalLanguage:"); - late final _sel_allowsNaturalLanguage1 = - _registerName1("allowsNaturalLanguage"); - late final _class_NSNumberFormatter1 = _getClass1("NSNumberFormatter"); - late final _sel_stringFromNumber_1 = _registerName1("stringFromNumber:"); - ffi.Pointer _objc_msgSend_797( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer number, - ) { - return __objc_msgSend_797( - obj, - sel, - number, - ); - } - - late final __objc_msgSend_797Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_797 = __objc_msgSend_797Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_numberFromString_1 = _registerName1("numberFromString:"); - ffi.Pointer _objc_msgSend_798( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - ) { - return __objc_msgSend_798( - obj, - sel, - string, - ); - } - - late final __objc_msgSend_798Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_798 = __objc_msgSend_798Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_localizedStringFromNumber_numberStyle_1 = - _registerName1("localizedStringFromNumber:numberStyle:"); - ffi.Pointer _objc_msgSend_799( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer num, - int nstyle, - ) { - return __objc_msgSend_799( - obj, - sel, - num, - nstyle, - ); - } - - late final __objc_msgSend_799Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_799 = __objc_msgSend_799Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - int _objc_msgSend_800( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_800( - obj, - sel, - ); - } - - late final __objc_msgSend_800Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_800 = __objc_msgSend_800Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_801( - ffi.Pointer obj, - ffi.Pointer sel, - int behavior, - ) { - return __objc_msgSend_801( - obj, - sel, - behavior, - ); - } - - late final __objc_msgSend_801Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_801 = __objc_msgSend_801Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_numberStyle1 = _registerName1("numberStyle"); - int _objc_msgSend_802( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_802( - obj, - sel, - ); - } - - late final __objc_msgSend_802Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_802 = __objc_msgSend_802Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setNumberStyle_1 = _registerName1("setNumberStyle:"); - void _objc_msgSend_803( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_803( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_803Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_803 = __objc_msgSend_803Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_generatesDecimalNumbers1 = - _registerName1("generatesDecimalNumbers"); - late final _sel_setGeneratesDecimalNumbers_1 = - _registerName1("setGeneratesDecimalNumbers:"); - void _objc_msgSend_804( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_804( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_804Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_804 = __objc_msgSend_804Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_negativeFormat1 = _registerName1("negativeFormat"); - late final _sel_setNegativeFormat_1 = _registerName1("setNegativeFormat:"); - late final _sel_textAttributesForNegativeValues1 = - _registerName1("textAttributesForNegativeValues"); - late final _sel_setTextAttributesForNegativeValues_1 = - _registerName1("setTextAttributesForNegativeValues:"); - late final _sel_positiveFormat1 = _registerName1("positiveFormat"); - late final _sel_setPositiveFormat_1 = _registerName1("setPositiveFormat:"); - late final _sel_textAttributesForPositiveValues1 = - _registerName1("textAttributesForPositiveValues"); - late final _sel_setTextAttributesForPositiveValues_1 = - _registerName1("setTextAttributesForPositiveValues:"); - late final _sel_allowsFloats1 = _registerName1("allowsFloats"); - late final _sel_setAllowsFloats_1 = _registerName1("setAllowsFloats:"); - late final _sel_setDecimalSeparator_1 = - _registerName1("setDecimalSeparator:"); - late final _sel_alwaysShowsDecimalSeparator1 = - _registerName1("alwaysShowsDecimalSeparator"); - late final _sel_setAlwaysShowsDecimalSeparator_1 = - _registerName1("setAlwaysShowsDecimalSeparator:"); - late final _sel_currencyDecimalSeparator1 = - _registerName1("currencyDecimalSeparator"); - late final _sel_setCurrencyDecimalSeparator_1 = - _registerName1("setCurrencyDecimalSeparator:"); - late final _sel_usesGroupingSeparator1 = - _registerName1("usesGroupingSeparator"); - late final _sel_setUsesGroupingSeparator_1 = - _registerName1("setUsesGroupingSeparator:"); - late final _sel_setGroupingSeparator_1 = - _registerName1("setGroupingSeparator:"); - late final _sel_zeroSymbol1 = _registerName1("zeroSymbol"); - late final _sel_setZeroSymbol_1 = _registerName1("setZeroSymbol:"); - late final _sel_textAttributesForZero1 = - _registerName1("textAttributesForZero"); - late final _sel_setTextAttributesForZero_1 = - _registerName1("setTextAttributesForZero:"); - late final _sel_nilSymbol1 = _registerName1("nilSymbol"); - late final _sel_setNilSymbol_1 = _registerName1("setNilSymbol:"); - late final _sel_textAttributesForNil1 = - _registerName1("textAttributesForNil"); - late final _sel_setTextAttributesForNil_1 = - _registerName1("setTextAttributesForNil:"); - late final _sel_notANumberSymbol1 = _registerName1("notANumberSymbol"); - late final _sel_setNotANumberSymbol_1 = - _registerName1("setNotANumberSymbol:"); - late final _sel_textAttributesForNotANumber1 = - _registerName1("textAttributesForNotANumber"); - late final _sel_setTextAttributesForNotANumber_1 = - _registerName1("setTextAttributesForNotANumber:"); - late final _sel_positiveInfinitySymbol1 = - _registerName1("positiveInfinitySymbol"); - late final _sel_setPositiveInfinitySymbol_1 = - _registerName1("setPositiveInfinitySymbol:"); - late final _sel_textAttributesForPositiveInfinity1 = - _registerName1("textAttributesForPositiveInfinity"); - late final _sel_setTextAttributesForPositiveInfinity_1 = - _registerName1("setTextAttributesForPositiveInfinity:"); - late final _sel_negativeInfinitySymbol1 = - _registerName1("negativeInfinitySymbol"); - late final _sel_setNegativeInfinitySymbol_1 = - _registerName1("setNegativeInfinitySymbol:"); - late final _sel_textAttributesForNegativeInfinity1 = - _registerName1("textAttributesForNegativeInfinity"); - late final _sel_setTextAttributesForNegativeInfinity_1 = - _registerName1("setTextAttributesForNegativeInfinity:"); - late final _sel_positivePrefix1 = _registerName1("positivePrefix"); - late final _sel_setPositivePrefix_1 = _registerName1("setPositivePrefix:"); - late final _sel_positiveSuffix1 = _registerName1("positiveSuffix"); - late final _sel_setPositiveSuffix_1 = _registerName1("setPositiveSuffix:"); - late final _sel_negativePrefix1 = _registerName1("negativePrefix"); - late final _sel_setNegativePrefix_1 = _registerName1("setNegativePrefix:"); - late final _sel_negativeSuffix1 = _registerName1("negativeSuffix"); - late final _sel_setNegativeSuffix_1 = _registerName1("setNegativeSuffix:"); - late final _sel_setCurrencyCode_1 = _registerName1("setCurrencyCode:"); - late final _sel_setCurrencySymbol_1 = _registerName1("setCurrencySymbol:"); - late final _sel_internationalCurrencySymbol1 = - _registerName1("internationalCurrencySymbol"); - late final _sel_setInternationalCurrencySymbol_1 = - _registerName1("setInternationalCurrencySymbol:"); - late final _sel_percentSymbol1 = _registerName1("percentSymbol"); - late final _sel_setPercentSymbol_1 = _registerName1("setPercentSymbol:"); - late final _sel_perMillSymbol1 = _registerName1("perMillSymbol"); - late final _sel_setPerMillSymbol_1 = _registerName1("setPerMillSymbol:"); - late final _sel_minusSign1 = _registerName1("minusSign"); - late final _sel_setMinusSign_1 = _registerName1("setMinusSign:"); - late final _sel_plusSign1 = _registerName1("plusSign"); - late final _sel_setPlusSign_1 = _registerName1("setPlusSign:"); - late final _sel_exponentSymbol1 = _registerName1("exponentSymbol"); - late final _sel_setExponentSymbol_1 = _registerName1("setExponentSymbol:"); - late final _sel_groupingSize1 = _registerName1("groupingSize"); - late final _sel_setGroupingSize_1 = _registerName1("setGroupingSize:"); - late final _sel_secondaryGroupingSize1 = - _registerName1("secondaryGroupingSize"); - late final _sel_setSecondaryGroupingSize_1 = - _registerName1("setSecondaryGroupingSize:"); - late final _sel_multiplier1 = _registerName1("multiplier"); - late final _sel_setMultiplier_1 = _registerName1("setMultiplier:"); - late final _sel_formatWidth1 = _registerName1("formatWidth"); - late final _sel_setFormatWidth_1 = _registerName1("setFormatWidth:"); - late final _sel_paddingCharacter1 = _registerName1("paddingCharacter"); - late final _sel_setPaddingCharacter_1 = - _registerName1("setPaddingCharacter:"); - late final _sel_paddingPosition1 = _registerName1("paddingPosition"); - int _objc_msgSend_805( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_805( - obj, - sel, - ); - } - - late final __objc_msgSend_805Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_805 = __objc_msgSend_805Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setPaddingPosition_1 = _registerName1("setPaddingPosition:"); - void _objc_msgSend_806( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_806( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_806Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_806 = __objc_msgSend_806Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_roundingMode1 = _registerName1("roundingMode"); - int _objc_msgSend_807( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_807( - obj, - sel, - ); - } - - late final __objc_msgSend_807Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_807 = __objc_msgSend_807Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setRoundingMode_1 = _registerName1("setRoundingMode:"); - void _objc_msgSend_808( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_808( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_808Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_808 = __objc_msgSend_808Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_roundingIncrement1 = _registerName1("roundingIncrement"); - ffi.Pointer _objc_msgSend_809( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_809( - obj, - sel, - ); - } - - late final __objc_msgSend_809Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_809 = __objc_msgSend_809Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setRoundingIncrement_1 = - _registerName1("setRoundingIncrement:"); - void _objc_msgSend_810( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_810( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_810Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_810 = __objc_msgSend_810Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_minimumIntegerDigits1 = - _registerName1("minimumIntegerDigits"); - late final _sel_setMinimumIntegerDigits_1 = - _registerName1("setMinimumIntegerDigits:"); - late final _sel_maximumIntegerDigits1 = - _registerName1("maximumIntegerDigits"); - late final _sel_setMaximumIntegerDigits_1 = - _registerName1("setMaximumIntegerDigits:"); - late final _sel_minimumFractionDigits1 = - _registerName1("minimumFractionDigits"); - late final _sel_setMinimumFractionDigits_1 = - _registerName1("setMinimumFractionDigits:"); - late final _sel_maximumFractionDigits1 = - _registerName1("maximumFractionDigits"); - late final _sel_setMaximumFractionDigits_1 = - _registerName1("setMaximumFractionDigits:"); - late final _sel_minimum1 = _registerName1("minimum"); - late final _sel_setMinimum_1 = _registerName1("setMinimum:"); - late final _sel_maximum1 = _registerName1("maximum"); - late final _sel_setMaximum_1 = _registerName1("setMaximum:"); - late final _sel_currencyGroupingSeparator1 = - _registerName1("currencyGroupingSeparator"); - late final _sel_setCurrencyGroupingSeparator_1 = - _registerName1("setCurrencyGroupingSeparator:"); - late final _sel_usesSignificantDigits1 = - _registerName1("usesSignificantDigits"); - late final _sel_setUsesSignificantDigits_1 = - _registerName1("setUsesSignificantDigits:"); - late final _sel_minimumSignificantDigits1 = - _registerName1("minimumSignificantDigits"); - late final _sel_setMinimumSignificantDigits_1 = - _registerName1("setMinimumSignificantDigits:"); - late final _sel_maximumSignificantDigits1 = - _registerName1("maximumSignificantDigits"); - late final _sel_setMaximumSignificantDigits_1 = - _registerName1("setMaximumSignificantDigits:"); - late final _sel_isPartialStringValidationEnabled1 = - _registerName1("isPartialStringValidationEnabled"); - late final _sel_setPartialStringValidationEnabled_1 = - _registerName1("setPartialStringValidationEnabled:"); - late final _sel_hasThousandSeparators1 = - _registerName1("hasThousandSeparators"); - late final _sel_setHasThousandSeparators_1 = - _registerName1("setHasThousandSeparators:"); - late final _sel_thousandSeparator1 = _registerName1("thousandSeparator"); - late final _sel_setThousandSeparator_1 = - _registerName1("setThousandSeparator:"); - late final _sel_localizesFormat1 = _registerName1("localizesFormat"); - late final _sel_setLocalizesFormat_1 = _registerName1("setLocalizesFormat:"); - late final _sel_format1 = _registerName1("format"); - late final _sel_setFormat_1 = _registerName1("setFormat:"); - late final _sel_attributedStringForZero1 = - _registerName1("attributedStringForZero"); - late final _sel_setAttributedStringForZero_1 = - _registerName1("setAttributedStringForZero:"); - void _objc_msgSend_811( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_811( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_811Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_811 = __objc_msgSend_811Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_attributedStringForNil1 = - _registerName1("attributedStringForNil"); - late final _sel_setAttributedStringForNil_1 = - _registerName1("setAttributedStringForNil:"); - late final _sel_attributedStringForNotANumber1 = - _registerName1("attributedStringForNotANumber"); - late final _sel_setAttributedStringForNotANumber_1 = - _registerName1("setAttributedStringForNotANumber:"); - late final _class_NSDecimalNumberHandler1 = - _getClass1("NSDecimalNumberHandler"); - late final _sel_defaultDecimalNumberHandler1 = - _registerName1("defaultDecimalNumberHandler"); - ffi.Pointer _objc_msgSend_812( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_812( - obj, - sel, - ); - } - - late final __objc_msgSend_812Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_812 = __objc_msgSend_812Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1 = - _registerName1( - "initWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:"); - instancetype _objc_msgSend_813( - ffi.Pointer obj, - ffi.Pointer sel, - int roundingMode, - int scale, - bool exact, - bool overflow, - bool underflow, - bool divideByZero, - ) { - return __objc_msgSend_813( - obj, - sel, - roundingMode, - scale, - exact, - overflow, - underflow, - divideByZero, - ); - } - - late final __objc_msgSend_813Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Short, - ffi.Bool, - ffi.Bool, - ffi.Bool, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_813 = __objc_msgSend_813Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, int, - int, bool, bool, bool, bool)>(); - - late final _sel_decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1 = - _registerName1( - "decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:"); - late final _sel_roundingBehavior1 = _registerName1("roundingBehavior"); - late final _sel_setRoundingBehavior_1 = - _registerName1("setRoundingBehavior:"); - void _objc_msgSend_814( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_814( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_814Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_814 = __objc_msgSend_814Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSScanner1 = _getClass1("NSScanner"); - late final _sel_scanLocation1 = _registerName1("scanLocation"); - late final _sel_setScanLocation_1 = _registerName1("setScanLocation:"); - late final _sel_charactersToBeSkipped1 = - _registerName1("charactersToBeSkipped"); - ffi.Pointer _objc_msgSend_815( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_815( - obj, - sel, - ); - } - - late final __objc_msgSend_815Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_815 = __objc_msgSend_815Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setCharactersToBeSkipped_1 = - _registerName1("setCharactersToBeSkipped:"); - void _objc_msgSend_816( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_816( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_816Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_816 = __objc_msgSend_816Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_caseSensitive1 = _registerName1("caseSensitive"); - late final _sel_setCaseSensitive_1 = _registerName1("setCaseSensitive:"); - late final _sel_scanInt_1 = _registerName1("scanInt:"); - bool _objc_msgSend_817( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer result, - ) { - return __objc_msgSend_817( - obj, - sel, - result, - ); - } - - late final __objc_msgSend_817Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_817 = __objc_msgSend_817Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_scanInteger_1 = _registerName1("scanInteger:"); - bool _objc_msgSend_818( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer result, - ) { - return __objc_msgSend_818( - obj, - sel, - result, - ); - } - - late final __objc_msgSend_818Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_818 = __objc_msgSend_818Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_scanLongLong_1 = _registerName1("scanLongLong:"); - bool _objc_msgSend_819( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer result, - ) { - return __objc_msgSend_819( - obj, - sel, - result, - ); - } - - late final __objc_msgSend_819Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_819 = __objc_msgSend_819Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_scanUnsignedLongLong_1 = - _registerName1("scanUnsignedLongLong:"); - bool _objc_msgSend_820( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer result, - ) { - return __objc_msgSend_820( - obj, - sel, - result, - ); - } - - late final __objc_msgSend_820Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_820 = __objc_msgSend_820Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_scanFloat_1 = _registerName1("scanFloat:"); - bool _objc_msgSend_821( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer result, - ) { - return __objc_msgSend_821( - obj, - sel, - result, - ); - } - - late final __objc_msgSend_821Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_821 = __objc_msgSend_821Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_scanDouble_1 = _registerName1("scanDouble:"); - bool _objc_msgSend_822( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer result, - ) { - return __objc_msgSend_822( - obj, - sel, - result, - ); - } - - late final __objc_msgSend_822Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_822 = __objc_msgSend_822Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_scanHexInt_1 = _registerName1("scanHexInt:"); - bool _objc_msgSend_823( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer result, - ) { - return __objc_msgSend_823( - obj, - sel, - result, - ); - } - - late final __objc_msgSend_823Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_823 = __objc_msgSend_823Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_scanHexLongLong_1 = _registerName1("scanHexLongLong:"); - late final _sel_scanHexFloat_1 = _registerName1("scanHexFloat:"); - late final _sel_scanHexDouble_1 = _registerName1("scanHexDouble:"); - late final _sel_scanString_intoString_1 = - _registerName1("scanString:intoString:"); - bool _objc_msgSend_824( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - ffi.Pointer> result, - ) { - return __objc_msgSend_824( - obj, - sel, - string, - result, - ); - } - - late final __objc_msgSend_824Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_824 = __objc_msgSend_824Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final _sel_scanCharactersFromSet_intoString_1 = - _registerName1("scanCharactersFromSet:intoString:"); - bool _objc_msgSend_825( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer set1, - ffi.Pointer> result, - ) { - return __objc_msgSend_825( - obj, - sel, - set1, - result, - ); - } - - late final __objc_msgSend_825Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_825 = __objc_msgSend_825Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final _sel_scanUpToString_intoString_1 = - _registerName1("scanUpToString:intoString:"); - late final _sel_scanUpToCharactersFromSet_intoString_1 = - _registerName1("scanUpToCharactersFromSet:intoString:"); - late final _sel_isAtEnd1 = _registerName1("isAtEnd"); - late final _sel_scannerWithString_1 = _registerName1("scannerWithString:"); - late final _sel_localizedScannerWithString_1 = - _registerName1("localizedScannerWithString:"); - late final _sel_scanDecimal_1 = _registerName1("scanDecimal:"); - bool _objc_msgSend_826( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dcm, - ) { - return __objc_msgSend_826( - obj, - sel, - dcm, - ); - } - - late final __objc_msgSend_826Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_826 = __objc_msgSend_826Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSException1 = _getClass1("NSException"); - late final _sel_exceptionWithName_reason_userInfo_1 = - _registerName1("exceptionWithName:reason:userInfo:"); - ffi.Pointer _objc_msgSend_827( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer reason, - ffi.Pointer userInfo, - ) { - return __objc_msgSend_827( - obj, - sel, - name, - reason, - userInfo, - ); - } - - late final __objc_msgSend_827Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_827 = __objc_msgSend_827Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithName_reason_userInfo_1 = - _registerName1("initWithName:reason:userInfo:"); - instancetype _objc_msgSend_828( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aName, - ffi.Pointer aReason, - ffi.Pointer aUserInfo, - ) { - return __objc_msgSend_828( - obj, - sel, - aName, - aReason, - aUserInfo, - ); - } - - late final __objc_msgSend_828Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_828 = __objc_msgSend_828Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_reason1 = _registerName1("reason"); - late final _sel_raise1 = _registerName1("raise"); - late final _sel_raise_format_1 = _registerName1("raise:format:"); - late final _sel_raise_format_arguments_1 = - _registerName1("raise:format:arguments:"); - void _objc_msgSend_829( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer format, - ffi.Pointer argList, - ) { - return __objc_msgSend_829( - obj, - sel, - name, - format, - argList, - ); - } - - late final __objc_msgSend_829Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_829 = __objc_msgSend_829Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSFileHandle1 = _getClass1("NSFileHandle"); - late final _sel_availableData1 = _registerName1("availableData"); - late final _sel_initWithFileDescriptor_closeOnDealloc_1 = - _registerName1("initWithFileDescriptor:closeOnDealloc:"); - instancetype _objc_msgSend_830( - ffi.Pointer obj, - ffi.Pointer sel, - int fd, - bool closeopt, - ) { - return __objc_msgSend_830( - obj, - sel, - fd, - closeopt, - ); - } - - late final __objc_msgSend_830Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Int, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_830 = __objc_msgSend_830Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int, bool)>(); - - late final _sel_readDataToEndOfFileAndReturnError_1 = - _registerName1("readDataToEndOfFileAndReturnError:"); - ffi.Pointer _objc_msgSend_831( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> error, - ) { - return __objc_msgSend_831( - obj, - sel, - error, - ); - } - - late final __objc_msgSend_831Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_831 = __objc_msgSend_831Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final _sel_readDataUpToLength_error_1 = - _registerName1("readDataUpToLength:error:"); - ffi.Pointer _objc_msgSend_832( - ffi.Pointer obj, - ffi.Pointer sel, - int length, - ffi.Pointer> error, - ) { - return __objc_msgSend_832( - obj, - sel, - length, - error, - ); - } - - late final __objc_msgSend_832Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_832 = __objc_msgSend_832Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer>)>(); - - late final _sel_writeData_error_1 = _registerName1("writeData:error:"); - bool _objc_msgSend_833( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ffi.Pointer> error, - ) { - return __objc_msgSend_833( - obj, - sel, - data, - error, - ); - } - - late final __objc_msgSend_833Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_833 = __objc_msgSend_833Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final _sel_getOffset_error_1 = _registerName1("getOffset:error:"); - bool _objc_msgSend_834( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer offsetInFile, - ffi.Pointer> error, - ) { - return __objc_msgSend_834( - obj, - sel, - offsetInFile, - error, - ); - } - - late final __objc_msgSend_834Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_834 = __objc_msgSend_834Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_seekToEndReturningOffset_error_1 = - _registerName1("seekToEndReturningOffset:error:"); - late final _sel_seekToOffset_error_1 = _registerName1("seekToOffset:error:"); - bool _objc_msgSend_835( - ffi.Pointer obj, - ffi.Pointer sel, - int offset, - ffi.Pointer> error, - ) { - return __objc_msgSend_835( - obj, - sel, - offset, - error, - ); - } - - late final __objc_msgSend_835Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLongLong, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_835 = __objc_msgSend_835Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer>)>(); - - late final _sel_truncateAtOffset_error_1 = - _registerName1("truncateAtOffset:error:"); - late final _sel_synchronizeAndReturnError_1 = - _registerName1("synchronizeAndReturnError:"); - late final _sel_closeAndReturnError_1 = - _registerName1("closeAndReturnError:"); - late final _sel_fileHandleWithStandardInput1 = - _registerName1("fileHandleWithStandardInput"); - ffi.Pointer _objc_msgSend_836( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_836( - obj, - sel, - ); - } - - late final __objc_msgSend_836Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_836 = __objc_msgSend_836Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_fileHandleWithStandardOutput1 = - _registerName1("fileHandleWithStandardOutput"); - late final _sel_fileHandleWithStandardError1 = - _registerName1("fileHandleWithStandardError"); - late final _sel_fileHandleWithNullDevice1 = - _registerName1("fileHandleWithNullDevice"); - late final _sel_fileHandleForReadingAtPath_1 = - _registerName1("fileHandleForReadingAtPath:"); - late final _sel_fileHandleForWritingAtPath_1 = - _registerName1("fileHandleForWritingAtPath:"); - late final _sel_fileHandleForUpdatingAtPath_1 = - _registerName1("fileHandleForUpdatingAtPath:"); - late final _sel_fileHandleForReadingFromURL_error_1 = - _registerName1("fileHandleForReadingFromURL:error:"); - instancetype _objc_msgSend_837( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> error, - ) { - return __objc_msgSend_837( - obj, - sel, - url, - error, - ); - } - - late final __objc_msgSend_837Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_837 = __objc_msgSend_837Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final _sel_fileHandleForWritingToURL_error_1 = - _registerName1("fileHandleForWritingToURL:error:"); - late final _sel_fileHandleForUpdatingURL_error_1 = - _registerName1("fileHandleForUpdatingURL:error:"); - late final _sel_readInBackgroundAndNotifyForModes_1 = - _registerName1("readInBackgroundAndNotifyForModes:"); - void _objc_msgSend_838( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer modes, - ) { - return __objc_msgSend_838( - obj, - sel, - modes, - ); - } - - late final __objc_msgSend_838Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_838 = __objc_msgSend_838Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_readInBackgroundAndNotify1 = - _registerName1("readInBackgroundAndNotify"); - late final _sel_readToEndOfFileInBackgroundAndNotifyForModes_1 = - _registerName1("readToEndOfFileInBackgroundAndNotifyForModes:"); - late final _sel_readToEndOfFileInBackgroundAndNotify1 = - _registerName1("readToEndOfFileInBackgroundAndNotify"); - late final _sel_acceptConnectionInBackgroundAndNotifyForModes_1 = - _registerName1("acceptConnectionInBackgroundAndNotifyForModes:"); - late final _sel_acceptConnectionInBackgroundAndNotify1 = - _registerName1("acceptConnectionInBackgroundAndNotify"); - late final _sel_waitForDataInBackgroundAndNotifyForModes_1 = - _registerName1("waitForDataInBackgroundAndNotifyForModes:"); - late final _sel_waitForDataInBackgroundAndNotify1 = - _registerName1("waitForDataInBackgroundAndNotify"); - late final _sel_readabilityHandler1 = _registerName1("readabilityHandler"); - ffi.Pointer<_ObjCBlock> _objc_msgSend_839( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_839( - obj, - sel, - ); - } - - late final __objc_msgSend_839Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_839 = __objc_msgSend_839Ptr.asFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setReadabilityHandler_1 = - _registerName1("setReadabilityHandler:"); - void _objc_msgSend_840( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> value, - ) { - return __objc_msgSend_840( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_840Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_840 = __objc_msgSend_840Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_writeabilityHandler1 = _registerName1("writeabilityHandler"); - late final _sel_setWriteabilityHandler_1 = - _registerName1("setWriteabilityHandler:"); - late final _sel_initWithFileDescriptor_1 = - _registerName1("initWithFileDescriptor:"); - instancetype _objc_msgSend_841( - ffi.Pointer obj, - ffi.Pointer sel, - int fd, - ) { - return __objc_msgSend_841( - obj, - sel, - fd, - ); - } - - late final __objc_msgSend_841Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_841 = __objc_msgSend_841Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_fileDescriptor1 = _registerName1("fileDescriptor"); - late final _sel_readDataToEndOfFile1 = _registerName1("readDataToEndOfFile"); - late final _sel_readDataOfLength_1 = _registerName1("readDataOfLength:"); - ffi.Pointer _objc_msgSend_842( - ffi.Pointer obj, - ffi.Pointer sel, - int length, - ) { - return __objc_msgSend_842( - obj, - sel, - length, - ); - } - - late final __objc_msgSend_842Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_842 = __objc_msgSend_842Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_offsetInFile1 = _registerName1("offsetInFile"); - late final _sel_seekToEndOfFile1 = _registerName1("seekToEndOfFile"); - late final _sel_seekToFileOffset_1 = _registerName1("seekToFileOffset:"); - void _objc_msgSend_843( - ffi.Pointer obj, - ffi.Pointer sel, - int offset, - ) { - return __objc_msgSend_843( - obj, - sel, - offset, - ); - } - - late final __objc_msgSend_843Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLongLong)>>('objc_msgSend'); - late final __objc_msgSend_843 = __objc_msgSend_843Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_truncateFileAtOffset_1 = - _registerName1("truncateFileAtOffset:"); - late final _sel_synchronizeFile1 = _registerName1("synchronizeFile"); - late final _sel_closeFile1 = _registerName1("closeFile"); - late final _class_NSHTTPCookieStorage1 = _getClass1("NSHTTPCookieStorage"); - late final _sel_sharedHTTPCookieStorage1 = - _registerName1("sharedHTTPCookieStorage"); - ffi.Pointer _objc_msgSend_844( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_844( - obj, - sel, - ); - } - - late final __objc_msgSend_844Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_844 = __objc_msgSend_844Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_sharedCookieStorageForGroupContainerIdentifier_1 = - _registerName1("sharedCookieStorageForGroupContainerIdentifier:"); - ffi.Pointer _objc_msgSend_845( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer identifier, - ) { - return __objc_msgSend_845( - obj, - sel, - identifier, - ); - } - - late final __objc_msgSend_845Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_845 = __objc_msgSend_845Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_cookies1 = _registerName1("cookies"); - late final _class_NSHTTPCookie1 = _getClass1("NSHTTPCookie"); - late final _sel_initWithProperties_1 = _registerName1("initWithProperties:"); - instancetype _objc_msgSend_846( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer properties, - ) { - return __objc_msgSend_846( - obj, - sel, - properties, - ); - } - - late final __objc_msgSend_846Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_846 = __objc_msgSend_846Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_cookieWithProperties_1 = - _registerName1("cookieWithProperties:"); - ffi.Pointer _objc_msgSend_847( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer properties, - ) { - return __objc_msgSend_847( - obj, - sel, - properties, - ); - } - - late final __objc_msgSend_847Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_847 = __objc_msgSend_847Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_requestHeaderFieldsWithCookies_1 = - _registerName1("requestHeaderFieldsWithCookies:"); - late final _sel_cookiesWithResponseHeaderFields_forURL_1 = - _registerName1("cookiesWithResponseHeaderFields:forURL:"); - ffi.Pointer _objc_msgSend_848( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer headerFields, - ffi.Pointer URL, - ) { - return __objc_msgSend_848( - obj, - sel, - headerFields, - URL, - ); - } - - late final __objc_msgSend_848Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_848 = __objc_msgSend_848Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_properties1 = _registerName1("properties"); - late final _sel_value1 = _registerName1("value"); - late final _sel_expiresDate1 = _registerName1("expiresDate"); - late final _sel_isSessionOnly1 = _registerName1("isSessionOnly"); - late final _sel_isSecure1 = _registerName1("isSecure"); - late final _sel_isHTTPOnly1 = _registerName1("isHTTPOnly"); - late final _sel_comment1 = _registerName1("comment"); - late final _sel_commentURL1 = _registerName1("commentURL"); - late final _sel_portList1 = _registerName1("portList"); - late final _sel_sameSitePolicy1 = _registerName1("sameSitePolicy"); - late final _sel_setCookie_1 = _registerName1("setCookie:"); - void _objc_msgSend_849( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cookie, - ) { - return __objc_msgSend_849( - obj, - sel, - cookie, - ); - } - - late final __objc_msgSend_849Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_849 = __objc_msgSend_849Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_deleteCookie_1 = _registerName1("deleteCookie:"); - late final _sel_removeCookiesSinceDate_1 = - _registerName1("removeCookiesSinceDate:"); - late final _sel_cookiesForURL_1 = _registerName1("cookiesForURL:"); - late final _sel_setCookies_forURL_mainDocumentURL_1 = - _registerName1("setCookies:forURL:mainDocumentURL:"); - void _objc_msgSend_850( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cookies, - ffi.Pointer URL, - ffi.Pointer mainDocumentURL, - ) { - return __objc_msgSend_850( - obj, - sel, - cookies, - URL, - mainDocumentURL, - ); - } - - late final __objc_msgSend_850Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_850 = __objc_msgSend_850Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_cookieAcceptPolicy1 = _registerName1("cookieAcceptPolicy"); - int _objc_msgSend_851( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_851( - obj, - sel, - ); - } - - late final __objc_msgSend_851Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_851 = __objc_msgSend_851Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setCookieAcceptPolicy_1 = - _registerName1("setCookieAcceptPolicy:"); - void _objc_msgSend_852( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_852( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_852Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_852 = __objc_msgSend_852Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_sortedCookiesUsingDescriptors_1 = - _registerName1("sortedCookiesUsingDescriptors:"); - late final _class_NSURLSessionTask1 = _getClass1("NSURLSessionTask"); - late final _sel_taskIdentifier1 = _registerName1("taskIdentifier"); - late final _class_NSURLRequest1 = _getClass1("NSURLRequest"); - late final _sel_requestWithURL_1 = _registerName1("requestWithURL:"); - late final _sel_supportsSecureCoding1 = - _registerName1("supportsSecureCoding"); - late final _sel_requestWithURL_cachePolicy_timeoutInterval_1 = - _registerName1("requestWithURL:cachePolicy:timeoutInterval:"); - instancetype _objc_msgSend_853( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer URL, - int cachePolicy, - double timeoutInterval, - ) { - return __objc_msgSend_853( - obj, - sel, - URL, - cachePolicy, - timeoutInterval, - ); - } - - late final __objc_msgSend_853Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_853 = __objc_msgSend_853Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, double)>(); - - late final _sel_initWithURL_cachePolicy_timeoutInterval_1 = - _registerName1("initWithURL:cachePolicy:timeoutInterval:"); - late final _sel_URL1 = _registerName1("URL"); - late final _sel_cachePolicy1 = _registerName1("cachePolicy"); - int _objc_msgSend_854( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_854( - obj, - sel, - ); - } - - late final __objc_msgSend_854Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_854 = __objc_msgSend_854Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_timeoutInterval1 = _registerName1("timeoutInterval"); - late final _sel_mainDocumentURL1 = _registerName1("mainDocumentURL"); - late final _sel_networkServiceType1 = _registerName1("networkServiceType"); - int _objc_msgSend_855( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_855( - obj, - sel, - ); - } - - late final __objc_msgSend_855Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_855 = __objc_msgSend_855Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_allowsCellularAccess1 = - _registerName1("allowsCellularAccess"); - late final _sel_allowsExpensiveNetworkAccess1 = - _registerName1("allowsExpensiveNetworkAccess"); - late final _sel_allowsConstrainedNetworkAccess1 = - _registerName1("allowsConstrainedNetworkAccess"); - late final _sel_assumesHTTP3Capable1 = _registerName1("assumesHTTP3Capable"); - late final _sel_attribution1 = _registerName1("attribution"); - int _objc_msgSend_856( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_856( - obj, - sel, - ); - } - - late final __objc_msgSend_856Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_856 = __objc_msgSend_856Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_requiresDNSSECValidation1 = - _registerName1("requiresDNSSECValidation"); - late final _sel_HTTPMethod1 = _registerName1("HTTPMethod"); - late final _sel_allHTTPHeaderFields1 = _registerName1("allHTTPHeaderFields"); - late final _sel_valueForHTTPHeaderField_1 = - _registerName1("valueForHTTPHeaderField:"); - late final _sel_HTTPBody1 = _registerName1("HTTPBody"); - late final _class_NSInputStream1 = _getClass1("NSInputStream"); - late final _class_NSStream1 = _getClass1("NSStream"); - late final _sel_open1 = _registerName1("open"); - late final _sel_close1 = _registerName1("close"); - bool _objc_msgSend_857( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer property, - ffi.Pointer key, - ) { - return __objc_msgSend_857( - obj, - sel, - property, - key, - ); - } - - late final __objc_msgSend_857Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_857 = __objc_msgSend_857Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_streamStatus1 = _registerName1("streamStatus"); - int _objc_msgSend_858( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_858( - obj, - sel, - ); - } - - late final __objc_msgSend_858Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_858 = __objc_msgSend_858Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_streamError1 = _registerName1("streamError"); - late final _class_NSOutputStream1 = _getClass1("NSOutputStream"); - late final _sel_write_maxLength_1 = _registerName1("write:maxLength:"); - int _objc_msgSend_859( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int len, - ) { - return __objc_msgSend_859( - obj, - sel, - buffer, - len, - ); - } - - late final __objc_msgSend_859Ptr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_859 = __objc_msgSend_859Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_hasSpaceAvailable1 = _registerName1("hasSpaceAvailable"); - late final _sel_initToMemory1 = _registerName1("initToMemory"); - late final _sel_initToBuffer_capacity_1 = - _registerName1("initToBuffer:capacity:"); - instancetype _objc_msgSend_860( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int capacity, - ) { - return __objc_msgSend_860( - obj, - sel, - buffer, - capacity, - ); - } - - late final __objc_msgSend_860Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_860 = __objc_msgSend_860Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_initWithURL_append_1 = _registerName1("initWithURL:append:"); - instancetype _objc_msgSend_861( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - bool shouldAppend, - ) { - return __objc_msgSend_861( - obj, - sel, - url, - shouldAppend, - ); - } - - late final __objc_msgSend_861Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_861 = __objc_msgSend_861Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_initToFileAtPath_append_1 = - _registerName1("initToFileAtPath:append:"); - instancetype _objc_msgSend_862( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool shouldAppend, - ) { - return __objc_msgSend_862( - obj, - sel, - path, - shouldAppend, - ); - } - - late final __objc_msgSend_862Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_862 = __objc_msgSend_862Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_outputStreamToMemory1 = - _registerName1("outputStreamToMemory"); - late final _sel_outputStreamToBuffer_capacity_1 = - _registerName1("outputStreamToBuffer:capacity:"); - late final _sel_outputStreamToFileAtPath_append_1 = - _registerName1("outputStreamToFileAtPath:append:"); - late final _sel_outputStreamWithURL_append_1 = - _registerName1("outputStreamWithURL:append:"); - late final _sel_getStreamsToHostWithName_port_inputStream_outputStream_1 = - _registerName1("getStreamsToHostWithName:port:inputStream:outputStream:"); - void _objc_msgSend_863( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer hostname, - int port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream, - ) { - return __objc_msgSend_863( - obj, - sel, - hostname, - port, - inputStream, - outputStream, - ); - } - - late final __objc_msgSend_863Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_863 = __objc_msgSend_863Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _class_NSHost1 = _getClass1("NSHost"); - late final _sel_currentHost1 = _registerName1("currentHost"); - late final _sel_hostWithName_1 = _registerName1("hostWithName:"); - instancetype _objc_msgSend_864( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ) { - return __objc_msgSend_864( - obj, - sel, - name, - ); - } - - late final __objc_msgSend_864Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_864 = __objc_msgSend_864Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_hostWithAddress_1 = _registerName1("hostWithAddress:"); - late final _sel_isEqualToHost_1 = _registerName1("isEqualToHost:"); - bool _objc_msgSend_865( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aHost, - ) { - return __objc_msgSend_865( - obj, - sel, - aHost, - ); - } - - late final __objc_msgSend_865Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_865 = __objc_msgSend_865Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_names1 = _registerName1("names"); - late final _sel_address1 = _registerName1("address"); - late final _sel_addresses1 = _registerName1("addresses"); - late final _sel_localizedName1 = _registerName1("localizedName"); - late final _sel_setHostCacheEnabled_1 = - _registerName1("setHostCacheEnabled:"); - void _objc_msgSend_866( - ffi.Pointer obj, - ffi.Pointer sel, - bool flag, - ) { - return __objc_msgSend_866( - obj, - sel, - flag, - ); - } - - late final __objc_msgSend_866Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_866 = __objc_msgSend_866Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_isHostCacheEnabled1 = _registerName1("isHostCacheEnabled"); - late final _sel_flushHostCache1 = _registerName1("flushHostCache"); - late final _sel_getStreamsToHost_port_inputStream_outputStream_1 = - _registerName1("getStreamsToHost:port:inputStream:outputStream:"); - void _objc_msgSend_867( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer host, - int port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream, - ) { - return __objc_msgSend_867( - obj, - sel, - host, - port, - inputStream, - outputStream, - ); - } - - late final __objc_msgSend_867Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_867 = __objc_msgSend_867Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1 = - _registerName1("getBoundStreamsWithBufferSize:inputStream:outputStream:"); - void _objc_msgSend_868( - ffi.Pointer obj, - ffi.Pointer sel, - int bufferSize, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream, - ) { - return __objc_msgSend_868( - obj, - sel, - bufferSize, - inputStream, - outputStream, - ); - } - - late final __objc_msgSend_868Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_868 = __objc_msgSend_868Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _sel_read_maxLength_1 = _registerName1("read:maxLength:"); - late final _sel_getBuffer_length_1 = _registerName1("getBuffer:length:"); - bool _objc_msgSend_869( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> buffer, - ffi.Pointer len, - ) { - return __objc_msgSend_869( - obj, - sel, - buffer, - len, - ); - } - - late final __objc_msgSend_869Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_869 = __objc_msgSend_869Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>(); - - late final _sel_hasBytesAvailable1 = _registerName1("hasBytesAvailable"); - late final _sel_initWithFileAtPath_1 = _registerName1("initWithFileAtPath:"); - late final _sel_inputStreamWithData_1 = - _registerName1("inputStreamWithData:"); - instancetype _objc_msgSend_870( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ) { - return __objc_msgSend_870( - obj, - sel, - data, - ); - } - - late final __objc_msgSend_870Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_870 = __objc_msgSend_870Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_inputStreamWithFileAtPath_1 = - _registerName1("inputStreamWithFileAtPath:"); - late final _sel_inputStreamWithURL_1 = _registerName1("inputStreamWithURL:"); - late final _sel_HTTPBodyStream1 = _registerName1("HTTPBodyStream"); - ffi.Pointer _objc_msgSend_871( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_871( - obj, - sel, - ); - } - - late final __objc_msgSend_871Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_871 = __objc_msgSend_871Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_HTTPShouldHandleCookies1 = - _registerName1("HTTPShouldHandleCookies"); - late final _sel_HTTPShouldUsePipelining1 = - _registerName1("HTTPShouldUsePipelining"); - late final _sel_originalRequest1 = _registerName1("originalRequest"); - ffi.Pointer _objc_msgSend_872( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_872( - obj, - sel, - ); - } - - late final __objc_msgSend_872Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_872 = __objc_msgSend_872Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_currentRequest1 = _registerName1("currentRequest"); - late final _class_NSURLResponse1 = _getClass1("NSURLResponse"); - late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1 = - _registerName1( - "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); - instancetype _objc_msgSend_873( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer URL, - ffi.Pointer MIMEType, - int length, - ffi.Pointer name, - ) { - return __objc_msgSend_873( - obj, - sel, - URL, - MIMEType, - length, - name, - ); - } - - late final __objc_msgSend_873Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_873 = __objc_msgSend_873Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - late final _sel_MIMEType1 = _registerName1("MIMEType"); - late final _sel_expectedContentLength1 = - _registerName1("expectedContentLength"); - late final _sel_textEncodingName1 = _registerName1("textEncodingName"); - late final _sel_suggestedFilename1 = _registerName1("suggestedFilename"); - late final _sel_response1 = _registerName1("response"); - ffi.Pointer _objc_msgSend_874( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_874( - obj, - sel, - ); - } - - late final __objc_msgSend_874Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_874 = __objc_msgSend_874Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_progress1 = _registerName1("progress"); - ffi.Pointer _objc_msgSend_875( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_875( - obj, - sel, - ); - } - - late final __objc_msgSend_875Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_875 = __objc_msgSend_875Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_earliestBeginDate1 = _registerName1("earliestBeginDate"); - late final _sel_setEarliestBeginDate_1 = - _registerName1("setEarliestBeginDate:"); - late final _sel_countOfBytesClientExpectsToSend1 = - _registerName1("countOfBytesClientExpectsToSend"); - late final _sel_setCountOfBytesClientExpectsToSend_1 = - _registerName1("setCountOfBytesClientExpectsToSend:"); - late final _sel_countOfBytesClientExpectsToReceive1 = - _registerName1("countOfBytesClientExpectsToReceive"); - late final _sel_setCountOfBytesClientExpectsToReceive_1 = - _registerName1("setCountOfBytesClientExpectsToReceive:"); - late final _sel_countOfBytesSent1 = _registerName1("countOfBytesSent"); - late final _sel_countOfBytesReceived1 = - _registerName1("countOfBytesReceived"); - late final _sel_countOfBytesExpectedToSend1 = - _registerName1("countOfBytesExpectedToSend"); - late final _sel_countOfBytesExpectedToReceive1 = - _registerName1("countOfBytesExpectedToReceive"); - late final _sel_taskDescription1 = _registerName1("taskDescription"); - late final _sel_setTaskDescription_1 = _registerName1("setTaskDescription:"); - late final _sel_state1 = _registerName1("state"); - int _objc_msgSend_876( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_876( - obj, - sel, - ); - } - - late final __objc_msgSend_876Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_876 = __objc_msgSend_876Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_suspend1 = _registerName1("suspend"); - late final _sel_priority1 = _registerName1("priority"); - late final _sel_setPriority_1 = _registerName1("setPriority:"); - void _objc_msgSend_877( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_877( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_877Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Float)>>('objc_msgSend'); - late final __objc_msgSend_877 = __objc_msgSend_877Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); - - late final _sel_prefersIncrementalDelivery1 = - _registerName1("prefersIncrementalDelivery"); - late final _sel_setPrefersIncrementalDelivery_1 = - _registerName1("setPrefersIncrementalDelivery:"); - late final _sel_storeCookies_forTask_1 = - _registerName1("storeCookies:forTask:"); - void _objc_msgSend_878( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cookies, - ffi.Pointer task, - ) { - return __objc_msgSend_878( - obj, - sel, - cookies, - task, - ); - } - - late final __objc_msgSend_878Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_878 = __objc_msgSend_878Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_getCookiesForTask_completionHandler_1 = - _registerName1("getCookiesForTask:completionHandler:"); - void _objc_msgSend_879( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer task, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_879( - obj, - sel, - task, - completionHandler, - ); - } - - late final __objc_msgSend_879Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_879 = __objc_msgSend_879Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _class_NSIndexPath1 = _getClass1("NSIndexPath"); - late final _sel_indexPathWithIndex_1 = _registerName1("indexPathWithIndex:"); - late final _sel_indexPathWithIndexes_length_1 = - _registerName1("indexPathWithIndexes:length:"); - instancetype _objc_msgSend_880( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexes, - int length, - ) { - return __objc_msgSend_880( - obj, - sel, - indexes, - length, - ); - } - - late final __objc_msgSend_880Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_880 = __objc_msgSend_880Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_initWithIndexes_length_1 = - _registerName1("initWithIndexes:length:"); - late final _sel_indexPathByAddingIndex_1 = - _registerName1("indexPathByAddingIndex:"); - ffi.Pointer _objc_msgSend_881( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_881( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_881Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_881 = __objc_msgSend_881Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_indexPathByRemovingLastIndex1 = - _registerName1("indexPathByRemovingLastIndex"); - ffi.Pointer _objc_msgSend_882( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_882( - obj, - sel, - ); - } - - late final __objc_msgSend_882Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_882 = __objc_msgSend_882Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_indexAtPosition_1 = _registerName1("indexAtPosition:"); - late final _sel_getIndexes_range_1 = _registerName1("getIndexes:range:"); - void _objc_msgSend_883( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexes, - _NSRange positionRange, - ) { - return __objc_msgSend_883( - obj, - sel, - indexes, - positionRange, - ); - } - - late final __objc_msgSend_883Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_883 = __objc_msgSend_883Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, _NSRange)>(); - - int _objc_msgSend_884( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherObject, - ) { - return __objc_msgSend_884( - obj, - sel, - otherObject, - ); - } - - late final __objc_msgSend_884Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_884 = __objc_msgSend_884Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_getIndexes_1 = _registerName1("getIndexes:"); - void _objc_msgSend_885( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexes, - ) { - return __objc_msgSend_885( - obj, - sel, - indexes, - ); - } - - late final __objc_msgSend_885Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_885 = __objc_msgSend_885Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSInflectionRule1 = _getClass1("NSInflectionRule"); - late final _sel_automaticRule1 = _registerName1("automaticRule"); - ffi.Pointer _objc_msgSend_886( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_886( - obj, - sel, - ); - } - - late final __objc_msgSend_886Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_886 = __objc_msgSend_886Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_canInflectLanguage_1 = _registerName1("canInflectLanguage:"); - late final _sel_canInflectPreferredLocalization1 = - _registerName1("canInflectPreferredLocalization"); - late final _class_NSMorphology1 = _getClass1("NSMorphology"); - late final _sel_grammaticalGender1 = _registerName1("grammaticalGender"); - int _objc_msgSend_887( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_887( - obj, - sel, - ); - } - - late final __objc_msgSend_887Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_887 = __objc_msgSend_887Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setGrammaticalGender_1 = - _registerName1("setGrammaticalGender:"); - void _objc_msgSend_888( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_888( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_888Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_888 = __objc_msgSend_888Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_partOfSpeech1 = _registerName1("partOfSpeech"); - int _objc_msgSend_889( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_889( - obj, - sel, - ); - } - - late final __objc_msgSend_889Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_889 = __objc_msgSend_889Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setPartOfSpeech_1 = _registerName1("setPartOfSpeech:"); - void _objc_msgSend_890( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_890( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_890Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_890 = __objc_msgSend_890Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_number1 = _registerName1("number"); - int _objc_msgSend_891( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_891( - obj, - sel, - ); - } - - late final __objc_msgSend_891Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_891 = __objc_msgSend_891Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setNumber_1 = _registerName1("setNumber:"); - void _objc_msgSend_892( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_892( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_892Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_892 = __objc_msgSend_892Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _class_NSMorphologyCustomPronoun1 = - _getClass1("NSMorphologyCustomPronoun"); - late final _sel_isSupportedForLanguage_1 = - _registerName1("isSupportedForLanguage:"); - late final _sel_requiredKeysForLanguage_1 = - _registerName1("requiredKeysForLanguage:"); - late final _sel_subjectForm1 = _registerName1("subjectForm"); - late final _sel_setSubjectForm_1 = _registerName1("setSubjectForm:"); - late final _sel_objectForm1 = _registerName1("objectForm"); - late final _sel_setObjectForm_1 = _registerName1("setObjectForm:"); - late final _sel_possessiveForm1 = _registerName1("possessiveForm"); - late final _sel_setPossessiveForm_1 = _registerName1("setPossessiveForm:"); - late final _sel_possessiveAdjectiveForm1 = - _registerName1("possessiveAdjectiveForm"); - late final _sel_setPossessiveAdjectiveForm_1 = - _registerName1("setPossessiveAdjectiveForm:"); - late final _sel_reflexiveForm1 = _registerName1("reflexiveForm"); - late final _sel_setReflexiveForm_1 = _registerName1("setReflexiveForm:"); - late final _sel_customPronounForLanguage_1 = - _registerName1("customPronounForLanguage:"); - ffi.Pointer _objc_msgSend_893( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer language, - ) { - return __objc_msgSend_893( - obj, - sel, - language, - ); - } - - late final __objc_msgSend_893Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_893 = __objc_msgSend_893Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setCustomPronoun_forLanguage_error_1 = - _registerName1("setCustomPronoun:forLanguage:error:"); - bool _objc_msgSend_894( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer features, - ffi.Pointer language, - ffi.Pointer> error, - ) { - return __objc_msgSend_894( - obj, - sel, - features, - language, - error, - ); - } - - late final __objc_msgSend_894Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_894 = __objc_msgSend_894Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_isUnspecified1 = _registerName1("isUnspecified"); - late final _sel_userMorphology1 = _registerName1("userMorphology"); - ffi.Pointer _objc_msgSend_895( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_895( - obj, - sel, - ); - } - - late final __objc_msgSend_895Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_895 = __objc_msgSend_895Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSOperationQueue1 = _getClass1("NSOperationQueue"); - late final _class_NSOperation1 = _getClass1("NSOperation"); - late final _sel_isConcurrent1 = _registerName1("isConcurrent"); - late final _sel_isAsynchronous1 = _registerName1("isAsynchronous"); - late final _sel_isReady1 = _registerName1("isReady"); - late final _sel_addDependency_1 = _registerName1("addDependency:"); - void _objc_msgSend_896( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer op, - ) { - return __objc_msgSend_896( - obj, - sel, - op, - ); - } - - late final __objc_msgSend_896Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_896 = __objc_msgSend_896Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removeDependency_1 = _registerName1("removeDependency:"); - late final _sel_dependencies1 = _registerName1("dependencies"); - late final _sel_queuePriority1 = _registerName1("queuePriority"); - int _objc_msgSend_897( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_897( - obj, - sel, - ); - } - - late final __objc_msgSend_897Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_897 = __objc_msgSend_897Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setQueuePriority_1 = _registerName1("setQueuePriority:"); - void _objc_msgSend_898( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_898( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_898Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_898 = __objc_msgSend_898Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_completionBlock1 = _registerName1("completionBlock"); - late final _sel_setCompletionBlock_1 = _registerName1("setCompletionBlock:"); - late final _sel_waitUntilFinished1 = _registerName1("waitUntilFinished"); - late final _sel_addOperation_1 = _registerName1("addOperation:"); - late final _sel_addOperations_waitUntilFinished_1 = - _registerName1("addOperations:waitUntilFinished:"); - void _objc_msgSend_899( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer ops, - bool wait, - ) { - return __objc_msgSend_899( - obj, - sel, - ops, - wait, - ); - } - - late final __objc_msgSend_899Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_899 = __objc_msgSend_899Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_addOperationWithBlock_1 = - _registerName1("addOperationWithBlock:"); - late final _sel_addBarrierBlock_1 = _registerName1("addBarrierBlock:"); - late final _sel_maxConcurrentOperationCount1 = - _registerName1("maxConcurrentOperationCount"); - late final _sel_setMaxConcurrentOperationCount_1 = - _registerName1("setMaxConcurrentOperationCount:"); - late final _sel_isSuspended1 = _registerName1("isSuspended"); - late final _sel_setSuspended_1 = _registerName1("setSuspended:"); - late final _sel_underlyingQueue1 = _registerName1("underlyingQueue"); - ffi.Pointer _objc_msgSend_900( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_900( - obj, - sel, - ); - } - - late final __objc_msgSend_900Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_900 = __objc_msgSend_900Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setUnderlyingQueue_1 = _registerName1("setUnderlyingQueue:"); - void _objc_msgSend_901( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_901( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_901Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_901 = __objc_msgSend_901Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_cancelAllOperations1 = _registerName1("cancelAllOperations"); - late final _sel_waitUntilAllOperationsAreFinished1 = - _registerName1("waitUntilAllOperationsAreFinished"); - late final _sel_currentQueue1 = _registerName1("currentQueue"); - ffi.Pointer _objc_msgSend_902( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_902( - obj, - sel, - ); - } - - late final __objc_msgSend_902Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_902 = __objc_msgSend_902Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_mainQueue1 = _registerName1("mainQueue"); - ffi.Pointer _objc_msgSend_903( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_903( - obj, - sel, - ); - } - - late final __objc_msgSend_903Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_903 = __objc_msgSend_903Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_operations1 = _registerName1("operations"); - late final _sel_operationCount1 = _registerName1("operationCount"); - late final _class_NSPointerArray1 = _getClass1("NSPointerArray"); - late final _sel_initWithOptions_1 = _registerName1("initWithOptions:"); - instancetype _objc_msgSend_904( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ) { - return __objc_msgSend_904( - obj, - sel, - options, - ); - } - - late final __objc_msgSend_904Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_904 = __objc_msgSend_904Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _class_NSPointerFunctions1 = _getClass1("NSPointerFunctions"); - late final _sel_pointerFunctionsWithOptions_1 = - _registerName1("pointerFunctionsWithOptions:"); - ffi.Pointer _objc_msgSend_905( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ) { - return __objc_msgSend_905( - obj, - sel, - options, - ); - } - - late final __objc_msgSend_905Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_905 = __objc_msgSend_905Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_hashFunction1 = _registerName1("hashFunction"); - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>>)>> - _objc_msgSend_906( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_906( - obj, - sel, - ); - } - - late final __objc_msgSend_906Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - Function(ffi.Pointer, ffi.Pointer)>>( - 'objc_msgSend'); - late final __objc_msgSend_906 = __objc_msgSend_906Ptr.asFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setHashFunction_1 = _registerName1("setHashFunction:"); - void _objc_msgSend_907( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - value, - ) { - return __objc_msgSend_907( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_907Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>>)>>( - 'objc_msgSend'); - late final __objc_msgSend_907 = __objc_msgSend_907Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>>)>(); - - late final _sel_isEqualFunction1 = _registerName1("isEqualFunction"); - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>>)>> - _objc_msgSend_908( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_908( - obj, - sel, - ); - } - - late final __objc_msgSend_908Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - Function(ffi.Pointer, ffi.Pointer)>>( - 'objc_msgSend'); - late final __objc_msgSend_908 = __objc_msgSend_908Ptr.asFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setIsEqualFunction_1 = _registerName1("setIsEqualFunction:"); - void _objc_msgSend_909( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - value, - ) { - return __objc_msgSend_909( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_909Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>>)>>( - 'objc_msgSend'); - late final __objc_msgSend_909 = __objc_msgSend_909Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>>)>(); - - late final _sel_sizeFunction1 = _registerName1("sizeFunction"); - ffi.Pointer< - ffi.NativeFunction)>> - _objc_msgSend_910( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_910( - obj, - sel, - ); - } - - late final __objc_msgSend_910Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>> - Function(ffi.Pointer, ffi.Pointer)>>( - 'objc_msgSend'); - late final __objc_msgSend_910 = __objc_msgSend_910Ptr.asFunction< - ffi.Pointer< - ffi - .NativeFunction)>> - Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setSizeFunction_1 = _registerName1("setSizeFunction:"); - void _objc_msgSend_911( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi - .NativeFunction)>> - value, - ) { - return __objc_msgSend_911( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_911Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>>('objc_msgSend'); - late final __objc_msgSend_911 = __objc_msgSend_911Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>>)>(); - - late final _sel_descriptionFunction1 = _registerName1("descriptionFunction"); - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>> - _objc_msgSend_912( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_912( - obj, - sel, - ); - } - - late final __objc_msgSend_912Ptr = - _lookup< - ffi.NativeFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>> - Function(ffi.Pointer, ffi.Pointer)>>( - 'objc_msgSend'); - late final __objc_msgSend_912 = __objc_msgSend_912Ptr.asFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>> - Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setDescriptionFunction_1 = - _registerName1("setDescriptionFunction:"); - void _objc_msgSend_913( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>> - value, - ) { - return __objc_msgSend_913( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_913Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>)>>('objc_msgSend'); - late final __objc_msgSend_913 = __objc_msgSend_913Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>)>(); - - late final _sel_relinquishFunction1 = _registerName1("relinquishFunction"); - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>>)>> - _objc_msgSend_914( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_914( - obj, - sel, - ); - } - - late final __objc_msgSend_914Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - Function(ffi.Pointer, ffi.Pointer)>>( - 'objc_msgSend'); - late final __objc_msgSend_914 = __objc_msgSend_914Ptr.asFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setRelinquishFunction_1 = - _registerName1("setRelinquishFunction:"); - void _objc_msgSend_915( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - value, - ) { - return __objc_msgSend_915( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_915Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>>)>>( - 'objc_msgSend'); - late final __objc_msgSend_915 = __objc_msgSend_915Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>>)>(); - - late final _sel_acquireFunction1 = _registerName1("acquireFunction"); - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>>, - ffi.Bool)>> _objc_msgSend_916( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_916( - obj, - sel, - ); - } - - late final __objc_msgSend_916Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>, - ffi.Bool)>> - Function(ffi.Pointer, ffi.Pointer)>>( - 'objc_msgSend'); - late final __objc_msgSend_916 = __objc_msgSend_916Ptr.asFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>, - ffi.Bool)>> - Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setAcquireFunction_1 = _registerName1("setAcquireFunction:"); - void _objc_msgSend_917( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>>, - ffi.Bool)>> - value, - ) { - return __objc_msgSend_917( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_917Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>, - ffi.Bool)>>)>>('objc_msgSend'); - late final __objc_msgSend_917 = __objc_msgSend_917Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>, - ffi.Bool)>>)>(); - - late final _sel_usesStrongWriteBarrier1 = - _registerName1("usesStrongWriteBarrier"); - late final _sel_setUsesStrongWriteBarrier_1 = - _registerName1("setUsesStrongWriteBarrier:"); - late final _sel_usesWeakReadAndWriteBarriers1 = - _registerName1("usesWeakReadAndWriteBarriers"); - late final _sel_setUsesWeakReadAndWriteBarriers_1 = - _registerName1("setUsesWeakReadAndWriteBarriers:"); - late final _sel_initWithPointerFunctions_1 = - _registerName1("initWithPointerFunctions:"); - instancetype _objc_msgSend_918( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer functions, - ) { - return __objc_msgSend_918( - obj, - sel, - functions, - ); - } - - late final __objc_msgSend_918Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_918 = __objc_msgSend_918Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_pointerArrayWithOptions_1 = - _registerName1("pointerArrayWithOptions:"); - ffi.Pointer _objc_msgSend_919( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ) { - return __objc_msgSend_919( - obj, - sel, - options, - ); - } - - late final __objc_msgSend_919Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_919 = __objc_msgSend_919Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_pointerArrayWithPointerFunctions_1 = - _registerName1("pointerArrayWithPointerFunctions:"); - ffi.Pointer _objc_msgSend_920( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer functions, - ) { - return __objc_msgSend_920( - obj, - sel, - functions, - ); - } - - late final __objc_msgSend_920Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_920 = __objc_msgSend_920Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_pointerFunctions1 = _registerName1("pointerFunctions"); - ffi.Pointer _objc_msgSend_921( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_921( - obj, - sel, - ); - } - - late final __objc_msgSend_921Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_921 = __objc_msgSend_921Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_pointerAtIndex_1 = _registerName1("pointerAtIndex:"); - ffi.Pointer _objc_msgSend_922( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_922( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_922Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_922 = __objc_msgSend_922Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_addPointer_1 = _registerName1("addPointer:"); - late final _sel_removePointerAtIndex_1 = - _registerName1("removePointerAtIndex:"); - late final _sel_insertPointer_atIndex_1 = - _registerName1("insertPointer:atIndex:"); - late final _sel_replacePointerAtIndex_withPointer_1 = - _registerName1("replacePointerAtIndex:withPointer:"); - void _objc_msgSend_923( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer item, - ) { - return __objc_msgSend_923( - obj, - sel, - index, - item, - ); - } - - late final __objc_msgSend_923Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_923 = __objc_msgSend_923Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _sel_compact1 = _registerName1("compact"); - late final _sel_setCount_1 = _registerName1("setCount:"); - late final _sel_pointerArrayWithStrongObjects1 = - _registerName1("pointerArrayWithStrongObjects"); - late final _sel_pointerArrayWithWeakObjects1 = - _registerName1("pointerArrayWithWeakObjects"); - late final _sel_strongObjectsPointerArray1 = - _registerName1("strongObjectsPointerArray"); - ffi.Pointer _objc_msgSend_924( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_924( - obj, - sel, - ); - } - - late final __objc_msgSend_924Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_924 = __objc_msgSend_924Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_weakObjectsPointerArray1 = - _registerName1("weakObjectsPointerArray"); - late final _class_NSProcessInfo1 = _getClass1("NSProcessInfo"); - late final _sel_processInfo1 = _registerName1("processInfo"); - ffi.Pointer _objc_msgSend_925( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_925( - obj, - sel, - ); - } - - late final __objc_msgSend_925Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_925 = __objc_msgSend_925Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_environment1 = _registerName1("environment"); - late final _sel_hostName1 = _registerName1("hostName"); - late final _sel_processName1 = _registerName1("processName"); - late final _sel_setProcessName_1 = _registerName1("setProcessName:"); - late final _sel_processIdentifier1 = _registerName1("processIdentifier"); - late final _sel_globallyUniqueString1 = - _registerName1("globallyUniqueString"); - late final _sel_operatingSystem1 = _registerName1("operatingSystem"); - late final _sel_operatingSystemName1 = _registerName1("operatingSystemName"); - late final _sel_operatingSystemVersionString1 = - _registerName1("operatingSystemVersionString"); - late final _sel_operatingSystemVersion1 = - _registerName1("operatingSystemVersion"); - NSOperatingSystemVersion _objc_msgSend_926( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_926( - obj, - sel, - ); - } - - late final __objc_msgSend_926Ptr = _lookup< - ffi.NativeFunction< - NSOperatingSystemVersion Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_926 = __objc_msgSend_926Ptr.asFunction< - NSOperatingSystemVersion Function( - ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_926_stret( - ffi.Pointer stret, - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_926_stret( - stret, - obj, - sel, - ); - } - - late final __objc_msgSend_926_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_926_stret = __objc_msgSend_926_stretPtr.asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_processorCount1 = _registerName1("processorCount"); - late final _sel_activeProcessorCount1 = - _registerName1("activeProcessorCount"); - late final _sel_physicalMemory1 = _registerName1("physicalMemory"); - late final _sel_isOperatingSystemAtLeastVersion_1 = - _registerName1("isOperatingSystemAtLeastVersion:"); - bool _objc_msgSend_927( - ffi.Pointer obj, - ffi.Pointer sel, - NSOperatingSystemVersion version, - ) { - return __objc_msgSend_927( - obj, - sel, - version, - ); - } - - late final __objc_msgSend_927Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - NSOperatingSystemVersion)>>('objc_msgSend'); - late final __objc_msgSend_927 = __objc_msgSend_927Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - NSOperatingSystemVersion)>(); - - late final _sel_systemUptime1 = _registerName1("systemUptime"); - late final _sel_disableSuddenTermination1 = - _registerName1("disableSuddenTermination"); - late final _sel_enableSuddenTermination1 = - _registerName1("enableSuddenTermination"); - late final _sel_disableAutomaticTermination_1 = - _registerName1("disableAutomaticTermination:"); - late final _sel_enableAutomaticTermination_1 = - _registerName1("enableAutomaticTermination:"); - late final _sel_automaticTerminationSupportEnabled1 = - _registerName1("automaticTerminationSupportEnabled"); - late final _sel_setAutomaticTerminationSupportEnabled_1 = - _registerName1("setAutomaticTerminationSupportEnabled:"); - late final _sel_beginActivityWithOptions_reason_1 = - _registerName1("beginActivityWithOptions:reason:"); - ffi.Pointer _objc_msgSend_928( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ffi.Pointer reason, - ) { - return __objc_msgSend_928( - obj, - sel, - options, - reason, - ); - } - - late final __objc_msgSend_928Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_928 = __objc_msgSend_928Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final _sel_endActivity_1 = _registerName1("endActivity:"); - late final _sel_performActivityWithOptions_reason_usingBlock_1 = - _registerName1("performActivityWithOptions:reason:usingBlock:"); - void _objc_msgSend_929( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ffi.Pointer reason, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_929( - obj, - sel, - options, - reason, - block, - ); - } - - late final __objc_msgSend_929Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_929 = __objc_msgSend_929Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_performExpiringActivityWithReason_usingBlock_1 = - _registerName1("performExpiringActivityWithReason:usingBlock:"); - void _objc_msgSend_930( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer reason, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_930( - obj, - sel, - reason, - block, - ); - } - - late final __objc_msgSend_930Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_930 = __objc_msgSend_930Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_userName1 = _registerName1("userName"); - late final _sel_fullUserName1 = _registerName1("fullUserName"); - late final _sel_thermalState1 = _registerName1("thermalState"); - int _objc_msgSend_931( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_931( - obj, - sel, - ); - } - - late final __objc_msgSend_931Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_931 = __objc_msgSend_931Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_isLowPowerModeEnabled1 = - _registerName1("isLowPowerModeEnabled"); - late final _sel_isMacCatalystApp1 = _registerName1("isMacCatalystApp"); - late final _sel_isiOSAppOnMac1 = _registerName1("isiOSAppOnMac"); - late final _class_NSTextCheckingResult1 = _getClass1("NSTextCheckingResult"); - late final _sel_resultType1 = _registerName1("resultType"); - int _objc_msgSend_932( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_932( - obj, - sel, - ); - } - - late final __objc_msgSend_932Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_932 = __objc_msgSend_932Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_range1 = _registerName1("range"); - late final _sel_orthography1 = _registerName1("orthography"); - ffi.Pointer _objc_msgSend_933( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_933( - obj, - sel, - ); - } - - late final __objc_msgSend_933Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_933 = __objc_msgSend_933Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_grammarDetails1 = _registerName1("grammarDetails"); - late final _sel_duration1 = _registerName1("duration"); - late final _sel_components1 = _registerName1("components"); - late final _sel_replacementString1 = _registerName1("replacementString"); - late final _sel_alternativeStrings1 = _registerName1("alternativeStrings"); - late final _class_NSRegularExpression1 = _getClass1("NSRegularExpression"); - late final _sel_regularExpressionWithPattern_options_error_1 = - _registerName1("regularExpressionWithPattern:options:error:"); - ffi.Pointer _objc_msgSend_934( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer pattern, - int options, - ffi.Pointer> error, - ) { - return __objc_msgSend_934( - obj, - sel, - pattern, - options, - error, - ); - } - - late final __objc_msgSend_934Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_934 = __objc_msgSend_934Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_initWithPattern_options_error_1 = - _registerName1("initWithPattern:options:error:"); - instancetype _objc_msgSend_935( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer pattern, - int options, - ffi.Pointer> error, - ) { - return __objc_msgSend_935( - obj, - sel, - pattern, - options, - error, - ); - } - - late final __objc_msgSend_935Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_935 = __objc_msgSend_935Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_pattern1 = _registerName1("pattern"); - late final _sel_options1 = _registerName1("options"); - int _objc_msgSend_936( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_936( - obj, - sel, - ); - } - - late final __objc_msgSend_936Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_936 = __objc_msgSend_936Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_numberOfCaptureGroups1 = - _registerName1("numberOfCaptureGroups"); - late final _sel_escapedPatternForString_1 = - _registerName1("escapedPatternForString:"); - late final _sel_enumerateMatchesInString_options_range_usingBlock_1 = - _registerName1("enumerateMatchesInString:options:range:usingBlock:"); - void _objc_msgSend_937( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int options, - _NSRange range, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_937( - obj, - sel, - string, - options, - range, - block, - ); - } - - late final __objc_msgSend_937Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_937 = __objc_msgSend_937Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_matchesInString_options_range_1 = - _registerName1("matchesInString:options:range:"); - ffi.Pointer _objc_msgSend_938( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int options, - _NSRange range, - ) { - return __objc_msgSend_938( - obj, - sel, - string, - options, - range, - ); - } - - late final __objc_msgSend_938Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_938 = __objc_msgSend_938Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); - - late final _sel_numberOfMatchesInString_options_range_1 = - _registerName1("numberOfMatchesInString:options:range:"); - int _objc_msgSend_939( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int options, - _NSRange range, - ) { - return __objc_msgSend_939( - obj, - sel, - string, - options, - range, - ); - } - - late final __objc_msgSend_939Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_939 = __objc_msgSend_939Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange)>(); - - late final _sel_firstMatchInString_options_range_1 = - _registerName1("firstMatchInString:options:range:"); - ffi.Pointer _objc_msgSend_940( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int options, - _NSRange range, - ) { - return __objc_msgSend_940( - obj, - sel, - string, - options, - range, - ); - } - - late final __objc_msgSend_940Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_940 = __objc_msgSend_940Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); - - late final _sel_rangeOfFirstMatchInString_options_range_1 = - _registerName1("rangeOfFirstMatchInString:options:range:"); - _NSRange _objc_msgSend_941( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int options, - _NSRange range, - ) { - return __objc_msgSend_941( - obj, - sel, - string, - options, - range, - ); - } - - late final __objc_msgSend_941Ptr = _lookup< - ffi.NativeFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_941 = __objc_msgSend_941Ptr.asFunction< - _NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange)>(); - - void _objc_msgSend_941_stret( - ffi.Pointer<_NSRange> stret, - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int options, - _NSRange range, - ) { - return __objc_msgSend_941_stret( - stret, - obj, - sel, - string, - options, - range, - ); - } - - late final __objc_msgSend_941_stretPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_941_stret = __objc_msgSend_941_stretPtr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); - - late final _sel_stringByReplacingMatchesInString_options_range_withTemplate_1 = - _registerName1( - "stringByReplacingMatchesInString:options:range:withTemplate:"); - ffi.Pointer _objc_msgSend_942( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int options, - _NSRange range, - ffi.Pointer templ, - ) { - return __objc_msgSend_942( - obj, - sel, - string, - options, - range, - templ, - ); - } - - late final __objc_msgSend_942Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_942 = __objc_msgSend_942Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _NSRange, - ffi.Pointer)>(); - - late final _sel_replaceMatchesInString_options_range_withTemplate_1 = - _registerName1("replaceMatchesInString:options:range:withTemplate:"); - int _objc_msgSend_943( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int options, - _NSRange range, - ffi.Pointer templ, - ) { - return __objc_msgSend_943( - obj, - sel, - string, - options, - range, - templ, - ); - } - - late final __objc_msgSend_943Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_943 = __objc_msgSend_943Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, _NSRange, ffi.Pointer)>(); - - late final _sel_replacementStringForResult_inString_offset_template_1 = - _registerName1("replacementStringForResult:inString:offset:template:"); - ffi.Pointer _objc_msgSend_944( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer result, - ffi.Pointer string, - int offset, - ffi.Pointer templ, - ) { - return __objc_msgSend_944( - obj, - sel, - result, - string, - offset, - templ, - ); - } - - late final __objc_msgSend_944Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_944 = __objc_msgSend_944Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - late final _sel_escapedTemplateForString_1 = - _registerName1("escapedTemplateForString:"); - late final _sel_regularExpression1 = _registerName1("regularExpression"); - ffi.Pointer _objc_msgSend_945( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_945( - obj, - sel, - ); - } - - late final __objc_msgSend_945Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_945 = __objc_msgSend_945Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_phoneNumber1 = _registerName1("phoneNumber"); - late final _sel_numberOfRanges1 = _registerName1("numberOfRanges"); - late final _sel_rangeAtIndex_1 = _registerName1("rangeAtIndex:"); - late final _sel_rangeWithName_1 = _registerName1("rangeWithName:"); - late final _sel_resultByAdjustingRangesWithOffset_1 = - _registerName1("resultByAdjustingRangesWithOffset:"); - ffi.Pointer _objc_msgSend_946( - ffi.Pointer obj, - ffi.Pointer sel, - int offset, - ) { - return __objc_msgSend_946( - obj, - sel, - offset, - ); - } - - late final __objc_msgSend_946Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_946 = __objc_msgSend_946Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_addressComponents1 = _registerName1("addressComponents"); - late final _sel_orthographyCheckingResultWithRange_orthography_1 = - _registerName1("orthographyCheckingResultWithRange:orthography:"); - ffi.Pointer _objc_msgSend_947( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer orthography, - ) { - return __objc_msgSend_947( - obj, - sel, - range, - orthography, - ); - } - - late final __objc_msgSend_947Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_947 = __objc_msgSend_947Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange, ffi.Pointer)>(); - - late final _sel_spellCheckingResultWithRange_1 = - _registerName1("spellCheckingResultWithRange:"); - ffi.Pointer _objc_msgSend_948( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ) { - return __objc_msgSend_948( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_948Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange)>>('objc_msgSend'); - late final __objc_msgSend_948 = __objc_msgSend_948Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, _NSRange)>(); - - late final _sel_grammarCheckingResultWithRange_details_1 = - _registerName1("grammarCheckingResultWithRange:details:"); - ffi.Pointer _objc_msgSend_949( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer details, - ) { - return __objc_msgSend_949( - obj, - sel, - range, - details, - ); - } - - late final __objc_msgSend_949Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_949 = __objc_msgSend_949Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange, ffi.Pointer)>(); - - late final _sel_dateCheckingResultWithRange_date_1 = - _registerName1("dateCheckingResultWithRange:date:"); - ffi.Pointer _objc_msgSend_950( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer date, - ) { - return __objc_msgSend_950( - obj, - sel, - range, - date, - ); - } - - late final __objc_msgSend_950Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_950 = __objc_msgSend_950Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange, ffi.Pointer)>(); - - late final _sel_dateCheckingResultWithRange_date_timeZone_duration_1 = - _registerName1("dateCheckingResultWithRange:date:timeZone:duration:"); - ffi.Pointer _objc_msgSend_951( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer date, - ffi.Pointer timeZone, - double duration, - ) { - return __objc_msgSend_951( - obj, - sel, - range, - date, - timeZone, - duration, - ); - } - - late final __objc_msgSend_951Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer, - ffi.Pointer, - ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_951 = __objc_msgSend_951Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer, - ffi.Pointer, - double)>(); - - late final _sel_addressCheckingResultWithRange_components_1 = - _registerName1("addressCheckingResultWithRange:components:"); - ffi.Pointer _objc_msgSend_952( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer components, - ) { - return __objc_msgSend_952( - obj, - sel, - range, - components, - ); - } - - late final __objc_msgSend_952Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_952 = __objc_msgSend_952Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange, ffi.Pointer)>(); - - late final _sel_linkCheckingResultWithRange_URL_1 = - _registerName1("linkCheckingResultWithRange:URL:"); - ffi.Pointer _objc_msgSend_953( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer url, - ) { - return __objc_msgSend_953( - obj, - sel, - range, - url, - ); - } - - late final __objc_msgSend_953Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_953 = __objc_msgSend_953Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange, ffi.Pointer)>(); - - late final _sel_quoteCheckingResultWithRange_replacementString_1 = - _registerName1("quoteCheckingResultWithRange:replacementString:"); - ffi.Pointer _objc_msgSend_954( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer replacementString, - ) { - return __objc_msgSend_954( - obj, - sel, - range, - replacementString, - ); - } - - late final __objc_msgSend_954Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_954 = __objc_msgSend_954Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, _NSRange, ffi.Pointer)>(); - - late final _sel_dashCheckingResultWithRange_replacementString_1 = - _registerName1("dashCheckingResultWithRange:replacementString:"); - late final _sel_replacementCheckingResultWithRange_replacementString_1 = - _registerName1("replacementCheckingResultWithRange:replacementString:"); - late final _sel_correctionCheckingResultWithRange_replacementString_1 = - _registerName1("correctionCheckingResultWithRange:replacementString:"); - late final _sel_correctionCheckingResultWithRange_replacementString_alternativeStrings_1 = - _registerName1( - "correctionCheckingResultWithRange:replacementString:alternativeStrings:"); - ffi.Pointer _objc_msgSend_955( - ffi.Pointer obj, - ffi.Pointer sel, - _NSRange range, - ffi.Pointer replacementString, - ffi.Pointer alternativeStrings, - ) { - return __objc_msgSend_955( - obj, - sel, - range, - replacementString, - alternativeStrings, - ); - } - - late final __objc_msgSend_955Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_955 = __objc_msgSend_955Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - _NSRange, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_regularExpressionCheckingResultWithRanges_count_regularExpression_1 = - _registerName1( - "regularExpressionCheckingResultWithRanges:count:regularExpression:"); - ffi.Pointer _objc_msgSend_956( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSRange> ranges, - int count, - ffi.Pointer regularExpression, - ) { - return __objc_msgSend_956( - obj, - sel, - ranges, - count, - regularExpression, - ); - } - - late final __objc_msgSend_956Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_NSRange>, - ffi.UnsignedLong, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_956 = __objc_msgSend_956Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_NSRange>, - int, - ffi.Pointer)>(); - - late final _sel_phoneNumberCheckingResultWithRange_phoneNumber_1 = - _registerName1("phoneNumberCheckingResultWithRange:phoneNumber:"); - late final _sel_transitInformationCheckingResultWithRange_components_1 = - _registerName1("transitInformationCheckingResultWithRange:components:"); - late final _class_NSURLCache1 = _getClass1("NSURLCache"); - late final _sel_sharedURLCache1 = _registerName1("sharedURLCache"); - ffi.Pointer _objc_msgSend_957( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_957( - obj, - sel, - ); - } - - late final __objc_msgSend_957Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_957 = __objc_msgSend_957Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setSharedURLCache_1 = _registerName1("setSharedURLCache:"); - void _objc_msgSend_958( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_958( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_958Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_958 = __objc_msgSend_958Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_1 = - _registerName1("initWithMemoryCapacity:diskCapacity:diskPath:"); - instancetype _objc_msgSend_959( - ffi.Pointer obj, - ffi.Pointer sel, - int memoryCapacity, - int diskCapacity, - ffi.Pointer path, - ) { - return __objc_msgSend_959( - obj, - sel, - memoryCapacity, - diskCapacity, - path, - ); - } - - late final __objc_msgSend_959Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_959 = __objc_msgSend_959Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, int, - int, ffi.Pointer)>(); - - late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_1 = - _registerName1("initWithMemoryCapacity:diskCapacity:directoryURL:"); - instancetype _objc_msgSend_960( - ffi.Pointer obj, - ffi.Pointer sel, - int memoryCapacity, - int diskCapacity, - ffi.Pointer directoryURL, - ) { - return __objc_msgSend_960( - obj, - sel, - memoryCapacity, - diskCapacity, - directoryURL, - ); - } - - late final __objc_msgSend_960Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_960 = __objc_msgSend_960Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, int, - int, ffi.Pointer)>(); - - late final _class_NSCachedURLResponse1 = _getClass1("NSCachedURLResponse"); - late final _sel_initWithResponse_data_1 = - _registerName1("initWithResponse:data:"); - instancetype _objc_msgSend_961( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer response, - ffi.Pointer data, - ) { - return __objc_msgSend_961( - obj, - sel, - response, - data, - ); - } - - late final __objc_msgSend_961Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_961 = __objc_msgSend_961Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithResponse_data_userInfo_storagePolicy_1 = - _registerName1("initWithResponse:data:userInfo:storagePolicy:"); - instancetype _objc_msgSend_962( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer response, - ffi.Pointer data, - ffi.Pointer userInfo, - int storagePolicy, - ) { - return __objc_msgSend_962( - obj, - sel, - response, - data, - userInfo, - storagePolicy, - ); - } - - late final __objc_msgSend_962Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_962 = __objc_msgSend_962Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - - ffi.Pointer _objc_msgSend_963( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_963( - obj, - sel, - ); - } - - late final __objc_msgSend_963Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_963 = __objc_msgSend_963Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_storagePolicy1 = _registerName1("storagePolicy"); - int _objc_msgSend_964( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_964( - obj, - sel, - ); - } - - late final __objc_msgSend_964Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_964 = __objc_msgSend_964Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_cachedResponseForRequest_1 = - _registerName1("cachedResponseForRequest:"); - ffi.Pointer _objc_msgSend_965( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_965( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_965Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_965 = __objc_msgSend_965Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_storeCachedResponse_forRequest_1 = - _registerName1("storeCachedResponse:forRequest:"); - void _objc_msgSend_966( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cachedResponse, - ffi.Pointer request, - ) { - return __objc_msgSend_966( - obj, - sel, - cachedResponse, - request, - ); - } - - late final __objc_msgSend_966Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_966 = __objc_msgSend_966Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_removeCachedResponseForRequest_1 = - _registerName1("removeCachedResponseForRequest:"); - void _objc_msgSend_967( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_967( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_967Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_967 = __objc_msgSend_967Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removeAllCachedResponses1 = - _registerName1("removeAllCachedResponses"); - late final _sel_removeCachedResponsesSinceDate_1 = - _registerName1("removeCachedResponsesSinceDate:"); - late final _sel_memoryCapacity1 = _registerName1("memoryCapacity"); - late final _sel_setMemoryCapacity_1 = _registerName1("setMemoryCapacity:"); - late final _sel_diskCapacity1 = _registerName1("diskCapacity"); - late final _sel_setDiskCapacity_1 = _registerName1("setDiskCapacity:"); - late final _sel_currentMemoryUsage1 = _registerName1("currentMemoryUsage"); - late final _sel_currentDiskUsage1 = _registerName1("currentDiskUsage"); - late final _class_NSURLSessionDataTask1 = _getClass1("NSURLSessionDataTask"); - late final _sel_storeCachedResponse_forDataTask_1 = - _registerName1("storeCachedResponse:forDataTask:"); - void _objc_msgSend_968( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cachedResponse, - ffi.Pointer dataTask, - ) { - return __objc_msgSend_968( - obj, - sel, - cachedResponse, - dataTask, - ); - } - - late final __objc_msgSend_968Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_968 = __objc_msgSend_968Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_getCachedResponseForDataTask_completionHandler_1 = - _registerName1("getCachedResponseForDataTask:completionHandler:"); - void _objc_msgSend_969( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dataTask, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_969( - obj, - sel, - dataTask, - completionHandler, - ); - } - - late final __objc_msgSend_969Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_969 = __objc_msgSend_969Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_removeCachedResponseForDataTask_1 = - _registerName1("removeCachedResponseForDataTask:"); - void _objc_msgSend_970( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dataTask, - ) { - return __objc_msgSend_970( - obj, - sel, - dataTask, - ); - } - - late final __objc_msgSend_970Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_970 = __objc_msgSend_970Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSURLConnection1 = _getClass1("NSURLConnection"); - late final _sel_initWithRequest_delegate_startImmediately_1 = - _registerName1("initWithRequest:delegate:startImmediately:"); - instancetype _objc_msgSend_971( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer delegate, - bool startImmediately, - ) { - return __objc_msgSend_971( - obj, - sel, - request, - delegate, - startImmediately, - ); - } - - late final __objc_msgSend_971Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_971 = __objc_msgSend_971Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_initWithRequest_delegate_1 = - _registerName1("initWithRequest:delegate:"); - instancetype _objc_msgSend_972( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer delegate, - ) { - return __objc_msgSend_972( - obj, - sel, - request, - delegate, - ); - } - - late final __objc_msgSend_972Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_972 = __objc_msgSend_972Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_connectionWithRequest_delegate_1 = - _registerName1("connectionWithRequest:delegate:"); - ffi.Pointer _objc_msgSend_973( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer delegate, - ) { - return __objc_msgSend_973( - obj, - sel, - request, - delegate, - ); - } - - late final __objc_msgSend_973Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_973 = __objc_msgSend_973Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_974( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_974( - obj, - sel, - ); - } - - late final __objc_msgSend_974Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_974 = __objc_msgSend_974Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_unscheduleFromRunLoop_forMode_1 = - _registerName1("unscheduleFromRunLoop:forMode:"); - late final _sel_setDelegateQueue_1 = _registerName1("setDelegateQueue:"); - void _objc_msgSend_975( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer queue, - ) { - return __objc_msgSend_975( - obj, - sel, - queue, - ); - } - - late final __objc_msgSend_975Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_975 = __objc_msgSend_975Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_canHandleRequest_1 = _registerName1("canHandleRequest:"); - bool _objc_msgSend_976( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_976( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_976Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_976 = __objc_msgSend_976Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_sendSynchronousRequest_returningResponse_error_1 = - _registerName1("sendSynchronousRequest:returningResponse:error:"); - ffi.Pointer _objc_msgSend_977( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer> response, - ffi.Pointer> error, - ) { - return __objc_msgSend_977( - obj, - sel, - request, - response, - error, - ); - } - - late final __objc_msgSend_977Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_977 = __objc_msgSend_977Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _sel_sendAsynchronousRequest_queue_completionHandler_1 = - _registerName1("sendAsynchronousRequest:queue:completionHandler:"); - void _objc_msgSend_978( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer queue, - ffi.Pointer<_ObjCBlock> handler, - ) { - return __objc_msgSend_978( - obj, - sel, - request, - queue, - handler, - ); - } - - late final __objc_msgSend_978Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_978 = __objc_msgSend_978Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _class_NSURLCredential1 = _getClass1("NSURLCredential"); - late final _sel_persistence1 = _registerName1("persistence"); - int _objc_msgSend_979( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_979( - obj, - sel, - ); - } - - late final __objc_msgSend_979Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_979 = __objc_msgSend_979Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithUser_password_persistence_1 = - _registerName1("initWithUser:password:persistence:"); - instancetype _objc_msgSend_980( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer user, - ffi.Pointer password, - int persistence, - ) { - return __objc_msgSend_980( - obj, - sel, - user, - password, - persistence, - ); - } - - late final __objc_msgSend_980Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_980 = __objc_msgSend_980Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_credentialWithUser_password_persistence_1 = - _registerName1("credentialWithUser:password:persistence:"); - ffi.Pointer _objc_msgSend_981( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer user, - ffi.Pointer password, - int persistence, - ) { - return __objc_msgSend_981( - obj, - sel, - user, - password, - persistence, - ); - } - - late final __objc_msgSend_981Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_981 = __objc_msgSend_981Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - - late final _sel_hasPassword1 = _registerName1("hasPassword"); - late final _sel_initWithIdentity_certificates_persistence_1 = - _registerName1("initWithIdentity:certificates:persistence:"); - instancetype _objc_msgSend_982( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<__SecIdentity> identity, - ffi.Pointer certArray, - int persistence, - ) { - return __objc_msgSend_982( - obj, - sel, - identity, - certArray, - persistence, - ); - } - - late final __objc_msgSend_982Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<__SecIdentity>, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_982 = __objc_msgSend_982Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<__SecIdentity>, ffi.Pointer, int)>(); - - late final _sel_credentialWithIdentity_certificates_persistence_1 = - _registerName1("credentialWithIdentity:certificates:persistence:"); - ffi.Pointer _objc_msgSend_983( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<__SecIdentity> identity, - ffi.Pointer certArray, - int persistence, - ) { - return __objc_msgSend_983( - obj, - sel, - identity, - certArray, - persistence, - ); - } - - late final __objc_msgSend_983Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<__SecIdentity>, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_983 = __objc_msgSend_983Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<__SecIdentity>, - ffi.Pointer, - int)>(); - - late final _sel_identity1 = _registerName1("identity"); - ffi.Pointer<__SecIdentity> _objc_msgSend_984( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_984( - obj, - sel, - ); - } - - late final __objc_msgSend_984Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer<__SecIdentity> Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_984 = __objc_msgSend_984Ptr.asFunction< - ffi.Pointer<__SecIdentity> Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_certificates1 = _registerName1("certificates"); - late final _sel_initWithTrust_1 = _registerName1("initWithTrust:"); - instancetype _objc_msgSend_985( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<__SecTrust> trust, - ) { - return __objc_msgSend_985( - obj, - sel, - trust, - ); - } - - late final __objc_msgSend_985Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<__SecTrust>)>>('objc_msgSend'); - late final __objc_msgSend_985 = __objc_msgSend_985Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<__SecTrust>)>(); - - late final _sel_credentialForTrust_1 = _registerName1("credentialForTrust:"); - ffi.Pointer _objc_msgSend_986( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<__SecTrust> trust, - ) { - return __objc_msgSend_986( - obj, - sel, - trust, - ); - } - - late final __objc_msgSend_986Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<__SecTrust>)>>('objc_msgSend'); - late final __objc_msgSend_986 = __objc_msgSend_986Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<__SecTrust>)>(); - - late final _class_NSURLProtectionSpace1 = _getClass1("NSURLProtectionSpace"); - late final _sel_initWithHost_port_protocol_realm_authenticationMethod_1 = - _registerName1("initWithHost:port:protocol:realm:authenticationMethod:"); - instancetype _objc_msgSend_987( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer host, - int port, - ffi.Pointer protocol, - ffi.Pointer realm, - ffi.Pointer authenticationMethod, - ) { - return __objc_msgSend_987( - obj, - sel, - host, - port, - protocol, - realm, - authenticationMethod, - ); - } - - late final __objc_msgSend_987Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_987 = __objc_msgSend_987Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithProxyHost_port_type_realm_authenticationMethod_1 = - _registerName1("initWithProxyHost:port:type:realm:authenticationMethod:"); - late final _sel_realm1 = _registerName1("realm"); - late final _sel_receivesCredentialSecurely1 = - _registerName1("receivesCredentialSecurely"); - late final _sel_isProxy1 = _registerName1("isProxy"); - late final _sel_proxyType1 = _registerName1("proxyType"); - late final _sel_protocol1 = _registerName1("protocol"); - late final _sel_authenticationMethod1 = - _registerName1("authenticationMethod"); - late final _sel_distinguishedNames1 = _registerName1("distinguishedNames"); - late final _sel_serverTrust1 = _registerName1("serverTrust"); - ffi.Pointer<__SecTrust> _objc_msgSend_988( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_988( - obj, - sel, - ); - } - - late final __objc_msgSend_988Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer<__SecTrust> Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_988 = __objc_msgSend_988Ptr.asFunction< - ffi.Pointer<__SecTrust> Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLCredentialStorage1 = - _getClass1("NSURLCredentialStorage"); - late final _sel_sharedCredentialStorage1 = - _registerName1("sharedCredentialStorage"); - ffi.Pointer _objc_msgSend_989( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_989( - obj, - sel, - ); - } - - late final __objc_msgSend_989Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_989 = __objc_msgSend_989Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_credentialsForProtectionSpace_1 = - _registerName1("credentialsForProtectionSpace:"); - ffi.Pointer _objc_msgSend_990( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer space, - ) { - return __objc_msgSend_990( - obj, - sel, - space, - ); - } - - late final __objc_msgSend_990Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_990 = __objc_msgSend_990Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_allCredentials1 = _registerName1("allCredentials"); - late final _sel_setCredential_forProtectionSpace_1 = - _registerName1("setCredential:forProtectionSpace:"); - void _objc_msgSend_991( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer credential, - ffi.Pointer space, - ) { - return __objc_msgSend_991( - obj, - sel, - credential, - space, - ); - } - - late final __objc_msgSend_991Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_991 = __objc_msgSend_991Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_removeCredential_forProtectionSpace_1 = - _registerName1("removeCredential:forProtectionSpace:"); - late final _sel_removeCredential_forProtectionSpace_options_1 = - _registerName1("removeCredential:forProtectionSpace:options:"); - void _objc_msgSend_992( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer credential, - ffi.Pointer space, - ffi.Pointer options, - ) { - return __objc_msgSend_992( - obj, - sel, - credential, - space, - options, - ); - } - - late final __objc_msgSend_992Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_992 = __objc_msgSend_992Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_defaultCredentialForProtectionSpace_1 = - _registerName1("defaultCredentialForProtectionSpace:"); - ffi.Pointer _objc_msgSend_993( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer space, - ) { - return __objc_msgSend_993( - obj, - sel, - space, - ); - } - - late final __objc_msgSend_993Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_993 = __objc_msgSend_993Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setDefaultCredential_forProtectionSpace_1 = - _registerName1("setDefaultCredential:forProtectionSpace:"); - late final _sel_getCredentialsForProtectionSpace_task_completionHandler_1 = - _registerName1( - "getCredentialsForProtectionSpace:task:completionHandler:"); - void _objc_msgSend_994( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protectionSpace, - ffi.Pointer task, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_994( - obj, - sel, - protectionSpace, - task, - completionHandler, - ); - } - - late final __objc_msgSend_994Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_994 = __objc_msgSend_994Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_setCredential_forProtectionSpace_task_1 = - _registerName1("setCredential:forProtectionSpace:task:"); - void _objc_msgSend_995( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer credential, - ffi.Pointer protectionSpace, - ffi.Pointer task, - ) { - return __objc_msgSend_995( - obj, - sel, - credential, - protectionSpace, - task, - ); - } - - late final __objc_msgSend_995Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_995 = __objc_msgSend_995Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removeCredential_forProtectionSpace_options_task_1 = - _registerName1("removeCredential:forProtectionSpace:options:task:"); - void _objc_msgSend_996( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer credential, - ffi.Pointer protectionSpace, - ffi.Pointer options, - ffi.Pointer task, - ) { - return __objc_msgSend_996( - obj, - sel, - credential, - protectionSpace, - options, - task, - ); - } - - late final __objc_msgSend_996Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_996 = __objc_msgSend_996Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_getDefaultCredentialForProtectionSpace_task_completionHandler_1 = - _registerName1( - "getDefaultCredentialForProtectionSpace:task:completionHandler:"); - void _objc_msgSend_997( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer space, - ffi.Pointer task, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_997( - obj, - sel, - space, - task, - completionHandler, - ); - } - - late final __objc_msgSend_997Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_997 = __objc_msgSend_997Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_setDefaultCredential_forProtectionSpace_task_1 = - _registerName1("setDefaultCredential:forProtectionSpace:task:"); - late final _class_NSURLProtocol1 = _getClass1("NSURLProtocol"); - late final _sel_initWithRequest_cachedResponse_client_1 = - _registerName1("initWithRequest:cachedResponse:client:"); - instancetype _objc_msgSend_998( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer cachedResponse, - ffi.Pointer client, - ) { - return __objc_msgSend_998( - obj, - sel, - request, - cachedResponse, - client, - ); - } - - late final __objc_msgSend_998Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_998 = __objc_msgSend_998Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_client1 = _registerName1("client"); - late final _sel_request1 = _registerName1("request"); - late final _sel_cachedResponse1 = _registerName1("cachedResponse"); - ffi.Pointer _objc_msgSend_999( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_999( - obj, - sel, - ); - } - - late final __objc_msgSend_999Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_999 = __objc_msgSend_999Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_canInitWithRequest_1 = _registerName1("canInitWithRequest:"); - late final _sel_canonicalRequestForRequest_1 = - _registerName1("canonicalRequestForRequest:"); - ffi.Pointer _objc_msgSend_1000( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_1000( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_1000Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1000 = __objc_msgSend_1000Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_requestIsCacheEquivalent_toRequest_1 = - _registerName1("requestIsCacheEquivalent:toRequest:"); - bool _objc_msgSend_1001( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer a, - ffi.Pointer b, - ) { - return __objc_msgSend_1001( - obj, - sel, - a, - b, - ); - } - - late final __objc_msgSend_1001Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1001 = __objc_msgSend_1001Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_startLoading1 = _registerName1("startLoading"); - late final _sel_stopLoading1 = _registerName1("stopLoading"); - late final _sel_propertyForKey_inRequest_1 = - _registerName1("propertyForKey:inRequest:"); - ffi.Pointer _objc_msgSend_1002( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ffi.Pointer request, - ) { - return __objc_msgSend_1002( - obj, - sel, - key, - request, - ); - } - - late final __objc_msgSend_1002Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1002 = __objc_msgSend_1002Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSMutableURLRequest1 = _getClass1("NSMutableURLRequest"); - late final _sel_setURL_1 = _registerName1("setURL:"); - late final _sel_setCachePolicy_1 = _registerName1("setCachePolicy:"); - void _objc_msgSend_1003( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_1003( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1003Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1003 = __objc_msgSend_1003Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_setTimeoutInterval_1 = _registerName1("setTimeoutInterval:"); - late final _sel_setMainDocumentURL_1 = _registerName1("setMainDocumentURL:"); - late final _sel_setNetworkServiceType_1 = - _registerName1("setNetworkServiceType:"); - void _objc_msgSend_1004( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_1004( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1004Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1004 = __objc_msgSend_1004Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_setAllowsCellularAccess_1 = - _registerName1("setAllowsCellularAccess:"); - late final _sel_setAllowsExpensiveNetworkAccess_1 = - _registerName1("setAllowsExpensiveNetworkAccess:"); - late final _sel_setAllowsConstrainedNetworkAccess_1 = - _registerName1("setAllowsConstrainedNetworkAccess:"); - late final _sel_setAssumesHTTP3Capable_1 = - _registerName1("setAssumesHTTP3Capable:"); - late final _sel_setAttribution_1 = _registerName1("setAttribution:"); - void _objc_msgSend_1005( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_1005( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1005Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1005 = __objc_msgSend_1005Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_setRequiresDNSSECValidation_1 = - _registerName1("setRequiresDNSSECValidation:"); - late final _sel_setHTTPMethod_1 = _registerName1("setHTTPMethod:"); - late final _sel_setAllHTTPHeaderFields_1 = - _registerName1("setAllHTTPHeaderFields:"); - late final _sel_setValue_forHTTPHeaderField_1 = - _registerName1("setValue:forHTTPHeaderField:"); - void _objc_msgSend_1006( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer field, - ) { - return __objc_msgSend_1006( - obj, - sel, - value, - field, - ); - } - - late final __objc_msgSend_1006Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1006 = __objc_msgSend_1006Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_addValue_forHTTPHeaderField_1 = - _registerName1("addValue:forHTTPHeaderField:"); - late final _sel_setHTTPBody_1 = _registerName1("setHTTPBody:"); - void _objc_msgSend_1007( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_1007( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1007Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1007 = __objc_msgSend_1007Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_setHTTPBodyStream_1 = _registerName1("setHTTPBodyStream:"); - void _objc_msgSend_1008( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_1008( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1008Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1008 = __objc_msgSend_1008Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_setHTTPShouldHandleCookies_1 = - _registerName1("setHTTPShouldHandleCookies:"); - late final _sel_setHTTPShouldUsePipelining_1 = - _registerName1("setHTTPShouldUsePipelining:"); - late final _sel_setProperty_forKey_inRequest_1 = - _registerName1("setProperty:forKey:inRequest:"); - void _objc_msgSend_1009( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer key, - ffi.Pointer request, - ) { - return __objc_msgSend_1009( - obj, - sel, - value, - key, - request, - ); - } - - late final __objc_msgSend_1009Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1009 = __objc_msgSend_1009Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removePropertyForKey_inRequest_1 = - _registerName1("removePropertyForKey:inRequest:"); - void _objc_msgSend_1010( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer key, - ffi.Pointer request, - ) { - return __objc_msgSend_1010( - obj, - sel, - key, - request, - ); - } - - late final __objc_msgSend_1010Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1010 = __objc_msgSend_1010Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_registerClass_1 = _registerName1("registerClass:"); - late final _sel_unregisterClass_1 = _registerName1("unregisterClass:"); - late final _sel_canInitWithTask_1 = _registerName1("canInitWithTask:"); - bool _objc_msgSend_1011( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer task, - ) { - return __objc_msgSend_1011( - obj, - sel, - task, - ); - } - - late final __objc_msgSend_1011Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1011 = __objc_msgSend_1011Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithTask_cachedResponse_client_1 = - _registerName1("initWithTask:cachedResponse:client:"); - instancetype _objc_msgSend_1012( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer task, - ffi.Pointer cachedResponse, - ffi.Pointer client, - ) { - return __objc_msgSend_1012( - obj, - sel, - task, - cachedResponse, - client, - ); - } - - late final __objc_msgSend_1012Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1012 = __objc_msgSend_1012Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_task1 = _registerName1("task"); - ffi.Pointer _objc_msgSend_1013( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1013( - obj, - sel, - ); - } - - late final __objc_msgSend_1013Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1013 = __objc_msgSend_1013Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSXMLParser1 = _getClass1("NSXMLParser"); - late final _sel_initWithStream_1 = _registerName1("initWithStream:"); - instancetype _objc_msgSend_1014( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer stream, - ) { - return __objc_msgSend_1014( - obj, - sel, - stream, - ); - } - - late final __objc_msgSend_1014Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1014 = __objc_msgSend_1014Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_shouldProcessNamespaces1 = - _registerName1("shouldProcessNamespaces"); - late final _sel_setShouldProcessNamespaces_1 = - _registerName1("setShouldProcessNamespaces:"); - late final _sel_shouldReportNamespacePrefixes1 = - _registerName1("shouldReportNamespacePrefixes"); - late final _sel_setShouldReportNamespacePrefixes_1 = - _registerName1("setShouldReportNamespacePrefixes:"); - late final _sel_externalEntityResolvingPolicy1 = - _registerName1("externalEntityResolvingPolicy"); - int _objc_msgSend_1015( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1015( - obj, - sel, - ); - } - - late final __objc_msgSend_1015Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1015 = __objc_msgSend_1015Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setExternalEntityResolvingPolicy_1 = - _registerName1("setExternalEntityResolvingPolicy:"); - void _objc_msgSend_1016( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_1016( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1016Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1016 = __objc_msgSend_1016Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_allowedExternalEntityURLs1 = - _registerName1("allowedExternalEntityURLs"); - late final _sel_setAllowedExternalEntityURLs_1 = - _registerName1("setAllowedExternalEntityURLs:"); - void _objc_msgSend_1017( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_1017( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1017Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1017 = __objc_msgSend_1017Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_parse1 = _registerName1("parse"); - late final _sel_abortParsing1 = _registerName1("abortParsing"); - late final _sel_parserError1 = _registerName1("parserError"); - late final _sel_shouldResolveExternalEntities1 = - _registerName1("shouldResolveExternalEntities"); - late final _sel_setShouldResolveExternalEntities_1 = - _registerName1("setShouldResolveExternalEntities:"); - late final _sel_publicID1 = _registerName1("publicID"); - late final _sel_systemID1 = _registerName1("systemID"); - late final _sel_lineNumber1 = _registerName1("lineNumber"); - late final _sel_columnNumber1 = _registerName1("columnNumber"); - late final _class_NSFileWrapper1 = _getClass1("NSFileWrapper"); - late final _sel_initWithURL_options_error_1 = - _registerName1("initWithURL:options:error:"); - instancetype _objc_msgSend_1018( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int options, - ffi.Pointer> outError, - ) { - return __objc_msgSend_1018( - obj, - sel, - url, - options, - outError, - ); - } - - late final __objc_msgSend_1018Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1018 = __objc_msgSend_1018Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_initDirectoryWithFileWrappers_1 = - _registerName1("initDirectoryWithFileWrappers:"); - late final _sel_initRegularFileWithContents_1 = - _registerName1("initRegularFileWithContents:"); - late final _sel_initSymbolicLinkWithDestinationURL_1 = - _registerName1("initSymbolicLinkWithDestinationURL:"); - late final _sel_initWithSerializedRepresentation_1 = - _registerName1("initWithSerializedRepresentation:"); - late final _sel_isDirectory1 = _registerName1("isDirectory"); - late final _sel_isRegularFile1 = _registerName1("isRegularFile"); - late final _sel_isSymbolicLink1 = _registerName1("isSymbolicLink"); - late final _sel_preferredFilename1 = _registerName1("preferredFilename"); - late final _sel_setPreferredFilename_1 = - _registerName1("setPreferredFilename:"); - late final _sel_filename1 = _registerName1("filename"); - late final _sel_setFilename_1 = _registerName1("setFilename:"); - late final _sel_fileAttributes1 = _registerName1("fileAttributes"); - late final _sel_setFileAttributes_1 = _registerName1("setFileAttributes:"); - late final _sel_matchesContentsOfURL_1 = - _registerName1("matchesContentsOfURL:"); - late final _sel_readFromURL_options_error_1 = - _registerName1("readFromURL:options:error:"); - bool _objc_msgSend_1019( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int options, - ffi.Pointer> outError, - ) { - return __objc_msgSend_1019( - obj, - sel, - url, - options, - outError, - ); - } - - late final __objc_msgSend_1019Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1019 = __objc_msgSend_1019Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_writeToURL_options_originalContentsURL_error_1 = - _registerName1("writeToURL:options:originalContentsURL:error:"); - bool _objc_msgSend_1020( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int options, - ffi.Pointer originalContentsURL, - ffi.Pointer> outError, - ) { - return __objc_msgSend_1020( - obj, - sel, - url, - options, - originalContentsURL, - outError, - ); - } - - late final __objc_msgSend_1020Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1020 = __objc_msgSend_1020Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_serializedRepresentation1 = - _registerName1("serializedRepresentation"); - late final _sel_addFileWrapper_1 = _registerName1("addFileWrapper:"); - ffi.Pointer _objc_msgSend_1021( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer child, - ) { - return __objc_msgSend_1021( - obj, - sel, - child, - ); - } - - late final __objc_msgSend_1021Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1021 = __objc_msgSend_1021Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_addRegularFileWithContents_preferredFilename_1 = - _registerName1("addRegularFileWithContents:preferredFilename:"); - ffi.Pointer _objc_msgSend_1022( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ffi.Pointer fileName, - ) { - return __objc_msgSend_1022( - obj, - sel, - data, - fileName, - ); - } - - late final __objc_msgSend_1022Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1022 = __objc_msgSend_1022Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removeFileWrapper_1 = _registerName1("removeFileWrapper:"); - void _objc_msgSend_1023( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer child, - ) { - return __objc_msgSend_1023( - obj, - sel, - child, - ); - } - - late final __objc_msgSend_1023Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1023 = __objc_msgSend_1023Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_fileWrappers1 = _registerName1("fileWrappers"); - late final _sel_keyForFileWrapper_1 = _registerName1("keyForFileWrapper:"); - ffi.Pointer _objc_msgSend_1024( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer child, - ) { - return __objc_msgSend_1024( - obj, - sel, - child, - ); - } - - late final __objc_msgSend_1024Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1024 = __objc_msgSend_1024Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_regularFileContents1 = _registerName1("regularFileContents"); - late final _sel_symbolicLinkDestinationURL1 = - _registerName1("symbolicLinkDestinationURL"); - late final _sel_initSymbolicLinkWithDestination_1 = - _registerName1("initSymbolicLinkWithDestination:"); - late final _sel_needsToBeUpdatedFromPath_1 = - _registerName1("needsToBeUpdatedFromPath:"); - late final _sel_updateFromPath_1 = _registerName1("updateFromPath:"); - late final _sel_writeToFile_atomically_updateFilenames_1 = - _registerName1("writeToFile:atomically:updateFilenames:"); - bool _objc_msgSend_1025( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool atomicFlag, - bool updateFilenamesFlag, - ) { - return __objc_msgSend_1025( - obj, - sel, - path, - atomicFlag, - updateFilenamesFlag, - ); - } - - late final __objc_msgSend_1025Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_1025 = __objc_msgSend_1025Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool, bool)>(); - - late final _sel_addFileWithPath_1 = _registerName1("addFileWithPath:"); - late final _sel_addSymbolicLinkWithDestination_preferredFilename_1 = - _registerName1("addSymbolicLinkWithDestination:preferredFilename:"); - late final _sel_symbolicLinkDestination1 = - _registerName1("symbolicLinkDestination"); - late final _class_NSURLSession1 = _getClass1("NSURLSession"); - late final _sel_sharedSession1 = _registerName1("sharedSession"); - ffi.Pointer _objc_msgSend_1026( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1026( - obj, - sel, - ); - } - - late final __objc_msgSend_1026Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1026 = __objc_msgSend_1026Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLSessionConfiguration1 = - _getClass1("NSURLSessionConfiguration"); - late final _sel_defaultSessionConfiguration1 = - _registerName1("defaultSessionConfiguration"); - ffi.Pointer _objc_msgSend_1027( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1027( - obj, - sel, - ); - } - - late final __objc_msgSend_1027Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1027 = __objc_msgSend_1027Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_ephemeralSessionConfiguration1 = - _registerName1("ephemeralSessionConfiguration"); - late final _sel_backgroundSessionConfigurationWithIdentifier_1 = - _registerName1("backgroundSessionConfigurationWithIdentifier:"); - ffi.Pointer _objc_msgSend_1028( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer identifier, - ) { - return __objc_msgSend_1028( - obj, - sel, - identifier, - ); - } - - late final __objc_msgSend_1028Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1028 = __objc_msgSend_1028Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_identifier1 = _registerName1("identifier"); - late final _sel_requestCachePolicy1 = _registerName1("requestCachePolicy"); - late final _sel_setRequestCachePolicy_1 = - _registerName1("setRequestCachePolicy:"); - late final _sel_timeoutIntervalForRequest1 = - _registerName1("timeoutIntervalForRequest"); - late final _sel_setTimeoutIntervalForRequest_1 = - _registerName1("setTimeoutIntervalForRequest:"); - late final _sel_timeoutIntervalForResource1 = - _registerName1("timeoutIntervalForResource"); - late final _sel_setTimeoutIntervalForResource_1 = - _registerName1("setTimeoutIntervalForResource:"); - late final _sel_waitsForConnectivity1 = - _registerName1("waitsForConnectivity"); - late final _sel_setWaitsForConnectivity_1 = - _registerName1("setWaitsForConnectivity:"); - late final _sel_isDiscretionary1 = _registerName1("isDiscretionary"); - late final _sel_setDiscretionary_1 = _registerName1("setDiscretionary:"); - late final _sel_sharedContainerIdentifier1 = - _registerName1("sharedContainerIdentifier"); - late final _sel_setSharedContainerIdentifier_1 = - _registerName1("setSharedContainerIdentifier:"); - late final _sel_sessionSendsLaunchEvents1 = - _registerName1("sessionSendsLaunchEvents"); - late final _sel_setSessionSendsLaunchEvents_1 = - _registerName1("setSessionSendsLaunchEvents:"); - late final _sel_connectionProxyDictionary1 = - _registerName1("connectionProxyDictionary"); - late final _sel_setConnectionProxyDictionary_1 = - _registerName1("setConnectionProxyDictionary:"); - late final _sel_TLSMinimumSupportedProtocol1 = - _registerName1("TLSMinimumSupportedProtocol"); - int _objc_msgSend_1029( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1029( - obj, - sel, - ); - } - - late final __objc_msgSend_1029Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1029 = __objc_msgSend_1029Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setTLSMinimumSupportedProtocol_1 = - _registerName1("setTLSMinimumSupportedProtocol:"); - void _objc_msgSend_1030( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_1030( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1030Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1030 = __objc_msgSend_1030Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_TLSMaximumSupportedProtocol1 = - _registerName1("TLSMaximumSupportedProtocol"); - late final _sel_setTLSMaximumSupportedProtocol_1 = - _registerName1("setTLSMaximumSupportedProtocol:"); - late final _sel_TLSMinimumSupportedProtocolVersion1 = - _registerName1("TLSMinimumSupportedProtocolVersion"); - int _objc_msgSend_1031( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1031( - obj, - sel, - ); - } - - late final __objc_msgSend_1031Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1031 = __objc_msgSend_1031Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setTLSMinimumSupportedProtocolVersion_1 = - _registerName1("setTLSMinimumSupportedProtocolVersion:"); - void _objc_msgSend_1032( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_1032( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1032Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1032 = __objc_msgSend_1032Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_TLSMaximumSupportedProtocolVersion1 = - _registerName1("TLSMaximumSupportedProtocolVersion"); - late final _sel_setTLSMaximumSupportedProtocolVersion_1 = - _registerName1("setTLSMaximumSupportedProtocolVersion:"); - late final _sel_HTTPShouldSetCookies1 = - _registerName1("HTTPShouldSetCookies"); - late final _sel_setHTTPShouldSetCookies_1 = - _registerName1("setHTTPShouldSetCookies:"); - late final _sel_HTTPCookieAcceptPolicy1 = - _registerName1("HTTPCookieAcceptPolicy"); - late final _sel_setHTTPCookieAcceptPolicy_1 = - _registerName1("setHTTPCookieAcceptPolicy:"); - late final _sel_HTTPAdditionalHeaders1 = - _registerName1("HTTPAdditionalHeaders"); - late final _sel_setHTTPAdditionalHeaders_1 = - _registerName1("setHTTPAdditionalHeaders:"); - late final _sel_HTTPMaximumConnectionsPerHost1 = - _registerName1("HTTPMaximumConnectionsPerHost"); - late final _sel_setHTTPMaximumConnectionsPerHost_1 = - _registerName1("setHTTPMaximumConnectionsPerHost:"); - late final _sel_HTTPCookieStorage1 = _registerName1("HTTPCookieStorage"); - ffi.Pointer _objc_msgSend_1033( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1033( - obj, - sel, - ); - } - - late final __objc_msgSend_1033Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1033 = __objc_msgSend_1033Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setHTTPCookieStorage_1 = - _registerName1("setHTTPCookieStorage:"); - void _objc_msgSend_1034( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_1034( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1034Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1034 = __objc_msgSend_1034Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_URLCredentialStorage1 = - _registerName1("URLCredentialStorage"); - ffi.Pointer _objc_msgSend_1035( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1035( - obj, - sel, - ); - } - - late final __objc_msgSend_1035Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1035 = __objc_msgSend_1035Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setURLCredentialStorage_1 = - _registerName1("setURLCredentialStorage:"); - void _objc_msgSend_1036( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_1036( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1036Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1036 = __objc_msgSend_1036Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_URLCache1 = _registerName1("URLCache"); - ffi.Pointer _objc_msgSend_1037( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1037( - obj, - sel, - ); - } - - late final __objc_msgSend_1037Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1037 = __objc_msgSend_1037Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setURLCache_1 = _registerName1("setURLCache:"); - void _objc_msgSend_1038( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_1038( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1038Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1038 = __objc_msgSend_1038Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_shouldUseExtendedBackgroundIdleMode1 = - _registerName1("shouldUseExtendedBackgroundIdleMode"); - late final _sel_setShouldUseExtendedBackgroundIdleMode_1 = - _registerName1("setShouldUseExtendedBackgroundIdleMode:"); - late final _sel_protocolClasses1 = _registerName1("protocolClasses"); - late final _sel_setProtocolClasses_1 = _registerName1("setProtocolClasses:"); - void _objc_msgSend_1039( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_1039( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1039Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1039 = __objc_msgSend_1039Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_multipathServiceType1 = - _registerName1("multipathServiceType"); - int _objc_msgSend_1040( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1040( - obj, - sel, - ); - } - - late final __objc_msgSend_1040Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1040 = __objc_msgSend_1040Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setMultipathServiceType_1 = - _registerName1("setMultipathServiceType:"); - void _objc_msgSend_1041( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_1041( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1041Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1041 = __objc_msgSend_1041Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_backgroundSessionConfiguration_1 = - _registerName1("backgroundSessionConfiguration:"); - late final _sel_sessionWithConfiguration_1 = - _registerName1("sessionWithConfiguration:"); - ffi.Pointer _objc_msgSend_1042( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer configuration, - ) { - return __objc_msgSend_1042( - obj, - sel, - configuration, - ); - } - - late final __objc_msgSend_1042Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1042 = __objc_msgSend_1042Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_sessionWithConfiguration_delegate_delegateQueue_1 = - _registerName1("sessionWithConfiguration:delegate:delegateQueue:"); - ffi.Pointer _objc_msgSend_1043( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer configuration, - ffi.Pointer delegate, - ffi.Pointer queue, - ) { - return __objc_msgSend_1043( - obj, - sel, - configuration, - delegate, - queue, - ); - } - - late final __objc_msgSend_1043Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1043 = __objc_msgSend_1043Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_delegateQueue1 = _registerName1("delegateQueue"); - late final _sel_configuration1 = _registerName1("configuration"); - late final _sel_sessionDescription1 = _registerName1("sessionDescription"); - late final _sel_setSessionDescription_1 = - _registerName1("setSessionDescription:"); - late final _sel_finishTasksAndInvalidate1 = - _registerName1("finishTasksAndInvalidate"); - late final _sel_invalidateAndCancel1 = _registerName1("invalidateAndCancel"); - late final _sel_resetWithCompletionHandler_1 = - _registerName1("resetWithCompletionHandler:"); - late final _sel_flushWithCompletionHandler_1 = - _registerName1("flushWithCompletionHandler:"); - late final _sel_getTasksWithCompletionHandler_1 = - _registerName1("getTasksWithCompletionHandler:"); - void _objc_msgSend_1044( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1044( - obj, - sel, - completionHandler, - ); - } - - late final __objc_msgSend_1044Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1044 = __objc_msgSend_1044Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_getAllTasksWithCompletionHandler_1 = - _registerName1("getAllTasksWithCompletionHandler:"); - void _objc_msgSend_1045( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1045( - obj, - sel, - completionHandler, - ); - } - - late final __objc_msgSend_1045Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1045 = __objc_msgSend_1045Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_dataTaskWithRequest_1 = - _registerName1("dataTaskWithRequest:"); - ffi.Pointer _objc_msgSend_1046( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_1046( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_1046Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1046 = __objc_msgSend_1046Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dataTaskWithURL_1 = _registerName1("dataTaskWithURL:"); - ffi.Pointer _objc_msgSend_1047( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_1047( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_1047Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1047 = __objc_msgSend_1047Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLSessionUploadTask1 = - _getClass1("NSURLSessionUploadTask"); - late final _sel_uploadTaskWithRequest_fromFile_1 = - _registerName1("uploadTaskWithRequest:fromFile:"); - ffi.Pointer _objc_msgSend_1048( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer fileURL, - ) { - return __objc_msgSend_1048( - obj, - sel, - request, - fileURL, - ); - } - - late final __objc_msgSend_1048Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1048 = __objc_msgSend_1048Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_uploadTaskWithRequest_fromData_1 = - _registerName1("uploadTaskWithRequest:fromData:"); - ffi.Pointer _objc_msgSend_1049( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer bodyData, - ) { - return __objc_msgSend_1049( - obj, - sel, - request, - bodyData, - ); - } - - late final __objc_msgSend_1049Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1049 = __objc_msgSend_1049Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_uploadTaskWithStreamedRequest_1 = - _registerName1("uploadTaskWithStreamedRequest:"); - ffi.Pointer _objc_msgSend_1050( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_1050( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_1050Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1050 = __objc_msgSend_1050Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLSessionDownloadTask1 = - _getClass1("NSURLSessionDownloadTask"); - late final _sel_cancelByProducingResumeData_1 = - _registerName1("cancelByProducingResumeData:"); - void _objc_msgSend_1051( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1051( - obj, - sel, - completionHandler, - ); - } - - late final __objc_msgSend_1051Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1051 = __objc_msgSend_1051Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_downloadTaskWithRequest_1 = - _registerName1("downloadTaskWithRequest:"); - ffi.Pointer _objc_msgSend_1052( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_1052( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_1052Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1052 = __objc_msgSend_1052Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_downloadTaskWithURL_1 = - _registerName1("downloadTaskWithURL:"); - ffi.Pointer _objc_msgSend_1053( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_1053( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_1053Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1053 = __objc_msgSend_1053Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_downloadTaskWithResumeData_1 = - _registerName1("downloadTaskWithResumeData:"); - ffi.Pointer _objc_msgSend_1054( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer resumeData, - ) { - return __objc_msgSend_1054( - obj, - sel, - resumeData, - ); - } - - late final __objc_msgSend_1054Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1054 = __objc_msgSend_1054Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLSessionStreamTask1 = - _getClass1("NSURLSessionStreamTask"); - late final _sel_readDataOfMinLength_maxLength_timeout_completionHandler_1 = - _registerName1( - "readDataOfMinLength:maxLength:timeout:completionHandler:"); - void _objc_msgSend_1055( - ffi.Pointer obj, - ffi.Pointer sel, - int minBytes, - int maxBytes, - double timeout, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1055( - obj, - sel, - minBytes, - maxBytes, - timeout, - completionHandler, - ); - } - - late final __objc_msgSend_1055Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Double, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1055 = __objc_msgSend_1055Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int, - double, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_writeData_timeout_completionHandler_1 = - _registerName1("writeData:timeout:completionHandler:"); - void _objc_msgSend_1056( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - double timeout, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1056( - obj, - sel, - data, - timeout, - completionHandler, - ); - } - - late final __objc_msgSend_1056Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1056 = __objc_msgSend_1056Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, double, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_captureStreams1 = _registerName1("captureStreams"); - late final _sel_closeWrite1 = _registerName1("closeWrite"); - late final _sel_closeRead1 = _registerName1("closeRead"); - late final _sel_startSecureConnection1 = - _registerName1("startSecureConnection"); - late final _sel_stopSecureConnection1 = - _registerName1("stopSecureConnection"); - late final _sel_streamTaskWithHostName_port_1 = - _registerName1("streamTaskWithHostName:port:"); - ffi.Pointer _objc_msgSend_1057( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer hostname, - int port, - ) { - return __objc_msgSend_1057( - obj, - sel, - hostname, - port, - ); - } - - late final __objc_msgSend_1057Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_1057 = __objc_msgSend_1057Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _class_NSNetService1 = _getClass1("NSNetService"); - late final _sel_initWithDomain_type_name_port_1 = - _registerName1("initWithDomain:type:name:port:"); - instancetype _objc_msgSend_1058( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer domain, - ffi.Pointer type, - ffi.Pointer name, - int port, - ) { - return __objc_msgSend_1058( - obj, - sel, - domain, - type, - name, - port, - ); - } - - late final __objc_msgSend_1058Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_1058 = __objc_msgSend_1058Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - - late final _sel_initWithDomain_type_name_1 = - _registerName1("initWithDomain:type:name:"); - instancetype _objc_msgSend_1059( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer domain, - ffi.Pointer type, - ffi.Pointer name, - ) { - return __objc_msgSend_1059( - obj, - sel, - domain, - type, - name, - ); - } - - late final __objc_msgSend_1059Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1059 = __objc_msgSend_1059Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_includesPeerToPeer1 = _registerName1("includesPeerToPeer"); - late final _sel_setIncludesPeerToPeer_1 = - _registerName1("setIncludesPeerToPeer:"); - late final _sel_type1 = _registerName1("type"); - late final _sel_publishWithOptions_1 = _registerName1("publishWithOptions:"); - void _objc_msgSend_1060( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ) { - return __objc_msgSend_1060( - obj, - sel, - options, - ); - } - - late final __objc_msgSend_1060Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1060 = __objc_msgSend_1060Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_resolve1 = _registerName1("resolve"); - late final _sel_stop1 = _registerName1("stop"); - late final _sel_dictionaryFromTXTRecordData_1 = - _registerName1("dictionaryFromTXTRecordData:"); - ffi.Pointer _objc_msgSend_1061( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer txtData, - ) { - return __objc_msgSend_1061( - obj, - sel, - txtData, - ); - } - - late final __objc_msgSend_1061Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1061 = __objc_msgSend_1061Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dataFromTXTRecordDictionary_1 = - _registerName1("dataFromTXTRecordDictionary:"); - ffi.Pointer _objc_msgSend_1062( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer txtDictionary, - ) { - return __objc_msgSend_1062( - obj, - sel, - txtDictionary, - ); - } - - late final __objc_msgSend_1062Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1062 = __objc_msgSend_1062Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_resolveWithTimeout_1 = _registerName1("resolveWithTimeout:"); - late final _sel_getInputStream_outputStream_1 = - _registerName1("getInputStream:outputStream:"); - bool _objc_msgSend_1063( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream, - ) { - return __objc_msgSend_1063( - obj, - sel, - inputStream, - outputStream, - ); - } - - late final __objc_msgSend_1063Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1063 = __objc_msgSend_1063Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _sel_setTXTRecordData_1 = _registerName1("setTXTRecordData:"); - bool _objc_msgSend_1064( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer recordData, - ) { - return __objc_msgSend_1064( - obj, - sel, - recordData, - ); - } - - late final __objc_msgSend_1064Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1064 = __objc_msgSend_1064Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_TXTRecordData1 = _registerName1("TXTRecordData"); - late final _sel_startMonitoring1 = _registerName1("startMonitoring"); - late final _sel_stopMonitoring1 = _registerName1("stopMonitoring"); - late final _sel_streamTaskWithNetService_1 = - _registerName1("streamTaskWithNetService:"); - ffi.Pointer _objc_msgSend_1065( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer service, - ) { - return __objc_msgSend_1065( - obj, - sel, - service, - ); - } - - late final __objc_msgSend_1065Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1065 = __objc_msgSend_1065Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLSessionWebSocketTask1 = - _getClass1("NSURLSessionWebSocketTask"); - late final _class_NSURLSessionWebSocketMessage1 = - _getClass1("NSURLSessionWebSocketMessage"); - int _objc_msgSend_1066( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1066( - obj, - sel, - ); - } - - late final __objc_msgSend_1066Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1066 = __objc_msgSend_1066Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_sendMessage_completionHandler_1 = - _registerName1("sendMessage:completionHandler:"); - void _objc_msgSend_1067( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer message, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1067( - obj, - sel, - message, - completionHandler, - ); - } - - late final __objc_msgSend_1067Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1067 = __objc_msgSend_1067Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_receiveMessageWithCompletionHandler_1 = - _registerName1("receiveMessageWithCompletionHandler:"); - void _objc_msgSend_1068( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1068( - obj, - sel, - completionHandler, - ); - } - - late final __objc_msgSend_1068Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1068 = __objc_msgSend_1068Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_sendPingWithPongReceiveHandler_1 = - _registerName1("sendPingWithPongReceiveHandler:"); - void _objc_msgSend_1069( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> pongReceiveHandler, - ) { - return __objc_msgSend_1069( - obj, - sel, - pongReceiveHandler, - ); - } - - late final __objc_msgSend_1069Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1069 = __objc_msgSend_1069Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_cancelWithCloseCode_reason_1 = - _registerName1("cancelWithCloseCode:reason:"); - void _objc_msgSend_1070( - ffi.Pointer obj, - ffi.Pointer sel, - int closeCode, - ffi.Pointer reason, - ) { - return __objc_msgSend_1070( - obj, - sel, - closeCode, - reason, - ); - } - - late final __objc_msgSend_1070Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1070 = __objc_msgSend_1070Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _sel_maximumMessageSize1 = _registerName1("maximumMessageSize"); - late final _sel_setMaximumMessageSize_1 = - _registerName1("setMaximumMessageSize:"); - late final _sel_closeCode1 = _registerName1("closeCode"); - int _objc_msgSend_1071( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1071( - obj, - sel, - ); - } - - late final __objc_msgSend_1071Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1071 = __objc_msgSend_1071Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_closeReason1 = _registerName1("closeReason"); - late final _sel_webSocketTaskWithURL_1 = - _registerName1("webSocketTaskWithURL:"); - ffi.Pointer _objc_msgSend_1072( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_1072( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_1072Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1072 = __objc_msgSend_1072Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_webSocketTaskWithURL_protocols_1 = - _registerName1("webSocketTaskWithURL:protocols:"); - ffi.Pointer _objc_msgSend_1073( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer protocols, - ) { - return __objc_msgSend_1073( - obj, - sel, - url, - protocols, - ); - } - - late final __objc_msgSend_1073Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1073 = __objc_msgSend_1073Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_webSocketTaskWithRequest_1 = - _registerName1("webSocketTaskWithRequest:"); - ffi.Pointer _objc_msgSend_1074( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_1074( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_1074Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1074 = __objc_msgSend_1074Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dataTaskWithRequest_completionHandler_1 = - _registerName1("dataTaskWithRequest:completionHandler:"); - ffi.Pointer _objc_msgSend_1075( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1075( - obj, - sel, - request, - completionHandler, - ); - } - - late final __objc_msgSend_1075Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1075 = __objc_msgSend_1075Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_dataTaskWithURL_completionHandler_1 = - _registerName1("dataTaskWithURL:completionHandler:"); - ffi.Pointer _objc_msgSend_1076( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1076( - obj, - sel, - url, - completionHandler, - ); - } - - late final __objc_msgSend_1076Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1076 = __objc_msgSend_1076Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_uploadTaskWithRequest_fromFile_completionHandler_1 = - _registerName1("uploadTaskWithRequest:fromFile:completionHandler:"); - ffi.Pointer _objc_msgSend_1077( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer fileURL, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1077( - obj, - sel, - request, - fileURL, - completionHandler, - ); - } - - late final __objc_msgSend_1077Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1077 = __objc_msgSend_1077Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_uploadTaskWithRequest_fromData_completionHandler_1 = - _registerName1("uploadTaskWithRequest:fromData:completionHandler:"); - ffi.Pointer _objc_msgSend_1078( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer bodyData, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1078( - obj, - sel, - request, - bodyData, - completionHandler, - ); - } - - late final __objc_msgSend_1078Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1078 = __objc_msgSend_1078Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_downloadTaskWithRequest_completionHandler_1 = - _registerName1("downloadTaskWithRequest:completionHandler:"); - ffi.Pointer _objc_msgSend_1079( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1079( - obj, - sel, - request, - completionHandler, - ); - } - - late final __objc_msgSend_1079Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1079 = __objc_msgSend_1079Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_downloadTaskWithURL_completionHandler_1 = - _registerName1("downloadTaskWithURL:completionHandler:"); - ffi.Pointer _objc_msgSend_1080( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1080( - obj, - sel, - url, - completionHandler, - ); - } - - late final __objc_msgSend_1080Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1080 = __objc_msgSend_1080Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_downloadTaskWithResumeData_completionHandler_1 = - _registerName1("downloadTaskWithResumeData:completionHandler:"); - ffi.Pointer _objc_msgSend_1081( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer resumeData, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_1081( - obj, - sel, - resumeData, - completionHandler, - ); - } - - late final __objc_msgSend_1081Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1081 = __objc_msgSend_1081Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _class_NSProtocolChecker1 = _getClass1("NSProtocolChecker"); - ffi.Pointer _objc_msgSend_1082( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1082( - obj, - sel, - ); - } - - late final __objc_msgSend_1082Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1082 = __objc_msgSend_1082Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_protocolCheckerWithTarget_protocol_1 = - _registerName1("protocolCheckerWithTarget:protocol:"); - instancetype _objc_msgSend_1083( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ffi.Pointer aProtocol, - ) { - return __objc_msgSend_1083( - obj, - sel, - anObject, - aProtocol, - ); - } - - late final __objc_msgSend_1083Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1083 = __objc_msgSend_1083Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithTarget_protocol_1 = - _registerName1("initWithTarget:protocol:"); - late final _class_NSTask1 = _getClass1("NSTask"); - late final _sel_setExecutableURL_1 = _registerName1("setExecutableURL:"); - late final _sel_setEnvironment_1 = _registerName1("setEnvironment:"); - late final _sel_currentDirectoryURL1 = _registerName1("currentDirectoryURL"); - late final _sel_setCurrentDirectoryURL_1 = - _registerName1("setCurrentDirectoryURL:"); - late final _sel_standardInput1 = _registerName1("standardInput"); - late final _sel_setStandardInput_1 = _registerName1("setStandardInput:"); - late final _sel_standardOutput1 = _registerName1("standardOutput"); - late final _sel_setStandardOutput_1 = _registerName1("setStandardOutput:"); - late final _sel_standardError1 = _registerName1("standardError"); - late final _sel_setStandardError_1 = _registerName1("setStandardError:"); - late final _sel_launchAndReturnError_1 = - _registerName1("launchAndReturnError:"); - late final _sel_interrupt1 = _registerName1("interrupt"); - late final _sel_terminate1 = _registerName1("terminate"); - late final _sel_isRunning1 = _registerName1("isRunning"); - late final _sel_terminationStatus1 = _registerName1("terminationStatus"); - late final _sel_terminationReason1 = _registerName1("terminationReason"); - int _objc_msgSend_1084( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1084( - obj, - sel, - ); - } - - late final __objc_msgSend_1084Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1084 = __objc_msgSend_1084Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_terminationHandler1 = _registerName1("terminationHandler"); - ffi.Pointer<_ObjCBlock> _objc_msgSend_1085( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1085( - obj, - sel, - ); - } - - late final __objc_msgSend_1085Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1085 = __objc_msgSend_1085Ptr.asFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setTerminationHandler_1 = - _registerName1("setTerminationHandler:"); - void _objc_msgSend_1086( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> value, - ) { - return __objc_msgSend_1086( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1086Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1086 = __objc_msgSend_1086Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_launchedTaskWithExecutableURL_arguments_error_terminationHandler_1 = - _registerName1( - "launchedTaskWithExecutableURL:arguments:error:terminationHandler:"); - ffi.Pointer _objc_msgSend_1087( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer arguments, - ffi.Pointer> error, - ffi.Pointer<_ObjCBlock> terminationHandler, - ) { - return __objc_msgSend_1087( - obj, - sel, - url, - arguments, - error, - terminationHandler, - ); - } - - late final __objc_msgSend_1087Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_1087 = __objc_msgSend_1087Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_waitUntilExit1 = _registerName1("waitUntilExit"); - late final _sel_launchPath1 = _registerName1("launchPath"); - late final _sel_setLaunchPath_1 = _registerName1("setLaunchPath:"); - late final _sel_setCurrentDirectoryPath_1 = - _registerName1("setCurrentDirectoryPath:"); - late final _sel_launch1 = _registerName1("launch"); - late final _sel_launchedTaskWithLaunchPath_arguments_1 = - _registerName1("launchedTaskWithLaunchPath:arguments:"); - ffi.Pointer _objc_msgSend_1088( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer arguments, - ) { - return __objc_msgSend_1088( - obj, - sel, - path, - arguments, - ); - } - - late final __objc_msgSend_1088Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1088 = __objc_msgSend_1088Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSXMLElement1 = _getClass1("NSXMLElement"); - late final _class_NSXMLNode1 = _getClass1("NSXMLNode"); - late final _sel_initWithKind_1 = _registerName1("initWithKind:"); - instancetype _objc_msgSend_1089( - ffi.Pointer obj, - ffi.Pointer sel, - int kind, - ) { - return __objc_msgSend_1089( - obj, - sel, - kind, - ); - } - - late final __objc_msgSend_1089Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1089 = __objc_msgSend_1089Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithKind_options_1 = - _registerName1("initWithKind:options:"); - instancetype _objc_msgSend_1090( - ffi.Pointer obj, - ffi.Pointer sel, - int kind, - int options, - ) { - return __objc_msgSend_1090( - obj, - sel, - kind, - options, - ); - } - - late final __objc_msgSend_1090Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1090 = __objc_msgSend_1090Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int, int)>(); - - late final _sel_document1 = _registerName1("document"); - late final _sel_documentWithRootElement_1 = - _registerName1("documentWithRootElement:"); - ffi.Pointer _objc_msgSend_1091( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer element, - ) { - return __objc_msgSend_1091( - obj, - sel, - element, - ); - } - - late final __objc_msgSend_1091Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1091 = __objc_msgSend_1091Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_elementWithName_1 = _registerName1("elementWithName:"); - late final _sel_elementWithName_URI_1 = - _registerName1("elementWithName:URI:"); - ffi.Pointer _objc_msgSend_1092( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer URI, - ) { - return __objc_msgSend_1092( - obj, - sel, - name, - URI, - ); - } - - late final __objc_msgSend_1092Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1092 = __objc_msgSend_1092Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_elementWithName_stringValue_1 = - _registerName1("elementWithName:stringValue:"); - late final _sel_elementWithName_children_attributes_1 = - _registerName1("elementWithName:children:attributes:"); - ffi.Pointer _objc_msgSend_1093( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer children, - ffi.Pointer attributes, - ) { - return __objc_msgSend_1093( - obj, - sel, - name, - children, - attributes, - ); - } - - late final __objc_msgSend_1093Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1093 = __objc_msgSend_1093Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_attributeWithName_stringValue_1 = - _registerName1("attributeWithName:stringValue:"); - late final _sel_attributeWithName_URI_stringValue_1 = - _registerName1("attributeWithName:URI:stringValue:"); - late final _sel_namespaceWithName_stringValue_1 = - _registerName1("namespaceWithName:stringValue:"); - late final _sel_processingInstructionWithName_stringValue_1 = - _registerName1("processingInstructionWithName:stringValue:"); - late final _sel_commentWithStringValue_1 = - _registerName1("commentWithStringValue:"); - late final _sel_textWithStringValue_1 = - _registerName1("textWithStringValue:"); - late final _sel_DTDNodeWithXMLString_1 = - _registerName1("DTDNodeWithXMLString:"); - int _objc_msgSend_1094( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1094( - obj, - sel, - ); - } - - late final __objc_msgSend_1094Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1094 = __objc_msgSend_1094Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_objectValue1 = _registerName1("objectValue"); - late final _sel_setObjectValue_1 = _registerName1("setObjectValue:"); - late final _sel_setStringValue_1 = _registerName1("setStringValue:"); - late final _sel_setStringValue_resolvingEntities_1 = - _registerName1("setStringValue:resolvingEntities:"); - void _objc_msgSend_1095( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - bool resolve, - ) { - return __objc_msgSend_1095( - obj, - sel, - string, - resolve, - ); - } - - late final __objc_msgSend_1095Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_1095 = __objc_msgSend_1095Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - late final _sel_index1 = _registerName1("index"); - late final _sel_level1 = _registerName1("level"); - late final _class_NSXMLDocument1 = _getClass1("NSXMLDocument"); - late final _sel_initWithXMLString_options_error_1 = - _registerName1("initWithXMLString:options:error:"); - instancetype _objc_msgSend_1096( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - ffi.Pointer> error, - ) { - return __objc_msgSend_1096( - obj, - sel, - string, - mask, - error, - ); - } - - late final __objc_msgSend_1096Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1096 = __objc_msgSend_1096Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - instancetype _objc_msgSend_1097( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int mask, - ffi.Pointer> error, - ) { - return __objc_msgSend_1097( - obj, - sel, - url, - mask, - error, - ); - } - - late final __objc_msgSend_1097Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1097 = __objc_msgSend_1097Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_initWithData_options_error_1 = - _registerName1("initWithData:options:error:"); - instancetype _objc_msgSend_1098( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - int mask, - ffi.Pointer> error, - ) { - return __objc_msgSend_1098( - obj, - sel, - data, - mask, - error, - ); - } - - late final __objc_msgSend_1098Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1098 = __objc_msgSend_1098Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_initWithRootElement_1 = - _registerName1("initWithRootElement:"); - instancetype _objc_msgSend_1099( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer element, - ) { - return __objc_msgSend_1099( - obj, - sel, - element, - ); - } - - late final __objc_msgSend_1099Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1099 = __objc_msgSend_1099Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_replacementClassForClass_1 = - _registerName1("replacementClassForClass:"); - late final _sel_characterEncoding1 = _registerName1("characterEncoding"); - late final _sel_setCharacterEncoding_1 = - _registerName1("setCharacterEncoding:"); - late final _sel_isStandalone1 = _registerName1("isStandalone"); - late final _sel_setStandalone_1 = _registerName1("setStandalone:"); - late final _sel_documentContentKind1 = _registerName1("documentContentKind"); - int _objc_msgSend_1100( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1100( - obj, - sel, - ); - } - - late final __objc_msgSend_1100Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1100 = __objc_msgSend_1100Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setDocumentContentKind_1 = - _registerName1("setDocumentContentKind:"); - void _objc_msgSend_1101( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_1101( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1101Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1101 = __objc_msgSend_1101Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_setMIMEType_1 = _registerName1("setMIMEType:"); - late final _class_NSXMLDTD1 = _getClass1("NSXMLDTD"); - late final _sel_setPublicID_1 = _registerName1("setPublicID:"); - late final _sel_setSystemID_1 = _registerName1("setSystemID:"); - late final _sel_insertChild_atIndex_1 = - _registerName1("insertChild:atIndex:"); - void _objc_msgSend_1102( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer child, - int index, - ) { - return __objc_msgSend_1102( - obj, - sel, - child, - index, - ); - } - - late final __objc_msgSend_1102Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_1102 = __objc_msgSend_1102Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_insertChildren_atIndex_1 = - _registerName1("insertChildren:atIndex:"); - void _objc_msgSend_1103( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer children, - int index, - ) { - return __objc_msgSend_1103( - obj, - sel, - children, - index, - ); - } - - late final __objc_msgSend_1103Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_1103 = __objc_msgSend_1103Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_removeChildAtIndex_1 = _registerName1("removeChildAtIndex:"); - late final _sel_setChildren_1 = _registerName1("setChildren:"); - late final _sel_addChild_1 = _registerName1("addChild:"); - void _objc_msgSend_1104( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer child, - ) { - return __objc_msgSend_1104( - obj, - sel, - child, - ); - } - - late final __objc_msgSend_1104Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1104 = __objc_msgSend_1104Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_replaceChildAtIndex_withNode_1 = - _registerName1("replaceChildAtIndex:withNode:"); - void _objc_msgSend_1105( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer node, - ) { - return __objc_msgSend_1105( - obj, - sel, - index, - node, - ); - } - - late final __objc_msgSend_1105Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1105 = __objc_msgSend_1105Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final _class_NSXMLDTDNode1 = _getClass1("NSXMLDTDNode"); - late final _sel_initWithXMLString_1 = _registerName1("initWithXMLString:"); - late final _sel_DTDKind1 = _registerName1("DTDKind"); - int _objc_msgSend_1106( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1106( - obj, - sel, - ); - } - - late final __objc_msgSend_1106Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1106 = __objc_msgSend_1106Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setDTDKind_1 = _registerName1("setDTDKind:"); - void _objc_msgSend_1107( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_1107( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1107Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1107 = __objc_msgSend_1107Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_isExternal1 = _registerName1("isExternal"); - late final _sel_notationName1 = _registerName1("notationName"); - late final _sel_setNotationName_1 = _registerName1("setNotationName:"); - late final _sel_localNameForName_1 = _registerName1("localNameForName:"); - late final _sel_prefixForName_1 = _registerName1("prefixForName:"); - late final _sel_predefinedNamespaceForPrefix_1 = - _registerName1("predefinedNamespaceForPrefix:"); - ffi.Pointer _objc_msgSend_1108( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ) { - return __objc_msgSend_1108( - obj, - sel, - name, - ); - } - - late final __objc_msgSend_1108Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1108 = __objc_msgSend_1108Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_entityDeclarationForName_1 = - _registerName1("entityDeclarationForName:"); - ffi.Pointer _objc_msgSend_1109( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ) { - return __objc_msgSend_1109( - obj, - sel, - name, - ); - } - - late final __objc_msgSend_1109Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1109 = __objc_msgSend_1109Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_notationDeclarationForName_1 = - _registerName1("notationDeclarationForName:"); - late final _sel_elementDeclarationForName_1 = - _registerName1("elementDeclarationForName:"); - late final _sel_attributeDeclarationForName_elementName_1 = - _registerName1("attributeDeclarationForName:elementName:"); - ffi.Pointer _objc_msgSend_1110( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer elementName, - ) { - return __objc_msgSend_1110( - obj, - sel, - name, - elementName, - ); - } - - late final __objc_msgSend_1110Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1110 = __objc_msgSend_1110Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_predefinedEntityDeclarationForName_1 = - _registerName1("predefinedEntityDeclarationForName:"); - late final _sel_DTD1 = _registerName1("DTD"); - ffi.Pointer _objc_msgSend_1111( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1111( - obj, - sel, - ); - } - - late final __objc_msgSend_1111Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1111 = __objc_msgSend_1111Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setDTD_1 = _registerName1("setDTD:"); - void _objc_msgSend_1112( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_1112( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1112Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1112 = __objc_msgSend_1112Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_setRootElement_1 = _registerName1("setRootElement:"); - void _objc_msgSend_1113( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer root, - ) { - return __objc_msgSend_1113( - obj, - sel, - root, - ); - } - - late final __objc_msgSend_1113Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1113 = __objc_msgSend_1113Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_rootElement1 = _registerName1("rootElement"); - ffi.Pointer _objc_msgSend_1114( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1114( - obj, - sel, - ); - } - - late final __objc_msgSend_1114Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1114 = __objc_msgSend_1114Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_XMLData1 = _registerName1("XMLData"); - late final _sel_XMLDataWithOptions_1 = _registerName1("XMLDataWithOptions:"); - ffi.Pointer _objc_msgSend_1115( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ) { - return __objc_msgSend_1115( - obj, - sel, - options, - ); - } - - late final __objc_msgSend_1115Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1115 = __objc_msgSend_1115Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_objectByApplyingXSLT_arguments_error_1 = - _registerName1("objectByApplyingXSLT:arguments:error:"); - ffi.Pointer _objc_msgSend_1116( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer xslt, - ffi.Pointer arguments, - ffi.Pointer> error, - ) { - return __objc_msgSend_1116( - obj, - sel, - xslt, - arguments, - error, - ); - } - - late final __objc_msgSend_1116Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1116 = __objc_msgSend_1116Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_objectByApplyingXSLTString_arguments_error_1 = - _registerName1("objectByApplyingXSLTString:arguments:error:"); - ffi.Pointer _objc_msgSend_1117( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer xslt, - ffi.Pointer arguments, - ffi.Pointer> error, - ) { - return __objc_msgSend_1117( - obj, - sel, - xslt, - arguments, - error, - ); - } - - late final __objc_msgSend_1117Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1117 = __objc_msgSend_1117Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_objectByApplyingXSLTAtURL_arguments_error_1 = - _registerName1("objectByApplyingXSLTAtURL:arguments:error:"); - ffi.Pointer _objc_msgSend_1118( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer xsltURL, - ffi.Pointer argument, - ffi.Pointer> error, - ) { - return __objc_msgSend_1118( - obj, - sel, - xsltURL, - argument, - error, - ); - } - - late final __objc_msgSend_1118Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1118 = __objc_msgSend_1118Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_validateAndReturnError_1 = - _registerName1("validateAndReturnError:"); - late final _sel_rootDocument1 = _registerName1("rootDocument"); - ffi.Pointer _objc_msgSend_1119( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1119( - obj, - sel, - ); - } - - late final __objc_msgSend_1119Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1119 = __objc_msgSend_1119Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_parent1 = _registerName1("parent"); - ffi.Pointer _objc_msgSend_1120( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1120( - obj, - sel, - ); - } - - late final __objc_msgSend_1120Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1120 = __objc_msgSend_1120Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_childCount1 = _registerName1("childCount"); - late final _sel_children1 = _registerName1("children"); - late final _sel_childAtIndex_1 = _registerName1("childAtIndex:"); - ffi.Pointer _objc_msgSend_1121( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_1121( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_1121Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_1121 = __objc_msgSend_1121Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_previousSibling1 = _registerName1("previousSibling"); - late final _sel_nextSibling1 = _registerName1("nextSibling"); - late final _sel_previousNode1 = _registerName1("previousNode"); - late final _sel_nextNode1 = _registerName1("nextNode"); - late final _sel_detach1 = _registerName1("detach"); - late final _sel_XPath1 = _registerName1("XPath"); - late final _sel_localName1 = _registerName1("localName"); - late final _sel_prefix1 = _registerName1("prefix"); - late final _sel_URI1 = _registerName1("URI"); - late final _sel_setURI_1 = _registerName1("setURI:"); - late final _sel_XMLString1 = _registerName1("XMLString"); - late final _sel_XMLStringWithOptions_1 = - _registerName1("XMLStringWithOptions:"); - ffi.Pointer _objc_msgSend_1122( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ) { - return __objc_msgSend_1122( - obj, - sel, - options, - ); - } - - late final __objc_msgSend_1122Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_1122 = __objc_msgSend_1122Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_canonicalXMLStringPreservingComments_1 = - _registerName1("canonicalXMLStringPreservingComments:"); - ffi.Pointer _objc_msgSend_1123( - ffi.Pointer obj, - ffi.Pointer sel, - bool comments, - ) { - return __objc_msgSend_1123( - obj, - sel, - comments, - ); - } - - late final __objc_msgSend_1123Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_1123 = __objc_msgSend_1123Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_nodesForXPath_error_1 = - _registerName1("nodesForXPath:error:"); - late final _sel_objectsForXQuery_constants_error_1 = - _registerName1("objectsForXQuery:constants:error:"); - ffi.Pointer _objc_msgSend_1124( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer xquery, - ffi.Pointer constants, - ffi.Pointer> error, - ) { - return __objc_msgSend_1124( - obj, - sel, - xquery, - constants, - error, - ); - } - - late final __objc_msgSend_1124Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_1124 = __objc_msgSend_1124Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_objectsForXQuery_error_1 = - _registerName1("objectsForXQuery:error:"); - late final _sel_initWithName_URI_1 = _registerName1("initWithName:URI:"); - instancetype _objc_msgSend_1125( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer URI, - ) { - return __objc_msgSend_1125( - obj, - sel, - name, - URI, - ); - } - - late final __objc_msgSend_1125Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1125 = __objc_msgSend_1125Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_initWithName_stringValue_1 = - _registerName1("initWithName:stringValue:"); - late final _sel_initWithXMLString_error_1 = - _registerName1("initWithXMLString:error:"); - late final _sel_elementsForName_1 = _registerName1("elementsForName:"); - late final _sel_elementsForLocalName_URI_1 = - _registerName1("elementsForLocalName:URI:"); - ffi.Pointer _objc_msgSend_1126( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer localName, - ffi.Pointer URI, - ) { - return __objc_msgSend_1126( - obj, - sel, - localName, - URI, - ); - } - - late final __objc_msgSend_1126Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1126 = __objc_msgSend_1126Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_addAttribute_1 = _registerName1("addAttribute:"); - late final _sel_removeAttributeForName_1 = - _registerName1("removeAttributeForName:"); - late final _sel_attributes1 = _registerName1("attributes"); - late final _sel_setAttributes_1 = _registerName1("setAttributes:"); - late final _sel_setAttributesWithDictionary_1 = - _registerName1("setAttributesWithDictionary:"); - late final _sel_attributeForName_1 = _registerName1("attributeForName:"); - late final _sel_attributeForLocalName_URI_1 = - _registerName1("attributeForLocalName:URI:"); - ffi.Pointer _objc_msgSend_1127( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer localName, - ffi.Pointer URI, - ) { - return __objc_msgSend_1127( - obj, - sel, - localName, - URI, - ); - } - - late final __objc_msgSend_1127Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1127 = __objc_msgSend_1127Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_addNamespace_1 = _registerName1("addNamespace:"); - late final _sel_removeNamespaceForPrefix_1 = - _registerName1("removeNamespaceForPrefix:"); - late final _sel_namespaces1 = _registerName1("namespaces"); - late final _sel_setNamespaces_1 = _registerName1("setNamespaces:"); - late final _sel_namespaceForPrefix_1 = _registerName1("namespaceForPrefix:"); - late final _sel_resolveNamespaceForName_1 = - _registerName1("resolveNamespaceForName:"); - late final _sel_resolvePrefixForNamespaceURI_1 = - _registerName1("resolvePrefixForNamespaceURI:"); - late final _sel_normalizeAdjacentTextNodesPreservingCDATA_1 = - _registerName1("normalizeAdjacentTextNodesPreservingCDATA:"); - late final _sel_setAttributesAsDictionary_1 = - _registerName1("setAttributesAsDictionary:"); - late final _class_ThermionDartTexture1 = - _getClass1("thermion_dart_texture.ThermionDartTexture"); - late final _sel_cvMetalTextureCache1 = _registerName1("cvMetalTextureCache"); - late final _sel_setCvMetalTextureCache_1 = - _registerName1("setCvMetalTextureCache:"); - void _objc_msgSend_1128( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_1128( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_1128Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_1128 = __objc_msgSend_1128Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_cvMetalTexture1 = _registerName1("cvMetalTexture"); - late final _sel_setCvMetalTexture_1 = _registerName1("setCvMetalTexture:"); - late final _sel_metalTexture1 = _registerName1("metalTexture"); - late final _sel_setMetalTexture_1 = _registerName1("setMetalTexture:"); - late final _sel_metalDevice1 = _registerName1("metalDevice"); - late final _sel_setMetalDevice_1 = _registerName1("setMetalDevice:"); - late final _sel_metalTextureAddress1 = _registerName1("metalTextureAddress"); - late final _sel_setMetalTextureAddress_1 = - _registerName1("setMetalTextureAddress:"); - late final _sel_initWithWidth_height_1 = - _registerName1("initWithWidth:height:"); - instancetype _objc_msgSend_1129( - ffi.Pointer obj, - ffi.Pointer sel, - int width, - int height, - ) { - return __objc_msgSend_1129( - obj, - sel, - width, - height, - ); - } - - late final __objc_msgSend_1129Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Int64, ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_1129 = __objc_msgSend_1129Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int, int)>(); - - late final _sel_destroyTexture1 = _registerName1("destroyTexture"); -} - -class _ObjCWrapper implements ffi.Finalizable { - final ffi.Pointer _id; - final ThermionDartTexture1 _lib; - bool _pendingRelease; - - _ObjCWrapper._(this._id, this._lib, - {bool retain = false, bool release = false}) - : _pendingRelease = release { - if (retain) { - _lib._objc_retain(_id.cast()); - } - if (release) { - _lib._objc_releaseFinalizer2.attach(this, _id.cast(), detach: this); - } - } - - /// Releases the reference to the underlying ObjC object held by this wrapper. - /// Throws a StateError if this wrapper doesn't currently hold a reference. - void release() { - if (_pendingRelease) { - _pendingRelease = false; - _lib._objc_release(_id.cast()); - _lib._objc_releaseFinalizer2.detach(this); - } else { - throw StateError( - 'Released an ObjC object that was unowned or already released.'); - } - } - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; - - /// Return a pointer to this object. - ffi.Pointer get pointer => _id; - - ffi.Pointer _retainAndReturnId() { - _lib._objc_retain(_id.cast()); - return _id; - } -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSObject] that points to the same underlying object as [other]. - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSObject] that wraps the given raw object pointer. - static NSObject castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSObject._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSObject]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSObject1); - } - - static void load(ThermionDartTexture1 _lib) { - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(ThermionDartTexture1 _lib) { - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - static NSObject allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - static NSObject alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - void dealloc() { - _lib._objc_msgSend_1(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_1(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - static NSObject copyWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - static NSObject mutableCopyWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - static bool instancesRespondToSelector_( - ThermionDartTexture1 _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_( - ThermionDartTexture1 _lib, Protocol protocol) { - return _lib._objc_msgSend_5( - _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); - } - - ffi.Pointer> methodForSelector_( - ffi.Pointer aSelector) { - return _lib._objc_msgSend_6(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static ffi.Pointer> - instanceMethodForSelector_( - ThermionDartTexture1 _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_6(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_7(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_8( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - void forwardInvocation_(NSInvocation anInvocation) { - _lib._objc_msgSend_420( - _id, _lib._sel_forwardInvocation_1, anInvocation._id); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_421( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib, retain: true, release: true); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - ThermionDartTexture1 _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_421(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib, retain: true, release: true); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_12(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_(ThermionDartTexture1 _lib, NSObject aClass) { - return _lib._objc_msgSend_0( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - ThermionDartTexture1 _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - ThermionDartTexture1 _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_10(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject class1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSString description(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_21(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString debugDescription(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_21( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static int version(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_82(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(ThermionDartTexture1 _lib, int aVersion) { - _lib._objc_msgSend_422( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? replacementObjectForCoder_(NSCoder coder) { - final _ret = _lib._objc_msgSend_46( - _id, _lib._sel_replacementObjectForCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? awakeAfterUsingCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_awakeAfterUsingCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: false, release: true); - } - - static void poseAsClass_(ThermionDartTexture1 _lib, NSObject aClass) { - _lib._objc_msgSend_15( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_2(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - void - attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_( - NSError error, - int recoveryOptionIndex, - NSObject? delegate, - ffi.Pointer didRecoverSelector, - ffi.Pointer contextInfo) { - _lib._objc_msgSend_423( - _id, - _lib._sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_1, - error._id, - recoveryOptionIndex, - delegate?._id ?? ffi.nullptr, - didRecoverSelector, - contextInfo); - } - - bool attemptRecoveryFromError_optionIndex_( - NSError error, int recoveryOptionIndex) { - return _lib._objc_msgSend_424( - _id, - _lib._sel_attemptRecoveryFromError_optionIndex_1, - error._id, - recoveryOptionIndex); - } - - void performSelector_withObject_afterDelay_inModes_( - ffi.Pointer aSelector, - NSObject? anArgument, - double delay, - NSArray modes) { - _lib._objc_msgSend_425( - _id, - _lib._sel_performSelector_withObject_afterDelay_inModes_1, - aSelector, - anArgument?._id ?? ffi.nullptr, - delay, - modes._id); - } - - void performSelector_withObject_afterDelay_( - ffi.Pointer aSelector, NSObject? anArgument, double delay) { - _lib._objc_msgSend_426( - _id, - _lib._sel_performSelector_withObject_afterDelay_1, - aSelector, - anArgument?._id ?? ffi.nullptr, - delay); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSObject1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSObject1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - void URL_resourceDataDidBecomeAvailable_(NSURL sender, NSData newBytes) { - _lib._objc_msgSend_427(_id, _lib._sel_URL_resourceDataDidBecomeAvailable_1, - sender._id, newBytes._id); - } - - void URLResourceDidFinishLoading_(NSURL sender) { - _lib._objc_msgSend_428( - _id, _lib._sel_URLResourceDidFinishLoading_1, sender._id); - } - - void URLResourceDidCancelLoading_(NSURL sender) { - _lib._objc_msgSend_428( - _id, _lib._sel_URLResourceDidCancelLoading_1, sender._id); - } - - void URL_resourceDidFailLoadingWithReason_(NSURL sender, NSString reason) { - _lib._objc_msgSend_429( - _id, - _lib._sel_URL_resourceDidFailLoadingWithReason_1, - sender._id, - reason._id); - } - - bool fileManager_shouldProceedAfterError_( - NSFileManager fm, NSDictionary errorInfo) { - return _lib._objc_msgSend_466(_id, - _lib._sel_fileManager_shouldProceedAfterError_1, fm._id, errorInfo._id); - } - - void fileManager_willProcessPath_(NSFileManager fm, NSString path) { - _lib._objc_msgSend_467( - _id, _lib._sel_fileManager_willProcessPath_1, fm._id, path._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSObject1, _lib._sel_accessInstanceVariablesDirectly1); - } - - NSObject? valueForKey_(NSString key) { - final _ret = _lib._objc_msgSend_38(_id, _lib._sel_valueForKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void setValue_forKey_(NSObject? value, NSString key) { - _lib._objc_msgSend_134( - _id, _lib._sel_setValue_forKey_1, value?._id ?? ffi.nullptr, key._id); - } - - bool validateValue_forKey_error_(ffi.Pointer> ioValue, - NSString inKey, ffi.Pointer> outError) { - return _lib._objc_msgSend_243(_id, _lib._sel_validateValue_forKey_error_1, - ioValue, inKey._id, outError); - } - - NSMutableArray mutableArrayValueForKey_(NSString key) { - final _ret = _lib._objc_msgSend_487( - _id, _lib._sel_mutableArrayValueForKey_1, key._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - NSMutableOrderedSet mutableOrderedSetValueForKey_(NSString key) { - final _ret = _lib._objc_msgSend_505( - _id, _lib._sel_mutableOrderedSetValueForKey_1, key._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSMutableSet mutableSetValueForKey_(NSString key) { - final _ret = - _lib._objc_msgSend_506(_id, _lib._sel_mutableSetValueForKey_1, key._id); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - NSObject? valueForKeyPath_(NSString keyPath) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_valueForKeyPath_1, keyPath._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void setValue_forKeyPath_(NSObject? value, NSString keyPath) { - _lib._objc_msgSend_134(_id, _lib._sel_setValue_forKeyPath_1, - value?._id ?? ffi.nullptr, keyPath._id); - } - - bool validateValue_forKeyPath_error_( - ffi.Pointer> ioValue, - NSString inKeyPath, - ffi.Pointer> outError) { - return _lib._objc_msgSend_243( - _id, - _lib._sel_validateValue_forKeyPath_error_1, - ioValue, - inKeyPath._id, - outError); - } - - NSMutableArray mutableArrayValueForKeyPath_(NSString keyPath) { - final _ret = _lib._objc_msgSend_487( - _id, _lib._sel_mutableArrayValueForKeyPath_1, keyPath._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - NSMutableOrderedSet mutableOrderedSetValueForKeyPath_(NSString keyPath) { - final _ret = _lib._objc_msgSend_505( - _id, _lib._sel_mutableOrderedSetValueForKeyPath_1, keyPath._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSMutableSet mutableSetValueForKeyPath_(NSString keyPath) { - final _ret = _lib._objc_msgSend_506( - _id, _lib._sel_mutableSetValueForKeyPath_1, keyPath._id); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - NSObject? valueForUndefinedKey_(NSString key) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_valueForUndefinedKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void setValue_forUndefinedKey_(NSObject? value, NSString key) { - _lib._objc_msgSend_134(_id, _lib._sel_setValue_forUndefinedKey_1, - value?._id ?? ffi.nullptr, key._id); - } - - void setNilValueForKey_(NSString key) { - _lib._objc_msgSend_247(_id, _lib._sel_setNilValueForKey_1, key._id); - } - - NSDictionary dictionaryWithValuesForKeys_(NSArray keys) { - final _ret = _lib._objc_msgSend_507( - _id, _lib._sel_dictionaryWithValuesForKeys_1, keys._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - void setValuesForKeysWithDictionary_(NSDictionary keyedValues) { - _lib._objc_msgSend_508( - _id, _lib._sel_setValuesForKeysWithDictionary_1, keyedValues._id); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSObject1, _lib._sel_useStoredAccessor1); - } - - NSObject? storedValueForKey_(NSString key) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_storedValueForKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void takeStoredValue_forKey_(NSObject? value, NSString key) { - _lib._objc_msgSend_134(_id, _lib._sel_takeStoredValue_forKey_1, - value?._id ?? ffi.nullptr, key._id); - } - - void takeValue_forKey_(NSObject? value, NSString key) { - _lib._objc_msgSend_134( - _id, _lib._sel_takeValue_forKey_1, value?._id ?? ffi.nullptr, key._id); - } - - void takeValue_forKeyPath_(NSObject? value, NSString keyPath) { - _lib._objc_msgSend_134(_id, _lib._sel_takeValue_forKeyPath_1, - value?._id ?? ffi.nullptr, keyPath._id); - } - - NSObject? handleQueryWithUnboundKey_(NSString key) { - final _ret = _lib._objc_msgSend_38( - _id, _lib._sel_handleQueryWithUnboundKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void handleTakeValue_forUnboundKey_(NSObject? value, NSString key) { - _lib._objc_msgSend_134(_id, _lib._sel_handleTakeValue_forUnboundKey_1, - value?._id ?? ffi.nullptr, key._id); - } - - void unableToSetNilForKey_(NSString key) { - _lib._objc_msgSend_247(_id, _lib._sel_unableToSetNilForKey_1, key._id); - } - - NSDictionary valuesForKeys_(NSArray keys) { - final _ret = - _lib._objc_msgSend_507(_id, _lib._sel_valuesForKeys_1, keys._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - void takeValuesFromDictionary_(NSDictionary properties) { - _lib._objc_msgSend_508( - _id, _lib._sel_takeValuesFromDictionary_1, properties._id); - } - - void observeValueForKeyPath_ofObject_change_context_(NSString? keyPath, - NSObject? object, NSDictionary? change, ffi.Pointer context) { - _lib._objc_msgSend_509( - _id, - _lib._sel_observeValueForKeyPath_ofObject_change_context_1, - keyPath?._id ?? ffi.nullptr, - object?._id ?? ffi.nullptr, - change?._id ?? ffi.nullptr, - context); - } - - void addObserver_forKeyPath_options_context_(NSObject observer, - NSString keyPath, int options, ffi.Pointer context) { - _lib._objc_msgSend_138( - _id, - _lib._sel_addObserver_forKeyPath_options_context_1, - observer._id, - keyPath._id, - options, - context); - } - - void removeObserver_forKeyPath_context_( - NSObject observer, NSString keyPath, ffi.Pointer context) { - _lib._objc_msgSend_139(_id, _lib._sel_removeObserver_forKeyPath_context_1, - observer._id, keyPath._id, context); - } - - void removeObserver_forKeyPath_(NSObject observer, NSString keyPath) { - _lib._objc_msgSend_140( - _id, _lib._sel_removeObserver_forKeyPath_1, observer._id, keyPath._id); - } - - void willChangeValueForKey_(NSString key) { - _lib._objc_msgSend_247(_id, _lib._sel_willChangeValueForKey_1, key._id); - } - - void didChangeValueForKey_(NSString key) { - _lib._objc_msgSend_247(_id, _lib._sel_didChangeValueForKey_1, key._id); - } - - void willChange_valuesAtIndexes_forKey_( - int changeKind, NSIndexSet indexes, NSString key) { - _lib._objc_msgSend_510(_id, _lib._sel_willChange_valuesAtIndexes_forKey_1, - changeKind, indexes._id, key._id); - } - - void didChange_valuesAtIndexes_forKey_( - int changeKind, NSIndexSet indexes, NSString key) { - _lib._objc_msgSend_510(_id, _lib._sel_didChange_valuesAtIndexes_forKey_1, - changeKind, indexes._id, key._id); - } - - void willChangeValueForKey_withSetMutation_usingObjects_( - NSString key, int mutationKind, NSSet objects) { - _lib._objc_msgSend_511( - _id, - _lib._sel_willChangeValueForKey_withSetMutation_usingObjects_1, - key._id, - mutationKind, - objects._id); - } - - void didChangeValueForKey_withSetMutation_usingObjects_( - NSString key, int mutationKind, NSSet objects) { - _lib._objc_msgSend_511( - _id, - _lib._sel_didChangeValueForKey_withSetMutation_usingObjects_1, - key._id, - mutationKind, - objects._id); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSObject1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSObject1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - ffi.Pointer get observationInfo { - return _lib._objc_msgSend_20(_id, _lib._sel_observationInfo1); - } - - set observationInfo(ffi.Pointer value) { - return _lib._objc_msgSend_512(_id, _lib._sel_setObservationInfo_1, value); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSObject1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - NSObject? get classForKeyedArchiver { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_classForKeyedArchiver1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? replacementObjectForKeyedArchiver_(NSKeyedArchiver archiver) { - final _ret = _lib._objc_msgSend_527( - _id, _lib._sel_replacementObjectForKeyedArchiver_1, archiver._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSObject1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - void performSelectorOnMainThread_withObject_waitUntilDone_modes_( - ffi.Pointer aSelector, - NSObject? arg, - bool wait, - NSArray? array) { - _lib._objc_msgSend_528( - _id, - _lib._sel_performSelectorOnMainThread_withObject_waitUntilDone_modes_1, - aSelector, - arg?._id ?? ffi.nullptr, - wait, - array?._id ?? ffi.nullptr); - } - - void performSelectorOnMainThread_withObject_waitUntilDone_( - ffi.Pointer aSelector, NSObject? arg, bool wait) { - _lib._objc_msgSend_529( - _id, - _lib._sel_performSelectorOnMainThread_withObject_waitUntilDone_1, - aSelector, - arg?._id ?? ffi.nullptr, - wait); - } - - void performSelector_onThread_withObject_waitUntilDone_modes_( - ffi.Pointer aSelector, - NSThread thr, - NSObject? arg, - bool wait, - NSArray? array) { - _lib._objc_msgSend_547( - _id, - _lib._sel_performSelector_onThread_withObject_waitUntilDone_modes_1, - aSelector, - thr._id, - arg?._id ?? ffi.nullptr, - wait, - array?._id ?? ffi.nullptr); - } - - void performSelector_onThread_withObject_waitUntilDone_( - ffi.Pointer aSelector, NSThread thr, NSObject? arg, bool wait) { - _lib._objc_msgSend_548( - _id, - _lib._sel_performSelector_onThread_withObject_waitUntilDone_1, - aSelector, - thr._id, - arg?._id ?? ffi.nullptr, - wait); - } - - void performSelectorInBackground_withObject_( - ffi.Pointer aSelector, NSObject? arg) { - _lib._objc_msgSend_89( - _id, - _lib._sel_performSelectorInBackground_withObject_1, - aSelector, - arg?._id ?? ffi.nullptr); - } - - NSObject? get classForArchiver { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_classForArchiver1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? replacementObjectForArchiver_(NSArchiver archiver) { - final _ret = _lib._objc_msgSend_551( - _id, _lib._sel_replacementObjectForArchiver_1, archiver._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject get classForPortCoder { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForPortCoder1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? replacementObjectForPortCoder_(NSPortCoder coder) { - final _ret = _lib._objc_msgSend_596( - _id, _lib._sel_replacementObjectForPortCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSClassDescription get classDescription { - final _ret = _lib._objc_msgSend_599(_id, _lib._sel_classDescription1); - return NSClassDescription._(_ret, _lib, retain: true, release: true); - } - - NSArray get attributeKeys { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_attributeKeys1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get toOneRelationshipKeys { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_toOneRelationshipKeys1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get toManyRelationshipKeys { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_toManyRelationshipKeys1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? inverseForRelationshipKey_(NSString relationshipKey) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_inverseForRelationshipKey_1, relationshipKey._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSObject? scriptingValueForSpecifier_( - NSScriptObjectSpecifier objectSpecifier) { - final _ret = _lib._objc_msgSend_648( - _id, _lib._sel_scriptingValueForSpecifier_1, objectSpecifier._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? get scriptingProperties { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_scriptingProperties1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set scriptingProperties(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, _lib._sel_setScriptingProperties_1, value?._id ?? ffi.nullptr); - } - - NSObject? copyScriptingValue_forKey_withProperties_( - NSObject value, NSString key, NSDictionary properties) { - final _ret = _lib._objc_msgSend_649( - _id, - _lib._sel_copyScriptingValue_forKey_withProperties_1, - value._id, - key._id, - properties._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: false, release: true); - } - - NSObject? - newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_( - NSObject objectClass, - NSString key, - NSObject? contentsValue, - NSDictionary properties) { - final _ret = _lib._objc_msgSend_650( - _id, - _lib._sel_newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_1, - objectClass._id, - key._id, - contentsValue?._id ?? ffi.nullptr, - properties._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: false, release: true); - } - - int get classCode { - return _lib._objc_msgSend_213(_id, _lib._sel_classCode1); - } - - NSString? get className { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_className1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSObject? valueAtIndex_inPropertyWithKey_(int index, NSString key) { - final _ret = _lib._objc_msgSend_651( - _id, _lib._sel_valueAtIndex_inPropertyWithKey_1, index, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? valueWithName_inPropertyWithKey_(NSString name, NSString key) { - final _ret = _lib._objc_msgSend_174( - _id, _lib._sel_valueWithName_inPropertyWithKey_1, name._id, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? valueWithUniqueID_inPropertyWithKey_( - NSObject uniqueID, NSString key) { - final _ret = _lib._objc_msgSend_310(_id, - _lib._sel_valueWithUniqueID_inPropertyWithKey_1, uniqueID._id, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void insertValue_atIndex_inPropertyWithKey_( - NSObject value, int index, NSString key) { - _lib._objc_msgSend_652( - _id, - _lib._sel_insertValue_atIndex_inPropertyWithKey_1, - value._id, - index, - key._id); - } - - void removeValueAtIndex_fromPropertyWithKey_(int index, NSString key) { - _lib._objc_msgSend_653(_id, - _lib._sel_removeValueAtIndex_fromPropertyWithKey_1, index, key._id); - } - - void replaceValueAtIndex_inPropertyWithKey_withValue_( - int index, NSString key, NSObject value) { - _lib._objc_msgSend_654( - _id, - _lib._sel_replaceValueAtIndex_inPropertyWithKey_withValue_1, - index, - key._id, - value._id); - } - - void insertValue_inPropertyWithKey_(NSObject value, NSString key) { - _lib._objc_msgSend_655( - _id, _lib._sel_insertValue_inPropertyWithKey_1, value._id, key._id); - } - - NSObject? coerceValue_forKey_(NSObject? value, NSString key) { - final _ret = _lib._objc_msgSend_656(_id, _lib._sel_coerceValue_forKey_1, - value?._id ?? ffi.nullptr, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSScriptObjectSpecifier? get objectSpecifier { - final _ret = _lib._objc_msgSend_631(_id, _lib._sel_objectSpecifier1); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); - } - - NSArray? indicesOfObjectsByEvaluatingObjectSpecifier_( - NSScriptObjectSpecifier specifier) { - final _ret = _lib._objc_msgSend_657(_id, - _lib._sel_indicesOfObjectsByEvaluatingObjectSpecifier_1, specifier._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - bool isEqualTo_(NSObject? object) { - return _lib._objc_msgSend_216( - _id, _lib._sel_isEqualTo_1, object?._id ?? ffi.nullptr); - } - - bool isLessThanOrEqualTo_(NSObject? object) { - return _lib._objc_msgSend_216( - _id, _lib._sel_isLessThanOrEqualTo_1, object?._id ?? ffi.nullptr); - } - - bool isLessThan_(NSObject? object) { - return _lib._objc_msgSend_216( - _id, _lib._sel_isLessThan_1, object?._id ?? ffi.nullptr); - } - - bool isGreaterThanOrEqualTo_(NSObject? object) { - return _lib._objc_msgSend_216( - _id, _lib._sel_isGreaterThanOrEqualTo_1, object?._id ?? ffi.nullptr); - } - - bool isGreaterThan_(NSObject? object) { - return _lib._objc_msgSend_216( - _id, _lib._sel_isGreaterThan_1, object?._id ?? ffi.nullptr); - } - - bool isNotEqualTo_(NSObject? object) { - return _lib._objc_msgSend_216( - _id, _lib._sel_isNotEqualTo_1, object?._id ?? ffi.nullptr); - } - - bool doesContain_(NSObject object) { - return _lib._objc_msgSend_0(_id, _lib._sel_doesContain_1, object._id); - } - - bool isLike_(NSString object) { - return _lib._objc_msgSend_63(_id, _lib._sel_isLike_1, object._id); - } - - bool isCaseInsensitiveLike_(NSString object) { - return _lib._objc_msgSend_63( - _id, _lib._sel_isCaseInsensitiveLike_1, object._id); - } - - bool scriptingIsEqualTo_(NSObject object) { - return _lib._objc_msgSend_0( - _id, _lib._sel_scriptingIsEqualTo_1, object._id); - } - - bool scriptingIsLessThanOrEqualTo_(NSObject object) { - return _lib._objc_msgSend_0( - _id, _lib._sel_scriptingIsLessThanOrEqualTo_1, object._id); - } - - bool scriptingIsLessThan_(NSObject object) { - return _lib._objc_msgSend_0( - _id, _lib._sel_scriptingIsLessThan_1, object._id); - } - - bool scriptingIsGreaterThanOrEqualTo_(NSObject object) { - return _lib._objc_msgSend_0( - _id, _lib._sel_scriptingIsGreaterThanOrEqualTo_1, object._id); - } - - bool scriptingIsGreaterThan_(NSObject object) { - return _lib._objc_msgSend_0( - _id, _lib._sel_scriptingIsGreaterThan_1, object._id); - } - - bool scriptingBeginsWith_(NSObject object) { - return _lib._objc_msgSend_0( - _id, _lib._sel_scriptingBeginsWith_1, object._id); - } - - bool scriptingEndsWith_(NSObject object) { - return _lib._objc_msgSend_0(_id, _lib._sel_scriptingEndsWith_1, object._id); - } - - bool scriptingContains_(NSObject object) { - return _lib._objc_msgSend_0(_id, _lib._sel_scriptingContains_1, object._id); - } -} - -final class ObjCSel extends ffi.Opaque {} - -final class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; -typedef Dartinstancetype = NSObject; - -final class _NSZone extends ffi.Opaque {} - -class Protocol extends _ObjCWrapper { - Protocol._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [Protocol] that points to the same underlying object as [other]. - static Protocol castFrom(T other) { - return Protocol._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [Protocol] that wraps the given raw object pointer. - static Protocol castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return Protocol._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [Protocol]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_Protocol1); - } -} - -class NSInvocation extends NSObject { - NSInvocation._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSInvocation] that points to the same underlying object as [other]. - static NSInvocation castFrom(T other) { - return NSInvocation._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSInvocation] that wraps the given raw object pointer. - static NSInvocation castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSInvocation._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSInvocation]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSInvocation1); - } - - static NSInvocation invocationWithMethodSignature_( - ThermionDartTexture1 _lib, NSMethodSignature sig) { - final _ret = _lib._objc_msgSend_413(_lib._class_NSInvocation1, - _lib._sel_invocationWithMethodSignature_1, sig._id); - return NSInvocation._(_ret, _lib, retain: true, release: true); - } - - NSMethodSignature get methodSignature { - final _ret = _lib._objc_msgSend_414(_id, _lib._sel_methodSignature1); - return NSMethodSignature._(_ret, _lib, retain: true, release: true); - } - - void retainArguments() { - _lib._objc_msgSend_1(_id, _lib._sel_retainArguments1); - } - - bool get argumentsRetained { - return _lib._objc_msgSend_12(_id, _lib._sel_argumentsRetained1); - } - - NSObject? get target { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_target1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set target(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setTarget_1, value?._id ?? ffi.nullptr); - } - - ffi.Pointer get selector { - return _lib._objc_msgSend_416(_id, _lib._sel_selector1); - } - - set selector(ffi.Pointer value) { - return _lib._objc_msgSend_417(_id, _lib._sel_setSelector_1, value); - } - - void getReturnValue_(ffi.Pointer retLoc) { - _lib._objc_msgSend_51(_id, _lib._sel_getReturnValue_1, retLoc); - } - - void setReturnValue_(ffi.Pointer retLoc) { - _lib._objc_msgSend_51(_id, _lib._sel_setReturnValue_1, retLoc); - } - - void getArgument_atIndex_(ffi.Pointer argumentLocation, int idx) { - _lib._objc_msgSend_418( - _id, _lib._sel_getArgument_atIndex_1, argumentLocation, idx); - } - - void setArgument_atIndex_(ffi.Pointer argumentLocation, int idx) { - _lib._objc_msgSend_418( - _id, _lib._sel_setArgument_atIndex_1, argumentLocation, idx); - } - - void invoke() { - _lib._objc_msgSend_1(_id, _lib._sel_invoke1); - } - - void invokeWithTarget_(NSObject target) { - _lib._objc_msgSend_15(_id, _lib._sel_invokeWithTarget_1, target._id); - } - - void invokeUsingIMP_( - ffi.Pointer> imp) { - _lib._objc_msgSend_419(_id, _lib._sel_invokeUsingIMP_1, imp); - } - - @override - NSInvocation init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSInvocation._(_ret, _lib, retain: true, release: true); - } - - static NSInvocation new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSInvocation1, _lib._sel_new1); - return NSInvocation._(_ret, _lib, retain: false, release: true); - } - - static NSInvocation allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSInvocation1, _lib._sel_allocWithZone_1, zone); - return NSInvocation._(_ret, _lib, retain: false, release: true); - } - - static NSInvocation alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSInvocation1, _lib._sel_alloc1); - return NSInvocation._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSInvocation1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSInvocation1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSInvocation1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSInvocation1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSInvocation1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSInvocation1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSInvocation1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSInvocation1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSInvocation1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSMethodSignature extends NSObject { - NSMethodSignature._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMethodSignature] that points to the same underlying object as [other]. - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSMethodSignature] that wraps the given raw object pointer. - static NSMethodSignature castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMethodSignature._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMethodSignature]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSMethodSignature1); - } - - static NSMethodSignature? signatureWithObjCTypes_( - ThermionDartTexture1 _lib, ffi.Pointer types) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSMethodSignature1, - _lib._sel_signatureWithObjCTypes_1, types); - return _ret.address == 0 - ? null - : NSMethodSignature._(_ret, _lib, retain: true, release: true); - } - - int get numberOfArguments { - return _lib._objc_msgSend_10(_id, _lib._sel_numberOfArguments1); - } - - ffi.Pointer getArgumentTypeAtIndex_(int idx) { - return _lib._objc_msgSend_11(_id, _lib._sel_getArgumentTypeAtIndex_1, idx); - } - - int get frameLength { - return _lib._objc_msgSend_10(_id, _lib._sel_frameLength1); - } - - bool isOneway() { - return _lib._objc_msgSend_12(_id, _lib._sel_isOneway1); - } - - ffi.Pointer get methodReturnType { - return _lib._objc_msgSend_13(_id, _lib._sel_methodReturnType1); - } - - int get methodReturnLength { - return _lib._objc_msgSend_10(_id, _lib._sel_methodReturnLength1); - } - - @override - NSMethodSignature init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMethodSignature._(_ret, _lib, retain: true, release: true); - } - - static NSMethodSignature new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMethodSignature1, _lib._sel_new1); - return NSMethodSignature._(_ret, _lib, retain: false, release: true); - } - - static NSMethodSignature allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMethodSignature1, _lib._sel_allocWithZone_1, zone); - return NSMethodSignature._(_ret, _lib, retain: false, release: true); - } - - static NSMethodSignature alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMethodSignature1, _lib._sel_alloc1); - return NSMethodSignature._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMethodSignature1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMethodSignature1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSMethodSignature1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMethodSignature1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMethodSignature1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMethodSignature1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMethodSignature1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSMethodSignature1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMethodSignature1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSSet extends NSObject { - NSSet._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSSet] that points to the same underlying object as [other]. - static NSSet castFrom(T other) { - return NSSet._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSSet] that wraps the given raw object pointer. - static NSSet castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSSet._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSSet]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSSet1); - } - - int get count { - return _lib._objc_msgSend_10(_id, _lib._sel_count1); - } - - NSObject? member_(NSObject object) { - final _ret = _lib._objc_msgSend_16(_id, _lib._sel_member_1, object._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSEnumerator objectEnumerator() { - final _ret = _lib._objc_msgSend_76(_id, _lib._sel_objectEnumerator1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - @override - NSSet init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - NSSet initWithObjects_count_( - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65( - _id, _lib._sel_initWithObjects_count_1, objects, cnt); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - NSSet? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSSet._(_ret, _lib, retain: true, release: true); - } - - NSArray get allObjects { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_allObjects1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSObject? anyObject() { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_anyObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - bool containsObject_(NSObject anObject) { - return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, anObject._id); - } - - NSString get description { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_69( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - bool intersectsSet_(NSSet otherSet) { - return _lib._objc_msgSend_402(_id, _lib._sel_intersectsSet_1, otherSet._id); - } - - bool isEqualToSet_(NSSet otherSet) { - return _lib._objc_msgSend_402(_id, _lib._sel_isEqualToSet_1, otherSet._id); - } - - bool isSubsetOfSet_(NSSet otherSet) { - return _lib._objc_msgSend_402(_id, _lib._sel_isSubsetOfSet_1, otherSet._id); - } - - void makeObjectsPerformSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_7( - _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); - } - - void makeObjectsPerformSelector_withObject_( - ffi.Pointer aSelector, NSObject? argument) { - _lib._objc_msgSend_89( - _id, - _lib._sel_makeObjectsPerformSelector_withObject_1, - aSelector, - argument?._id ?? ffi.nullptr); - } - - NSSet setByAddingObject_(NSObject anObject) { - final _ret = _lib._objc_msgSend_403( - _id, _lib._sel_setByAddingObject_1, anObject._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - NSSet setByAddingObjectsFromSet_(NSSet other) { - final _ret = _lib._objc_msgSend_404( - _id, _lib._sel_setByAddingObjectsFromSet_1, other._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - NSSet setByAddingObjectsFromArray_(NSArray other) { - final _ret = _lib._objc_msgSend_405( - _id, _lib._sel_setByAddingObjectsFromArray_1, other._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - void enumerateObjectsUsingBlock_(ObjCBlock_ffiVoid_ObjCObject_bool block) { - _lib._objc_msgSend_406( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); - } - - void enumerateObjectsWithOptions_usingBlock_( - int opts, ObjCBlock_ffiVoid_ObjCObject_bool block) { - _lib._objc_msgSend_407(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); - } - - NSSet objectsPassingTest_(ObjCBlock_bool_ObjCObject_bool predicate) { - final _ret = _lib._objc_msgSend_408( - _id, _lib._sel_objectsPassingTest_1, predicate._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - NSSet objectsWithOptions_passingTest_( - int opts, ObjCBlock_bool_ObjCObject_bool predicate) { - final _ret = _lib._objc_msgSend_409( - _id, _lib._sel_objectsWithOptions_passingTest_1, opts, predicate._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static NSSet set1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_set1); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static NSSet setWithObject_(ThermionDartTexture1 _lib, NSObject object) { - final _ret = _lib._objc_msgSend_123( - _lib._class_NSSet1, _lib._sel_setWithObject_1, object._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static NSSet setWithObjects_count_(ThermionDartTexture1 _lib, - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSSet1, _lib._sel_setWithObjects_count_1, objects, cnt); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static NSSet setWithObjects_(ThermionDartTexture1 _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_123( - _lib._class_NSSet1, _lib._sel_setWithObjects_1, firstObj._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static NSSet setWithSet_(ThermionDartTexture1 _lib, NSSet set) { - final _ret = _lib._objc_msgSend_410( - _lib._class_NSSet1, _lib._sel_setWithSet_1, set._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static NSSet setWithArray_(ThermionDartTexture1 _lib, NSArray array) { - final _ret = _lib._objc_msgSend_124( - _lib._class_NSSet1, _lib._sel_setWithArray_1, array._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - NSSet initWithObjects_(NSObject firstObj) { - final _ret = - _lib._objc_msgSend_123(_id, _lib._sel_initWithObjects_1, firstObj._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - NSSet initWithSet_(NSSet set) { - final _ret = _lib._objc_msgSend_410(_id, _lib._sel_initWithSet_1, set._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - NSSet initWithSet_copyItems_(NSSet set, bool flag) { - final _ret = _lib._objc_msgSend_411( - _id, _lib._sel_initWithSet_copyItems_1, set._id, flag); - return NSSet._(_ret, _lib, retain: false, release: true); - } - - NSSet initWithArray_(NSArray array) { - final _ret = - _lib._objc_msgSend_124(_id, _lib._sel_initWithArray_1, array._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - NSObject valueForKey_(NSString key) { - final _ret = _lib._objc_msgSend_31(_id, _lib._sel_valueForKey_1, key._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - void setValue_forKey_(NSObject? value, NSString key) { - _lib._objc_msgSend_134( - _id, _lib._sel_setValue_forKey_1, value?._id ?? ffi.nullptr, key._id); - } - - @override - void addObserver_forKeyPath_options_context_(NSObject observer, - NSString keyPath, int options, ffi.Pointer context) { - _lib._objc_msgSend_138( - _id, - _lib._sel_addObserver_forKeyPath_options_context_1, - observer._id, - keyPath._id, - options, - context); - } - - @override - void removeObserver_forKeyPath_context_( - NSObject observer, NSString keyPath, ffi.Pointer context) { - _lib._objc_msgSend_139(_id, _lib._sel_removeObserver_forKeyPath_context_1, - observer._id, keyPath._id, context); - } - - @override - void removeObserver_forKeyPath_(NSObject observer, NSString keyPath) { - _lib._objc_msgSend_140( - _id, _lib._sel_removeObserver_forKeyPath_1, observer._id, keyPath._id); - } - - NSArray sortedArrayUsingDescriptors_(NSArray sortDescriptors) { - final _ret = _lib._objc_msgSend_67( - _id, _lib._sel_sortedArrayUsingDescriptors_1, sortDescriptors._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSSet filteredSetUsingPredicate_(NSPredicate predicate) { - final _ret = _lib._objc_msgSend_412( - _id, _lib._sel_filteredSetUsingPredicate_1, predicate._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static NSSet new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_new1); - return NSSet._(_ret, _lib, retain: false, release: true); - } - - static NSSet allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSSet1, _lib._sel_allocWithZone_1, zone); - return NSSet._(_ret, _lib, retain: false, release: true); - } - - static NSSet alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_alloc1); - return NSSet._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSSet1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSSet1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSSet1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSSet1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSSet1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSSet1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSSet1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSEnumerator extends NSObject { - NSEnumerator._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSEnumerator] that points to the same underlying object as [other]. - static NSEnumerator castFrom(T other) { - return NSEnumerator._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSEnumerator] that wraps the given raw object pointer. - static NSEnumerator castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSEnumerator._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSEnumerator]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSEnumerator1); - } - - NSObject? nextObject() { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_nextObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject get allObjects { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_allObjects1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - NSEnumerator init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - static NSEnumerator new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSEnumerator1, _lib._sel_new1); - return NSEnumerator._(_ret, _lib, retain: false, release: true); - } - - static NSEnumerator allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSEnumerator1, _lib._sel_allocWithZone_1, zone); - return NSEnumerator._(_ret, _lib, retain: false, release: true); - } - - static NSEnumerator alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSEnumerator1, _lib._sel_alloc1); - return NSEnumerator._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSEnumerator1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSEnumerator1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSEnumerator1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSEnumerator1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSEnumerator1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSEnumerator1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSEnumerator1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSEnumerator1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSEnumerator1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSString extends NSObject { - NSString._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSString] that points to the same underlying object as [other]. - static NSString castFrom(T other) { - return NSString._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSString] that wraps the given raw object pointer. - static NSString castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSString._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSString]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSString1); - } - - factory NSString(ThermionDartTexture1 _lib, String str) { - final cstr = str.toNativeUtf16(); - final nsstr = stringWithCharacters_length_(_lib, cstr.cast(), str.length); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() { - final data = - dataUsingEncoding_(0x94000100 /* NSUTF16LittleEndianStringEncoding */); - return data!.bytes.cast().toDartString(length: length); - } - - int get length { - return _lib._objc_msgSend_10(_id, _lib._sel_length1); - } - - int characterAtIndex_(int index) { - return _lib._objc_msgSend_18(_id, _lib._sel_characterAtIndex_1, index); - } - - @override - NSString init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString substringFromIndex_(int from) { - final _ret = - _lib._objc_msgSend_331(_id, _lib._sel_substringFromIndex_1, from); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString substringToIndex_(int to) { - final _ret = _lib._objc_msgSend_331(_id, _lib._sel_substringToIndex_1, to); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString substringWithRange_(_NSRange range) { - final _ret = - _lib._objc_msgSend_332(_id, _lib._sel_substringWithRange_1, range); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void getCharacters_range_( - ffi.Pointer buffer, _NSRange range) { - _lib._objc_msgSend_333(_id, _lib._sel_getCharacters_range_1, buffer, range); - } - - int compare_(NSString string) { - return _lib._objc_msgSend_334(_id, _lib._sel_compare_1, string._id); - } - - int compare_options_(NSString string, int mask) { - return _lib._objc_msgSend_335( - _id, _lib._sel_compare_options_1, string._id, mask); - } - - int compare_options_range_( - NSString string, int mask, _NSRange rangeOfReceiverToCompare) { - return _lib._objc_msgSend_336(_id, _lib._sel_compare_options_range_1, - string._id, mask, rangeOfReceiverToCompare); - } - - int compare_options_range_locale_(NSString string, int mask, - _NSRange rangeOfReceiverToCompare, NSObject? locale) { - return _lib._objc_msgSend_337(_id, _lib._sel_compare_options_range_locale_1, - string._id, mask, rangeOfReceiverToCompare, locale?._id ?? ffi.nullptr); - } - - int caseInsensitiveCompare_(NSString string) { - return _lib._objc_msgSend_334( - _id, _lib._sel_caseInsensitiveCompare_1, string._id); - } - - int localizedCompare_(NSString string) { - return _lib._objc_msgSend_334( - _id, _lib._sel_localizedCompare_1, string._id); - } - - int localizedCaseInsensitiveCompare_(NSString string) { - return _lib._objc_msgSend_334( - _id, _lib._sel_localizedCaseInsensitiveCompare_1, string._id); - } - - int localizedStandardCompare_(NSString string) { - return _lib._objc_msgSend_334( - _id, _lib._sel_localizedStandardCompare_1, string._id); - } - - bool isEqualToString_(NSString aString) { - return _lib._objc_msgSend_63(_id, _lib._sel_isEqualToString_1, aString._id); - } - - bool hasPrefix_(NSString str) { - return _lib._objc_msgSend_63(_id, _lib._sel_hasPrefix_1, str._id); - } - - bool hasSuffix_(NSString str) { - return _lib._objc_msgSend_63(_id, _lib._sel_hasSuffix_1, str._id); - } - - NSString commonPrefixWithString_options_(NSString str, int mask) { - final _ret = _lib._objc_msgSend_338( - _id, _lib._sel_commonPrefixWithString_options_1, str._id, mask); - return NSString._(_ret, _lib, retain: true, release: true); - } - - bool containsString_(NSString str) { - return _lib._objc_msgSend_63(_id, _lib._sel_containsString_1, str._id); - } - - bool localizedCaseInsensitiveContainsString_(NSString str) { - return _lib._objc_msgSend_63( - _id, _lib._sel_localizedCaseInsensitiveContainsString_1, str._id); - } - - bool localizedStandardContainsString_(NSString str) { - return _lib._objc_msgSend_63( - _id, _lib._sel_localizedStandardContainsString_1, str._id); - } - - void localizedStandardRangeOfString_( - ffi.Pointer<_NSRange> stret, NSString str) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_339_stret( - stret, _id, _lib._sel_localizedStandardRangeOfString_1, str._id) - : stret.ref = _lib._objc_msgSend_339( - _id, _lib._sel_localizedStandardRangeOfString_1, str._id); - } - - void rangeOfString_(ffi.Pointer<_NSRange> stret, NSString searchString) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_339_stret( - stret, _id, _lib._sel_rangeOfString_1, searchString._id) - : stret.ref = _lib._objc_msgSend_339( - _id, _lib._sel_rangeOfString_1, searchString._id); - } - - void rangeOfString_options_( - ffi.Pointer<_NSRange> stret, NSString searchString, int mask) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_340_stret(stret, _id, - _lib._sel_rangeOfString_options_1, searchString._id, mask) - : stret.ref = _lib._objc_msgSend_340( - _id, _lib._sel_rangeOfString_options_1, searchString._id, mask); - } - - void rangeOfString_options_range_(ffi.Pointer<_NSRange> stret, - NSString searchString, int mask, _NSRange rangeOfReceiverToSearch) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_341_stret( - stret, - _id, - _lib._sel_rangeOfString_options_range_1, - searchString._id, - mask, - rangeOfReceiverToSearch) - : stret.ref = _lib._objc_msgSend_341( - _id, - _lib._sel_rangeOfString_options_range_1, - searchString._id, - mask, - rangeOfReceiverToSearch); - } - - void rangeOfString_options_range_locale_( - ffi.Pointer<_NSRange> stret, - NSString searchString, - int mask, - _NSRange rangeOfReceiverToSearch, - NSLocale? locale) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_342_stret( - stret, - _id, - _lib._sel_rangeOfString_options_range_locale_1, - searchString._id, - mask, - rangeOfReceiverToSearch, - locale?._id ?? ffi.nullptr) - : stret.ref = _lib._objc_msgSend_342( - _id, - _lib._sel_rangeOfString_options_range_locale_1, - searchString._id, - mask, - rangeOfReceiverToSearch, - locale?._id ?? ffi.nullptr); - } - - void rangeOfCharacterFromSet_( - ffi.Pointer<_NSRange> stret, NSCharacterSet searchSet) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_343_stret( - stret, _id, _lib._sel_rangeOfCharacterFromSet_1, searchSet._id) - : stret.ref = _lib._objc_msgSend_343( - _id, _lib._sel_rangeOfCharacterFromSet_1, searchSet._id); - } - - void rangeOfCharacterFromSet_options_( - ffi.Pointer<_NSRange> stret, NSCharacterSet searchSet, int mask) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_344_stret(stret, _id, - _lib._sel_rangeOfCharacterFromSet_options_1, searchSet._id, mask) - : stret.ref = _lib._objc_msgSend_344(_id, - _lib._sel_rangeOfCharacterFromSet_options_1, searchSet._id, mask); - } - - void rangeOfCharacterFromSet_options_range_(ffi.Pointer<_NSRange> stret, - NSCharacterSet searchSet, int mask, _NSRange rangeOfReceiverToSearch) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_345_stret( - stret, - _id, - _lib._sel_rangeOfCharacterFromSet_options_range_1, - searchSet._id, - mask, - rangeOfReceiverToSearch) - : stret.ref = _lib._objc_msgSend_345( - _id, - _lib._sel_rangeOfCharacterFromSet_options_range_1, - searchSet._id, - mask, - rangeOfReceiverToSearch); - } - - void rangeOfComposedCharacterSequenceAtIndex_( - ffi.Pointer<_NSRange> stret, int index) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_346_stret(stret, _id, - _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index) - : stret.ref = _lib._objc_msgSend_346( - _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); - } - - void rangeOfComposedCharacterSequencesForRange_( - ffi.Pointer<_NSRange> stret, _NSRange range) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_347_stret(stret, _id, - _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range) - : stret.ref = _lib._objc_msgSend_347( - _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); - } - - NSString stringByAppendingString_(NSString aString) { - final _ret = _lib._objc_msgSend_68( - _id, _lib._sel_stringByAppendingString_1, aString._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByAppendingFormat_(NSString format) { - final _ret = _lib._objc_msgSend_68( - _id, _lib._sel_stringByAppendingFormat_1, format._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - double get doubleValue { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_doubleValue1) - : _lib._objc_msgSend_164(_id, _lib._sel_doubleValue1); - } - - double get floatValue { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_238_fpret(_id, _lib._sel_floatValue1) - : _lib._objc_msgSend_238(_id, _lib._sel_floatValue1); - } - - int get intValue { - return _lib._objc_msgSend_236(_id, _lib._sel_intValue1); - } - - int get integerValue { - return _lib._objc_msgSend_82(_id, _lib._sel_integerValue1); - } - - int get longLongValue { - return _lib._objc_msgSend_237(_id, _lib._sel_longLongValue1); - } - - bool get boolValue { - return _lib._objc_msgSend_12(_id, _lib._sel_boolValue1); - } - - NSString get uppercaseString { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_uppercaseString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get lowercaseString { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_lowercaseString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get capitalizedString { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_capitalizedString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get localizedUppercaseString { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_localizedUppercaseString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get localizedLowercaseString { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_localizedLowercaseString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get localizedCapitalizedString { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_localizedCapitalizedString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString uppercaseStringWithLocale_(NSLocale? locale) { - final _ret = _lib._objc_msgSend_348( - _id, _lib._sel_uppercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString lowercaseStringWithLocale_(NSLocale? locale) { - final _ret = _lib._objc_msgSend_348( - _id, _lib._sel_lowercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString capitalizedStringWithLocale_(NSLocale? locale) { - final _ret = _lib._objc_msgSend_348(_id, - _lib._sel_capitalizedStringWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void getLineStart_end_contentsEnd_forRange_( - ffi.Pointer startPtr, - ffi.Pointer lineEndPtr, - ffi.Pointer contentsEndPtr, - _NSRange range) { - _lib._objc_msgSend_349( - _id, - _lib._sel_getLineStart_end_contentsEnd_forRange_1, - startPtr, - lineEndPtr, - contentsEndPtr, - range); - } - - void lineRangeForRange_(ffi.Pointer<_NSRange> stret, _NSRange range) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_347_stret( - stret, _id, _lib._sel_lineRangeForRange_1, range) - : stret.ref = - _lib._objc_msgSend_347(_id, _lib._sel_lineRangeForRange_1, range); - } - - void getParagraphStart_end_contentsEnd_forRange_( - ffi.Pointer startPtr, - ffi.Pointer parEndPtr, - ffi.Pointer contentsEndPtr, - _NSRange range) { - _lib._objc_msgSend_349( - _id, - _lib._sel_getParagraphStart_end_contentsEnd_forRange_1, - startPtr, - parEndPtr, - contentsEndPtr, - range); - } - - void paragraphRangeForRange_(ffi.Pointer<_NSRange> stret, _NSRange range) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_347_stret( - stret, _id, _lib._sel_paragraphRangeForRange_1, range) - : stret.ref = _lib._objc_msgSend_347( - _id, _lib._sel_paragraphRangeForRange_1, range); - } - - void enumerateSubstringsInRange_options_usingBlock_(_NSRange range, int opts, - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool block) { - _lib._objc_msgSend_350( - _id, - _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, - range, - opts, - block._id); - } - - void enumerateLinesUsingBlock_(ObjCBlock_ffiVoid_NSString_bool block) { - _lib._objc_msgSend_351( - _id, _lib._sel_enumerateLinesUsingBlock_1, block._id); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } - - int get fastestEncoding { - return _lib._objc_msgSend_10(_id, _lib._sel_fastestEncoding1); - } - - int get smallestEncoding { - return _lib._objc_msgSend_10(_id, _lib._sel_smallestEncoding1); - } - - NSData? dataUsingEncoding_allowLossyConversion_(int encoding, bool lossy) { - final _ret = _lib._objc_msgSend_352(_id, - _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? dataUsingEncoding_(int encoding) { - final _ret = - _lib._objc_msgSend_353(_id, _lib._sel_dataUsingEncoding_1, encoding); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - bool canBeConvertedToEncoding_(int encoding) { - return _lib._objc_msgSend_96( - _id, _lib._sel_canBeConvertedToEncoding_1, encoding); - } - - ffi.Pointer cStringUsingEncoding_(int encoding) { - return _lib._objc_msgSend_11( - _id, _lib._sel_cStringUsingEncoding_1, encoding); - } - - bool getCString_maxLength_encoding_( - ffi.Pointer buffer, int maxBufferCount, int encoding) { - return _lib._objc_msgSend_354( - _id, - _lib._sel_getCString_maxLength_encoding_1, - buffer, - maxBufferCount, - encoding); - } - - bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( - ffi.Pointer buffer, - int maxBufferCount, - ffi.Pointer usedBufferCount, - int encoding, - int options, - _NSRange range, - ffi.Pointer<_NSRange> leftover) { - return _lib._objc_msgSend_355( - _id, - _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, - buffer, - maxBufferCount, - usedBufferCount, - encoding, - options, - range, - leftover); - } - - int maximumLengthOfBytesUsingEncoding_(int enc) { - return _lib._objc_msgSend_93( - _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); - } - - int lengthOfBytesUsingEncoding_(int enc) { - return _lib._objc_msgSend_93( - _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); - } - - static ffi.Pointer getAvailableStringEncodings( - ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_356( - _lib._class_NSString1, _lib._sel_availableStringEncodings1); - } - - static NSString localizedNameOfStringEncoding_( - ThermionDartTexture1 _lib, int encoding) { - final _ret = _lib._objc_msgSend_331(_lib._class_NSString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static int getDefaultCStringEncoding(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_10( - _lib._class_NSString1, _lib._sel_defaultCStringEncoding1); - } - - NSString get decomposedStringWithCanonicalMapping { - final _ret = _lib._objc_msgSend_21( - _id, _lib._sel_decomposedStringWithCanonicalMapping1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get precomposedStringWithCanonicalMapping { - final _ret = _lib._objc_msgSend_21( - _id, _lib._sel_precomposedStringWithCanonicalMapping1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get decomposedStringWithCompatibilityMapping { - final _ret = _lib._objc_msgSend_21( - _id, _lib._sel_decomposedStringWithCompatibilityMapping1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get precomposedStringWithCompatibilityMapping { - final _ret = _lib._objc_msgSend_21( - _id, _lib._sel_precomposedStringWithCompatibilityMapping1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray componentsSeparatedByString_(NSString separator) { - final _ret = _lib._objc_msgSend_357( - _id, _lib._sel_componentsSeparatedByString_1, separator._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray componentsSeparatedByCharactersInSet_(NSCharacterSet separator) { - final _ret = _lib._objc_msgSend_358( - _id, _lib._sel_componentsSeparatedByCharactersInSet_1, separator._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString stringByTrimmingCharactersInSet_(NSCharacterSet set) { - final _ret = _lib._objc_msgSend_359( - _id, _lib._sel_stringByTrimmingCharactersInSet_1, set._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByPaddingToLength_withString_startingAtIndex_( - int newLength, NSString padString, int padIndex) { - final _ret = _lib._objc_msgSend_360( - _id, - _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, - newLength, - padString._id, - padIndex); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByFoldingWithOptions_locale_(int options, NSLocale? locale) { - final _ret = _lib._objc_msgSend_361( - _id, - _lib._sel_stringByFoldingWithOptions_locale_1, - options, - locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByReplacingOccurrencesOfString_withString_options_range_( - NSString target, - NSString replacement, - int options, - _NSRange searchRange) { - final _ret = _lib._objc_msgSend_362( - _id, - _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, - target._id, - replacement._id, - options, - searchRange); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByReplacingOccurrencesOfString_withString_( - NSString target, NSString replacement) { - final _ret = _lib._objc_msgSend_363( - _id, - _lib._sel_stringByReplacingOccurrencesOfString_withString_1, - target._id, - replacement._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByReplacingCharactersInRange_withString_( - _NSRange range, NSString replacement) { - final _ret = _lib._objc_msgSend_364( - _id, - _lib._sel_stringByReplacingCharactersInRange_withString_1, - range, - replacement._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? stringByApplyingTransform_reverse_( - NSString transform, bool reverse) { - final _ret = _lib._objc_msgSend_365(_id, - _lib._sel_stringByApplyingTransform_reverse_1, transform._id, reverse); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool writeToURL_atomically_encoding_error_(NSURL url, bool useAuxiliaryFile, - int enc, ffi.Pointer> error) { - return _lib._objc_msgSend_366( - _id, - _lib._sel_writeToURL_atomically_encoding_error_1, - url._id, - useAuxiliaryFile, - enc, - error); - } - - bool writeToFile_atomically_encoding_error_( - NSString path, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error) { - return _lib._objc_msgSend_367( - _id, - _lib._sel_writeToFile_atomically_encoding_error_1, - path._id, - useAuxiliaryFile, - enc, - error); - } - - NSString get description { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int get hash { - return _lib._objc_msgSend_10(_id, _lib._sel_hash1); - } - - NSString initWithCharactersNoCopy_length_freeWhenDone_( - ffi.Pointer characters, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_368( - _id, - _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, - characters, - length, - freeBuffer); - return NSString._(_ret, _lib, retain: false, release: true); - } - - NSString initWithCharactersNoCopy_length_deallocator_( - ffi.Pointer chars, - int len, - ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong? deallocator) { - final _ret = _lib._objc_msgSend_369( - _id, - _lib._sel_initWithCharactersNoCopy_length_deallocator_1, - chars, - len, - deallocator?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: false, release: true); - } - - NSString initWithCharacters_length_( - ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_370( - _id, _lib._sel_initWithCharacters_length_1, characters, length); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithUTF8String_(ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_371( - _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString initWithString_(NSString aString) { - final _ret = - _lib._objc_msgSend_31(_id, _lib._sel_initWithString_1, aString._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString initWithFormat_(NSString format) { - final _ret = - _lib._objc_msgSend_31(_id, _lib._sel_initWithFormat_1, format._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString initWithFormat_arguments_( - NSString format, ffi.Pointer argList) { - final _ret = _lib._objc_msgSend_372( - _id, _lib._sel_initWithFormat_arguments_1, format._id, argList); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString initWithFormat_locale_(NSString format, NSObject? locale) { - final _ret = _lib._objc_msgSend_373(_id, _lib._sel_initWithFormat_locale_1, - format._id, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString initWithFormat_locale_arguments_( - NSString format, NSObject? locale, ffi.Pointer argList) { - final _ret = _lib._objc_msgSend_374( - _id, - _lib._sel_initWithFormat_locale_arguments_1, - format._id, - locale?._id ?? ffi.nullptr, - argList); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithValidatedFormat_validFormatSpecifiers_error_( - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_375( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithValidatedFormat_validFormatSpecifiers_locale_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_376( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithValidatedFormat_validFormatSpecifiers_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_377( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1, - format._id, - validFormatSpecifiers._id, - argList, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? - initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - ffi.Pointer argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_378( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - argList, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithData_encoding_(NSData data, int encoding) { - final _ret = _lib._objc_msgSend_379( - _id, _lib._sel_initWithData_encoding_1, data._id, encoding); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithBytes_length_encoding_( - ffi.Pointer bytes, int len, int encoding) { - final _ret = _lib._objc_msgSend_380( - _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithBytesNoCopy_length_encoding_freeWhenDone_( - ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { - final _ret = _lib._objc_msgSend_381( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, - bytes, - len, - encoding, - freeBuffer); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: false, release: true); - } - - NSString? initWithBytesNoCopy_length_encoding_deallocator_( - ffi.Pointer bytes, - int len, - int encoding, - ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong? deallocator) { - final _ret = _lib._objc_msgSend_382( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, - bytes, - len, - encoding, - deallocator?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: false, release: true); - } - - static NSString string(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_string1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString stringWithString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSString1, _lib._sel_stringWithString_1, string._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString stringWithCharacters_length_(ThermionDartTexture1 _lib, - ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_370(_lib._class_NSString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithUTF8String_( - ThermionDartTexture1 _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_371(_lib._class_NSString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString stringWithFormat_( - ThermionDartTexture1 _lib, NSString format) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSString1, _lib._sel_stringWithFormat_1, format._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString localizedStringWithFormat_( - ThermionDartTexture1 _lib, NSString format) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSString1, - _lib._sel_localizedStringWithFormat_1, format._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithValidatedFormat_validFormatSpecifiers_error_( - ThermionDartTexture1 _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_375( - _lib._class_NSString1, - _lib._sel_stringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? - localizedStringWithValidatedFormat_validFormatSpecifiers_error_( - ThermionDartTexture1 _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_375( - _lib._class_NSString1, - _lib._sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithCString_encoding_( - ffi.Pointer nullTerminatedCString, int encoding) { - final _ret = _lib._objc_msgSend_383(_id, - _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithCString_encoding_( - ThermionDartTexture1 _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_383(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithContentsOfURL_encoding_error_( - NSURL url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_384(_id, - _lib._sel_initWithContentsOfURL_encoding_error_1, url._id, enc, error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithContentsOfFile_encoding_error_( - NSString path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_385( - _id, - _lib._sel_initWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithContentsOfURL_encoding_error_( - ThermionDartTexture1 _lib, - NSURL url, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_384( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithContentsOfFile_encoding_error_( - ThermionDartTexture1 _lib, - NSString path, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_385( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithContentsOfURL_usedEncoding_error_( - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_386( - _id, - _lib._sel_initWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithContentsOfFile_usedEncoding_error_( - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_387( - _id, - _lib._sel_initWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithContentsOfURL_usedEncoding_error_( - ThermionDartTexture1 _lib, - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_386( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithContentsOfFile_usedEncoding_error_( - ThermionDartTexture1 _lib, - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_387( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - ThermionDartTexture1 _lib, - NSData data, - NSDictionary? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_388( - _lib._class_NSString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data._id, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - NSObject propertyList() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_propertyList1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? propertyListFromStringsFileFormat() { - final _ret = _lib._objc_msgSend_389( - _id, _lib._sel_propertyListFromStringsFileFormat1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer cString() { - return _lib._objc_msgSend_13(_id, _lib._sel_cString1); - } - - ffi.Pointer lossyCString() { - return _lib._objc_msgSend_13(_id, _lib._sel_lossyCString1); - } - - int cStringLength() { - return _lib._objc_msgSend_10(_id, _lib._sel_cStringLength1); - } - - void getCString_(ffi.Pointer bytes) { - _lib._objc_msgSend_289(_id, _lib._sel_getCString_1, bytes); - } - - void getCString_maxLength_(ffi.Pointer bytes, int maxLength) { - _lib._objc_msgSend_390( - _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); - } - - void getCString_maxLength_range_remainingRange_(ffi.Pointer bytes, - int maxLength, _NSRange aRange, ffi.Pointer<_NSRange> leftoverRange) { - _lib._objc_msgSend_391( - _id, - _lib._sel_getCString_maxLength_range_remainingRange_1, - bytes, - maxLength, - aRange, - leftoverRange); - } - - bool writeToFile_atomically_(NSString path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_26( - _id, _lib._sel_writeToFile_atomically_1, path._id, useAuxiliaryFile); - } - - bool writeToURL_atomically_(NSURL url, bool atomically) { - return _lib._objc_msgSend_133( - _id, _lib._sel_writeToURL_atomically_1, url._id, atomically); - } - - NSObject? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_38( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_276(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithContentsOfFile_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38( - _lib._class_NSString1, _lib._sel_stringWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithContentsOfURL_( - ThermionDartTexture1 _lib, NSURL url) { - final _ret = _lib._objc_msgSend_276( - _lib._class_NSString1, _lib._sel_stringWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithCStringNoCopy_length_freeWhenDone_( - ffi.Pointer bytes, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_392( - _id, - _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, - bytes, - length, - freeBuffer); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: false, release: true); - } - - NSObject? initWithCString_length_(ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_383( - _id, _lib._sel_initWithCString_length_1, bytes, length); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithCString_(ffi.Pointer bytes) { - final _ret = - _lib._objc_msgSend_371(_id, _lib._sel_initWithCString_1, bytes); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithCString_length_( - ThermionDartTexture1 _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_383(_lib._class_NSString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithCString_( - ThermionDartTexture1 _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_371( - _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void getCharacters_(ffi.Pointer buffer) { - _lib._objc_msgSend_393(_id, _lib._sel_getCharacters_1, buffer); - } - - NSString variantFittingPresentationWidth_(int width) { - final _ret = _lib._objc_msgSend_394( - _id, _lib._sel_variantFittingPresentationWidth_1, width); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString pathWithComponents_( - ThermionDartTexture1 _lib, NSArray components) { - final _ret = _lib._objc_msgSend_395( - _lib._class_NSString1, _lib._sel_pathWithComponents_1, components._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray get pathComponents { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_pathComponents1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - bool get absolutePath { - return _lib._objc_msgSend_12(_id, _lib._sel_isAbsolutePath1); - } - - NSString get lastPathComponent { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_lastPathComponent1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get stringByDeletingLastPathComponent { - final _ret = _lib._objc_msgSend_21( - _id, _lib._sel_stringByDeletingLastPathComponent1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByAppendingPathComponent_(NSString str) { - final _ret = _lib._objc_msgSend_68( - _id, _lib._sel_stringByAppendingPathComponent_1, str._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get pathExtension { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_pathExtension1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get stringByDeletingPathExtension { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_stringByDeletingPathExtension1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? stringByAppendingPathExtension_(NSString str) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_stringByAppendingPathExtension_1, str._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get stringByAbbreviatingWithTildeInPath { - final _ret = _lib._objc_msgSend_21( - _id, _lib._sel_stringByAbbreviatingWithTildeInPath1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get stringByExpandingTildeInPath { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_stringByExpandingTildeInPath1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get stringByStandardizingPath { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_stringByStandardizingPath1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get stringByResolvingSymlinksInPath { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_stringByResolvingSymlinksInPath1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray stringsByAppendingPaths_(NSArray paths) { - final _ret = _lib._objc_msgSend_67( - _id, _lib._sel_stringsByAppendingPaths_1, paths._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - int completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_( - ffi.Pointer> outputName, - bool flag, - ffi.Pointer> outputArray, - NSArray? filterTypes) { - return _lib._objc_msgSend_396( - _id, - _lib._sel_completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_1, - outputName, - flag, - outputArray, - filterTypes?._id ?? ffi.nullptr); - } - - ffi.Pointer get fileSystemRepresentation { - return _lib._objc_msgSend_13(_id, _lib._sel_fileSystemRepresentation1); - } - - bool getFileSystemRepresentation_maxLength_( - ffi.Pointer cname, int max) { - return _lib._objc_msgSend_241( - _id, _lib._sel_getFileSystemRepresentation_maxLength_1, cname, max); - } - - NSString? stringByAddingPercentEncodingWithAllowedCharacters_( - NSCharacterSet allowedCharacters) { - final _ret = _lib._objc_msgSend_397( - _id, - _lib._sel_stringByAddingPercentEncodingWithAllowedCharacters_1, - allowedCharacters._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get stringByRemovingPercentEncoding { - final _ret = - _lib._objc_msgSend_43(_id, _lib._sel_stringByRemovingPercentEncoding1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? stringByAddingPercentEscapesUsingEncoding_(int enc) { - final _ret = _lib._objc_msgSend_398( - _id, _lib._sel_stringByAddingPercentEscapesUsingEncoding_1, enc); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? stringByReplacingPercentEscapesUsingEncoding_(int enc) { - final _ret = _lib._objc_msgSend_398( - _id, _lib._sel_stringByReplacingPercentEscapesUsingEncoding_1, enc); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray linguisticTagsInRange_scheme_options_orthography_tokenRanges_( - _NSRange range, - NSString scheme, - int options, - NSOrthography? orthography, - ffi.Pointer> tokenRanges) { - final _ret = _lib._objc_msgSend_400( - _id, - _lib._sel_linguisticTagsInRange_scheme_options_orthography_tokenRanges_1, - range, - scheme._id, - options, - orthography?._id ?? ffi.nullptr, - tokenRanges); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - void enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_( - _NSRange range, - NSString scheme, - int options, - NSOrthography? orthography, - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool block) { - _lib._objc_msgSend_401( - _id, - _lib._sel_enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_1, - range, - scheme._id, - options, - orthography?._id ?? ffi.nullptr, - block._id); - } - - static NSString new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_new1); - return NSString._(_ret, _lib, retain: false, release: true); - } - - static NSString allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSString1, _lib._sel_allocWithZone_1, zone); - return NSString._(_ret, _lib, retain: false, release: true); - } - - static NSString alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_alloc1); - return NSString._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSString1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSString1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSString1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSString1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSString1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSString1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSString1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSString1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSString1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -extension StringToNSString on String { - NSString toNSString(ThermionDartTexture1 lib) => NSString(lib, this); -} - -class NSCoder extends NSObject { - NSCoder._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSCoder] that points to the same underlying object as [other]. - static NSCoder castFrom(T other) { - return NSCoder._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSCoder] that wraps the given raw object pointer. - static NSCoder castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSCoder._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSCoder]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSCoder1); - } - - void encodeValueOfObjCType_at_( - ffi.Pointer type, ffi.Pointer addr) { - _lib._objc_msgSend_19( - _id, _lib._sel_encodeValueOfObjCType_at_1, type, addr); - } - - void encodeDataObject_(NSData data) { - _lib._objc_msgSend_284(_id, _lib._sel_encodeDataObject_1, data._id); - } - - NSData? decodeDataObject() { - final _ret = _lib._objc_msgSend_285(_id, _lib._sel_decodeDataObject1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - void decodeValueOfObjCType_at_size_( - ffi.Pointer type, ffi.Pointer data, int size) { - _lib._objc_msgSend_286( - _id, _lib._sel_decodeValueOfObjCType_at_size_1, type, data, size); - } - - int versionForClassName_(NSString className) { - return _lib._objc_msgSend_287( - _id, _lib._sel_versionForClassName_1, className._id); - } - - void encodeObject_(NSObject? object) { - _lib._objc_msgSend_288( - _id, _lib._sel_encodeObject_1, object?._id ?? ffi.nullptr); - } - - void encodeRootObject_(NSObject rootObject) { - _lib._objc_msgSend_15(_id, _lib._sel_encodeRootObject_1, rootObject._id); - } - - void encodeBycopyObject_(NSObject? anObject) { - _lib._objc_msgSend_288( - _id, _lib._sel_encodeBycopyObject_1, anObject?._id ?? ffi.nullptr); - } - - void encodeByrefObject_(NSObject? anObject) { - _lib._objc_msgSend_288( - _id, _lib._sel_encodeByrefObject_1, anObject?._id ?? ffi.nullptr); - } - - void encodeConditionalObject_(NSObject? object) { - _lib._objc_msgSend_288( - _id, _lib._sel_encodeConditionalObject_1, object?._id ?? ffi.nullptr); - } - - void encodeValuesOfObjCTypes_(ffi.Pointer types) { - _lib._objc_msgSend_289(_id, _lib._sel_encodeValuesOfObjCTypes_1, types); - } - - void encodeArrayOfObjCType_count_at_( - ffi.Pointer type, int count, ffi.Pointer array) { - _lib._objc_msgSend_290( - _id, _lib._sel_encodeArrayOfObjCType_count_at_1, type, count, array); - } - - void encodeBytes_length_(ffi.Pointer byteaddr, int length) { - _lib._objc_msgSend_22( - _id, _lib._sel_encodeBytes_length_1, byteaddr, length); - } - - NSObject? decodeObject() { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_decodeObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? decodeTopLevelObjectAndReturnError_( - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_291( - _id, _lib._sel_decodeTopLevelObjectAndReturnError_1, error); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void decodeValuesOfObjCTypes_(ffi.Pointer types) { - _lib._objc_msgSend_289(_id, _lib._sel_decodeValuesOfObjCTypes_1, types); - } - - void decodeArrayOfObjCType_count_at_( - ffi.Pointer itemType, int count, ffi.Pointer array) { - _lib._objc_msgSend_290(_id, _lib._sel_decodeArrayOfObjCType_count_at_1, - itemType, count, array); - } - - ffi.Pointer decodeBytesWithReturnedLength_( - ffi.Pointer lengthp) { - return _lib._objc_msgSend_292( - _id, _lib._sel_decodeBytesWithReturnedLength_1, lengthp); - } - - void encodePropertyList_(NSObject aPropertyList) { - _lib._objc_msgSend_15( - _id, _lib._sel_encodePropertyList_1, aPropertyList._id); - } - - NSObject? decodePropertyList() { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_decodePropertyList1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void setObjectZone_(ffi.Pointer<_NSZone> zone) { - _lib._objc_msgSend_293(_id, _lib._sel_setObjectZone_1, zone); - } - - ffi.Pointer<_NSZone> objectZone() { - return _lib._objc_msgSend_294(_id, _lib._sel_objectZone1); - } - - int get systemVersion { - return _lib._objc_msgSend_213(_id, _lib._sel_systemVersion1); - } - - bool get allowsKeyedCoding { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsKeyedCoding1); - } - - void encodeObject_forKey_(NSObject? object, NSString key) { - _lib._objc_msgSend_134(_id, _lib._sel_encodeObject_forKey_1, - object?._id ?? ffi.nullptr, key._id); - } - - void encodeConditionalObject_forKey_(NSObject? object, NSString key) { - _lib._objc_msgSend_134(_id, _lib._sel_encodeConditionalObject_forKey_1, - object?._id ?? ffi.nullptr, key._id); - } - - void encodeBool_forKey_(bool value, NSString key) { - _lib._objc_msgSend_295(_id, _lib._sel_encodeBool_forKey_1, value, key._id); - } - - void encodeInt_forKey_(int value, NSString key) { - _lib._objc_msgSend_296(_id, _lib._sel_encodeInt_forKey_1, value, key._id); - } - - void encodeInt32_forKey_(int value, NSString key) { - _lib._objc_msgSend_297(_id, _lib._sel_encodeInt32_forKey_1, value, key._id); - } - - void encodeInt64_forKey_(int value, NSString key) { - _lib._objc_msgSend_298(_id, _lib._sel_encodeInt64_forKey_1, value, key._id); - } - - void encodeFloat_forKey_(double value, NSString key) { - _lib._objc_msgSend_299(_id, _lib._sel_encodeFloat_forKey_1, value, key._id); - } - - void encodeDouble_forKey_(double value, NSString key) { - _lib._objc_msgSend_300( - _id, _lib._sel_encodeDouble_forKey_1, value, key._id); - } - - void encodeBytes_length_forKey_( - ffi.Pointer bytes, int length, NSString key) { - _lib._objc_msgSend_301( - _id, _lib._sel_encodeBytes_length_forKey_1, bytes, length, key._id); - } - - bool containsValueForKey_(NSString key) { - return _lib._objc_msgSend_63(_id, _lib._sel_containsValueForKey_1, key._id); - } - - NSObject? decodeObjectForKey_(NSString key) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_decodeObjectForKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? decodeTopLevelObjectForKey_error_( - NSString key, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_302( - _id, _lib._sel_decodeTopLevelObjectForKey_error_1, key._id, error); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - bool decodeBoolForKey_(NSString key) { - return _lib._objc_msgSend_63(_id, _lib._sel_decodeBoolForKey_1, key._id); - } - - int decodeIntForKey_(NSString key) { - return _lib._objc_msgSend_303(_id, _lib._sel_decodeIntForKey_1, key._id); - } - - int decodeInt32ForKey_(NSString key) { - return _lib._objc_msgSend_304(_id, _lib._sel_decodeInt32ForKey_1, key._id); - } - - int decodeInt64ForKey_(NSString key) { - return _lib._objc_msgSend_305(_id, _lib._sel_decodeInt64ForKey_1, key._id); - } - - double decodeFloatForKey_(NSString key) { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_306_fpret( - _id, _lib._sel_decodeFloatForKey_1, key._id) - : _lib._objc_msgSend_306(_id, _lib._sel_decodeFloatForKey_1, key._id); - } - - double decodeDoubleForKey_(NSString key) { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_307_fpret( - _id, _lib._sel_decodeDoubleForKey_1, key._id) - : _lib._objc_msgSend_307(_id, _lib._sel_decodeDoubleForKey_1, key._id); - } - - ffi.Pointer decodeBytesForKey_returnedLength_( - NSString key, ffi.Pointer lengthp) { - return _lib._objc_msgSend_308( - _id, _lib._sel_decodeBytesForKey_returnedLength_1, key._id, lengthp); - } - - void encodeInteger_forKey_(int value, NSString key) { - _lib._objc_msgSend_309( - _id, _lib._sel_encodeInteger_forKey_1, value, key._id); - } - - int decodeIntegerForKey_(NSString key) { - return _lib._objc_msgSend_287( - _id, _lib._sel_decodeIntegerForKey_1, key._id); - } - - bool get requiresSecureCoding { - return _lib._objc_msgSend_12(_id, _lib._sel_requiresSecureCoding1); - } - - NSObject? decodeObjectOfClass_forKey_(NSObject aClass, NSString key) { - final _ret = _lib._objc_msgSend_310( - _id, _lib._sel_decodeObjectOfClass_forKey_1, aClass._id, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? decodeTopLevelObjectOfClass_forKey_error_(NSObject aClass, - NSString key, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_311( - _id, - _lib._sel_decodeTopLevelObjectOfClass_forKey_error_1, - aClass._id, - key._id, - error); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSArray? decodeArrayOfObjectsOfClass_forKey_(NSObject cls, NSString key) { - final _ret = _lib._objc_msgSend_312( - _id, _lib._sel_decodeArrayOfObjectsOfClass_forKey_1, cls._id, key._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_( - NSObject keyCls, NSObject objectCls, NSString key) { - final _ret = _lib._objc_msgSend_313( - _id, - _lib._sel_decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_1, - keyCls._id, - objectCls._id, - key._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSObject? decodeObjectOfClasses_forKey_(NSSet? classes, NSString key) { - final _ret = _lib._objc_msgSend_314( - _id, - _lib._sel_decodeObjectOfClasses_forKey_1, - classes?._id ?? ffi.nullptr, - key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? decodeTopLevelObjectOfClasses_forKey_error_(NSSet? classes, - NSString key, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_315( - _id, - _lib._sel_decodeTopLevelObjectOfClasses_forKey_error_1, - classes?._id ?? ffi.nullptr, - key._id, - error); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSArray? decodeArrayOfObjectsOfClasses_forKey_(NSSet classes, NSString key) { - final _ret = _lib._objc_msgSend_316(_id, - _lib._sel_decodeArrayOfObjectsOfClasses_forKey_1, classes._id, key._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_( - NSSet keyClasses, NSSet objectClasses, NSString key) { - final _ret = _lib._objc_msgSend_317( - _id, - _lib._sel_decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_1, - keyClasses._id, - objectClasses._id, - key._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSObject? decodePropertyListForKey_(NSString key) { - final _ret = _lib._objc_msgSend_38( - _id, _lib._sel_decodePropertyListForKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSSet? get allowedClasses { - final _ret = _lib._objc_msgSend_318(_id, _lib._sel_allowedClasses1); - return _ret.address == 0 - ? null - : NSSet._(_ret, _lib, retain: true, release: true); - } - - void failWithError_(NSError error) { - _lib._objc_msgSend_319(_id, _lib._sel_failWithError_1, error._id); - } - - int get decodingFailurePolicy { - return _lib._objc_msgSend_320(_id, _lib._sel_decodingFailurePolicy1); - } - - NSError? get error { - final _ret = _lib._objc_msgSend_321(_id, _lib._sel_error1); - return _ret.address == 0 - ? null - : NSError._(_ret, _lib, retain: true, release: true); - } - - void encodeNXObject_(NSObject object) { - _lib._objc_msgSend_15(_id, _lib._sel_encodeNXObject_1, object._id); - } - - NSObject? decodeNXObject() { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_decodeNXObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void decodeValueOfObjCType_at_( - ffi.Pointer type, ffi.Pointer data) { - _lib._objc_msgSend_19( - _id, _lib._sel_decodeValueOfObjCType_at_1, type, data); - } - - void encodePoint_(CGPoint point) { - _lib._objc_msgSend_322(_id, _lib._sel_encodePoint_1, point); - } - - void decodePoint(ffi.Pointer stret) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_58_stret(stret, _id, _lib._sel_decodePoint1) - : stret.ref = _lib._objc_msgSend_58(_id, _lib._sel_decodePoint1); - } - - void encodeSize_(CGSize size) { - _lib._objc_msgSend_323(_id, _lib._sel_encodeSize_1, size); - } - - void decodeSize(ffi.Pointer stret) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_59_stret(stret, _id, _lib._sel_decodeSize1) - : stret.ref = _lib._objc_msgSend_59(_id, _lib._sel_decodeSize1); - } - - void encodeRect_(CGRect rect) { - _lib._objc_msgSend_324(_id, _lib._sel_encodeRect_1, rect); - } - - void decodeRect(ffi.Pointer stret) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_60_stret(stret, _id, _lib._sel_decodeRect1) - : stret.ref = _lib._objc_msgSend_60(_id, _lib._sel_decodeRect1); - } - - void encodePoint_forKey_(CGPoint point, NSString key) { - _lib._objc_msgSend_325(_id, _lib._sel_encodePoint_forKey_1, point, key._id); - } - - void encodeSize_forKey_(CGSize size, NSString key) { - _lib._objc_msgSend_326(_id, _lib._sel_encodeSize_forKey_1, size, key._id); - } - - void encodeRect_forKey_(CGRect rect, NSString key) { - _lib._objc_msgSend_327(_id, _lib._sel_encodeRect_forKey_1, rect, key._id); - } - - void decodePointForKey_(ffi.Pointer stret, NSString key) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_328_stret( - stret, _id, _lib._sel_decodePointForKey_1, key._id) - : stret.ref = - _lib._objc_msgSend_328(_id, _lib._sel_decodePointForKey_1, key._id); - } - - void decodeSizeForKey_(ffi.Pointer stret, NSString key) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_329_stret( - stret, _id, _lib._sel_decodeSizeForKey_1, key._id) - : stret.ref = - _lib._objc_msgSend_329(_id, _lib._sel_decodeSizeForKey_1, key._id); - } - - void decodeRectForKey_(ffi.Pointer stret, NSString key) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_330_stret( - stret, _id, _lib._sel_decodeRectForKey_1, key._id) - : stret.ref = - _lib._objc_msgSend_330(_id, _lib._sel_decodeRectForKey_1, key._id); - } - - @override - NSCoder init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSCoder._(_ret, _lib, retain: true, release: true); - } - - static NSCoder new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSCoder1, _lib._sel_new1); - return NSCoder._(_ret, _lib, retain: false, release: true); - } - - static NSCoder allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSCoder1, _lib._sel_allocWithZone_1, zone); - return NSCoder._(_ret, _lib, retain: false, release: true); - } - - static NSCoder alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSCoder1, _lib._sel_alloc1); - return NSCoder._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSCoder1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSCoder1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSCoder1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSCoder1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSCoder1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSCoder1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSCoder1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSCoder1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSCoder1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSData extends NSObject { - NSData._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSData] that points to the same underlying object as [other]. - static NSData castFrom(T other) { - return NSData._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSData] that wraps the given raw object pointer. - static NSData castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSData._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSData]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSData1); - } - - int get length { - return _lib._objc_msgSend_10(_id, _lib._sel_length1); - } - - ffi.Pointer get bytes { - return _lib._objc_msgSend_20(_id, _lib._sel_bytes1); - } - - NSString get description { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void getBytes_length_(ffi.Pointer buffer, int length) { - _lib._objc_msgSend_22(_id, _lib._sel_getBytes_length_1, buffer, length); - } - - void getBytes_range_(ffi.Pointer buffer, _NSRange range) { - _lib._objc_msgSend_23(_id, _lib._sel_getBytes_range_1, buffer, range); - } - - bool isEqualToData_(NSData other) { - return _lib._objc_msgSend_24(_id, _lib._sel_isEqualToData_1, other._id); - } - - NSData subdataWithRange_(_NSRange range) { - final _ret = - _lib._objc_msgSend_25(_id, _lib._sel_subdataWithRange_1, range); - return NSData._(_ret, _lib, retain: true, release: true); - } - - bool writeToFile_atomically_(NSString path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_26( - _id, _lib._sel_writeToFile_atomically_1, path._id, useAuxiliaryFile); - } - - bool writeToURL_atomically_(NSURL url, bool atomically) { - return _lib._objc_msgSend_133( - _id, _lib._sel_writeToURL_atomically_1, url._id, atomically); - } - - bool writeToFile_options_error_(NSString path, int writeOptionsMask, - ffi.Pointer> errorPtr) { - return _lib._objc_msgSend_268(_id, _lib._sel_writeToFile_options_error_1, - path._id, writeOptionsMask, errorPtr); - } - - bool writeToURL_options_error_(NSURL url, int writeOptionsMask, - ffi.Pointer> errorPtr) { - return _lib._objc_msgSend_269(_id, _lib._sel_writeToURL_options_error_1, - url._id, writeOptionsMask, errorPtr); - } - - void rangeOfData_options_range_(ffi.Pointer<_NSRange> stret, - NSData dataToFind, int mask, _NSRange searchRange) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_270_stret( - stret, - _id, - _lib._sel_rangeOfData_options_range_1, - dataToFind._id, - mask, - searchRange) - : stret.ref = _lib._objc_msgSend_270( - _id, - _lib._sel_rangeOfData_options_range_1, - dataToFind._id, - mask, - searchRange); - } - - void enumerateByteRangesUsingBlock_( - ObjCBlock_ffiVoid_ffiVoid_NSRange_bool block) { - _lib._objc_msgSend_271( - _id, _lib._sel_enumerateByteRangesUsingBlock_1, block._id); - } - - static NSData data(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_data1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData dataWithBytes_length_( - ThermionDartTexture1 _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_272( - _lib._class_NSData1, _lib._sel_dataWithBytes_length_1, bytes, length); - return NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData dataWithBytesNoCopy_length_( - ThermionDartTexture1 _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_272(_lib._class_NSData1, - _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); - return NSData._(_ret, _lib, retain: false, release: true); - } - - static NSData dataWithBytesNoCopy_length_freeWhenDone_( - ThermionDartTexture1 _lib, - ffi.Pointer bytes, - int length, - bool b) { - final _ret = _lib._objc_msgSend_273(_lib._class_NSData1, - _lib._sel_dataWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); - return NSData._(_ret, _lib, retain: false, release: true); - } - - static NSData? dataWithContentsOfFile_options_error_( - ThermionDartTexture1 _lib, - NSString path, - int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_274( - _lib._class_NSData1, - _lib._sel_dataWithContentsOfFile_options_error_1, - path._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData? dataWithContentsOfURL_options_error_( - ThermionDartTexture1 _lib, - NSURL url, - int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_275( - _lib._class_NSData1, - _lib._sel_dataWithContentsOfURL_options_error_1, - url._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData? dataWithContentsOfFile_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38( - _lib._class_NSData1, _lib._sel_dataWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData? dataWithContentsOfURL_(ThermionDartTexture1 _lib, NSURL url) { - final _ret = _lib._objc_msgSend_276( - _lib._class_NSData1, _lib._sel_dataWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData initWithBytes_length_(ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_272( - _id, _lib._sel_initWithBytes_length_1, bytes, length); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSData initWithBytesNoCopy_length_(ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_272( - _id, _lib._sel_initWithBytesNoCopy_length_1, bytes, length); - return NSData._(_ret, _lib, retain: false, release: true); - } - - NSData initWithBytesNoCopy_length_freeWhenDone_( - ffi.Pointer bytes, int length, bool b) { - final _ret = _lib._objc_msgSend_273(_id, - _lib._sel_initWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); - return NSData._(_ret, _lib, retain: false, release: true); - } - - NSData initWithBytesNoCopy_length_deallocator_(ffi.Pointer bytes, - int length, ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong? deallocator) { - final _ret = _lib._objc_msgSend_277( - _id, - _lib._sel_initWithBytesNoCopy_length_deallocator_1, - bytes, - length, - deallocator?._id ?? ffi.nullptr); - return NSData._(_ret, _lib, retain: false, release: true); - } - - NSData? initWithContentsOfFile_options_error_(NSString path, - int readOptionsMask, ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_274( - _id, - _lib._sel_initWithContentsOfFile_options_error_1, - path._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? initWithContentsOfURL_options_error_(NSURL url, int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_275( - _id, - _lib._sel_initWithContentsOfURL_options_error_1, - url._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_38( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_276(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_278(_id, _lib._sel_initWithData_1, data._id); - return NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData dataWithData_(ThermionDartTexture1 _lib, NSData data) { - final _ret = _lib._objc_msgSend_278( - _lib._class_NSData1, _lib._sel_dataWithData_1, data._id); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? initWithBase64EncodedString_options_( - NSString base64String, int options) { - final _ret = _lib._objc_msgSend_279( - _id, - _lib._sel_initWithBase64EncodedString_options_1, - base64String._id, - options); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSString base64EncodedStringWithOptions_(int options) { - final _ret = _lib._objc_msgSend_280( - _id, _lib._sel_base64EncodedStringWithOptions_1, options); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSData? initWithBase64EncodedData_options_(NSData base64Data, int options) { - final _ret = _lib._objc_msgSend_281(_id, - _lib._sel_initWithBase64EncodedData_options_1, base64Data._id, options); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData base64EncodedDataWithOptions_(int options) { - final _ret = _lib._objc_msgSend_282( - _id, _lib._sel_base64EncodedDataWithOptions_1, options); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? decompressedDataUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283(_id, - _lib._sel_decompressedDataUsingAlgorithm_error_1, algorithm, error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? compressedDataUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283( - _id, _lib._sel_compressedDataUsingAlgorithm_error_1, algorithm, error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - void getBytes_(ffi.Pointer buffer) { - _lib._objc_msgSend_51(_id, _lib._sel_getBytes_1, buffer); - } - - static NSObject? dataWithContentsOfMappedFile_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSData1, - _lib._sel_dataWithContentsOfMappedFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithContentsOfMappedFile_(NSString path) { - final _ret = _lib._objc_msgSend_38( - _id, _lib._sel_initWithContentsOfMappedFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithBase64Encoding_(NSString base64String) { - final _ret = _lib._objc_msgSend_38( - _id, _lib._sel_initWithBase64Encoding_1, base64String._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSString base64Encoding() { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_base64Encoding1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - @override - NSData init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_new1); - return NSData._(_ret, _lib, retain: false, release: true); - } - - static NSData allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSData1, _lib._sel_allocWithZone_1, zone); - return NSData._(_ret, _lib, retain: false, release: true); - } - - static NSData alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_alloc1); - return NSData._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSData1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSData1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSData1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSData1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSData1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSData1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSData1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSData1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSData1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -final class _NSRange extends ffi.Struct { - @ffi.UnsignedLong() - external int location; - - @ffi.UnsignedLong() - external int length; -} - -class NSURL extends NSObject { - NSURL._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURL] that points to the same underlying object as [other]. - static NSURL castFrom(T other) { - return NSURL._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSURL] that wraps the given raw object pointer. - static NSURL castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURL._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURL]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURL1); - } - - NSURL? initWithScheme_host_path_( - NSString scheme, NSString? host, NSString path) { - final _ret = _lib._objc_msgSend_27( - _id, - _lib._sel_initWithScheme_host_path_1, - scheme._id, - host?._id ?? ffi.nullptr, - path._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL initFileURLWithPath_isDirectory_relativeToURL_( - NSString path, bool isDir, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_28( - _id, - _lib._sel_initFileURLWithPath_isDirectory_relativeToURL_1, - path._id, - isDir, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL initFileURLWithPath_relativeToURL_(NSString path, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_29( - _id, - _lib._sel_initFileURLWithPath_relativeToURL_1, - path._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL initFileURLWithPath_isDirectory_(NSString path, bool isDir) { - final _ret = _lib._objc_msgSend_30( - _id, _lib._sel_initFileURLWithPath_isDirectory_1, path._id, isDir); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL initFileURLWithPath_(NSString path) { - final _ret = - _lib._objc_msgSend_31(_id, _lib._sel_initFileURLWithPath_1, path._id); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL fileURLWithPath_isDirectory_relativeToURL_( - ThermionDartTexture1 _lib, NSString path, bool isDir, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_32( - _lib._class_NSURL1, - _lib._sel_fileURLWithPath_isDirectory_relativeToURL_1, - path._id, - isDir, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL fileURLWithPath_relativeToURL_( - ThermionDartTexture1 _lib, NSString path, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_33( - _lib._class_NSURL1, - _lib._sel_fileURLWithPath_relativeToURL_1, - path._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL fileURLWithPath_isDirectory_( - ThermionDartTexture1 _lib, NSString path, bool isDir) { - final _ret = _lib._objc_msgSend_34(_lib._class_NSURL1, - _lib._sel_fileURLWithPath_isDirectory_1, path._id, isDir); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL fileURLWithPath_(ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_35( - _lib._class_NSURL1, _lib._sel_fileURLWithPath_1, path._id); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_( - ffi.Pointer path, bool isDir, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_36( - _id, - _lib._sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1, - path, - isDir, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_( - ThermionDartTexture1 _lib, - ffi.Pointer path, - bool isDir, - NSURL? baseURL) { - final _ret = _lib._objc_msgSend_37( - _lib._class_NSURL1, - _lib._sel_fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1, - path, - isDir, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? initWithString_(NSString URLString) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_initWithString_1, URLString._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? initWithString_relativeToURL_(NSString URLString, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_39( - _id, - _lib._sel_initWithString_relativeToURL_1, - URLString._id, - baseURL?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL? URLWithString_(ThermionDartTexture1 _lib, NSString URLString) { - final _ret = _lib._objc_msgSend_38( - _lib._class_NSURL1, _lib._sel_URLWithString_1, URLString._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL? URLWithString_relativeToURL_( - ThermionDartTexture1 _lib, NSString URLString, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_39( - _lib._class_NSURL1, - _lib._sel_URLWithString_relativeToURL_1, - URLString._id, - baseURL?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL initWithDataRepresentation_relativeToURL_(NSData data, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_40( - _id, - _lib._sel_initWithDataRepresentation_relativeToURL_1, - data._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL URLWithDataRepresentation_relativeToURL_( - ThermionDartTexture1 _lib, NSData data, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_41( - _lib._class_NSURL1, - _lib._sel_URLWithDataRepresentation_relativeToURL_1, - data._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL initAbsoluteURLWithDataRepresentation_relativeToURL_( - NSData data, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_40( - _id, - _lib._sel_initAbsoluteURLWithDataRepresentation_relativeToURL_1, - data._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL absoluteURLWithDataRepresentation_relativeToURL_( - ThermionDartTexture1 _lib, NSData data, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_41( - _lib._class_NSURL1, - _lib._sel_absoluteURLWithDataRepresentation_relativeToURL_1, - data._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSData get dataRepresentation { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_dataRepresentation1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSString? get absoluteString { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_absoluteString1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get relativeString { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_relativeString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSURL? get baseURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_baseURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get absoluteURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_absoluteURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSString? get scheme { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_scheme1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get resourceSpecifier { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_resourceSpecifier1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get host { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_host1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSNumber? get port { - final _ret = _lib._objc_msgSend_214(_id, _lib._sel_port1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSString? get user { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_user1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get password { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_password1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get path { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_path1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get fragment { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_fragment1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get parameterString { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_parameterString1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get query { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_query1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get relativePath { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_relativePath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool get hasDirectoryPath { - return _lib._objc_msgSend_12(_id, _lib._sel_hasDirectoryPath1); - } - - bool getFileSystemRepresentation_maxLength_( - ffi.Pointer buffer, int maxBufferLength) { - return _lib._objc_msgSend_241( - _id, - _lib._sel_getFileSystemRepresentation_maxLength_1, - buffer, - maxBufferLength); - } - - ffi.Pointer get fileSystemRepresentation { - return _lib._objc_msgSend_13(_id, _lib._sel_fileSystemRepresentation1); - } - - bool get fileURL { - return _lib._objc_msgSend_12(_id, _lib._sel_isFileURL1); - } - - NSURL? get standardizedURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_standardizedURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - bool checkResourceIsReachableAndReturnError_( - ffi.Pointer> error) { - return _lib._objc_msgSend_242( - _id, _lib._sel_checkResourceIsReachableAndReturnError_1, error); - } - - bool isFileReferenceURL() { - return _lib._objc_msgSend_12(_id, _lib._sel_isFileReferenceURL1); - } - - NSURL? fileReferenceURL() { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_fileReferenceURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get filePathURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_filePathURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - bool getResourceValue_forKey_error_( - ffi.Pointer> value, - NSString key, - ffi.Pointer> error) { - return _lib._objc_msgSend_243( - _id, _lib._sel_getResourceValue_forKey_error_1, value, key._id, error); - } - - NSObject? resourceValuesForKeys_error_( - NSArray keys, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_244( - _id, _lib._sel_resourceValuesForKeys_error_1, keys._id, error); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - bool setResourceValue_forKey_error_(NSObject? value, NSString key, - ffi.Pointer> error) { - return _lib._objc_msgSend_245( - _id, - _lib._sel_setResourceValue_forKey_error_1, - value?._id ?? ffi.nullptr, - key._id, - error); - } - - bool setResourceValues_error_( - NSObject keyedValues, ffi.Pointer> error) { - return _lib._objc_msgSend_246( - _id, _lib._sel_setResourceValues_error_1, keyedValues._id, error); - } - - void removeCachedResourceValueForKey_(NSString key) { - _lib._objc_msgSend_247( - _id, _lib._sel_removeCachedResourceValueForKey_1, key._id); - } - - void removeAllCachedResourceValues() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllCachedResourceValues1); - } - - void setTemporaryResourceValue_forKey_(NSObject? value, NSString key) { - _lib._objc_msgSend_134(_id, _lib._sel_setTemporaryResourceValue_forKey_1, - value?._id ?? ffi.nullptr, key._id); - } - - NSData? - bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error_( - int options, - NSArray? keys, - NSURL? relativeURL, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_248( - _id, - _lib._sel_bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error_1, - options, - keys?._id ?? ffi.nullptr, - relativeURL?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSURL? - initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_( - NSData bookmarkData, - int options, - NSURL? relativeURL, - ffi.Pointer isStale, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_249( - _id, - _lib._sel_initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1, - bookmarkData._id, - options, - relativeURL?._id ?? ffi.nullptr, - isStale, - error); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL? - URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_( - ThermionDartTexture1 _lib, - NSData bookmarkData, - int options, - NSURL? relativeURL, - ffi.Pointer isStale, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_249( - _lib._class_NSURL1, - _lib._sel_URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1, - bookmarkData._id, - options, - relativeURL?._id ?? ffi.nullptr, - isStale, - error); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSObject? resourceValuesForKeys_fromBookmarkData_( - ThermionDartTexture1 _lib, NSArray keys, NSData bookmarkData) { - final _ret = _lib._objc_msgSend_250( - _lib._class_NSURL1, - _lib._sel_resourceValuesForKeys_fromBookmarkData_1, - keys._id, - bookmarkData._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static bool writeBookmarkData_toURL_options_error_( - ThermionDartTexture1 _lib, - NSData bookmarkData, - NSURL bookmarkFileURL, - int options, - ffi.Pointer> error) { - return _lib._objc_msgSend_251( - _lib._class_NSURL1, - _lib._sel_writeBookmarkData_toURL_options_error_1, - bookmarkData._id, - bookmarkFileURL._id, - options, - error); - } - - static NSData? bookmarkDataWithContentsOfURL_error_(ThermionDartTexture1 _lib, - NSURL bookmarkFileURL, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_252( - _lib._class_NSURL1, - _lib._sel_bookmarkDataWithContentsOfURL_error_1, - bookmarkFileURL._id, - error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - static NSURL? URLByResolvingAliasFileAtURL_options_error_( - ThermionDartTexture1 _lib, - NSURL url, - int options, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_253( - _lib._class_NSURL1, - _lib._sel_URLByResolvingAliasFileAtURL_options_error_1, - url._id, - options, - error); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - bool startAccessingSecurityScopedResource() { - return _lib._objc_msgSend_12( - _id, _lib._sel_startAccessingSecurityScopedResource1); - } - - void stopAccessingSecurityScopedResource() { - _lib._objc_msgSend_1(_id, _lib._sel_stopAccessingSecurityScopedResource1); - } - - bool getPromisedItemResourceValue_forKey_error_( - ffi.Pointer> value, - NSString key, - ffi.Pointer> error) { - return _lib._objc_msgSend_243( - _id, - _lib._sel_getPromisedItemResourceValue_forKey_error_1, - value, - key._id, - error); - } - - NSDictionary? promisedItemResourceValuesForKeys_error_( - NSArray keys, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_254(_id, - _lib._sel_promisedItemResourceValuesForKeys_error_1, keys._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - bool checkPromisedItemIsReachableAndReturnError_( - ffi.Pointer> error) { - return _lib._objc_msgSend_242( - _id, _lib._sel_checkPromisedItemIsReachableAndReturnError_1, error); - } - - static NSURL? fileURLWithPathComponents_( - ThermionDartTexture1 _lib, NSArray components) { - final _ret = _lib._objc_msgSend_255(_lib._class_NSURL1, - _lib._sel_fileURLWithPathComponents_1, components._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSArray? get pathComponents { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_pathComponents1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? get lastPathComponent { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_lastPathComponent1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get pathExtension { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_pathExtension1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSURL? URLByAppendingPathComponent_(NSString pathComponent) { - final _ret = _lib._objc_msgSend_256( - _id, _lib._sel_URLByAppendingPathComponent_1, pathComponent._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? URLByAppendingPathComponent_isDirectory_( - NSString pathComponent, bool isDirectory) { - final _ret = _lib._objc_msgSend_257( - _id, - _lib._sel_URLByAppendingPathComponent_isDirectory_1, - pathComponent._id, - isDirectory); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get URLByDeletingLastPathComponent { - final _ret = - _lib._objc_msgSend_44(_id, _lib._sel_URLByDeletingLastPathComponent1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? URLByAppendingPathExtension_(NSString pathExtension) { - final _ret = _lib._objc_msgSend_256( - _id, _lib._sel_URLByAppendingPathExtension_1, pathExtension._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get URLByDeletingPathExtension { - final _ret = - _lib._objc_msgSend_44(_id, _lib._sel_URLByDeletingPathExtension1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get URLByStandardizingPath { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_URLByStandardizingPath1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get URLByResolvingSymlinksInPath { - final _ret = - _lib._objc_msgSend_44(_id, _lib._sel_URLByResolvingSymlinksInPath1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSData? resourceDataUsingCache_(bool shouldUseCache) { - final _ret = _lib._objc_msgSend_258( - _id, _lib._sel_resourceDataUsingCache_1, shouldUseCache); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - void loadResourceDataNotifyingClient_usingCache_( - NSObject client, bool shouldUseCache) { - _lib._objc_msgSend_259( - _id, - _lib._sel_loadResourceDataNotifyingClient_usingCache_1, - client._id, - shouldUseCache); - } - - NSObject? propertyForKey_(NSString propertyKey) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_propertyForKey_1, propertyKey._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - bool setResourceData_(NSData data) { - return _lib._objc_msgSend_24(_id, _lib._sel_setResourceData_1, data._id); - } - - bool setProperty_forKey_(NSObject property, NSString propertyKey) { - return _lib._objc_msgSend_260( - _id, _lib._sel_setProperty_forKey_1, property._id, propertyKey._id); - } - - NSURLHandle? URLHandleUsingCache_(bool shouldUseCache) { - final _ret = _lib._objc_msgSend_267( - _id, _lib._sel_URLHandleUsingCache_1, shouldUseCache); - return _ret.address == 0 - ? null - : NSURLHandle._(_ret, _lib, retain: true, release: true); - } - - @override - NSURL init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURL1, _lib._sel_new1); - return NSURL._(_ret, _lib, retain: false, release: true); - } - - static NSURL allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURL1, _lib._sel_allocWithZone_1, zone); - return NSURL._(_ret, _lib, retain: false, release: true); - } - - static NSURL alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURL1, _lib._sel_alloc1); - return NSURL._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURL1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURL1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURL1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURL1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURL1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURL1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURL1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSURL1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURL1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSNumber extends NSValue { - NSNumber._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSNumber] that points to the same underlying object as [other]. - static NSNumber castFrom(T other) { - return NSNumber._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSNumber] that wraps the given raw object pointer. - static NSNumber castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSNumber._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSNumber]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSNumber1); - } - - @override - NSNumber? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithChar_(int value) { - final _ret = _lib._objc_msgSend_219(_id, _lib._sel_initWithChar_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedChar_(int value) { - final _ret = - _lib._objc_msgSend_220(_id, _lib._sel_initWithUnsignedChar_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithShort_(int value) { - final _ret = _lib._objc_msgSend_221(_id, _lib._sel_initWithShort_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedShort_(int value) { - final _ret = - _lib._objc_msgSend_222(_id, _lib._sel_initWithUnsignedShort_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithInt_(int value) { - final _ret = _lib._objc_msgSend_223(_id, _lib._sel_initWithInt_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedInt_(int value) { - final _ret = - _lib._objc_msgSend_224(_id, _lib._sel_initWithUnsignedInt_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithLong_(int value) { - final _ret = _lib._objc_msgSend_225(_id, _lib._sel_initWithLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedLong_(int value) { - final _ret = - _lib._objc_msgSend_226(_id, _lib._sel_initWithUnsignedLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithLongLong_(int value) { - final _ret = - _lib._objc_msgSend_227(_id, _lib._sel_initWithLongLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedLongLong_(int value) { - final _ret = _lib._objc_msgSend_228( - _id, _lib._sel_initWithUnsignedLongLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithFloat_(double value) { - final _ret = _lib._objc_msgSend_229(_id, _lib._sel_initWithFloat_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithDouble_(double value) { - final _ret = _lib._objc_msgSend_230(_id, _lib._sel_initWithDouble_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithBool_(bool value) { - final _ret = _lib._objc_msgSend_231(_id, _lib._sel_initWithBool_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithInteger_(int value) { - final _ret = - _lib._objc_msgSend_225(_id, _lib._sel_initWithInteger_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedInteger_(int value) { - final _ret = - _lib._objc_msgSend_226(_id, _lib._sel_initWithUnsignedInteger_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - int get charValue { - return _lib._objc_msgSend_232(_id, _lib._sel_charValue1); - } - - int get unsignedCharValue { - return _lib._objc_msgSend_233(_id, _lib._sel_unsignedCharValue1); - } - - int get shortValue { - return _lib._objc_msgSend_234(_id, _lib._sel_shortValue1); - } - - int get unsignedShortValue { - return _lib._objc_msgSend_235(_id, _lib._sel_unsignedShortValue1); - } - - int get intValue { - return _lib._objc_msgSend_236(_id, _lib._sel_intValue1); - } - - int get unsignedIntValue { - return _lib._objc_msgSend_213(_id, _lib._sel_unsignedIntValue1); - } - - int get longValue { - return _lib._objc_msgSend_82(_id, _lib._sel_longValue1); - } - - int get unsignedLongValue { - return _lib._objc_msgSend_10(_id, _lib._sel_unsignedLongValue1); - } - - int get longLongValue { - return _lib._objc_msgSend_237(_id, _lib._sel_longLongValue1); - } - - int get unsignedLongLongValue { - return _lib._objc_msgSend_163(_id, _lib._sel_unsignedLongLongValue1); - } - - double get floatValue { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_238_fpret(_id, _lib._sel_floatValue1) - : _lib._objc_msgSend_238(_id, _lib._sel_floatValue1); - } - - double get doubleValue { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_doubleValue1) - : _lib._objc_msgSend_164(_id, _lib._sel_doubleValue1); - } - - bool get boolValue { - return _lib._objc_msgSend_12(_id, _lib._sel_boolValue1); - } - - int get integerValue { - return _lib._objc_msgSend_82(_id, _lib._sel_integerValue1); - } - - int get unsignedIntegerValue { - return _lib._objc_msgSend_10(_id, _lib._sel_unsignedIntegerValue1); - } - - NSString get stringValue { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_stringValue1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int compare_(NSNumber otherNumber) { - return _lib._objc_msgSend_239(_id, _lib._sel_compare_1, otherNumber._id); - } - - bool isEqualToNumber_(NSNumber number) { - return _lib._objc_msgSend_240(_id, _lib._sel_isEqualToNumber_1, number._id); - } - - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_69( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithChar_(ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_219( - _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedChar_( - ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_220( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithShort_(ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_221( - _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedShort_( - ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_222( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithInt_(ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_223( - _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedInt_(ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_224( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithLong_(ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_225( - _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedLong_( - ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_226( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithLongLong_(ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_227( - _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedLongLong_( - ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_228( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithFloat_(ThermionDartTexture1 _lib, double value) { - final _ret = _lib._objc_msgSend_229( - _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithDouble_(ThermionDartTexture1 _lib, double value) { - final _ret = _lib._objc_msgSend_230( - _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithBool_(ThermionDartTexture1 _lib, bool value) { - final _ret = _lib._objc_msgSend_231( - _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithInteger_(ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_225( - _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedInteger_( - ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_226( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - @override - NSNumber initWithBytes_objCType_( - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_45( - _id, _lib._sel_initWithBytes_objCType_1, value, type); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithBytes_objCType_(ThermionDartTexture1 _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_47(_lib._class_NSNumber1, - _lib._sel_valueWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue value_withObjCType_(ThermionDartTexture1 _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_47( - _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithNonretainedObject_( - ThermionDartTexture1 _lib, NSObject? anObject) { - final _ret = _lib._objc_msgSend_48(_lib._class_NSNumber1, - _lib._sel_valueWithNonretainedObject_1, anObject?._id ?? ffi.nullptr); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithPointer_( - ThermionDartTexture1 _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_49( - _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithRange_(ThermionDartTexture1 _lib, _NSRange range) { - final _ret = _lib._objc_msgSend_52( - _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithPoint_(ThermionDartTexture1 _lib, CGPoint point) { - final _ret = _lib._objc_msgSend_54( - _lib._class_NSNumber1, _lib._sel_valueWithPoint_1, point); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithSize_(ThermionDartTexture1 _lib, CGSize size) { - final _ret = _lib._objc_msgSend_55( - _lib._class_NSNumber1, _lib._sel_valueWithSize_1, size); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithRect_(ThermionDartTexture1 _lib, CGRect rect) { - final _ret = _lib._objc_msgSend_56( - _lib._class_NSNumber1, _lib._sel_valueWithRect_1, rect); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithEdgeInsets_( - ThermionDartTexture1 _lib, NSEdgeInsets insets) { - final _ret = _lib._objc_msgSend_57( - _lib._class_NSNumber1, _lib._sel_valueWithEdgeInsets_1, insets); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - @override - NSNumber init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSNumber1, _lib._sel_new1); - return NSNumber._(_ret, _lib, retain: false, release: true); - } - - static NSNumber allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSNumber1, _lib._sel_allocWithZone_1, zone); - return NSNumber._(_ret, _lib, retain: false, release: true); - } - - static NSNumber alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSNumber1, _lib._sel_alloc1); - return NSNumber._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSNumber1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSNumber1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSNumber1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSNumber1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSNumber1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSNumber1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSNumber1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSNumber1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSNumber1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSValue extends NSObject { - NSValue._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSValue] that points to the same underlying object as [other]. - static NSValue castFrom(T other) { - return NSValue._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSValue] that wraps the given raw object pointer. - static NSValue castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSValue._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSValue]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSValue1); - } - - void getValue_size_(ffi.Pointer value, int size) { - _lib._objc_msgSend_22(_id, _lib._sel_getValue_size_1, value, size); - } - - ffi.Pointer get objCType { - return _lib._objc_msgSend_13(_id, _lib._sel_objCType1); - } - - NSValue initWithBytes_objCType_( - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_45( - _id, _lib._sel_initWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - NSValue? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithBytes_objCType_(ThermionDartTexture1 _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_47( - _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue value_withObjCType_(ThermionDartTexture1 _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_47( - _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithNonretainedObject_( - ThermionDartTexture1 _lib, NSObject? anObject) { - final _ret = _lib._objc_msgSend_48(_lib._class_NSValue1, - _lib._sel_valueWithNonretainedObject_1, anObject?._id ?? ffi.nullptr); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - NSObject? get nonretainedObjectValue { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_nonretainedObjectValue1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithPointer_( - ThermionDartTexture1 _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_49( - _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer get pointerValue { - return _lib._objc_msgSend_20(_id, _lib._sel_pointerValue1); - } - - bool isEqualToValue_(NSValue value) { - return _lib._objc_msgSend_50(_id, _lib._sel_isEqualToValue_1, value._id); - } - - void getValue_(ffi.Pointer value) { - _lib._objc_msgSend_51(_id, _lib._sel_getValue_1, value); - } - - static NSValue valueWithRange_(ThermionDartTexture1 _lib, _NSRange range) { - final _ret = _lib._objc_msgSend_52( - _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - void getRangeValue(ffi.Pointer<_NSRange> stret) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_53_stret(stret, _id, _lib._sel_rangeValue1) - : stret.ref = _lib._objc_msgSend_53(_id, _lib._sel_rangeValue1); - } - - static NSValue valueWithPoint_(ThermionDartTexture1 _lib, CGPoint point) { - final _ret = _lib._objc_msgSend_54( - _lib._class_NSValue1, _lib._sel_valueWithPoint_1, point); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithSize_(ThermionDartTexture1 _lib, CGSize size) { - final _ret = _lib._objc_msgSend_55( - _lib._class_NSValue1, _lib._sel_valueWithSize_1, size); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithRect_(ThermionDartTexture1 _lib, CGRect rect) { - final _ret = _lib._objc_msgSend_56( - _lib._class_NSValue1, _lib._sel_valueWithRect_1, rect); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithEdgeInsets_( - ThermionDartTexture1 _lib, NSEdgeInsets insets) { - final _ret = _lib._objc_msgSend_57( - _lib._class_NSValue1, _lib._sel_valueWithEdgeInsets_1, insets); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - void getPointValue(ffi.Pointer stret) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_58_stret(stret, _id, _lib._sel_pointValue1) - : stret.ref = _lib._objc_msgSend_58(_id, _lib._sel_pointValue1); - } - - void getSizeValue(ffi.Pointer stret) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_59_stret(stret, _id, _lib._sel_sizeValue1) - : stret.ref = _lib._objc_msgSend_59(_id, _lib._sel_sizeValue1); - } - - void getRectValue(ffi.Pointer stret) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_60_stret(stret, _id, _lib._sel_rectValue1) - : stret.ref = _lib._objc_msgSend_60(_id, _lib._sel_rectValue1); - } - - void getEdgeInsetsValue(ffi.Pointer stret) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_61_stret(stret, _id, _lib._sel_edgeInsetsValue1) - : stret.ref = _lib._objc_msgSend_61(_id, _lib._sel_edgeInsetsValue1); - } - - @override - NSValue init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSValue1, _lib._sel_new1); - return NSValue._(_ret, _lib, retain: false, release: true); - } - - static NSValue allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSValue1, _lib._sel_allocWithZone_1, zone); - return NSValue._(_ret, _lib, retain: false, release: true); - } - - static NSValue alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSValue1, _lib._sel_alloc1); - return NSValue._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSValue1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSValue1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSValue1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSValue1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSValue1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSValue1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSValue1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSValue1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSValue1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -final class CGPoint extends ffi.Struct { - @ffi.Double() - external double x; - - @ffi.Double() - external double y; -} - -final class CGSize extends ffi.Struct { - @ffi.Double() - external double width; - - @ffi.Double() - external double height; -} - -final class CGRect extends ffi.Struct { - external CGPoint origin; - - external CGSize size; -} - -final class NSEdgeInsets extends ffi.Struct { - @ffi.Double() - external double top; - - @ffi.Double() - external double left; - - @ffi.Double() - external double bottom; - - @ffi.Double() - external double right; -} - -class NSArray extends NSObject { - NSArray._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSArray] that points to the same underlying object as [other]. - static NSArray castFrom(T other) { - return NSArray._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSArray] that wraps the given raw object pointer. - static NSArray castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSArray._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSArray]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSArray1); - } - - int get count { - return _lib._objc_msgSend_10(_id, _lib._sel_count1); - } - - NSObject objectAtIndex_(int index) { - final _ret = _lib._objc_msgSend_64(_id, _lib._sel_objectAtIndex_1, index); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - NSArray init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray initWithObjects_count_( - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65( - _id, _lib._sel_initWithObjects_count_1, objects, cnt); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray arrayByAddingObject_(NSObject anObject) { - final _ret = _lib._objc_msgSend_66( - _id, _lib._sel_arrayByAddingObject_1, anObject._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray arrayByAddingObjectsFromArray_(NSArray otherArray) { - final _ret = _lib._objc_msgSend_67( - _id, _lib._sel_arrayByAddingObjectsFromArray_1, otherArray._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString componentsJoinedByString_(NSString separator) { - final _ret = _lib._objc_msgSend_68( - _id, _lib._sel_componentsJoinedByString_1, separator._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - bool containsObject_(NSObject anObject) { - return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, anObject._id); - } - - NSString get description { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_69( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_indent_(NSObject? locale, int level) { - final _ret = _lib._objc_msgSend_70( - _id, - _lib._sel_descriptionWithLocale_indent_1, - locale?._id ?? ffi.nullptr, - level); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSObject? firstObjectCommonWithArray_(NSArray otherArray) { - final _ret = _lib._objc_msgSend_71( - _id, _lib._sel_firstObjectCommonWithArray_1, otherArray._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void getObjects_range_( - ffi.Pointer> objects, _NSRange range) { - _lib._objc_msgSend_72(_id, _lib._sel_getObjects_range_1, objects, range); - } - - int indexOfObject_(NSObject anObject) { - return _lib._objc_msgSend_73(_id, _lib._sel_indexOfObject_1, anObject._id); - } - - int indexOfObject_inRange_(NSObject anObject, _NSRange range) { - return _lib._objc_msgSend_74( - _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); - } - - int indexOfObjectIdenticalTo_(NSObject anObject) { - return _lib._objc_msgSend_73( - _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); - } - - int indexOfObjectIdenticalTo_inRange_(NSObject anObject, _NSRange range) { - return _lib._objc_msgSend_74( - _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); - } - - bool isEqualToArray_(NSArray otherArray) { - return _lib._objc_msgSend_75( - _id, _lib._sel_isEqualToArray_1, otherArray._id); - } - - NSObject? get firstObject { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_firstObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? get lastObject { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_lastObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSEnumerator objectEnumerator() { - final _ret = _lib._objc_msgSend_76(_id, _lib._sel_objectEnumerator1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - NSEnumerator reverseObjectEnumerator() { - final _ret = _lib._objc_msgSend_76(_id, _lib._sel_reverseObjectEnumerator1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - NSData get sortedArrayHint { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_sortedArrayHint1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSArray sortedArrayUsingFunction_context_( - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - comparator, - ffi.Pointer context) { - final _ret = _lib._objc_msgSend_77( - _id, _lib._sel_sortedArrayUsingFunction_context_1, comparator, context); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray sortedArrayUsingFunction_context_hint_( - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - comparator, - ffi.Pointer context, - NSData? hint) { - final _ret = _lib._objc_msgSend_78( - _id, - _lib._sel_sortedArrayUsingFunction_context_hint_1, - comparator, - context, - hint?._id ?? ffi.nullptr); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray sortedArrayUsingSelector_(ffi.Pointer comparator) { - final _ret = _lib._objc_msgSend_79( - _id, _lib._sel_sortedArrayUsingSelector_1, comparator); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray subarrayWithRange_(_NSRange range) { - final _ret = - _lib._objc_msgSend_80(_id, _lib._sel_subarrayWithRange_1, range); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - bool writeToURL_error_( - NSURL url, ffi.Pointer> error) { - return _lib._objc_msgSend_88( - _id, _lib._sel_writeToURL_error_1, url._id, error); - } - - void makeObjectsPerformSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_7( - _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); - } - - void makeObjectsPerformSelector_withObject_( - ffi.Pointer aSelector, NSObject? argument) { - _lib._objc_msgSend_89( - _id, - _lib._sel_makeObjectsPerformSelector_withObject_1, - aSelector, - argument?._id ?? ffi.nullptr); - } - - NSArray objectsAtIndexes_(NSIndexSet indexes) { - final _ret = - _lib._objc_msgSend_110(_id, _lib._sel_objectsAtIndexes_1, indexes._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSObject objectAtIndexedSubscript_(int idx) { - final _ret = - _lib._objc_msgSend_64(_id, _lib._sel_objectAtIndexedSubscript_1, idx); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - void enumerateObjectsUsingBlock_( - ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { - _lib._objc_msgSend_111( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); - } - - void enumerateObjectsWithOptions_usingBlock_( - int opts, ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { - _lib._objc_msgSend_112(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); - } - - void enumerateObjectsAtIndexes_options_usingBlock_(NSIndexSet s, int opts, - ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { - _lib._objc_msgSend_113( - _id, - _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, - s._id, - opts, - block._id); - } - - int indexOfObjectPassingTest_( - ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - return _lib._objc_msgSend_114( - _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); - } - - int indexOfObjectWithOptions_passingTest_( - int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - return _lib._objc_msgSend_115(_id, - _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); - } - - int indexOfObjectAtIndexes_options_passingTest_(NSIndexSet s, int opts, - ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - return _lib._objc_msgSend_116( - _id, - _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, - s._id, - opts, - predicate._id); - } - - NSIndexSet indexesOfObjectsPassingTest_( - ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - final _ret = _lib._objc_msgSend_117( - _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet indexesOfObjectsWithOptions_passingTest_( - int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - final _ret = _lib._objc_msgSend_118( - _id, - _lib._sel_indexesOfObjectsWithOptions_passingTest_1, - opts, - predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_(NSIndexSet s, - int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - final _ret = _lib._objc_msgSend_119( - _id, - _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, - s._id, - opts, - predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSArray sortedArrayUsingComparator_( - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - final _ret = _lib._objc_msgSend_120( - _id, _lib._sel_sortedArrayUsingComparator_1, cmptr._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray sortedArrayWithOptions_usingComparator_( - int opts, ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - final _ret = _lib._objc_msgSend_121(_id, - _lib._sel_sortedArrayWithOptions_usingComparator_1, opts, cmptr._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - int indexOfObject_inSortedRange_options_usingComparator_( - NSObject obj, - _NSRange r, - int opts, - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmp) { - return _lib._objc_msgSend_122( - _id, - _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, - obj._id, - r, - opts, - cmp._id); - } - - static NSArray array(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_array1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray arrayWithObject_( - ThermionDartTexture1 _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_123( - _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray arrayWithObjects_count_(ThermionDartTexture1 _lib, - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray arrayWithObjects_( - ThermionDartTexture1 _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_123( - _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray arrayWithArray_(ThermionDartTexture1 _lib, NSArray array) { - final _ret = _lib._objc_msgSend_124( - _lib._class_NSArray1, _lib._sel_arrayWithArray_1, array._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray initWithObjects_(NSObject firstObj) { - final _ret = - _lib._objc_msgSend_123(_id, _lib._sel_initWithObjects_1, firstObj._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray initWithArray_(NSArray array) { - final _ret = - _lib._objc_msgSend_124(_id, _lib._sel_initWithArray_1, array._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray initWithArray_copyItems_(NSArray array, bool flag) { - final _ret = _lib._objc_msgSend_125( - _id, _lib._sel_initWithArray_copyItems_1, array._id, flag); - return NSArray._(_ret, _lib, retain: false, release: true); - } - - NSArray? initWithContentsOfURL_error_( - NSURL url, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_126( - _id, _lib._sel_initWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray? arrayWithContentsOfURL_error_(ThermionDartTexture1 _lib, - NSURL url, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_126(_lib._class_NSArray1, - _lib._sel_arrayWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSObject differenceFromArray_withOptions_usingEquivalenceTest_( - NSArray other, int options, ObjCBlock_bool_ObjCObject_ObjCObject block) { - final _ret = _lib._objc_msgSend_127( - _id, - _lib._sel_differenceFromArray_withOptions_usingEquivalenceTest_1, - other._id, - options, - block._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject differenceFromArray_withOptions_(NSArray other, int options) { - final _ret = _lib._objc_msgSend_128( - _id, _lib._sel_differenceFromArray_withOptions_1, other._id, options); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject differenceFromArray_(NSArray other) { - final _ret = - _lib._objc_msgSend_124(_id, _lib._sel_differenceFromArray_1, other._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSArray? arrayByApplyingDifference_(NSObject difference) { - final _ret = _lib._objc_msgSend_129( - _id, _lib._sel_arrayByApplyingDifference_1, difference._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - void getObjects_(ffi.Pointer> objects) { - _lib._objc_msgSend_130(_id, _lib._sel_getObjects_1, objects); - } - - static NSArray? arrayWithContentsOfFile_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_131( - _lib._class_NSArray1, _lib._sel_arrayWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray? arrayWithContentsOfURL_( - ThermionDartTexture1 _lib, NSURL url) { - final _ret = _lib._objc_msgSend_132( - _lib._class_NSArray1, _lib._sel_arrayWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_131( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_132(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - bool writeToFile_atomically_(NSString path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_26( - _id, _lib._sel_writeToFile_atomically_1, path._id, useAuxiliaryFile); - } - - bool writeToURL_atomically_(NSURL url, bool atomically) { - return _lib._objc_msgSend_133( - _id, _lib._sel_writeToURL_atomically_1, url._id, atomically); - } - - NSArray pathsMatchingExtensions_(NSArray filterTypes) { - final _ret = _lib._objc_msgSend_67( - _id, _lib._sel_pathsMatchingExtensions_1, filterTypes._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSObject valueForKey_(NSString key) { - final _ret = _lib._objc_msgSend_31(_id, _lib._sel_valueForKey_1, key._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - void setValue_forKey_(NSObject? value, NSString key) { - _lib._objc_msgSend_134( - _id, _lib._sel_setValue_forKey_1, value?._id ?? ffi.nullptr, key._id); - } - - void addObserver_toObjectsAtIndexes_forKeyPath_options_context_( - NSObject observer, - NSIndexSet indexes, - NSString keyPath, - int options, - ffi.Pointer context) { - _lib._objc_msgSend_135( - _id, - _lib._sel_addObserver_toObjectsAtIndexes_forKeyPath_options_context_1, - observer._id, - indexes._id, - keyPath._id, - options, - context); - } - - void removeObserver_fromObjectsAtIndexes_forKeyPath_context_( - NSObject observer, - NSIndexSet indexes, - NSString keyPath, - ffi.Pointer context) { - _lib._objc_msgSend_136( - _id, - _lib._sel_removeObserver_fromObjectsAtIndexes_forKeyPath_context_1, - observer._id, - indexes._id, - keyPath._id, - context); - } - - void removeObserver_fromObjectsAtIndexes_forKeyPath_( - NSObject observer, NSIndexSet indexes, NSString keyPath) { - _lib._objc_msgSend_137( - _id, - _lib._sel_removeObserver_fromObjectsAtIndexes_forKeyPath_1, - observer._id, - indexes._id, - keyPath._id); - } - - @override - void addObserver_forKeyPath_options_context_(NSObject observer, - NSString keyPath, int options, ffi.Pointer context) { - _lib._objc_msgSend_138( - _id, - _lib._sel_addObserver_forKeyPath_options_context_1, - observer._id, - keyPath._id, - options, - context); - } - - @override - void removeObserver_forKeyPath_context_( - NSObject observer, NSString keyPath, ffi.Pointer context) { - _lib._objc_msgSend_139(_id, _lib._sel_removeObserver_forKeyPath_context_1, - observer._id, keyPath._id, context); - } - - @override - void removeObserver_forKeyPath_(NSObject observer, NSString keyPath) { - _lib._objc_msgSend_140( - _id, _lib._sel_removeObserver_forKeyPath_1, observer._id, keyPath._id); - } - - NSArray sortedArrayUsingDescriptors_(NSArray sortDescriptors) { - final _ret = _lib._objc_msgSend_67( - _id, _lib._sel_sortedArrayUsingDescriptors_1, sortDescriptors._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray filteredArrayUsingPredicate_(NSPredicate predicate) { - final _ret = _lib._objc_msgSend_218( - _id, _lib._sel_filteredArrayUsingPredicate_1, predicate._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_new1); - return NSArray._(_ret, _lib, retain: false, release: true); - } - - static NSArray allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSArray1, _lib._sel_allocWithZone_1, zone); - return NSArray._(_ret, _lib, retain: false, release: true); - } - - static NSArray alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_alloc1); - return NSArray._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSArray1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSArray1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSArray1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSArray1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSArray1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSArray1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSArray1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSArray1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSArray1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSError extends NSObject { - NSError._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSError] that points to the same underlying object as [other]. - static NSError castFrom(T other) { - return NSError._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSError] that wraps the given raw object pointer. - static NSError castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSError._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSError]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSError1); - } - - NSError initWithDomain_code_userInfo_( - NSString domain, int code, NSObject? dict) { - final _ret = _lib._objc_msgSend_81( - _id, - _lib._sel_initWithDomain_code_userInfo_1, - domain._id, - code, - dict?._id ?? ffi.nullptr); - return NSError._(_ret, _lib, retain: true, release: true); - } - - static NSError errorWithDomain_code_userInfo_( - ThermionDartTexture1 _lib, NSString domain, int code, NSObject? dict) { - final _ret = _lib._objc_msgSend_81( - _lib._class_NSError1, - _lib._sel_errorWithDomain_code_userInfo_1, - domain._id, - code, - dict?._id ?? ffi.nullptr); - return NSError._(_ret, _lib, retain: true, release: true); - } - - NSString get domain { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_domain1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int get code { - return _lib._objc_msgSend_82(_id, _lib._sel_code1); - } - - NSObject get userInfo { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_userInfo1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSString get localizedDescription { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_localizedDescription1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get localizedFailureReason { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_localizedFailureReason1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get localizedRecoverySuggestion { - final _ret = - _lib._objc_msgSend_43(_id, _lib._sel_localizedRecoverySuggestion1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray? get localizedRecoveryOptions { - final _ret = - _lib._objc_msgSend_83(_id, _lib._sel_localizedRecoveryOptions1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSObject? get recoveryAttempter { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_recoveryAttempter1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSString? get helpAnchor { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_helpAnchor1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray get underlyingErrors { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_underlyingErrors1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static void setUserInfoValueProviderForDomain_provider_( - ThermionDartTexture1 _lib, - NSString errorDomain, - ObjCBlock_ObjCObject_NSError_NSString? provider) { - _lib._objc_msgSend_85( - _lib._class_NSError1, - _lib._sel_setUserInfoValueProviderForDomain_provider_1, - errorDomain._id, - provider?._id ?? ffi.nullptr); - } - - static ObjCBlock_ObjCObject_NSError_NSString? userInfoValueProviderForDomain_( - ThermionDartTexture1 _lib, - NSError err, - NSString userInfoKey, - NSString errorDomain) { - final _ret = _lib._objc_msgSend_86( - _lib._class_NSError1, - _lib._sel_userInfoValueProviderForDomain_1, - err._id, - userInfoKey._id, - errorDomain._id); - return _ret.address == 0 - ? null - : ObjCBlock_ObjCObject_NSError_NSString._(_ret, _lib, - retain: true, release: true); - } - - @override - NSError init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSError._(_ret, _lib, retain: true, release: true); - } - - static NSError new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSError1, _lib._sel_new1); - return NSError._(_ret, _lib, retain: false, release: true); - } - - static NSError allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSError1, _lib._sel_allocWithZone_1, zone); - return NSError._(_ret, _lib, retain: false, release: true); - } - - static NSError alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSError1, _lib._sel_alloc1); - return NSError._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSError1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSError1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSError1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSError1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSError1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSError1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSError1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSError1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSError1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class _ObjCBlockBase implements ffi.Finalizable { - final ffi.Pointer<_ObjCBlock> _id; - final ThermionDartTexture1 _lib; - bool _pendingRelease; - - _ObjCBlockBase._(this._id, this._lib, - {bool retain = false, bool release = false}) - : _pendingRelease = release { - if (retain) { - _lib._Block_copy(_id.cast()); - } - if (release) { - _lib._objc_releaseFinalizer11.attach(this, _id.cast(), detach: this); - } - } - - /// Releases the reference to the underlying ObjC block held by this wrapper. - /// Throws a StateError if this wrapper doesn't currently hold a reference. - void release() { - if (_pendingRelease) { - _pendingRelease = false; - _lib._Block_release(_id.cast()); - _lib._objc_releaseFinalizer11.detach(this); - } else { - throw StateError( - 'Released an ObjC block that was unowned or already released.'); - } - } - - @override - bool operator ==(Object other) { - return other is _ObjCBlockBase && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; - - /// Return a pointer to this object. - ffi.Pointer<_ObjCBlock> get pointer => _id; - - ffi.Pointer<_ObjCBlock> _retainAndReturnId() { - _lib._Block_copy(_id.cast()); - return _id; - } -} - -ffi.Pointer _ObjCBlock_ObjCObject_NSError_NSString_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ObjCObject_NSError_NSString_closureRegistry = Function( - ffi.Pointer, ffi.Pointer)>{}; -int _ObjCBlock_ObjCObject_NSError_NSString_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ObjCObject_NSError_NSString_registerClosure( - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer) - fn) { - final id = ++_ObjCBlock_ObjCObject_NSError_NSString_closureRegistryIndex; - _ObjCBlock_ObjCObject_NSError_NSString_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -ffi.Pointer - _ObjCBlock_ObjCObject_NSError_NSString_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ObjCObject_NSError_NSString_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ObjCObject_NSError_NSString extends _ObjCBlockBase { - ObjCBlock_ObjCObject_NSError_NSString._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ObjCObject_NSError_NSString.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ObjCObject_NSError_NSString_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ObjCObject_NSError_NSString.fromFunction( - ThermionDartTexture1 lib, NSObject? Function(NSError, NSString) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ObjCObject_NSError_NSString_closureTrampoline) - .cast(), - _ObjCBlock_ObjCObject_NSError_NSString_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(NSError._(arg0, lib, retain: true, release: true), NSString._(arg1, lib, retain: true, release: true)) - ?._retainAndReturnId() ?? - ffi.nullptr)), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - NSObject? call(NSError arg0, NSString arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, ffi.Pointer)>() - (_id, arg0._id, arg1._id) - .address == - 0 - ? null - : NSObject._( - _id.ref.invoke - .cast Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, ffi.Pointer)>()(_id, arg0._id, arg1._id), - _lib, - retain: false, - release: true); -} - -final class _ObjCBlockDesc extends ffi.Struct { - @ffi.UnsignedLong() - external int reserved; - - @ffi.UnsignedLong() - external int size; - - external ffi.Pointer copy_helper; - - external ffi.Pointer dispose_helper; - - external ffi.Pointer signature; -} - -final class _ObjCBlock extends ffi.Struct { - external ffi.Pointer isa; - - @ffi.Int() - external int flags; - - @ffi.Int() - external int reserved; - - external ffi.Pointer invoke; - - external ffi.Pointer<_ObjCBlockDesc> descriptor; - - external ffi.Pointer target; -} - -class NSIndexSet extends NSObject { - NSIndexSet._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSIndexSet] that points to the same underlying object as [other]. - static NSIndexSet castFrom(T other) { - return NSIndexSet._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSIndexSet] that wraps the given raw object pointer. - static NSIndexSet castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSIndexSet._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSIndexSet]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSIndexSet1); - } - - static NSIndexSet indexSet(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_indexSet1); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - static NSIndexSet indexSetWithIndex_(ThermionDartTexture1 _lib, int value) { - final _ret = _lib._objc_msgSend_64( - _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - static NSIndexSet indexSetWithIndexesInRange_( - ThermionDartTexture1 _lib, _NSRange range) { - final _ret = _lib._objc_msgSend_90( - _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet initWithIndexesInRange_(_NSRange range) { - final _ret = - _lib._objc_msgSend_90(_id, _lib._sel_initWithIndexesInRange_1, range); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet initWithIndexSet_(NSIndexSet indexSet) { - final _ret = - _lib._objc_msgSend_91(_id, _lib._sel_initWithIndexSet_1, indexSet._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet initWithIndex_(int value) { - final _ret = _lib._objc_msgSend_64(_id, _lib._sel_initWithIndex_1, value); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - bool isEqualToIndexSet_(NSIndexSet indexSet) { - return _lib._objc_msgSend_92( - _id, _lib._sel_isEqualToIndexSet_1, indexSet._id); - } - - int get count { - return _lib._objc_msgSend_10(_id, _lib._sel_count1); - } - - int get firstIndex { - return _lib._objc_msgSend_10(_id, _lib._sel_firstIndex1); - } - - int get lastIndex { - return _lib._objc_msgSend_10(_id, _lib._sel_lastIndex1); - } - - int indexGreaterThanIndex_(int value) { - return _lib._objc_msgSend_93(_id, _lib._sel_indexGreaterThanIndex_1, value); - } - - int indexLessThanIndex_(int value) { - return _lib._objc_msgSend_93(_id, _lib._sel_indexLessThanIndex_1, value); - } - - int indexGreaterThanOrEqualToIndex_(int value) { - return _lib._objc_msgSend_93( - _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); - } - - int indexLessThanOrEqualToIndex_(int value) { - return _lib._objc_msgSend_93( - _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); - } - - int getIndexes_maxCount_inIndexRange_( - ffi.Pointer indexBuffer, - int bufferSize, - ffi.Pointer<_NSRange> range) { - return _lib._objc_msgSend_94( - _id, - _lib._sel_getIndexes_maxCount_inIndexRange_1, - indexBuffer, - bufferSize, - range); - } - - int countOfIndexesInRange_(_NSRange range) { - return _lib._objc_msgSend_95(_id, _lib._sel_countOfIndexesInRange_1, range); - } - - bool containsIndex_(int value) { - return _lib._objc_msgSend_96(_id, _lib._sel_containsIndex_1, value); - } - - bool containsIndexesInRange_(_NSRange range) { - return _lib._objc_msgSend_97( - _id, _lib._sel_containsIndexesInRange_1, range); - } - - bool containsIndexes_(NSIndexSet indexSet) { - return _lib._objc_msgSend_92( - _id, _lib._sel_containsIndexes_1, indexSet._id); - } - - bool intersectsIndexesInRange_(_NSRange range) { - return _lib._objc_msgSend_97( - _id, _lib._sel_intersectsIndexesInRange_1, range); - } - - void enumerateIndexesUsingBlock_( - ObjCBlock_ffiVoid_ffiUnsignedLong_bool block) { - _lib._objc_msgSend_98( - _id, _lib._sel_enumerateIndexesUsingBlock_1, block._id); - } - - void enumerateIndexesWithOptions_usingBlock_( - int opts, ObjCBlock_ffiVoid_ffiUnsignedLong_bool block) { - _lib._objc_msgSend_99(_id, - _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._id); - } - - void enumerateIndexesInRange_options_usingBlock_( - _NSRange range, int opts, ObjCBlock_ffiVoid_ffiUnsignedLong_bool block) { - _lib._objc_msgSend_100( - _id, - _lib._sel_enumerateIndexesInRange_options_usingBlock_1, - range, - opts, - block._id); - } - - int indexPassingTest_(ObjCBlock_bool_ffiUnsignedLong_bool predicate) { - return _lib._objc_msgSend_101( - _id, _lib._sel_indexPassingTest_1, predicate._id); - } - - int indexWithOptions_passingTest_( - int opts, ObjCBlock_bool_ffiUnsignedLong_bool predicate) { - return _lib._objc_msgSend_102( - _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._id); - } - - int indexInRange_options_passingTest_( - _NSRange range, int opts, ObjCBlock_bool_ffiUnsignedLong_bool predicate) { - return _lib._objc_msgSend_103( - _id, - _lib._sel_indexInRange_options_passingTest_1, - range, - opts, - predicate._id); - } - - NSIndexSet indexesPassingTest_( - ObjCBlock_bool_ffiUnsignedLong_bool predicate) { - final _ret = _lib._objc_msgSend_104( - _id, _lib._sel_indexesPassingTest_1, predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet indexesWithOptions_passingTest_( - int opts, ObjCBlock_bool_ffiUnsignedLong_bool predicate) { - final _ret = _lib._objc_msgSend_105( - _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet indexesInRange_options_passingTest_( - _NSRange range, int opts, ObjCBlock_bool_ffiUnsignedLong_bool predicate) { - final _ret = _lib._objc_msgSend_106( - _id, - _lib._sel_indexesInRange_options_passingTest_1, - range, - opts, - predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - void enumerateRangesUsingBlock_(ObjCBlock_ffiVoid_NSRange_bool block) { - _lib._objc_msgSend_107( - _id, _lib._sel_enumerateRangesUsingBlock_1, block._id); - } - - void enumerateRangesWithOptions_usingBlock_( - int opts, ObjCBlock_ffiVoid_NSRange_bool block) { - _lib._objc_msgSend_108(_id, - _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._id); - } - - void enumerateRangesInRange_options_usingBlock_( - _NSRange range, int opts, ObjCBlock_ffiVoid_NSRange_bool block) { - _lib._objc_msgSend_109( - _id, - _lib._sel_enumerateRangesInRange_options_usingBlock_1, - range, - opts, - block._id); - } - - @override - NSIndexSet init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - static NSIndexSet new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_new1); - return NSIndexSet._(_ret, _lib, retain: false, release: true); - } - - static NSIndexSet allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSIndexSet1, _lib._sel_allocWithZone_1, zone); - return NSIndexSet._(_ret, _lib, retain: false, release: true); - } - - static NSIndexSet alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_alloc1); - return NSIndexSet._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSIndexSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSIndexSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSIndexSet1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSIndexSet1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSIndexSet1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSIndexSet1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSIndexSet1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSIndexSet1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSIndexSet1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_registerClosure( - void Function(int, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_ffiUnsignedLong_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ffiUnsignedLong_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ffiUnsignedLong_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.UnsignedLong arg0, ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ffiUnsignedLong_bool.fromFunction( - ThermionDartTexture1 lib, void Function(int, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_registerClosure( - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ffiUnsignedLong_bool.listener( - ThermionDartTexture1 lib, void Function(int, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.UnsignedLong, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_registerClosure( - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.UnsignedLong, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(int arg0, ffi.Pointer arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, int, - ffi.Pointer)>()(_id, arg0, arg1); -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -bool _ObjCBlock_bool_ffiUnsignedLong_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction)>()(arg0, arg1); -final _ObjCBlock_bool_ffiUnsignedLong_bool_closureRegistry = - )>{}; -int _ObjCBlock_bool_ffiUnsignedLong_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_bool_ffiUnsignedLong_bool_registerClosure( - bool Function(int, ffi.Pointer) fn) { - final id = ++_ObjCBlock_bool_ffiUnsignedLong_bool_closureRegistryIndex; - _ObjCBlock_bool_ffiUnsignedLong_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_ffiUnsignedLong_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) => - _ObjCBlock_bool_ffiUnsignedLong_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_bool_ffiUnsignedLong_bool extends _ObjCBlockBase { - ObjCBlock_bool_ffiUnsignedLong_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ffiUnsignedLong_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.UnsignedLong arg0, ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer<_ObjCBlock>, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_bool_ffiUnsignedLong_bool_fnPtrTrampoline, - false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ffiUnsignedLong_bool.fromFunction( - ThermionDartTexture1 lib, bool Function(int, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer<_ObjCBlock>, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_bool_ffiUnsignedLong_bool_closureTrampoline, - false) - .cast(), - _ObjCBlock_bool_ffiUnsignedLong_bool_registerClosure( - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(int arg0, ffi.Pointer arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer<_ObjCBlock>, int, - ffi.Pointer)>()(_id, arg0, arg1); -} - -void _ObjCBlock_ffiVoid_NSRange_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - _NSRange arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(_NSRange arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(_NSRange, ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSRange_bool_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSRange_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSRange_bool_registerClosure( - void Function(_NSRange, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSRange_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSRange_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSRange_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - _NSRange arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSRange_bool_closureRegistry[block.ref.target.address]!( - arg0, arg1); - -class ObjCBlock_ffiVoid_NSRange_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSRange_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSRange_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(_NSRange arg0, ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, _NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSRange_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSRange_bool.fromFunction(ThermionDartTexture1 lib, - void Function(_NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, _NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSRange_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSRange_bool_registerClosure( - (_NSRange arg0, ffi.Pointer arg1) => - fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSRange_bool.listener(ThermionDartTexture1 lib, - void Function(_NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, _NSRange, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSRange_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSRange_bool_registerClosure( - (_NSRange arg0, ffi.Pointer arg1) => - fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, _NSRange, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(_NSRange arg0, ffi.Pointer arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, _NSRange arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, _NSRange, - ffi.Pointer)>()(_id, arg0, arg1); -} - -void _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.UnsignedLong arg1, ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, int, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureRegistry = - , int, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_registerClosure( - void Function(ffi.Pointer, int, ffi.Pointer) fn) { - final id = - ++_ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.UnsignedLong arg1, ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool.fromFunction( - ThermionDartTexture1 lib, - void Function(NSObject, int, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_registerClosure( - (ffi.Pointer arg0, int arg1, - ffi.Pointer arg2) => - fn(NSObject._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool.listener( - ThermionDartTexture1 lib, - void Function(NSObject, int, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_registerClosure( - (ffi.Pointer arg0, int arg1, ffi.Pointer arg2) => - fn(NSObject._(arg0, lib, retain: true, release: true), - arg1, arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSObject arg0, int arg1, ffi.Pointer arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.UnsignedLong arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - int, ffi.Pointer)>()(_id, arg0._id, arg1, arg2); -} - -bool _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.UnsignedLong arg1, ffi.Pointer arg2)>>() - .asFunction< - bool Function(ffi.Pointer, int, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureRegistry = - , int, ffi.Pointer)>{}; -int _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_registerClosure( - bool Function(ffi.Pointer, int, ffi.Pointer) fn) { - final id = - ++_ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureRegistryIndex; - _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool extends _ObjCBlockBase { - ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.UnsignedLong arg1, ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_fnPtrTrampoline, - false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool.fromFunction( - ThermionDartTexture1 lib, - bool Function(NSObject, int, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureTrampoline, false) - .cast(), - _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_registerClosure( - (ffi.Pointer arg0, int arg1, - ffi.Pointer arg2) => - fn(NSObject._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(NSObject arg0, int arg1, ffi.Pointer arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.UnsignedLong arg1, - ffi.Pointer arg2)>>() - .asFunction< - bool Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - int, ffi.Pointer)>()(_id, arg0._id, arg1, arg2); -} - -int _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_registerClosure( - int Function(ffi.Pointer, ffi.Pointer) fn) { - final id = - ++_ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistryIndex; - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -int _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject - extends _ObjCBlockBase { - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Int32 Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_fnPtrTrampoline, - 0) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject.fromFunction( - ThermionDartTexture1 lib, int Function(NSObject, NSObject) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Int32 Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureTrampoline, 0) - .cast(), - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - NSObject._(arg0, lib, retain: true, release: true), - NSObject._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - int call(NSObject arg0, NSObject arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - int Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id); -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSBinarySearchingOptions { - static const int NSBinarySearchingFirstEqual = 256; - static const int NSBinarySearchingLastEqual = 512; - static const int NSBinarySearchingInsertionIndex = 1024; -} - -abstract class NSOrderedCollectionDifferenceCalculationOptions { - static const int NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = - 1; - static const int NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = - 2; - static const int NSOrderedCollectionDifferenceCalculationInferMoves = 4; -} - -bool _ObjCBlock_bool_ObjCObject_ObjCObject_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_bool_ObjCObject_ObjCObject_registerClosure( - bool Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistryIndex; - _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_ObjCObject_ObjCObject_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_bool_ObjCObject_ObjCObject extends _ObjCBlockBase { - ObjCBlock_bool_ObjCObject_ObjCObject._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ObjCObject_ObjCObject.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_ObjCObject_fnPtrTrampoline, - false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ObjCObject_ObjCObject.fromFunction( - ThermionDartTexture1 lib, bool Function(NSObject, NSObject) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_ObjCObject_closureTrampoline, - false) - .cast(), - _ObjCBlock_bool_ObjCObject_ObjCObject_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(NSObject._(arg0, lib, retain: true, release: true), NSObject._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(NSObject arg0, NSObject arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id); -} - -abstract class NSKeyValueObservingOptions { - static const int NSKeyValueObservingOptionNew = 1; - static const int NSKeyValueObservingOptionOld = 2; - static const int NSKeyValueObservingOptionInitial = 4; - static const int NSKeyValueObservingOptionPrior = 8; -} - -class NSPredicate extends NSObject { - NSPredicate._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSPredicate] that points to the same underlying object as [other]. - static NSPredicate castFrom(T other) { - return NSPredicate._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSPredicate] that wraps the given raw object pointer. - static NSPredicate castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSPredicate._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSPredicate]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPredicate1); - } - - static NSPredicate predicateWithFormat_argumentArray_( - ThermionDartTexture1 _lib, NSString predicateFormat, NSArray? arguments) { - final _ret = _lib._objc_msgSend_141( - _lib._class_NSPredicate1, - _lib._sel_predicateWithFormat_argumentArray_1, - predicateFormat._id, - arguments?._id ?? ffi.nullptr); - return NSPredicate._(_ret, _lib, retain: true, release: true); - } - - static NSPredicate predicateWithFormat_( - ThermionDartTexture1 _lib, NSString predicateFormat) { - final _ret = _lib._objc_msgSend_142(_lib._class_NSPredicate1, - _lib._sel_predicateWithFormat_1, predicateFormat._id); - return NSPredicate._(_ret, _lib, retain: true, release: true); - } - - static NSPredicate predicateWithFormat_arguments_(ThermionDartTexture1 _lib, - NSString predicateFormat, ffi.Pointer argList) { - final _ret = _lib._objc_msgSend_143( - _lib._class_NSPredicate1, - _lib._sel_predicateWithFormat_arguments_1, - predicateFormat._id, - argList); - return NSPredicate._(_ret, _lib, retain: true, release: true); - } - - static NSPredicate? predicateFromMetadataQueryString_( - ThermionDartTexture1 _lib, NSString queryString) { - final _ret = _lib._objc_msgSend_144(_lib._class_NSPredicate1, - _lib._sel_predicateFromMetadataQueryString_1, queryString._id); - return _ret.address == 0 - ? null - : NSPredicate._(_ret, _lib, retain: true, release: true); - } - - static NSPredicate predicateWithValue_( - ThermionDartTexture1 _lib, bool value) { - final _ret = _lib._objc_msgSend_145( - _lib._class_NSPredicate1, _lib._sel_predicateWithValue_1, value); - return NSPredicate._(_ret, _lib, retain: true, release: true); - } - - static NSPredicate predicateWithBlock_( - ThermionDartTexture1 _lib, ObjCBlock_bool_ObjCObject_NSDictionary block) { - final _ret = _lib._objc_msgSend_215( - _lib._class_NSPredicate1, _lib._sel_predicateWithBlock_1, block._id); - return NSPredicate._(_ret, _lib, retain: true, release: true); - } - - NSString get predicateFormat { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_predicateFormat1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSPredicate predicateWithSubstitutionVariables_(NSDictionary variables) { - final _ret = _lib._objc_msgSend_158( - _id, _lib._sel_predicateWithSubstitutionVariables_1, variables._id); - return NSPredicate._(_ret, _lib, retain: true, release: true); - } - - bool evaluateWithObject_(NSObject? object) { - return _lib._objc_msgSend_216( - _id, _lib._sel_evaluateWithObject_1, object?._id ?? ffi.nullptr); - } - - bool evaluateWithObject_substitutionVariables_( - NSObject? object, NSDictionary? bindings) { - return _lib._objc_msgSend_217( - _id, - _lib._sel_evaluateWithObject_substitutionVariables_1, - object?._id ?? ffi.nullptr, - bindings?._id ?? ffi.nullptr); - } - - void allowEvaluation() { - _lib._objc_msgSend_1(_id, _lib._sel_allowEvaluation1); - } - - @override - NSPredicate init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSPredicate._(_ret, _lib, retain: true, release: true); - } - - static NSPredicate new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSPredicate1, _lib._sel_new1); - return NSPredicate._(_ret, _lib, retain: false, release: true); - } - - static NSPredicate allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSPredicate1, _lib._sel_allocWithZone_1, zone); - return NSPredicate._(_ret, _lib, retain: false, release: true); - } - - static NSPredicate alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPredicate1, _lib._sel_alloc1); - return NSPredicate._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSPredicate1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSPredicate1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSPredicate1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSPredicate1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSPredicate1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSPredicate1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSPredicate1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSPredicate1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSPredicate1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -bool _ObjCBlock_bool_ObjCObject_NSDictionary_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_bool_ObjCObject_NSDictionary_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_bool_ObjCObject_NSDictionary_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_bool_ObjCObject_NSDictionary_registerClosure( - bool Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_bool_ObjCObject_NSDictionary_closureRegistryIndex; - _ObjCBlock_bool_ObjCObject_NSDictionary_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_ObjCObject_NSDictionary_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_bool_ObjCObject_NSDictionary_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_bool_ObjCObject_NSDictionary extends _ObjCBlockBase { - ObjCBlock_bool_ObjCObject_NSDictionary._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ObjCObject_NSDictionary.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_NSDictionary_fnPtrTrampoline, - false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ObjCObject_NSDictionary.fromFunction( - ThermionDartTexture1 lib, bool Function(NSObject?, NSDictionary?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_NSDictionary_closureTrampoline, false) - .cast(), - _ObjCBlock_bool_ObjCObject_NSDictionary_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSObject._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSDictionary._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(NSObject? arg0, NSDictionary? arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1?._id ?? ffi.nullptr); -} - -class NSDictionary extends NSObject { - NSDictionary._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSDictionary] that points to the same underlying object as [other]. - static NSDictionary castFrom(T other) { - return NSDictionary._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSDictionary] that wraps the given raw object pointer. - static NSDictionary castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSDictionary._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSDictionary]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSDictionary1); - } - - int get count { - return _lib._objc_msgSend_10(_id, _lib._sel_count1); - } - - NSObject? objectForKey_(NSObject aKey) { - final _ret = _lib._objc_msgSend_16(_id, _lib._sel_objectForKey_1, aKey._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSEnumerator keyEnumerator() { - final _ret = _lib._objc_msgSend_76(_id, _lib._sel_keyEnumerator1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - @override - NSDictionary init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary initWithObjects_forKeys_count_( - ffi.Pointer> objects, - ffi.Pointer> keys, - int cnt) { - final _ret = _lib._objc_msgSend_146( - _id, _lib._sel_initWithObjects_forKeys_count_1, objects, keys, cnt); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSArray get allKeys { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_allKeys1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray allKeysForObject_(NSObject anObject) { - final _ret = - _lib._objc_msgSend_66(_id, _lib._sel_allKeysForObject_1, anObject._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get allValues { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_allValues1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString get description { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get descriptionInStringsFileFormat { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_descriptionInStringsFileFormat1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_69( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_indent_(NSObject? locale, int level) { - final _ret = _lib._objc_msgSend_70( - _id, - _lib._sel_descriptionWithLocale_indent_1, - locale?._id ?? ffi.nullptr, - level); - return NSString._(_ret, _lib, retain: true, release: true); - } - - bool isEqualToDictionary_(NSDictionary otherDictionary) { - return _lib._objc_msgSend_147( - _id, _lib._sel_isEqualToDictionary_1, otherDictionary._id); - } - - NSEnumerator objectEnumerator() { - final _ret = _lib._objc_msgSend_76(_id, _lib._sel_objectEnumerator1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - NSArray objectsForKeys_notFoundMarker_(NSArray keys, NSObject marker) { - final _ret = _lib._objc_msgSend_148( - _id, _lib._sel_objectsForKeys_notFoundMarker_1, keys._id, marker._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - bool writeToURL_error_( - NSURL url, ffi.Pointer> error) { - return _lib._objc_msgSend_88( - _id, _lib._sel_writeToURL_error_1, url._id, error); - } - - NSArray keysSortedByValueUsingSelector_(ffi.Pointer comparator) { - final _ret = _lib._objc_msgSend_79( - _id, _lib._sel_keysSortedByValueUsingSelector_1, comparator); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - void getObjects_andKeys_count_(ffi.Pointer> objects, - ffi.Pointer> keys, int count) { - _lib._objc_msgSend_149( - _id, _lib._sel_getObjects_andKeys_count_1, objects, keys, count); - } - - NSObject? objectForKeyedSubscript_(NSObject key) { - final _ret = _lib._objc_msgSend_16( - _id, _lib._sel_objectForKeyedSubscript_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void enumerateKeysAndObjectsUsingBlock_( - ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool block) { - _lib._objc_msgSend_150( - _id, _lib._sel_enumerateKeysAndObjectsUsingBlock_1, block._id); - } - - void enumerateKeysAndObjectsWithOptions_usingBlock_( - int opts, ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool block) { - _lib._objc_msgSend_151( - _id, - _lib._sel_enumerateKeysAndObjectsWithOptions_usingBlock_1, - opts, - block._id); - } - - NSArray keysSortedByValueUsingComparator_( - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - final _ret = _lib._objc_msgSend_120( - _id, _lib._sel_keysSortedByValueUsingComparator_1, cmptr._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray keysSortedByValueWithOptions_usingComparator_( - int opts, ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - final _ret = _lib._objc_msgSend_121( - _id, - _lib._sel_keysSortedByValueWithOptions_usingComparator_1, - opts, - cmptr._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSObject keysOfEntriesPassingTest_( - ObjCBlock_bool_ObjCObject_ObjCObject_bool predicate) { - final _ret = _lib._objc_msgSend_152( - _id, _lib._sel_keysOfEntriesPassingTest_1, predicate._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject keysOfEntriesWithOptions_passingTest_( - int opts, ObjCBlock_bool_ObjCObject_ObjCObject_bool predicate) { - final _ret = _lib._objc_msgSend_153(_id, - _lib._sel_keysOfEntriesWithOptions_passingTest_1, opts, predicate._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - void getObjects_andKeys_(ffi.Pointer> objects, - ffi.Pointer> keys) { - _lib._objc_msgSend_154(_id, _lib._sel_getObjects_andKeys_1, objects, keys); - } - - static NSDictionary? dictionaryWithContentsOfFile_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_155(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary? dictionaryWithContentsOfURL_( - ThermionDartTexture1 _lib, NSURL url) { - final _ret = _lib._objc_msgSend_156(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_155( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_156(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - bool writeToFile_atomically_(NSString path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_26( - _id, _lib._sel_writeToFile_atomically_1, path._id, useAuxiliaryFile); - } - - bool writeToURL_atomically_(NSURL url, bool atomically) { - return _lib._objc_msgSend_133( - _id, _lib._sel_writeToURL_atomically_1, url._id, atomically); - } - - static NSDictionary dictionary(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_dictionary1); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary dictionaryWithObject_forKey_( - ThermionDartTexture1 _lib, NSObject object, NSObject key) { - final _ret = _lib._objc_msgSend_157(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithObject_forKey_1, object._id, key._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary dictionaryWithObjects_forKeys_count_( - ThermionDartTexture1 _lib, - ffi.Pointer> objects, - ffi.Pointer> keys, - int cnt) { - final _ret = _lib._objc_msgSend_146(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithObjects_forKeys_count_1, objects, keys, cnt); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary dictionaryWithObjectsAndKeys_( - ThermionDartTexture1 _lib, NSObject firstObject) { - final _ret = _lib._objc_msgSend_123(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithObjectsAndKeys_1, firstObject._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary dictionaryWithDictionary_( - ThermionDartTexture1 _lib, NSDictionary dict) { - final _ret = _lib._objc_msgSend_158(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithDictionary_1, dict._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary dictionaryWithObjects_forKeys_( - ThermionDartTexture1 _lib, NSArray objects, NSArray keys) { - final _ret = _lib._objc_msgSend_159(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithObjects_forKeys_1, objects._id, keys._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary initWithObjectsAndKeys_(NSObject firstObject) { - final _ret = _lib._objc_msgSend_123( - _id, _lib._sel_initWithObjectsAndKeys_1, firstObject._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary initWithDictionary_(NSDictionary otherDictionary) { - final _ret = _lib._objc_msgSend_158( - _id, _lib._sel_initWithDictionary_1, otherDictionary._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary initWithDictionary_copyItems_( - NSDictionary otherDictionary, bool flag) { - final _ret = _lib._objc_msgSend_160(_id, - _lib._sel_initWithDictionary_copyItems_1, otherDictionary._id, flag); - return NSDictionary._(_ret, _lib, retain: false, release: true); - } - - NSDictionary initWithObjects_forKeys_(NSArray objects, NSArray keys) { - final _ret = _lib._objc_msgSend_159( - _id, _lib._sel_initWithObjects_forKeys_1, objects._id, keys._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? initWithContentsOfURL_error_( - NSURL url, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_161( - _id, _lib._sel_initWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary? dictionaryWithContentsOfURL_error_( - ThermionDartTexture1 _lib, - NSURL url, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_161(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSObject sharedKeySetForKeys_( - ThermionDartTexture1 _lib, NSArray keys) { - final _ret = _lib._objc_msgSend_124( - _lib._class_NSDictionary1, _lib._sel_sharedKeySetForKeys_1, keys._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - int countByEnumeratingWithState_objects_count_( - ffi.Pointer state, - ffi.Pointer> buffer, - int len) { - return _lib._objc_msgSend_162( - _id, - _lib._sel_countByEnumeratingWithState_objects_count_1, - state, - buffer, - len); - } - - int fileSize() { - return _lib._objc_msgSend_163(_id, _lib._sel_fileSize1); - } - - NSDate? fileModificationDate() { - final _ret = _lib._objc_msgSend_182(_id, _lib._sel_fileModificationDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSString? fileType() { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_fileType1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - int filePosixPermissions() { - return _lib._objc_msgSend_10(_id, _lib._sel_filePosixPermissions1); - } - - NSString? fileOwnerAccountName() { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_fileOwnerAccountName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? fileGroupOwnerAccountName() { - final _ret = - _lib._objc_msgSend_43(_id, _lib._sel_fileGroupOwnerAccountName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - int fileSystemNumber() { - return _lib._objc_msgSend_82(_id, _lib._sel_fileSystemNumber1); - } - - int fileSystemFileNumber() { - return _lib._objc_msgSend_10(_id, _lib._sel_fileSystemFileNumber1); - } - - bool fileExtensionHidden() { - return _lib._objc_msgSend_12(_id, _lib._sel_fileExtensionHidden1); - } - - int fileHFSCreatorCode() { - return _lib._objc_msgSend_213(_id, _lib._sel_fileHFSCreatorCode1); - } - - int fileHFSTypeCode() { - return _lib._objc_msgSend_213(_id, _lib._sel_fileHFSTypeCode1); - } - - bool fileIsImmutable() { - return _lib._objc_msgSend_12(_id, _lib._sel_fileIsImmutable1); - } - - bool fileIsAppendOnly() { - return _lib._objc_msgSend_12(_id, _lib._sel_fileIsAppendOnly1); - } - - NSDate? fileCreationDate() { - final _ret = _lib._objc_msgSend_182(_id, _lib._sel_fileCreationDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSNumber? fileOwnerAccountID() { - final _ret = _lib._objc_msgSend_214(_id, _lib._sel_fileOwnerAccountID1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber? fileGroupOwnerAccountID() { - final _ret = - _lib._objc_msgSend_214(_id, _lib._sel_fileGroupOwnerAccountID1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - @override - NSObject? valueForKey_(NSString key) { - final _ret = _lib._objc_msgSend_38(_id, _lib._sel_valueForKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_new1); - return NSDictionary._(_ret, _lib, retain: false, release: true); - } - - static NSDictionary allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSDictionary1, _lib._sel_allocWithZone_1, zone); - return NSDictionary._(_ret, _lib, retain: false, release: true); - } - - static NSDictionary alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_alloc1); - return NSDictionary._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSDictionary1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSDictionary1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSDictionary1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSDictionary1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSDictionary1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSDictionary1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSDictionary1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSDictionary1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSDictionary1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_registerClosure( - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool.fromFunction( - ThermionDartTexture1 lib, - void Function(NSObject, NSObject, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - NSObject._(arg0, lib, retain: true, release: true), - NSObject._(arg1, lib, retain: true, release: true), - arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool.listener( - ThermionDartTexture1 lib, - void Function(NSObject, NSObject, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_registerClosure((ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - NSObject._(arg0, lib, retain: true, release: true), - NSObject._(arg1, lib, retain: true, release: true), - arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSObject arg0, NSObject arg1, ffi.Pointer arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id, arg2); -} - -bool _ObjCBlock_bool_ObjCObject_ObjCObject_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_registerClosure( - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = ++_ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistryIndex; - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_bool_ObjCObject_ObjCObject_bool extends _ObjCBlockBase { - ObjCBlock_bool_ObjCObject_ObjCObject_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ObjCObject_ObjCObject_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_fnPtrTrampoline, - false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ObjCObject_ObjCObject_bool.fromFunction( - ThermionDartTexture1 lib, - bool Function(NSObject, NSObject, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureTrampoline, false) - .cast(), - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn(NSObject._(arg0, lib, retain: true, release: true), NSObject._(arg1, lib, retain: true, release: true), arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(NSObject arg0, NSObject arg1, ffi.Pointer arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id, arg2); -} - -final class NSFastEnumerationState extends ffi.Struct { - @ffi.UnsignedLong() - external int state; - - external ffi.Pointer> itemsPtr; - - external ffi.Pointer mutationsPtr; - - @ffi.Array.multi([5]) - external ffi.Array extra; -} - -class NSDate extends NSObject { - NSDate._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSDate] that points to the same underlying object as [other]. - static NSDate castFrom(T other) { - return NSDate._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSDate] that wraps the given raw object pointer. - static NSDate castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSDate._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSDate]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSDate1); - } - - double get timeIntervalSinceReferenceDate { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret( - _id, _lib._sel_timeIntervalSinceReferenceDate1) - : _lib._objc_msgSend_164( - _id, _lib._sel_timeIntervalSinceReferenceDate1); - } - - @override - NSDate init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate initWithTimeIntervalSinceReferenceDate_(double ti) { - final _ret = _lib._objc_msgSend_165( - _id, _lib._sel_initWithTimeIntervalSinceReferenceDate_1, ti); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - double timeIntervalSinceDate_(NSDate anotherDate) { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_166_fpret( - _id, _lib._sel_timeIntervalSinceDate_1, anotherDate._id) - : _lib._objc_msgSend_166( - _id, _lib._sel_timeIntervalSinceDate_1, anotherDate._id); - } - - double get timeIntervalSinceNow { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_timeIntervalSinceNow1) - : _lib._objc_msgSend_164(_id, _lib._sel_timeIntervalSinceNow1); - } - - double get timeIntervalSince1970 { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_timeIntervalSince19701) - : _lib._objc_msgSend_164(_id, _lib._sel_timeIntervalSince19701); - } - - NSObject addTimeInterval_(double seconds) { - final _ret = - _lib._objc_msgSend_165(_id, _lib._sel_addTimeInterval_1, seconds); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSDate dateByAddingTimeInterval_(double ti) { - final _ret = - _lib._objc_msgSend_165(_id, _lib._sel_dateByAddingTimeInterval_1, ti); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate earlierDate_(NSDate anotherDate) { - final _ret = - _lib._objc_msgSend_167(_id, _lib._sel_earlierDate_1, anotherDate._id); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate laterDate_(NSDate anotherDate) { - final _ret = - _lib._objc_msgSend_167(_id, _lib._sel_laterDate_1, anotherDate._id); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - int compare_(NSDate other) { - return _lib._objc_msgSend_168(_id, _lib._sel_compare_1, other._id); - } - - bool isEqualToDate_(NSDate otherDate) { - return _lib._objc_msgSend_169( - _id, _lib._sel_isEqualToDate_1, otherDate._id); - } - - NSString get description { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_69( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSDate date(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_date1); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSDate dateWithTimeIntervalSinceNow_( - ThermionDartTexture1 _lib, double secs) { - final _ret = _lib._objc_msgSend_165( - _lib._class_NSDate1, _lib._sel_dateWithTimeIntervalSinceNow_1, secs); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSDate dateWithTimeIntervalSinceReferenceDate_( - ThermionDartTexture1 _lib, double ti) { - final _ret = _lib._objc_msgSend_165(_lib._class_NSDate1, - _lib._sel_dateWithTimeIntervalSinceReferenceDate_1, ti); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSDate dateWithTimeIntervalSince1970_( - ThermionDartTexture1 _lib, double secs) { - final _ret = _lib._objc_msgSend_165( - _lib._class_NSDate1, _lib._sel_dateWithTimeIntervalSince1970_1, secs); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSDate dateWithTimeInterval_sinceDate_( - ThermionDartTexture1 _lib, double secsToBeAdded, NSDate date) { - final _ret = _lib._objc_msgSend_170(_lib._class_NSDate1, - _lib._sel_dateWithTimeInterval_sinceDate_1, secsToBeAdded, date._id); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSDate getDistantFuture(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_171(_lib._class_NSDate1, _lib._sel_distantFuture1); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSDate getDistantPast(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_171(_lib._class_NSDate1, _lib._sel_distantPast1); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSDate getNow(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_171(_lib._class_NSDate1, _lib._sel_now1); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate initWithTimeIntervalSinceNow_(double secs) { - final _ret = _lib._objc_msgSend_165( - _id, _lib._sel_initWithTimeIntervalSinceNow_1, secs); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate initWithTimeIntervalSince1970_(double secs) { - final _ret = _lib._objc_msgSend_165( - _id, _lib._sel_initWithTimeIntervalSince1970_1, secs); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate initWithTimeInterval_sinceDate_(double secsToBeAdded, NSDate date) { - final _ret = _lib._objc_msgSend_170(_id, - _lib._sel_initWithTimeInterval_sinceDate_1, secsToBeAdded, date._id); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSObject? dateWithNaturalLanguageString_locale_( - ThermionDartTexture1 _lib, NSString string, NSObject? locale) { - final _ret = _lib._objc_msgSend_172( - _lib._class_NSDate1, - _lib._sel_dateWithNaturalLanguageString_locale_1, - string._id, - locale?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? dateWithNaturalLanguageString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSDate1, - _lib._sel_dateWithNaturalLanguageString_1, string._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject dateWithString_(ThermionDartTexture1 _lib, NSString aString) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSDate1, _lib._sel_dateWithString_1, aString._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSCalendarDate dateWithCalendarFormat_timeZone_( - NSString? format, NSTimeZone? aTimeZone) { - final _ret = _lib._objc_msgSend_211( - _id, - _lib._sel_dateWithCalendarFormat_timeZone_1, - format?._id ?? ffi.nullptr, - aTimeZone?._id ?? ffi.nullptr); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - NSString? descriptionWithCalendarFormat_timeZone_locale_( - NSString? format, NSTimeZone? aTimeZone, NSObject? locale) { - final _ret = _lib._objc_msgSend_212( - _id, - _lib._sel_descriptionWithCalendarFormat_timeZone_locale_1, - format?._id ?? ffi.nullptr, - aTimeZone?._id ?? ffi.nullptr, - locale?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithString_(NSString description) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_initWithString_1, description._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSDate new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_new1); - return NSDate._(_ret, _lib, retain: false, release: true); - } - - static NSDate allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSDate1, _lib._sel_allocWithZone_1, zone); - return NSDate._(_ret, _lib, retain: false, release: true); - } - - static NSDate alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_alloc1); - return NSDate._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSDate1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSDate1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSDate1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSDate1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSDate1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSDate1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSDate1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSDate1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSDate1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSCalendarDate extends NSDate { - NSCalendarDate._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSCalendarDate] that points to the same underlying object as [other]. - static NSCalendarDate castFrom(T other) { - return NSCalendarDate._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSCalendarDate] that wraps the given raw object pointer. - static NSCalendarDate castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSCalendarDate._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSCalendarDate]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSCalendarDate1); - } - - static NSObject calendarDate(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSCalendarDate1, _lib._sel_calendarDate1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? dateWithString_calendarFormat_locale_( - ThermionDartTexture1 _lib, - NSString description, - NSString format, - NSObject? locale) { - final _ret = _lib._objc_msgSend_173( - _lib._class_NSCalendarDate1, - _lib._sel_dateWithString_calendarFormat_locale_1, - description._id, - format._id, - locale?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? dateWithString_calendarFormat_( - ThermionDartTexture1 _lib, NSString description, NSString format) { - final _ret = _lib._objc_msgSend_174(_lib._class_NSCalendarDate1, - _lib._sel_dateWithString_calendarFormat_1, description._id, format._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject dateWithYear_month_day_hour_minute_second_timeZone_( - ThermionDartTexture1 _lib, - int year, - int month, - int day, - int hour, - int minute, - int second, - NSTimeZone? aTimeZone) { - final _ret = _lib._objc_msgSend_205( - _lib._class_NSCalendarDate1, - _lib._sel_dateWithYear_month_day_hour_minute_second_timeZone_1, - year, - month, - day, - hour, - minute, - second, - aTimeZone?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSCalendarDate dateByAddingYears_months_days_hours_minutes_seconds_( - int year, int month, int day, int hour, int minute, int second) { - final _ret = _lib._objc_msgSend_206( - _id, - _lib._sel_dateByAddingYears_months_days_hours_minutes_seconds_1, - year, - month, - day, - hour, - minute, - second); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - int dayOfCommonEra() { - return _lib._objc_msgSend_82(_id, _lib._sel_dayOfCommonEra1); - } - - int dayOfMonth() { - return _lib._objc_msgSend_82(_id, _lib._sel_dayOfMonth1); - } - - int dayOfWeek() { - return _lib._objc_msgSend_82(_id, _lib._sel_dayOfWeek1); - } - - int dayOfYear() { - return _lib._objc_msgSend_82(_id, _lib._sel_dayOfYear1); - } - - int hourOfDay() { - return _lib._objc_msgSend_82(_id, _lib._sel_hourOfDay1); - } - - int minuteOfHour() { - return _lib._objc_msgSend_82(_id, _lib._sel_minuteOfHour1); - } - - int monthOfYear() { - return _lib._objc_msgSend_82(_id, _lib._sel_monthOfYear1); - } - - int secondOfMinute() { - return _lib._objc_msgSend_82(_id, _lib._sel_secondOfMinute1); - } - - int yearOfCommonEra() { - return _lib._objc_msgSend_82(_id, _lib._sel_yearOfCommonEra1); - } - - NSString calendarFormat() { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_calendarFormat1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithCalendarFormat_locale_( - NSString format, NSObject? locale) { - final _ret = _lib._objc_msgSend_207( - _id, - _lib._sel_descriptionWithCalendarFormat_locale_1, - format._id, - locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithCalendarFormat_(NSString format) { - final _ret = _lib._objc_msgSend_68( - _id, _lib._sel_descriptionWithCalendarFormat_1, format._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - @override - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_69( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSTimeZone timeZone() { - final _ret = _lib._objc_msgSend_178(_id, _lib._sel_timeZone1); - return NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithString_calendarFormat_locale_( - NSString description, NSString format, NSObject? locale) { - final _ret = _lib._objc_msgSend_173( - _id, - _lib._sel_initWithString_calendarFormat_locale_1, - description._id, - format._id, - locale?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithString_calendarFormat_( - NSString description, NSString format) { - final _ret = _lib._objc_msgSend_174(_id, - _lib._sel_initWithString_calendarFormat_1, description._id, format._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - NSObject? initWithString_(NSString description) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_initWithString_1, description._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject initWithYear_month_day_hour_minute_second_timeZone_( - int year, - int month, - int day, - int hour, - int minute, - int second, - NSTimeZone? aTimeZone) { - final _ret = _lib._objc_msgSend_205( - _id, - _lib._sel_initWithYear_month_day_hour_minute_second_timeZone_1, - year, - month, - day, - hour, - minute, - second, - aTimeZone?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - void setCalendarFormat_(NSString? format) { - _lib._objc_msgSend_208( - _id, _lib._sel_setCalendarFormat_1, format?._id ?? ffi.nullptr); - } - - void setTimeZone_(NSTimeZone? aTimeZone) { - _lib._objc_msgSend_209( - _id, _lib._sel_setTimeZone_1, aTimeZone?._id ?? ffi.nullptr); - } - - void years_months_days_hours_minutes_seconds_sinceDate_( - ffi.Pointer yp, - ffi.Pointer mop, - ffi.Pointer dp, - ffi.Pointer hp, - ffi.Pointer mip, - ffi.Pointer sp, - NSCalendarDate date) { - _lib._objc_msgSend_210( - _id, - _lib._sel_years_months_days_hours_minutes_seconds_sinceDate_1, - yp, - mop, - dp, - hp, - mip, - sp, - date._id); - } - - static NSDate getDistantFuture(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_171( - _lib._class_NSCalendarDate1, _lib._sel_distantFuture1); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSDate getDistantPast(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_171( - _lib._class_NSCalendarDate1, _lib._sel_distantPast1); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - @override - NSCalendarDate init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - @override - NSCalendarDate initWithTimeIntervalSinceReferenceDate_(double ti) { - final _ret = _lib._objc_msgSend_165( - _id, _lib._sel_initWithTimeIntervalSinceReferenceDate_1, ti); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - @override - NSCalendarDate? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - @override - NSCalendarDate dateByAddingTimeInterval_(double ti) { - final _ret = - _lib._objc_msgSend_165(_id, _lib._sel_dateByAddingTimeInterval_1, ti); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - static NSCalendarDate date(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_date1); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - static NSCalendarDate dateWithTimeIntervalSinceNow_( - ThermionDartTexture1 _lib, double secs) { - final _ret = _lib._objc_msgSend_165(_lib._class_NSCalendarDate1, - _lib._sel_dateWithTimeIntervalSinceNow_1, secs); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - static NSCalendarDate dateWithTimeIntervalSinceReferenceDate_( - ThermionDartTexture1 _lib, double ti) { - final _ret = _lib._objc_msgSend_165(_lib._class_NSCalendarDate1, - _lib._sel_dateWithTimeIntervalSinceReferenceDate_1, ti); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - static NSCalendarDate dateWithTimeIntervalSince1970_( - ThermionDartTexture1 _lib, double secs) { - final _ret = _lib._objc_msgSend_165(_lib._class_NSCalendarDate1, - _lib._sel_dateWithTimeIntervalSince1970_1, secs); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - static NSCalendarDate dateWithTimeInterval_sinceDate_( - ThermionDartTexture1 _lib, double secsToBeAdded, NSDate date) { - final _ret = _lib._objc_msgSend_170(_lib._class_NSCalendarDate1, - _lib._sel_dateWithTimeInterval_sinceDate_1, secsToBeAdded, date._id); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - static NSDate getNow(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_171(_lib._class_NSCalendarDate1, _lib._sel_now1); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - @override - NSCalendarDate initWithTimeIntervalSinceNow_(double secs) { - final _ret = _lib._objc_msgSend_165( - _id, _lib._sel_initWithTimeIntervalSinceNow_1, secs); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - @override - NSCalendarDate initWithTimeIntervalSince1970_(double secs) { - final _ret = _lib._objc_msgSend_165( - _id, _lib._sel_initWithTimeIntervalSince1970_1, secs); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - @override - NSCalendarDate initWithTimeInterval_sinceDate_( - double secsToBeAdded, NSDate date) { - final _ret = _lib._objc_msgSend_170(_id, - _lib._sel_initWithTimeInterval_sinceDate_1, secsToBeAdded, date._id); - return NSCalendarDate._(_ret, _lib, retain: true, release: true); - } - - static NSObject? dateWithNaturalLanguageString_locale_( - ThermionDartTexture1 _lib, NSString string, NSObject? locale) { - final _ret = _lib._objc_msgSend_172( - _lib._class_NSCalendarDate1, - _lib._sel_dateWithNaturalLanguageString_locale_1, - string._id, - locale?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? dateWithNaturalLanguageString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSCalendarDate1, - _lib._sel_dateWithNaturalLanguageString_1, string._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject dateWithString_(ThermionDartTexture1 _lib, NSString aString) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSCalendarDate1, _lib._sel_dateWithString_1, aString._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSCalendarDate new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_new1); - return NSCalendarDate._(_ret, _lib, retain: false, release: true); - } - - static NSCalendarDate allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSCalendarDate1, _lib._sel_allocWithZone_1, zone); - return NSCalendarDate._(_ret, _lib, retain: false, release: true); - } - - static NSCalendarDate alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_alloc1); - return NSCalendarDate._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSCalendarDate1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSCalendarDate1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSCalendarDate1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSCalendarDate1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSCalendarDate1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSCalendarDate1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSCalendarDate1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSCalendarDate1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSCalendarDate1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSTimeZone extends NSObject { - NSTimeZone._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSTimeZone] that points to the same underlying object as [other]. - static NSTimeZone castFrom(T other) { - return NSTimeZone._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSTimeZone] that wraps the given raw object pointer. - static NSTimeZone castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSTimeZone._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSTimeZone]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTimeZone1); - } - - NSString get name { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_name1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSData get data { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_data1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - int secondsFromGMTForDate_(NSDate aDate) { - return _lib._objc_msgSend_175( - _id, _lib._sel_secondsFromGMTForDate_1, aDate._id); - } - - NSString? abbreviationForDate_(NSDate aDate) { - final _ret = - _lib._objc_msgSend_176(_id, _lib._sel_abbreviationForDate_1, aDate._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool isDaylightSavingTimeForDate_(NSDate aDate) { - return _lib._objc_msgSend_169( - _id, _lib._sel_isDaylightSavingTimeForDate_1, aDate._id); - } - - double daylightSavingTimeOffsetForDate_(NSDate aDate) { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_166_fpret( - _id, _lib._sel_daylightSavingTimeOffsetForDate_1, aDate._id) - : _lib._objc_msgSend_166( - _id, _lib._sel_daylightSavingTimeOffsetForDate_1, aDate._id); - } - - NSDate? nextDaylightSavingTimeTransitionAfterDate_(NSDate aDate) { - final _ret = _lib._objc_msgSend_177( - _id, _lib._sel_nextDaylightSavingTimeTransitionAfterDate_1, aDate._id); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSTimeZone getSystemTimeZone(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_178( - _lib._class_NSTimeZone1, _lib._sel_systemTimeZone1); - return NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - static void resetSystemTimeZone(ThermionDartTexture1 _lib) { - _lib._objc_msgSend_1( - _lib._class_NSTimeZone1, _lib._sel_resetSystemTimeZone1); - } - - static NSTimeZone getDefaultTimeZone(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_178( - _lib._class_NSTimeZone1, _lib._sel_defaultTimeZone1); - return NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - static void setDefaultTimeZone(ThermionDartTexture1 _lib, NSTimeZone value) { - return _lib._objc_msgSend_179( - _lib._class_NSTimeZone1, _lib._sel_setDefaultTimeZone_1, value._id); - } - - static NSTimeZone getLocalTimeZone(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_178( - _lib._class_NSTimeZone1, _lib._sel_localTimeZone1); - return NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - static NSArray getKnownTimeZoneNames(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSTimeZone1, _lib._sel_knownTimeZoneNames1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary getAbbreviationDictionary(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_180( - _lib._class_NSTimeZone1, _lib._sel_abbreviationDictionary1); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static void setAbbreviationDictionary( - ThermionDartTexture1 _lib, NSDictionary value) { - return _lib._objc_msgSend_181(_lib._class_NSTimeZone1, - _lib._sel_setAbbreviationDictionary_1, value._id); - } - - static NSString getTimeZoneDataVersion(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_21( - _lib._class_NSTimeZone1, _lib._sel_timeZoneDataVersion1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int get secondsFromGMT { - return _lib._objc_msgSend_82(_id, _lib._sel_secondsFromGMT1); - } - - NSString? get abbreviation { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_abbreviation1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool get daylightSavingTime { - return _lib._objc_msgSend_12(_id, _lib._sel_isDaylightSavingTime1); - } - - double get daylightSavingTimeOffset { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_daylightSavingTimeOffset1) - : _lib._objc_msgSend_164(_id, _lib._sel_daylightSavingTimeOffset1); - } - - NSDate? get nextDaylightSavingTimeTransition { - final _ret = _lib._objc_msgSend_182( - _id, _lib._sel_nextDaylightSavingTimeTransition1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSString get description { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - bool isEqualToTimeZone_(NSTimeZone aTimeZone) { - return _lib._objc_msgSend_183( - _id, _lib._sel_isEqualToTimeZone_1, aTimeZone._id); - } - - NSString? localizedName_locale_(int style, NSLocale? locale) { - final _ret = _lib._objc_msgSend_202(_id, _lib._sel_localizedName_locale_1, - style, locale?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSTimeZone? timeZoneWithName_( - ThermionDartTexture1 _lib, NSString tzName) { - final _ret = _lib._objc_msgSend_38( - _lib._class_NSTimeZone1, _lib._sel_timeZoneWithName_1, tzName._id); - return _ret.address == 0 - ? null - : NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - static NSTimeZone? timeZoneWithName_data_( - ThermionDartTexture1 _lib, NSString tzName, NSData? aData) { - final _ret = _lib._objc_msgSend_203( - _lib._class_NSTimeZone1, - _lib._sel_timeZoneWithName_data_1, - tzName._id, - aData?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - NSTimeZone? initWithName_(NSString tzName) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_initWithName_1, tzName._id); - return _ret.address == 0 - ? null - : NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - NSTimeZone? initWithName_data_(NSString tzName, NSData? aData) { - final _ret = _lib._objc_msgSend_203(_id, _lib._sel_initWithName_data_1, - tzName._id, aData?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - static NSTimeZone timeZoneForSecondsFromGMT_( - ThermionDartTexture1 _lib, int seconds) { - final _ret = _lib._objc_msgSend_204(_lib._class_NSTimeZone1, - _lib._sel_timeZoneForSecondsFromGMT_1, seconds); - return NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - static NSTimeZone? timeZoneWithAbbreviation_( - ThermionDartTexture1 _lib, NSString abbreviation) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSTimeZone1, - _lib._sel_timeZoneWithAbbreviation_1, abbreviation._id); - return _ret.address == 0 - ? null - : NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - @override - NSTimeZone init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - static NSTimeZone new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSTimeZone1, _lib._sel_new1); - return NSTimeZone._(_ret, _lib, retain: false, release: true); - } - - static NSTimeZone allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSTimeZone1, _lib._sel_allocWithZone_1, zone); - return NSTimeZone._(_ret, _lib, retain: false, release: true); - } - - static NSTimeZone alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSTimeZone1, _lib._sel_alloc1); - return NSTimeZone._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSTimeZone1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSTimeZone1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSTimeZone1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSTimeZone1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSTimeZone1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSTimeZone1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSTimeZone1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSTimeZone1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSTimeZone1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSTimeZoneNameStyle { - static const int NSTimeZoneNameStyleStandard = 0; - static const int NSTimeZoneNameStyleShortStandard = 1; - static const int NSTimeZoneNameStyleDaylightSaving = 2; - static const int NSTimeZoneNameStyleShortDaylightSaving = 3; - static const int NSTimeZoneNameStyleGeneric = 4; - static const int NSTimeZoneNameStyleShortGeneric = 5; -} - -class NSLocale extends NSObject { - NSLocale._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSLocale] that points to the same underlying object as [other]. - static NSLocale castFrom(T other) { - return NSLocale._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSLocale] that wraps the given raw object pointer. - static NSLocale castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSLocale._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSLocale]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSLocale1); - } - - NSObject? objectForKey_(NSString key) { - final _ret = _lib._objc_msgSend_38(_id, _lib._sel_objectForKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSString? displayNameForKey_value_(NSString key, NSObject value) { - final _ret = _lib._objc_msgSend_184( - _id, _lib._sel_displayNameForKey_value_1, key._id, value._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSLocale initWithLocaleIdentifier_(NSString string) { - final _ret = _lib._objc_msgSend_31( - _id, _lib._sel_initWithLocaleIdentifier_1, string._id); - return NSLocale._(_ret, _lib, retain: true, release: true); - } - - NSLocale? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSLocale._(_ret, _lib, retain: true, release: true); - } - - NSString get localeIdentifier { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_localeIdentifier1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString localizedStringForLocaleIdentifier_(NSString localeIdentifier) { - final _ret = _lib._objc_msgSend_68(_id, - _lib._sel_localizedStringForLocaleIdentifier_1, localeIdentifier._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get languageCode { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_languageCode1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? localizedStringForLanguageCode_(NSString languageCode) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_localizedStringForLanguageCode_1, languageCode._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get countryCode { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_countryCode1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? localizedStringForCountryCode_(NSString countryCode) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_localizedStringForCountryCode_1, countryCode._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get scriptCode { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_scriptCode1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? localizedStringForScriptCode_(NSString scriptCode) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_localizedStringForScriptCode_1, scriptCode._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get variantCode { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_variantCode1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? localizedStringForVariantCode_(NSString variantCode) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_localizedStringForVariantCode_1, variantCode._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSCharacterSet get exemplarCharacterSet { - final _ret = _lib._objc_msgSend_186(_id, _lib._sel_exemplarCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - NSString get calendarIdentifier { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_calendarIdentifier1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? localizedStringForCalendarIdentifier_(NSString calendarIdentifier) { - final _ret = _lib._objc_msgSend_185( - _id, - _lib._sel_localizedStringForCalendarIdentifier_1, - calendarIdentifier._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get collationIdentifier { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_collationIdentifier1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? localizedStringForCollationIdentifier_( - NSString collationIdentifier) { - final _ret = _lib._objc_msgSend_185( - _id, - _lib._sel_localizedStringForCollationIdentifier_1, - collationIdentifier._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool get usesMetricSystem { - return _lib._objc_msgSend_12(_id, _lib._sel_usesMetricSystem1); - } - - NSString get decimalSeparator { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_decimalSeparator1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get groupingSeparator { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_groupingSeparator1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get currencySymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_currencySymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get currencyCode { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_currencyCode1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? localizedStringForCurrencyCode_(NSString currencyCode) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_localizedStringForCurrencyCode_1, currencyCode._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get collatorIdentifier { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_collatorIdentifier1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? localizedStringForCollatorIdentifier_(NSString collatorIdentifier) { - final _ret = _lib._objc_msgSend_185( - _id, - _lib._sel_localizedStringForCollatorIdentifier_1, - collatorIdentifier._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get quotationBeginDelimiter { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_quotationBeginDelimiter1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get quotationEndDelimiter { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_quotationEndDelimiter1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get alternateQuotationBeginDelimiter { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_alternateQuotationBeginDelimiter1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get alternateQuotationEndDelimiter { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_alternateQuotationEndDelimiter1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSLocale getAutoupdatingCurrentLocale(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_196( - _lib._class_NSLocale1, _lib._sel_autoupdatingCurrentLocale1); - return NSLocale._(_ret, _lib, retain: true, release: true); - } - - static NSLocale getCurrentLocale(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_196(_lib._class_NSLocale1, _lib._sel_currentLocale1); - return NSLocale._(_ret, _lib, retain: true, release: true); - } - - static NSLocale getSystemLocale(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_196(_lib._class_NSLocale1, _lib._sel_systemLocale1); - return NSLocale._(_ret, _lib, retain: true, release: true); - } - - static NSLocale localeWithLocaleIdentifier_( - ThermionDartTexture1 _lib, NSString ident) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSLocale1, - _lib._sel_localeWithLocaleIdentifier_1, ident._id); - return NSLocale._(_ret, _lib, retain: true, release: true); - } - - @override - NSLocale init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSLocale._(_ret, _lib, retain: true, release: true); - } - - static NSArray getAvailableLocaleIdentifiers(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSLocale1, _lib._sel_availableLocaleIdentifiers1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray getISOLanguageCodes(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSLocale1, _lib._sel_ISOLanguageCodes1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray getISOCountryCodes(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSLocale1, _lib._sel_ISOCountryCodes1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray getISOCurrencyCodes(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSLocale1, _lib._sel_ISOCurrencyCodes1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray getCommonISOCurrencyCodes(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSLocale1, _lib._sel_commonISOCurrencyCodes1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray getPreferredLanguages(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSLocale1, _lib._sel_preferredLanguages1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary componentsFromLocaleIdentifier_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_197(_lib._class_NSLocale1, - _lib._sel_componentsFromLocaleIdentifier_1, string._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSString localeIdentifierFromComponents_( - ThermionDartTexture1 _lib, NSDictionary dict) { - final _ret = _lib._objc_msgSend_198(_lib._class_NSLocale1, - _lib._sel_localeIdentifierFromComponents_1, dict._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString canonicalLocaleIdentifierFromString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_68(_lib._class_NSLocale1, - _lib._sel_canonicalLocaleIdentifierFromString_1, string._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString canonicalLanguageIdentifierFromString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_68(_lib._class_NSLocale1, - _lib._sel_canonicalLanguageIdentifierFromString_1, string._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? localeIdentifierFromWindowsLocaleCode_( - ThermionDartTexture1 _lib, int lcid) { - final _ret = _lib._objc_msgSend_199(_lib._class_NSLocale1, - _lib._sel_localeIdentifierFromWindowsLocaleCode_1, lcid); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static int windowsLocaleCodeFromLocaleIdentifier_( - ThermionDartTexture1 _lib, NSString localeIdentifier) { - return _lib._objc_msgSend_200( - _lib._class_NSLocale1, - _lib._sel_windowsLocaleCodeFromLocaleIdentifier_1, - localeIdentifier._id); - } - - static int characterDirectionForLanguage_( - ThermionDartTexture1 _lib, NSString isoLangCode) { - return _lib._objc_msgSend_201(_lib._class_NSLocale1, - _lib._sel_characterDirectionForLanguage_1, isoLangCode._id); - } - - static int lineDirectionForLanguage_( - ThermionDartTexture1 _lib, NSString isoLangCode) { - return _lib._objc_msgSend_201(_lib._class_NSLocale1, - _lib._sel_lineDirectionForLanguage_1, isoLangCode._id); - } - - static NSLocale new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSLocale1, _lib._sel_new1); - return NSLocale._(_ret, _lib, retain: false, release: true); - } - - static NSLocale allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSLocale1, _lib._sel_allocWithZone_1, zone); - return NSLocale._(_ret, _lib, retain: false, release: true); - } - - static NSLocale alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSLocale1, _lib._sel_alloc1); - return NSLocale._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSLocale1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSLocale1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSLocale1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSLocale1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSLocale1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSLocale1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSLocale1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSLocale1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSLocale1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSCharacterSet extends NSObject { - NSCharacterSet._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSCharacterSet] that points to the same underlying object as [other]. - static NSCharacterSet castFrom(T other) { - return NSCharacterSet._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSCharacterSet] that wraps the given raw object pointer. - static NSCharacterSet castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSCharacterSet._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSCharacterSet]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSCharacterSet1); - } - - static NSCharacterSet getControlCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_controlCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getWhitespaceCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_whitespaceCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getWhitespaceAndNewlineCharacterSet( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186(_lib._class_NSCharacterSet1, - _lib._sel_whitespaceAndNewlineCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getDecimalDigitCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_decimalDigitCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getLetterCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_letterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getLowercaseLetterCharacterSet( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_lowercaseLetterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getUppercaseLetterCharacterSet( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_uppercaseLetterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getNonBaseCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_nonBaseCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getAlphanumericCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_alphanumericCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getDecomposableCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_decomposableCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getIllegalCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_illegalCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getPunctuationCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_punctuationCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getCapitalizedLetterCharacterSet( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_capitalizedLetterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getSymbolCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_symbolCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getNewlineCharacterSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_newlineCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: false, release: true); - } - - static NSCharacterSet characterSetWithRange_( - ThermionDartTexture1 _lib, _NSRange aRange) { - final _ret = _lib._objc_msgSend_187( - _lib._class_NSCharacterSet1, _lib._sel_characterSetWithRange_1, aRange); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet characterSetWithCharactersInString_( - ThermionDartTexture1 _lib, NSString aString) { - final _ret = _lib._objc_msgSend_188(_lib._class_NSCharacterSet1, - _lib._sel_characterSetWithCharactersInString_1, aString._id); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet characterSetWithBitmapRepresentation_( - ThermionDartTexture1 _lib, NSData data) { - final _ret = _lib._objc_msgSend_189(_lib._class_NSCharacterSet1, - _lib._sel_characterSetWithBitmapRepresentation_1, data._id); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet? characterSetWithContentsOfFile_( - ThermionDartTexture1 _lib, NSString fName) { - final _ret = _lib._objc_msgSend_190(_lib._class_NSCharacterSet1, - _lib._sel_characterSetWithContentsOfFile_1, fName._id); - return _ret.address == 0 - ? null - : NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - NSCharacterSet initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_191(_id, _lib._sel_initWithCoder_1, coder._id); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - bool characterIsMember_(int aCharacter) { - return _lib._objc_msgSend_192( - _id, _lib._sel_characterIsMember_1, aCharacter); - } - - NSData get bitmapRepresentation { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_bitmapRepresentation1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSCharacterSet get invertedSet { - final _ret = _lib._objc_msgSend_186(_id, _lib._sel_invertedSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - bool longCharacterIsMember_(int theLongChar) { - return _lib._objc_msgSend_193( - _id, _lib._sel_longCharacterIsMember_1, theLongChar); - } - - bool isSupersetOfSet_(NSCharacterSet theOtherSet) { - return _lib._objc_msgSend_194( - _id, _lib._sel_isSupersetOfSet_1, theOtherSet._id); - } - - bool hasMemberInPlane_(int thePlane) { - return _lib._objc_msgSend_195(_id, _lib._sel_hasMemberInPlane_1, thePlane); - } - - static NSCharacterSet getURLUserAllowedCharacterSet( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_URLUserAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getURLPasswordAllowedCharacterSet( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_URLPasswordAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getURLHostAllowedCharacterSet( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_URLHostAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getURLPathAllowedCharacterSet( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_URLPathAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getURLQueryAllowedCharacterSet( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_URLQueryAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getURLFragmentAllowedCharacterSet( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSCharacterSet1, _lib._sel_URLFragmentAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSCharacterSet init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSCharacterSet1, _lib._sel_new1); - return NSCharacterSet._(_ret, _lib, retain: false, release: true); - } - - static NSCharacterSet allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSCharacterSet1, _lib._sel_allocWithZone_1, zone); - return NSCharacterSet._(_ret, _lib, retain: false, release: true); - } - - static NSCharacterSet alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSCharacterSet1, _lib._sel_alloc1); - return NSCharacterSet._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSCharacterSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSCharacterSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSCharacterSet1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSCharacterSet1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSCharacterSet1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSCharacterSet1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSCharacterSet1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSCharacterSet1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSCharacterSet1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSLocaleLanguageDirection { - static const int NSLocaleLanguageDirectionUnknown = 0; - static const int NSLocaleLanguageDirectionLeftToRight = 1; - static const int NSLocaleLanguageDirectionRightToLeft = 2; - static const int NSLocaleLanguageDirectionTopToBottom = 3; - static const int NSLocaleLanguageDirectionBottomToTop = 4; -} - -abstract class NSURLBookmarkCreationOptions { - static const int NSURLBookmarkCreationPreferFileIDResolution = 256; - static const int NSURLBookmarkCreationMinimalBookmark = 512; - static const int NSURLBookmarkCreationSuitableForBookmarkFile = 1024; - static const int NSURLBookmarkCreationWithSecurityScope = 2048; - static const int NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess = 4096; - static const int NSURLBookmarkCreationWithoutImplicitSecurityScope = - 536870912; -} - -abstract class NSURLBookmarkResolutionOptions { - static const int NSURLBookmarkResolutionWithoutUI = 256; - static const int NSURLBookmarkResolutionWithoutMounting = 512; - static const int NSURLBookmarkResolutionWithSecurityScope = 1024; - static const int NSURLBookmarkResolutionWithoutImplicitStartAccessing = 32768; -} - -class NSURLHandle extends NSObject { - NSURLHandle._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLHandle] that points to the same underlying object as [other]. - static NSURLHandle castFrom(T other) { - return NSURLHandle._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSURLHandle] that wraps the given raw object pointer. - static NSURLHandle castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLHandle._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLHandle]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLHandle1); - } - - static void registerURLHandleClass_( - ThermionDartTexture1 _lib, NSObject anURLHandleSubclass) { - _lib._objc_msgSend_15(_lib._class_NSURLHandle1, - _lib._sel_registerURLHandleClass_1, anURLHandleSubclass._id); - } - - static NSObject URLHandleClassForURL_( - ThermionDartTexture1 _lib, NSURL anURL) { - final _ret = _lib._objc_msgSend_261( - _lib._class_NSURLHandle1, _lib._sel_URLHandleClassForURL_1, anURL._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - int status() { - return _lib._objc_msgSend_262(_id, _lib._sel_status1); - } - - NSString failureReason() { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_failureReason1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void addClient_(NSObject client) { - _lib._objc_msgSend_15(_id, _lib._sel_addClient_1, client._id); - } - - void removeClient_(NSObject client) { - _lib._objc_msgSend_15(_id, _lib._sel_removeClient_1, client._id); - } - - void loadInBackground() { - _lib._objc_msgSend_1(_id, _lib._sel_loadInBackground1); - } - - void cancelLoadInBackground() { - _lib._objc_msgSend_1(_id, _lib._sel_cancelLoadInBackground1); - } - - NSData resourceData() { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_resourceData1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSData availableResourceData() { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_availableResourceData1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - int expectedResourceDataSize() { - return _lib._objc_msgSend_237(_id, _lib._sel_expectedResourceDataSize1); - } - - void flushCachedData() { - _lib._objc_msgSend_1(_id, _lib._sel_flushCachedData1); - } - - void backgroundLoadDidFailWithReason_(NSString reason) { - _lib._objc_msgSend_247( - _id, _lib._sel_backgroundLoadDidFailWithReason_1, reason._id); - } - - void didLoadBytes_loadComplete_(NSData newBytes, bool yorn) { - _lib._objc_msgSend_263( - _id, _lib._sel_didLoadBytes_loadComplete_1, newBytes._id, yorn); - } - - static bool canInitWithURL_(ThermionDartTexture1 _lib, NSURL anURL) { - return _lib._objc_msgSend_264( - _lib._class_NSURLHandle1, _lib._sel_canInitWithURL_1, anURL._id); - } - - static NSURLHandle cachedHandleForURL_( - ThermionDartTexture1 _lib, NSURL anURL) { - final _ret = _lib._objc_msgSend_265( - _lib._class_NSURLHandle1, _lib._sel_cachedHandleForURL_1, anURL._id); - return NSURLHandle._(_ret, _lib, retain: true, release: true); - } - - NSObject initWithURL_cached_(NSURL anURL, bool willCache) { - final _ret = _lib._objc_msgSend_266( - _id, _lib._sel_initWithURL_cached_1, anURL._id, willCache); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject propertyForKey_(NSString propertyKey) { - final _ret = - _lib._objc_msgSend_31(_id, _lib._sel_propertyForKey_1, propertyKey._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject propertyForKeyIfAvailable_(NSString propertyKey) { - final _ret = _lib._objc_msgSend_31( - _id, _lib._sel_propertyForKeyIfAvailable_1, propertyKey._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - bool writeProperty_forKey_(NSObject propertyValue, NSString propertyKey) { - return _lib._objc_msgSend_260(_id, _lib._sel_writeProperty_forKey_1, - propertyValue._id, propertyKey._id); - } - - bool writeData_(NSData data) { - return _lib._objc_msgSend_24(_id, _lib._sel_writeData_1, data._id); - } - - NSData loadInForeground() { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_loadInForeground1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - void beginLoadInBackground() { - _lib._objc_msgSend_1(_id, _lib._sel_beginLoadInBackground1); - } - - void endLoadInBackground() { - _lib._objc_msgSend_1(_id, _lib._sel_endLoadInBackground1); - } - - @override - NSURLHandle init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLHandle._(_ret, _lib, retain: true, release: true); - } - - static NSURLHandle new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLHandle1, _lib._sel_new1); - return NSURLHandle._(_ret, _lib, retain: false, release: true); - } - - static NSURLHandle allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLHandle1, _lib._sel_allocWithZone_1, zone); - return NSURLHandle._(_ret, _lib, retain: false, release: true); - } - - static NSURLHandle alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLHandle1, _lib._sel_alloc1); - return NSURLHandle._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLHandle1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLHandle1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLHandle1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLHandle1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLHandle1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLHandle1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLHandle1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSURLHandle1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLHandle1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSURLHandleStatus { - static const int NSURLHandleNotLoaded = 0; - static const int NSURLHandleLoadSucceeded = 1; - static const int NSURLHandleLoadInProgress = 2; - static const int NSURLHandleLoadFailed = 3; -} - -abstract class NSDataWritingOptions { - static const int NSDataWritingAtomic = 1; - static const int NSDataWritingWithoutOverwriting = 2; - static const int NSDataWritingFileProtectionNone = 268435456; - static const int NSDataWritingFileProtectionComplete = 536870912; - static const int NSDataWritingFileProtectionCompleteUnlessOpen = 805306368; - static const int - NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication = - 1073741824; - static const int NSDataWritingFileProtectionMask = 4026531840; - static const int NSAtomicWrite = 1; -} - -abstract class NSDataSearchOptions { - static const int NSDataSearchBackwards = 1; - static const int NSDataSearchAnchored = 2; -} - -void _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, _NSRange, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistry = , _NSRange, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_registerClosure( - void Function(ffi.Pointer, _NSRange, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_ffiVoid_NSRange_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ffiVoid_NSRange_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ffiVoid_NSRange_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ffiVoid_NSRange_bool.fromFunction(ThermionDartTexture1 lib, - void Function(ffi.Pointer, _NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_registerClosure( - (ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2) => - fn(arg0, arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ffiVoid_NSRange_bool.listener(ThermionDartTexture1 lib, - void Function(ffi.Pointer, _NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_registerClosure( - (ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2) => - fn(arg0, arg1, arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - _NSRange, ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - _NSRange, ffi.Pointer)>()(_id, arg0, arg1, arg2); -} - -abstract class NSDataReadingOptions { - static const int NSDataReadingMappedIfSafe = 1; - static const int NSDataReadingUncached = 2; - static const int NSDataReadingMappedAlways = 8; - static const int NSDataReadingMapped = 1; - static const int NSMappedRead = 1; - static const int NSUncachedRead = 2; -} - -void _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, ffi.UnsignedLong arg1)>>() - .asFunction, int)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureRegistry = - , int)>{}; -int _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_registerClosure( - void Function(ffi.Pointer, int) fn) { - final id = ++_ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureRegistryIndex; - _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) => - _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, ffi.UnsignedLong arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, ffi.UnsignedLong)>( - _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong.fromFunction( - ThermionDartTexture1 lib, void Function(ffi.Pointer, int) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, ffi.UnsignedLong)>( - _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_registerClosure( - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong.listener( - ThermionDartTexture1 lib, void Function(ffi.Pointer, int) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.UnsignedLong)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_registerClosure( - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.UnsignedLong)>? _dartFuncListenerTrampoline; - - void call(ffi.Pointer arg0, int arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.UnsignedLong arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - int)>()(_id, arg0, arg1); -} - -abstract class NSDataBase64DecodingOptions { - static const int NSDataBase64DecodingIgnoreUnknownCharacters = 1; -} - -abstract class NSDataBase64EncodingOptions { - static const int NSDataBase64Encoding64CharacterLineLength = 1; - static const int NSDataBase64Encoding76CharacterLineLength = 2; - static const int NSDataBase64EncodingEndLineWithCarriageReturn = 16; - static const int NSDataBase64EncodingEndLineWithLineFeed = 32; -} - -abstract class NSDataCompressionAlgorithm { - static const int NSDataCompressionAlgorithmLZFSE = 0; - static const int NSDataCompressionAlgorithmLZ4 = 1; - static const int NSDataCompressionAlgorithmLZMA = 2; - static const int NSDataCompressionAlgorithmZlib = 3; -} - -abstract class NSDecodingFailurePolicy { - static const int NSDecodingFailurePolicyRaiseException = 0; - static const int NSDecodingFailurePolicySetErrorAndReturn = 1; -} - -abstract class NSStringCompareOptions { - static const int NSCaseInsensitiveSearch = 1; - static const int NSLiteralSearch = 2; - static const int NSBackwardsSearch = 4; - static const int NSAnchoredSearch = 8; - static const int NSNumericSearch = 64; - static const int NSDiacriticInsensitiveSearch = 128; - static const int NSWidthInsensitiveSearch = 256; - static const int NSForcedOrderingSearch = 512; - static const int NSRegularExpressionSearch = 1024; -} - -abstract class NSStringEnumerationOptions { - static const int NSStringEnumerationByLines = 0; - static const int NSStringEnumerationByParagraphs = 1; - static const int NSStringEnumerationByComposedCharacterSequences = 2; - static const int NSStringEnumerationByWords = 3; - static const int NSStringEnumerationBySentences = 4; - static const int NSStringEnumerationByCaretPositions = 5; - static const int NSStringEnumerationByDeletionClusters = 6; - static const int NSStringEnumerationReverse = 256; - static const int NSStringEnumerationSubstringNotRequired = 512; - static const int NSStringEnumerationLocalized = 1024; -} - -void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - _NSRange arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, - _NSRange arg2, ffi.Pointer arg3)>>() - .asFunction< - void Function(ffi.Pointer, _NSRange, _NSRange, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -final _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistry = , _NSRange, _NSRange, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_registerClosure( - void Function(ffi.Pointer, _NSRange, _NSRange, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - _NSRange arg2, - ffi.Pointer arg3) => - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2, arg3); - -class ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, - _NSRange arg2, ffi.Pointer arg3)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - _NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool.fromFunction( - ThermionDartTexture1 lib, - void Function(NSString?, _NSRange, _NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - _NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_registerClosure( - (ffi.Pointer arg0, _NSRange arg1, _NSRange arg2, - ffi.Pointer arg3) => - fn(arg0.address == 0 ? null : NSString._(arg0, lib, retain: true, release: true), arg1, arg2, arg3))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool.listener( - ThermionDartTexture1 lib, - void Function(NSString?, _NSRange, _NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - _NSRange, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_registerClosure( - (ffi.Pointer arg0, _NSRange arg1, _NSRange arg2, - ffi.Pointer arg3) => - fn(arg0.address == 0 ? null : NSString._(arg0, lib, retain: true, release: true), arg1, arg2, arg3))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - _NSRange, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSString? arg0, _NSRange arg1, _NSRange arg2, - ffi.Pointer arg3) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - _NSRange arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - _NSRange, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1, arg2, arg3); -} - -void _ObjCBlock_ffiVoid_NSString_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function( - ffi.Pointer, ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSString_bool_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSString_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSString_bool_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSString_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSString_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSString_bool_closureRegistry[block.ref.target.address]!( - arg0, arg1); - -class ObjCBlock_ffiVoid_NSString_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSString_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSString_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSString_bool.fromFunction(ThermionDartTexture1 lib, - void Function(NSString, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSString_bool_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(NSString._(arg0, lib, retain: true, release: true), - arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSString_bool.listener(ThermionDartTexture1 lib, - void Function(NSString, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSString_bool_registerClosure( - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn(NSString._(arg0, lib, retain: true, release: true), - arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSString arg0, ffi.Pointer arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1); -} - -abstract class NSStringEncodingConversionOptions { - static const int NSStringEncodingConversionAllowLossy = 1; - static const int NSStringEncodingConversionExternalRepresentation = 2; -} - -void _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.UnsignedLong arg1)>>() - .asFunction, int)>()( - arg0, arg1); -final _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureRegistry = - , int)>{}; -int _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_registerClosure( - void Function(ffi.Pointer, int) fn) { - final id = - ++_ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureRegistryIndex; - _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1) => - _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.UnsignedLong arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.UnsignedLong)>( - _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong.fromFunction( - ThermionDartTexture1 lib, - void Function(ffi.Pointer, int) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.UnsignedLong)>( - _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_registerClosure( - (ffi.Pointer arg0, int arg1) => - fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong.listener( - ThermionDartTexture1 lib, - void Function(ffi.Pointer, int) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.UnsignedLong)>.listener( - _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_registerClosure( - (ffi.Pointer arg0, int arg1) => - fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.UnsignedLong)>? _dartFuncListenerTrampoline; - - void call(ffi.Pointer arg0, int arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.UnsignedLong arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - int)>()(_id, arg0, arg1); -} - -abstract class NSLinguisticTaggerOptions { - static const int NSLinguisticTaggerOmitWords = 1; - static const int NSLinguisticTaggerOmitPunctuation = 2; - static const int NSLinguisticTaggerOmitWhitespace = 4; - static const int NSLinguisticTaggerOmitOther = 8; - static const int NSLinguisticTaggerJoinNames = 16; -} - -class NSOrthography extends NSObject { - NSOrthography._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSOrthography] that points to the same underlying object as [other]. - static NSOrthography castFrom(T other) { - return NSOrthography._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSOrthography] that wraps the given raw object pointer. - static NSOrthography castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSOrthography._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSOrthography]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOrthography1); - } - - NSString get dominantScript { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_dominantScript1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSDictionary get languageMap { - final _ret = _lib._objc_msgSend_180(_id, _lib._sel_languageMap1); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSOrthography initWithDominantScript_languageMap_( - NSString script, NSDictionary map) { - final _ret = _lib._objc_msgSend_399(_id, - _lib._sel_initWithDominantScript_languageMap_1, script._id, map._id); - return NSOrthography._(_ret, _lib, retain: true, release: true); - } - - NSOrthography? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSOrthography._(_ret, _lib, retain: true, release: true); - } - - NSArray? languagesForScript_(NSString script) { - final _ret = - _lib._objc_msgSend_131(_id, _lib._sel_languagesForScript_1, script._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? dominantLanguageForScript_(NSString script) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_dominantLanguageForScript_1, script._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get dominantLanguage { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_dominantLanguage1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray get allScripts { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_allScripts1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get allLanguages { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_allLanguages1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSOrthography defaultOrthographyForLanguage_( - ThermionDartTexture1 _lib, NSString language) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSOrthography1, - _lib._sel_defaultOrthographyForLanguage_1, language._id); - return NSOrthography._(_ret, _lib, retain: true, release: true); - } - - static NSOrthography orthographyWithDominantScript_languageMap_( - ThermionDartTexture1 _lib, NSString script, NSDictionary map) { - final _ret = _lib._objc_msgSend_399( - _lib._class_NSOrthography1, - _lib._sel_orthographyWithDominantScript_languageMap_1, - script._id, - map._id); - return NSOrthography._(_ret, _lib, retain: true, release: true); - } - - @override - NSOrthography init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSOrthography._(_ret, _lib, retain: true, release: true); - } - - static NSOrthography new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOrthography1, _lib._sel_new1); - return NSOrthography._(_ret, _lib, retain: false, release: true); - } - - static NSOrthography allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSOrthography1, _lib._sel_allocWithZone_1, zone); - return NSOrthography._(_ret, _lib, retain: false, release: true); - } - - static NSOrthography alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOrthography1, _lib._sel_alloc1); - return NSOrthography._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSOrthography1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSOrthography1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSOrthography1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSOrthography1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSOrthography1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSOrthography1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSOrthography1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSOrthography1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOrthography1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_ObjCObject_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function( - ffi.Pointer, ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_ObjCObject_bool_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ObjCObject_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ObjCObject_bool_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_ObjCObject_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_ObjCObject_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_ObjCObject_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_ObjCObject_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ObjCObject_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_bool.fromFunction(ThermionDartTexture1 lib, - void Function(NSObject, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_bool_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(NSObject._(arg0, lib, retain: true, release: true), - arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ObjCObject_bool.listener(ThermionDartTexture1 lib, - void Function(NSObject, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ObjCObject_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_bool_registerClosure( - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn(NSObject._(arg0, lib, retain: true, release: true), - arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSObject arg0, ffi.Pointer arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1); -} - -bool _ObjCBlock_bool_ObjCObject_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function( - ffi.Pointer, ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_bool_ObjCObject_bool_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_bool_ObjCObject_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_bool_ObjCObject_bool_registerClosure( - bool Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_bool_ObjCObject_bool_closureRegistryIndex; - _ObjCBlock_bool_ObjCObject_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_ObjCObject_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_bool_ObjCObject_bool_closureRegistry[block.ref.target.address]!( - arg0, arg1); - -class ObjCBlock_bool_ObjCObject_bool extends _ObjCBlockBase { - ObjCBlock_bool_ObjCObject_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ObjCObject_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_bool_fnPtrTrampoline, false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_ObjCObject_bool.fromFunction(ThermionDartTexture1 lib, - bool Function(NSObject, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_bool_closureTrampoline, false) - .cast(), - _ObjCBlock_bool_ObjCObject_bool_registerClosure( - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn(NSObject._(arg0, lib, retain: true, release: true), arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(NSObject arg0, ffi.Pointer arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1); -} - -class NSFileManager extends NSObject { - NSFileManager._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSFileManager] that points to the same underlying object as [other]. - static NSFileManager castFrom(T other) { - return NSFileManager._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSFileManager] that wraps the given raw object pointer. - static NSFileManager castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSFileManager._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSFileManager]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileManager1); - } - - static NSFileManager getDefaultManager(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_430( - _lib._class_NSFileManager1, _lib._sel_defaultManager1); - return NSFileManager._(_ret, _lib, retain: true, release: true); - } - - NSArray? mountedVolumeURLsIncludingResourceValuesForKeys_options_( - NSArray? propertyKeys, int options) { - final _ret = _lib._objc_msgSend_431( - _id, - _lib._sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_1, - propertyKeys?._id ?? ffi.nullptr, - options); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - void unmountVolumeAtURL_options_completionHandler_( - NSURL url, int mask, ObjCBlock_ffiVoid_NSError completionHandler) { - _lib._objc_msgSend_432( - _id, - _lib._sel_unmountVolumeAtURL_options_completionHandler_1, - url._id, - mask, - completionHandler._id); - } - - NSArray? contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_( - NSURL url, - NSArray? keys, - int mask, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_433( - _id, - _lib._sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_1, - url._id, - keys?._id ?? ffi.nullptr, - mask, - error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray URLsForDirectory_inDomains_(int directory, int domainMask) { - final _ret = _lib._objc_msgSend_434( - _id, _lib._sel_URLsForDirectory_inDomains_1, directory, domainMask); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSURL? URLForDirectory_inDomain_appropriateForURL_create_error_( - int directory, - int domain, - NSURL? url, - bool shouldCreate, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_435( - _id, - _lib._sel_URLForDirectory_inDomain_appropriateForURL_create_error_1, - directory, - domain, - url?._id ?? ffi.nullptr, - shouldCreate, - error); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - bool getRelationship_ofDirectoryAtURL_toItemAtURL_error_( - ffi.Pointer outRelationship, - NSURL directoryURL, - NSURL otherURL, - ffi.Pointer> error) { - return _lib._objc_msgSend_436( - _id, - _lib._sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_1, - outRelationship, - directoryURL._id, - otherURL._id, - error); - } - - bool getRelationship_ofDirectory_inDomain_toItemAtURL_error_( - ffi.Pointer outRelationship, - int directory, - int domainMask, - NSURL url, - ffi.Pointer> error) { - return _lib._objc_msgSend_437( - _id, - _lib._sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_1, - outRelationship, - directory, - domainMask, - url._id, - error); - } - - bool createDirectoryAtURL_withIntermediateDirectories_attributes_error_( - NSURL url, - bool createIntermediates, - NSDictionary? attributes, - ffi.Pointer> error) { - return _lib._objc_msgSend_438( - _id, - _lib._sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_1, - url._id, - createIntermediates, - attributes?._id ?? ffi.nullptr, - error); - } - - bool createSymbolicLinkAtURL_withDestinationURL_error_( - NSURL url, NSURL destURL, ffi.Pointer> error) { - return _lib._objc_msgSend_439( - _id, - _lib._sel_createSymbolicLinkAtURL_withDestinationURL_error_1, - url._id, - destURL._id, - error); - } - - NSObject? get delegate { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set delegate(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); - } - - bool setAttributes_ofItemAtPath_error_(NSDictionary attributes, NSString path, - ffi.Pointer> error) { - return _lib._objc_msgSend_440( - _id, - _lib._sel_setAttributes_ofItemAtPath_error_1, - attributes._id, - path._id, - error); - } - - bool createDirectoryAtPath_withIntermediateDirectories_attributes_error_( - NSString path, - bool createIntermediates, - NSDictionary? attributes, - ffi.Pointer> error) { - return _lib._objc_msgSend_441( - _id, - _lib._sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_1, - path._id, - createIntermediates, - attributes?._id ?? ffi.nullptr, - error); - } - - NSArray? contentsOfDirectoryAtPath_error_( - NSString path, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_442( - _id, _lib._sel_contentsOfDirectoryAtPath_error_1, path._id, error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray? subpathsOfDirectoryAtPath_error_( - NSString path, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_442( - _id, _lib._sel_subpathsOfDirectoryAtPath_error_1, path._id, error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? attributesOfItemAtPath_error_( - NSString path, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_443( - _id, _lib._sel_attributesOfItemAtPath_error_1, path._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? attributesOfFileSystemForPath_error_( - NSString path, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_443( - _id, _lib._sel_attributesOfFileSystemForPath_error_1, path._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - bool createSymbolicLinkAtPath_withDestinationPath_error_(NSString path, - NSString destPath, ffi.Pointer> error) { - return _lib._objc_msgSend_444( - _id, - _lib._sel_createSymbolicLinkAtPath_withDestinationPath_error_1, - path._id, - destPath._id, - error); - } - - NSString? destinationOfSymbolicLinkAtPath_error_( - NSString path, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_445(_id, - _lib._sel_destinationOfSymbolicLinkAtPath_error_1, path._id, error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool copyItemAtPath_toPath_error_(NSString srcPath, NSString dstPath, - ffi.Pointer> error) { - return _lib._objc_msgSend_444(_id, _lib._sel_copyItemAtPath_toPath_error_1, - srcPath._id, dstPath._id, error); - } - - bool moveItemAtPath_toPath_error_(NSString srcPath, NSString dstPath, - ffi.Pointer> error) { - return _lib._objc_msgSend_444(_id, _lib._sel_moveItemAtPath_toPath_error_1, - srcPath._id, dstPath._id, error); - } - - bool linkItemAtPath_toPath_error_(NSString srcPath, NSString dstPath, - ffi.Pointer> error) { - return _lib._objc_msgSend_444(_id, _lib._sel_linkItemAtPath_toPath_error_1, - srcPath._id, dstPath._id, error); - } - - bool removeItemAtPath_error_( - NSString path, ffi.Pointer> error) { - return _lib._objc_msgSend_446( - _id, _lib._sel_removeItemAtPath_error_1, path._id, error); - } - - bool copyItemAtURL_toURL_error_( - NSURL srcURL, NSURL dstURL, ffi.Pointer> error) { - return _lib._objc_msgSend_439(_id, _lib._sel_copyItemAtURL_toURL_error_1, - srcURL._id, dstURL._id, error); - } - - bool moveItemAtURL_toURL_error_( - NSURL srcURL, NSURL dstURL, ffi.Pointer> error) { - return _lib._objc_msgSend_439(_id, _lib._sel_moveItemAtURL_toURL_error_1, - srcURL._id, dstURL._id, error); - } - - bool linkItemAtURL_toURL_error_( - NSURL srcURL, NSURL dstURL, ffi.Pointer> error) { - return _lib._objc_msgSend_439(_id, _lib._sel_linkItemAtURL_toURL_error_1, - srcURL._id, dstURL._id, error); - } - - bool removeItemAtURL_error_( - NSURL URL, ffi.Pointer> error) { - return _lib._objc_msgSend_88( - _id, _lib._sel_removeItemAtURL_error_1, URL._id, error); - } - - bool trashItemAtURL_resultingItemURL_error_( - NSURL url, - ffi.Pointer> outResultingURL, - ffi.Pointer> error) { - return _lib._objc_msgSend_447( - _id, - _lib._sel_trashItemAtURL_resultingItemURL_error_1, - url._id, - outResultingURL, - error); - } - - NSDictionary? fileAttributesAtPath_traverseLink_(NSString path, bool yorn) { - final _ret = _lib._objc_msgSend_448( - _id, _lib._sel_fileAttributesAtPath_traverseLink_1, path._id, yorn); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - bool changeFileAttributes_atPath_(NSDictionary attributes, NSString path) { - return _lib._objc_msgSend_449( - _id, _lib._sel_changeFileAttributes_atPath_1, attributes._id, path._id); - } - - NSArray? directoryContentsAtPath_(NSString path) { - final _ret = _lib._objc_msgSend_131( - _id, _lib._sel_directoryContentsAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? fileSystemAttributesAtPath_(NSString path) { - final _ret = _lib._objc_msgSend_155( - _id, _lib._sel_fileSystemAttributesAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSString? pathContentOfSymbolicLinkAtPath_(NSString path) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_pathContentOfSymbolicLinkAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool createSymbolicLinkAtPath_pathContent_( - NSString path, NSString otherpath) { - return _lib._objc_msgSend_450( - _id, - _lib._sel_createSymbolicLinkAtPath_pathContent_1, - path._id, - otherpath._id); - } - - bool createDirectoryAtPath_attributes_( - NSString path, NSDictionary attributes) { - return _lib._objc_msgSend_451(_id, - _lib._sel_createDirectoryAtPath_attributes_1, path._id, attributes._id); - } - - bool linkPath_toPath_handler_( - NSString src, NSString dest, NSObject? handler) { - return _lib._objc_msgSend_452(_id, _lib._sel_linkPath_toPath_handler_1, - src._id, dest._id, handler?._id ?? ffi.nullptr); - } - - bool copyPath_toPath_handler_( - NSString src, NSString dest, NSObject? handler) { - return _lib._objc_msgSend_452(_id, _lib._sel_copyPath_toPath_handler_1, - src._id, dest._id, handler?._id ?? ffi.nullptr); - } - - bool movePath_toPath_handler_( - NSString src, NSString dest, NSObject? handler) { - return _lib._objc_msgSend_452(_id, _lib._sel_movePath_toPath_handler_1, - src._id, dest._id, handler?._id ?? ffi.nullptr); - } - - bool removeFileAtPath_handler_(NSString path, NSObject? handler) { - return _lib._objc_msgSend_453(_id, _lib._sel_removeFileAtPath_handler_1, - path._id, handler?._id ?? ffi.nullptr); - } - - NSString get currentDirectoryPath { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_currentDirectoryPath1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - bool changeCurrentDirectoryPath_(NSString path) { - return _lib._objc_msgSend_63( - _id, _lib._sel_changeCurrentDirectoryPath_1, path._id); - } - - bool fileExistsAtPath_(NSString path) { - return _lib._objc_msgSend_63(_id, _lib._sel_fileExistsAtPath_1, path._id); - } - - bool fileExistsAtPath_isDirectory_( - NSString path, ffi.Pointer isDirectory) { - return _lib._objc_msgSend_454( - _id, _lib._sel_fileExistsAtPath_isDirectory_1, path._id, isDirectory); - } - - bool isReadableFileAtPath_(NSString path) { - return _lib._objc_msgSend_63( - _id, _lib._sel_isReadableFileAtPath_1, path._id); - } - - bool isWritableFileAtPath_(NSString path) { - return _lib._objc_msgSend_63( - _id, _lib._sel_isWritableFileAtPath_1, path._id); - } - - bool isExecutableFileAtPath_(NSString path) { - return _lib._objc_msgSend_63( - _id, _lib._sel_isExecutableFileAtPath_1, path._id); - } - - bool isDeletableFileAtPath_(NSString path) { - return _lib._objc_msgSend_63( - _id, _lib._sel_isDeletableFileAtPath_1, path._id); - } - - bool contentsEqualAtPath_andPath_(NSString path1, NSString path2) { - return _lib._objc_msgSend_450( - _id, _lib._sel_contentsEqualAtPath_andPath_1, path1._id, path2._id); - } - - NSString displayNameAtPath_(NSString path) { - final _ret = - _lib._objc_msgSend_68(_id, _lib._sel_displayNameAtPath_1, path._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray? componentsToDisplayForPath_(NSString path) { - final _ret = _lib._objc_msgSend_131( - _id, _lib._sel_componentsToDisplayForPath_1, path._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSObject? enumeratorAtPath_(NSString path) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_enumeratorAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_( - NSURL url, - NSArray? keys, - int mask, - ObjCBlock_bool_NSURL_NSError? handler) { - final _ret = _lib._objc_msgSend_455( - _id, - _lib._sel_enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_1, - url._id, - keys?._id ?? ffi.nullptr, - mask, - handler?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSArray? subpathsAtPath_(NSString path) { - final _ret = - _lib._objc_msgSend_131(_id, _lib._sel_subpathsAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSData? contentsAtPath_(NSString path) { - final _ret = - _lib._objc_msgSend_456(_id, _lib._sel_contentsAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - bool createFileAtPath_contents_attributes_( - NSString path, NSData? data, NSDictionary? attr) { - return _lib._objc_msgSend_457( - _id, - _lib._sel_createFileAtPath_contents_attributes_1, - path._id, - data?._id ?? ffi.nullptr, - attr?._id ?? ffi.nullptr); - } - - ffi.Pointer fileSystemRepresentationWithPath_(NSString path) { - return _lib._objc_msgSend_458( - _id, _lib._sel_fileSystemRepresentationWithPath_1, path._id); - } - - NSString stringWithFileSystemRepresentation_length_( - ffi.Pointer str, int len) { - final _ret = _lib._objc_msgSend_459( - _id, _lib._sel_stringWithFileSystemRepresentation_length_1, str, len); - return NSString._(_ret, _lib, retain: true, release: true); - } - - bool - replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_( - NSURL originalItemURL, - NSURL newItemURL, - NSString? backupItemName, - int options, - ffi.Pointer> resultingURL, - ffi.Pointer> error) { - return _lib._objc_msgSend_460( - _id, - _lib._sel_replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_1, - originalItemURL._id, - newItemURL._id, - backupItemName?._id ?? ffi.nullptr, - options, - resultingURL, - error); - } - - bool setUbiquitous_itemAtURL_destinationURL_error_(bool flag, NSURL url, - NSURL destinationURL, ffi.Pointer> error) { - return _lib._objc_msgSend_461( - _id, - _lib._sel_setUbiquitous_itemAtURL_destinationURL_error_1, - flag, - url._id, - destinationURL._id, - error); - } - - bool isUbiquitousItemAtURL_(NSURL url) { - return _lib._objc_msgSend_264( - _id, _lib._sel_isUbiquitousItemAtURL_1, url._id); - } - - bool startDownloadingUbiquitousItemAtURL_error_( - NSURL url, ffi.Pointer> error) { - return _lib._objc_msgSend_88(_id, - _lib._sel_startDownloadingUbiquitousItemAtURL_error_1, url._id, error); - } - - bool evictUbiquitousItemAtURL_error_( - NSURL url, ffi.Pointer> error) { - return _lib._objc_msgSend_88( - _id, _lib._sel_evictUbiquitousItemAtURL_error_1, url._id, error); - } - - NSURL? URLForUbiquityContainerIdentifier_(NSString? containerIdentifier) { - final _ret = _lib._objc_msgSend_462( - _id, - _lib._sel_URLForUbiquityContainerIdentifier_1, - containerIdentifier?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? URLForPublishingUbiquitousItemAtURL_expirationDate_error_( - NSURL url, - ffi.Pointer> outDate, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_463( - _id, - _lib._sel_URLForPublishingUbiquitousItemAtURL_expirationDate_error_1, - url._id, - outDate, - error); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSObject? get ubiquityIdentityToken { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_ubiquityIdentityToken1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void getFileProviderServicesForItemAtURL_completionHandler_( - NSURL url, ObjCBlock_ffiVoid_NSDictionary_NSError completionHandler) { - _lib._objc_msgSend_464( - _id, - _lib._sel_getFileProviderServicesForItemAtURL_completionHandler_1, - url._id, - completionHandler._id); - } - - NSURL? containerURLForSecurityApplicationGroupIdentifier_( - NSString groupIdentifier) { - final _ret = _lib._objc_msgSend_256( - _id, - _lib._sel_containerURLForSecurityApplicationGroupIdentifier_1, - groupIdentifier._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL get homeDirectoryForCurrentUser { - final _ret = - _lib._objc_msgSend_465(_id, _lib._sel_homeDirectoryForCurrentUser1); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL get temporaryDirectory { - final _ret = _lib._objc_msgSend_465(_id, _lib._sel_temporaryDirectory1); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? homeDirectoryForUser_(NSString userName) { - final _ret = _lib._objc_msgSend_256( - _id, _lib._sel_homeDirectoryForUser_1, userName._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - @override - NSFileManager init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSFileManager._(_ret, _lib, retain: true, release: true); - } - - static NSFileManager new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSFileManager1, _lib._sel_new1); - return NSFileManager._(_ret, _lib, retain: false, release: true); - } - - static NSFileManager allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSFileManager1, _lib._sel_allocWithZone_1, zone); - return NSFileManager._(_ret, _lib, retain: false, release: true); - } - - static NSFileManager alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSFileManager1, _lib._sel_alloc1); - return NSFileManager._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSFileManager1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSFileManager1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSFileManager1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSFileManager1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSFileManager1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSFileManager1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSFileManager1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSFileManager1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSFileManager1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSVolumeEnumerationOptions { - static const int NSVolumeEnumerationSkipHiddenVolumes = 2; - static const int NSVolumeEnumerationProduceFileReferenceURLs = 4; -} - -abstract class NSFileManagerUnmountOptions { - static const int NSFileManagerUnmountAllPartitionsAndEjectDisk = 1; - static const int NSFileManagerUnmountWithoutUI = 2; -} - -void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSError_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSError_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSError_closureRegistry[block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSError.fromFunction( - ThermionDartTexture1 lib, void Function(NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSError_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSError._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSError.listener( - ThermionDartTexture1 lib, void Function(NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSError_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSError._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSError? arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0?._id ?? ffi.nullptr); -} - -abstract class NSDirectoryEnumerationOptions { - static const int NSDirectoryEnumerationSkipsSubdirectoryDescendants = 1; - static const int NSDirectoryEnumerationSkipsPackageDescendants = 2; - static const int NSDirectoryEnumerationSkipsHiddenFiles = 4; - static const int NSDirectoryEnumerationIncludesDirectoriesPostOrder = 8; - static const int NSDirectoryEnumerationProducesRelativePathURLs = 16; -} - -abstract class NSSearchPathDirectory { - static const int NSApplicationDirectory = 1; - static const int NSDemoApplicationDirectory = 2; - static const int NSDeveloperApplicationDirectory = 3; - static const int NSAdminApplicationDirectory = 4; - static const int NSLibraryDirectory = 5; - static const int NSDeveloperDirectory = 6; - static const int NSUserDirectory = 7; - static const int NSDocumentationDirectory = 8; - static const int NSDocumentDirectory = 9; - static const int NSCoreServiceDirectory = 10; - static const int NSAutosavedInformationDirectory = 11; - static const int NSDesktopDirectory = 12; - static const int NSCachesDirectory = 13; - static const int NSApplicationSupportDirectory = 14; - static const int NSDownloadsDirectory = 15; - static const int NSInputMethodsDirectory = 16; - static const int NSMoviesDirectory = 17; - static const int NSMusicDirectory = 18; - static const int NSPicturesDirectory = 19; - static const int NSPrinterDescriptionDirectory = 20; - static const int NSSharedPublicDirectory = 21; - static const int NSPreferencePanesDirectory = 22; - static const int NSApplicationScriptsDirectory = 23; - static const int NSItemReplacementDirectory = 99; - static const int NSAllApplicationsDirectory = 100; - static const int NSAllLibrariesDirectory = 101; - static const int NSTrashDirectory = 102; -} - -abstract class NSSearchPathDomainMask { - static const int NSUserDomainMask = 1; - static const int NSLocalDomainMask = 2; - static const int NSNetworkDomainMask = 4; - static const int NSSystemDomainMask = 8; - static const int NSAllDomainsMask = 65535; -} - -abstract class NSURLRelationship { - static const int NSURLRelationshipContains = 0; - static const int NSURLRelationshipSame = 1; - static const int NSURLRelationshipOther = 2; -} - -bool _ObjCBlock_bool_NSURL_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_bool_NSURL_NSError_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_bool_NSURL_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_bool_NSURL_NSError_registerClosure( - bool Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_bool_NSURL_NSError_closureRegistryIndex; - _ObjCBlock_bool_NSURL_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_NSURL_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_bool_NSURL_NSError_closureRegistry[block.ref.target.address]!( - arg0, arg1); - -class ObjCBlock_bool_NSURL_NSError extends _ObjCBlockBase { - ObjCBlock_bool_NSURL_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_NSURL_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_NSURL_NSError_fnPtrTrampoline, false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_bool_NSURL_NSError.fromFunction( - ThermionDartTexture1 lib, bool Function(NSURL, NSError) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_NSURL_NSError_closureTrampoline, false) - .cast(), - _ObjCBlock_bool_NSURL_NSError_registerClosure( - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn(NSURL._(arg0, lib, retain: true, release: true), NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(NSURL arg0, NSError arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id); -} - -abstract class NSFileManagerItemReplacementOptions { - static const int NSFileManagerItemReplacementUsingNewMetadataOnly = 1; - static const int NSFileManagerItemReplacementWithoutDeletingBackupItem = 2; -} - -void _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSDictionary_NSError_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSDictionary_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSDictionary_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSDictionary_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSDictionary_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSDictionary_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_NSDictionary_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSDictionary_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSDictionary_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSDictionary_NSError.fromFunction( - ThermionDartTexture1 lib, void Function(NSDictionary?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSDictionary_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 ? null : NSDictionary._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSDictionary_NSError.listener( - ThermionDartTexture1 lib, void Function(NSDictionary?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi - .NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSDictionary_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSDictionary._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSDictionary? arg0, NSError? arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1?._id ?? ffi.nullptr); -} - -class NSMutableArray extends NSArray { - NSMutableArray._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMutableArray] that points to the same underlying object as [other]. - static NSMutableArray castFrom(T other) { - return NSMutableArray._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSMutableArray] that wraps the given raw object pointer. - static NSMutableArray castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableArray._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMutableArray]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSMutableArray1); - } - - void addObject_(NSObject anObject) { - _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, anObject._id); - } - - void insertObject_atIndex_(NSObject anObject, int index) { - _lib._objc_msgSend_468( - _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); - } - - void removeLastObject() { - _lib._objc_msgSend_1(_id, _lib._sel_removeLastObject1); - } - - void removeObjectAtIndex_(int index) { - _lib._objc_msgSend_469(_id, _lib._sel_removeObjectAtIndex_1, index); - } - - void replaceObjectAtIndex_withObject_(int index, NSObject anObject) { - _lib._objc_msgSend_470( - _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); - } - - @override - NSMutableArray init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - NSMutableArray initWithCapacity_(int numItems) { - final _ret = - _lib._objc_msgSend_64(_id, _lib._sel_initWithCapacity_1, numItems); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableArray? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - void addObjectsFromArray_(NSArray otherArray) { - _lib._objc_msgSend_471( - _id, _lib._sel_addObjectsFromArray_1, otherArray._id); - } - - void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { - _lib._objc_msgSend_472( - _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); - } - - void removeAllObjects() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); - } - - void removeObject_inRange_(NSObject anObject, _NSRange range) { - _lib._objc_msgSend_473( - _id, _lib._sel_removeObject_inRange_1, anObject._id, range); - } - - void removeObject_(NSObject anObject) { - _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, anObject._id); - } - - void removeObjectIdenticalTo_inRange_(NSObject anObject, _NSRange range) { - _lib._objc_msgSend_473( - _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); - } - - void removeObjectIdenticalTo_(NSObject anObject) { - _lib._objc_msgSend_15( - _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); - } - - void removeObjectsFromIndices_numIndices_( - ffi.Pointer indices, int cnt) { - _lib._objc_msgSend_474( - _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); - } - - void removeObjectsInArray_(NSArray otherArray) { - _lib._objc_msgSend_471( - _id, _lib._sel_removeObjectsInArray_1, otherArray._id); - } - - void removeObjectsInRange_(_NSRange range) { - _lib._objc_msgSend_475(_id, _lib._sel_removeObjectsInRange_1, range); - } - - void replaceObjectsInRange_withObjectsFromArray_range_( - _NSRange range, NSArray otherArray, _NSRange otherRange) { - _lib._objc_msgSend_476( - _id, - _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, - range, - otherArray._id, - otherRange); - } - - void replaceObjectsInRange_withObjectsFromArray_( - _NSRange range, NSArray otherArray) { - _lib._objc_msgSend_477( - _id, - _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, - range, - otherArray._id); - } - - void setArray_(NSArray otherArray) { - _lib._objc_msgSend_471(_id, _lib._sel_setArray_1, otherArray._id); - } - - void sortUsingFunction_context_( - ffi.Pointer< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - compare, - ffi.Pointer context) { - _lib._objc_msgSend_478( - _id, _lib._sel_sortUsingFunction_context_1, compare, context); - } - - void sortUsingSelector_(ffi.Pointer comparator) { - _lib._objc_msgSend_7(_id, _lib._sel_sortUsingSelector_1, comparator); - } - - void insertObjects_atIndexes_(NSArray objects, NSIndexSet indexes) { - _lib._objc_msgSend_479( - _id, _lib._sel_insertObjects_atIndexes_1, objects._id, indexes._id); - } - - void removeObjectsAtIndexes_(NSIndexSet indexes) { - _lib._objc_msgSend_480( - _id, _lib._sel_removeObjectsAtIndexes_1, indexes._id); - } - - void replaceObjectsAtIndexes_withObjects_( - NSIndexSet indexes, NSArray objects) { - _lib._objc_msgSend_481(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, - indexes._id, objects._id); - } - - void setObject_atIndexedSubscript_(NSObject obj, int idx) { - _lib._objc_msgSend_468( - _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); - } - - void sortUsingComparator_( - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - _lib._objc_msgSend_482(_id, _lib._sel_sortUsingComparator_1, cmptr._id); - } - - void sortWithOptions_usingComparator_( - int opts, ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - _lib._objc_msgSend_483( - _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr._id); - } - - static NSMutableArray arrayWithCapacity_( - ThermionDartTexture1 _lib, int numItems) { - final _ret = _lib._objc_msgSend_64( - _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray? arrayWithContentsOfFile_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_484(_lib._class_NSMutableArray1, - _lib._sel_arrayWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray? arrayWithContentsOfURL_( - ThermionDartTexture1 _lib, NSURL url) { - final _ret = _lib._objc_msgSend_485(_lib._class_NSMutableArray1, - _lib._sel_arrayWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - NSMutableArray? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_484( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - NSMutableArray? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_485(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - void applyDifference_(NSObject difference) { - _lib._objc_msgSend_15(_id, _lib._sel_applyDifference_1, difference._id); - } - - void sortUsingDescriptors_(NSArray sortDescriptors) { - _lib._objc_msgSend_471( - _id, _lib._sel_sortUsingDescriptors_1, sortDescriptors._id); - } - - void filterUsingPredicate_(NSPredicate predicate) { - _lib._objc_msgSend_486( - _id, _lib._sel_filterUsingPredicate_1, predicate._id); - } - - @override - NSMutableArray initWithObjects_count_( - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65( - _id, _lib._sel_initWithObjects_count_1, objects, cnt); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray array(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_array1); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray arrayWithObject_( - ThermionDartTexture1 _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_123( - _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray arrayWithObjects_count_(ThermionDartTexture1 _lib, - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65(_lib._class_NSMutableArray1, - _lib._sel_arrayWithObjects_count_1, objects, cnt); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray arrayWithObjects_( - ThermionDartTexture1 _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_123(_lib._class_NSMutableArray1, - _lib._sel_arrayWithObjects_1, firstObj._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray arrayWithArray_( - ThermionDartTexture1 _lib, NSArray array) { - final _ret = _lib._objc_msgSend_124( - _lib._class_NSMutableArray1, _lib._sel_arrayWithArray_1, array._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableArray initWithObjects_(NSObject firstObj) { - final _ret = - _lib._objc_msgSend_123(_id, _lib._sel_initWithObjects_1, firstObj._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableArray initWithArray_(NSArray array) { - final _ret = - _lib._objc_msgSend_124(_id, _lib._sel_initWithArray_1, array._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableArray initWithArray_copyItems_(NSArray array, bool flag) { - final _ret = _lib._objc_msgSend_125( - _id, _lib._sel_initWithArray_copyItems_1, array._id, flag); - return NSMutableArray._(_ret, _lib, retain: false, release: true); - } - - static NSArray? arrayWithContentsOfURL_error_(ThermionDartTexture1 _lib, - NSURL url, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_126(_lib._class_NSMutableArray1, - _lib._sel_arrayWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_new1); - return NSMutableArray._(_ret, _lib, retain: false, release: true); - } - - static NSMutableArray allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableArray1, _lib._sel_allocWithZone_1, zone); - return NSMutableArray._(_ret, _lib, retain: false, release: true); - } - - static NSMutableArray alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_alloc1); - return NSMutableArray._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMutableArray1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMutableArray1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSMutableArray1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableArray1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMutableArray1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMutableArray1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMutableArray1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSMutableArray1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableArray1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSMutableOrderedSet extends NSOrderedSet { - NSMutableOrderedSet._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMutableOrderedSet] that points to the same underlying object as [other]. - static NSMutableOrderedSet castFrom(T other) { - return NSMutableOrderedSet._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSMutableOrderedSet] that wraps the given raw object pointer. - static NSMutableOrderedSet castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableOrderedSet._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMutableOrderedSet]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSMutableOrderedSet1); - } - - void insertObject_atIndex_(NSObject object, int idx) { - _lib._objc_msgSend_468( - _id, _lib._sel_insertObject_atIndex_1, object._id, idx); - } - - void removeObjectAtIndex_(int idx) { - _lib._objc_msgSend_469(_id, _lib._sel_removeObjectAtIndex_1, idx); - } - - void replaceObjectAtIndex_withObject_(int idx, NSObject object) { - _lib._objc_msgSend_470( - _id, _lib._sel_replaceObjectAtIndex_withObject_1, idx, object._id); - } - - @override - NSMutableOrderedSet? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableOrderedSet init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSMutableOrderedSet initWithCapacity_(int numItems) { - final _ret = - _lib._objc_msgSend_64(_id, _lib._sel_initWithCapacity_1, numItems); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - void addObject_(NSObject object) { - _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, object._id); - } - - void addObjects_count_( - ffi.Pointer> objects, int count) { - _lib._objc_msgSend_499(_id, _lib._sel_addObjects_count_1, objects, count); - } - - void addObjectsFromArray_(NSArray array) { - _lib._objc_msgSend_471(_id, _lib._sel_addObjectsFromArray_1, array._id); - } - - void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { - _lib._objc_msgSend_472( - _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); - } - - void moveObjectsAtIndexes_toIndex_(NSIndexSet indexes, int idx) { - _lib._objc_msgSend_500( - _id, _lib._sel_moveObjectsAtIndexes_toIndex_1, indexes._id, idx); - } - - void insertObjects_atIndexes_(NSArray objects, NSIndexSet indexes) { - _lib._objc_msgSend_479( - _id, _lib._sel_insertObjects_atIndexes_1, objects._id, indexes._id); - } - - void setObject_atIndex_(NSObject obj, int idx) { - _lib._objc_msgSend_468(_id, _lib._sel_setObject_atIndex_1, obj._id, idx); - } - - void setObject_atIndexedSubscript_(NSObject obj, int idx) { - _lib._objc_msgSend_468( - _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); - } - - void replaceObjectsInRange_withObjects_count_( - _NSRange range, ffi.Pointer> objects, int count) { - _lib._objc_msgSend_501( - _id, - _lib._sel_replaceObjectsInRange_withObjects_count_1, - range, - objects, - count); - } - - void replaceObjectsAtIndexes_withObjects_( - NSIndexSet indexes, NSArray objects) { - _lib._objc_msgSend_481(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, - indexes._id, objects._id); - } - - void removeObjectsInRange_(_NSRange range) { - _lib._objc_msgSend_475(_id, _lib._sel_removeObjectsInRange_1, range); - } - - void removeObjectsAtIndexes_(NSIndexSet indexes) { - _lib._objc_msgSend_480( - _id, _lib._sel_removeObjectsAtIndexes_1, indexes._id); - } - - void removeAllObjects() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); - } - - void removeObject_(NSObject object) { - _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, object._id); - } - - void removeObjectsInArray_(NSArray array) { - _lib._objc_msgSend_471(_id, _lib._sel_removeObjectsInArray_1, array._id); - } - - void intersectOrderedSet_(NSOrderedSet other) { - _lib._objc_msgSend_502(_id, _lib._sel_intersectOrderedSet_1, other._id); - } - - void minusOrderedSet_(NSOrderedSet other) { - _lib._objc_msgSend_502(_id, _lib._sel_minusOrderedSet_1, other._id); - } - - void unionOrderedSet_(NSOrderedSet other) { - _lib._objc_msgSend_502(_id, _lib._sel_unionOrderedSet_1, other._id); - } - - void intersectSet_(NSSet other) { - _lib._objc_msgSend_503(_id, _lib._sel_intersectSet_1, other._id); - } - - void minusSet_(NSSet other) { - _lib._objc_msgSend_503(_id, _lib._sel_minusSet_1, other._id); - } - - void unionSet_(NSSet other) { - _lib._objc_msgSend_503(_id, _lib._sel_unionSet_1, other._id); - } - - void sortUsingComparator_( - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - _lib._objc_msgSend_482(_id, _lib._sel_sortUsingComparator_1, cmptr._id); - } - - void sortWithOptions_usingComparator_( - int opts, ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - _lib._objc_msgSend_483( - _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr._id); - } - - void sortRange_options_usingComparator_(_NSRange range, int opts, - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - _lib._objc_msgSend_504(_id, _lib._sel_sortRange_options_usingComparator_1, - range, opts, cmptr._id); - } - - static NSMutableOrderedSet orderedSetWithCapacity_( - ThermionDartTexture1 _lib, int numItems) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableOrderedSet1, - _lib._sel_orderedSetWithCapacity_1, numItems); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - void applyDifference_(NSObject difference) { - _lib._objc_msgSend_15(_id, _lib._sel_applyDifference_1, difference._id); - } - - void sortUsingDescriptors_(NSArray sortDescriptors) { - _lib._objc_msgSend_471( - _id, _lib._sel_sortUsingDescriptors_1, sortDescriptors._id); - } - - void filterUsingPredicate_(NSPredicate p) { - _lib._objc_msgSend_486(_id, _lib._sel_filterUsingPredicate_1, p._id); - } - - @override - NSMutableOrderedSet initWithObjects_count_( - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65( - _id, _lib._sel_initWithObjects_count_1, objects, cnt); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableOrderedSet orderedSet(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableOrderedSet1, _lib._sel_orderedSet1); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableOrderedSet orderedSetWithObject_( - ThermionDartTexture1 _lib, NSObject object) { - final _ret = _lib._objc_msgSend_123(_lib._class_NSMutableOrderedSet1, - _lib._sel_orderedSetWithObject_1, object._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableOrderedSet orderedSetWithObjects_count_( - ThermionDartTexture1 _lib, - ffi.Pointer> objects, - int cnt) { - final _ret = _lib._objc_msgSend_65(_lib._class_NSMutableOrderedSet1, - _lib._sel_orderedSetWithObjects_count_1, objects, cnt); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableOrderedSet orderedSetWithObjects_( - ThermionDartTexture1 _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_123(_lib._class_NSMutableOrderedSet1, - _lib._sel_orderedSetWithObjects_1, firstObj._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableOrderedSet orderedSetWithOrderedSet_( - ThermionDartTexture1 _lib, NSOrderedSet set) { - final _ret = _lib._objc_msgSend_491(_lib._class_NSMutableOrderedSet1, - _lib._sel_orderedSetWithOrderedSet_1, set._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableOrderedSet orderedSetWithOrderedSet_range_copyItems_( - ThermionDartTexture1 _lib, NSOrderedSet set, _NSRange range, bool flag) { - final _ret = _lib._objc_msgSend_492( - _lib._class_NSMutableOrderedSet1, - _lib._sel_orderedSetWithOrderedSet_range_copyItems_1, - set._id, - range, - flag); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static NSMutableOrderedSet orderedSetWithArray_( - ThermionDartTexture1 _lib, NSArray array) { - final _ret = _lib._objc_msgSend_124(_lib._class_NSMutableOrderedSet1, - _lib._sel_orderedSetWithArray_1, array._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableOrderedSet orderedSetWithArray_range_copyItems_( - ThermionDartTexture1 _lib, NSArray array, _NSRange range, bool flag) { - final _ret = _lib._objc_msgSend_493( - _lib._class_NSMutableOrderedSet1, - _lib._sel_orderedSetWithArray_range_copyItems_1, - array._id, - range, - flag); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static NSMutableOrderedSet orderedSetWithSet_( - ThermionDartTexture1 _lib, NSSet set) { - final _ret = _lib._objc_msgSend_410(_lib._class_NSMutableOrderedSet1, - _lib._sel_orderedSetWithSet_1, set._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableOrderedSet orderedSetWithSet_copyItems_( - ThermionDartTexture1 _lib, NSSet set, bool flag) { - final _ret = _lib._objc_msgSend_411(_lib._class_NSMutableOrderedSet1, - _lib._sel_orderedSetWithSet_copyItems_1, set._id, flag); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableOrderedSet initWithObject_(NSObject object) { - final _ret = - _lib._objc_msgSend_123(_id, _lib._sel_initWithObject_1, object._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableOrderedSet initWithObjects_(NSObject firstObj) { - final _ret = - _lib._objc_msgSend_123(_id, _lib._sel_initWithObjects_1, firstObj._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableOrderedSet initWithOrderedSet_(NSOrderedSet set) { - final _ret = - _lib._objc_msgSend_491(_id, _lib._sel_initWithOrderedSet_1, set._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableOrderedSet initWithOrderedSet_copyItems_( - NSOrderedSet set, bool flag) { - final _ret = _lib._objc_msgSend_494( - _id, _lib._sel_initWithOrderedSet_copyItems_1, set._id, flag); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableOrderedSet initWithOrderedSet_range_copyItems_( - NSOrderedSet set, _NSRange range, bool flag) { - final _ret = _lib._objc_msgSend_492(_id, - _lib._sel_initWithOrderedSet_range_copyItems_1, set._id, range, flag); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableOrderedSet initWithArray_(NSArray array) { - final _ret = - _lib._objc_msgSend_124(_id, _lib._sel_initWithArray_1, array._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableOrderedSet initWithArray_copyItems_(NSArray set, bool flag) { - final _ret = _lib._objc_msgSend_125( - _id, _lib._sel_initWithArray_copyItems_1, set._id, flag); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableOrderedSet initWithArray_range_copyItems_( - NSArray set, _NSRange range, bool flag) { - final _ret = _lib._objc_msgSend_493( - _id, _lib._sel_initWithArray_range_copyItems_1, set._id, range, flag); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableOrderedSet initWithSet_(NSSet set) { - final _ret = _lib._objc_msgSend_410(_id, _lib._sel_initWithSet_1, set._id); - return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableOrderedSet initWithSet_copyItems_(NSSet set, bool flag) { - final _ret = _lib._objc_msgSend_411( - _id, _lib._sel_initWithSet_copyItems_1, set._id, flag); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static NSMutableOrderedSet new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableOrderedSet1, _lib._sel_new1); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static NSMutableOrderedSet allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableOrderedSet1, _lib._sel_allocWithZone_1, zone); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static NSMutableOrderedSet alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableOrderedSet1, _lib._sel_alloc1); - return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMutableOrderedSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMutableOrderedSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSMutableOrderedSet1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableOrderedSet1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMutableOrderedSet1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMutableOrderedSet1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMutableOrderedSet1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSMutableOrderedSet1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableOrderedSet1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSOrderedSet extends NSObject { - NSOrderedSet._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSOrderedSet] that points to the same underlying object as [other]. - static NSOrderedSet castFrom(T other) { - return NSOrderedSet._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSOrderedSet] that wraps the given raw object pointer. - static NSOrderedSet castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSOrderedSet._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSOrderedSet]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOrderedSet1); - } - - int get count { - return _lib._objc_msgSend_10(_id, _lib._sel_count1); - } - - NSObject objectAtIndex_(int idx) { - final _ret = _lib._objc_msgSend_64(_id, _lib._sel_objectAtIndex_1, idx); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - int indexOfObject_(NSObject object) { - return _lib._objc_msgSend_73(_id, _lib._sel_indexOfObject_1, object._id); - } - - @override - NSOrderedSet init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSOrderedSet initWithObjects_count_( - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65( - _id, _lib._sel_initWithObjects_count_1, objects, cnt); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSOrderedSet? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - void getObjects_range_( - ffi.Pointer> objects, _NSRange range) { - _lib._objc_msgSend_72(_id, _lib._sel_getObjects_range_1, objects, range); - } - - NSArray objectsAtIndexes_(NSIndexSet indexes) { - final _ret = - _lib._objc_msgSend_110(_id, _lib._sel_objectsAtIndexes_1, indexes._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSObject? get firstObject { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_firstObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? get lastObject { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_lastObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - bool isEqualToOrderedSet_(NSOrderedSet other) { - return _lib._objc_msgSend_488( - _id, _lib._sel_isEqualToOrderedSet_1, other._id); - } - - bool containsObject_(NSObject object) { - return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, object._id); - } - - bool intersectsOrderedSet_(NSOrderedSet other) { - return _lib._objc_msgSend_488( - _id, _lib._sel_intersectsOrderedSet_1, other._id); - } - - bool intersectsSet_(NSSet set) { - return _lib._objc_msgSend_402(_id, _lib._sel_intersectsSet_1, set._id); - } - - bool isSubsetOfOrderedSet_(NSOrderedSet other) { - return _lib._objc_msgSend_488( - _id, _lib._sel_isSubsetOfOrderedSet_1, other._id); - } - - bool isSubsetOfSet_(NSSet set) { - return _lib._objc_msgSend_402(_id, _lib._sel_isSubsetOfSet_1, set._id); - } - - NSObject objectAtIndexedSubscript_(int idx) { - final _ret = - _lib._objc_msgSend_64(_id, _lib._sel_objectAtIndexedSubscript_1, idx); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSEnumerator objectEnumerator() { - final _ret = _lib._objc_msgSend_76(_id, _lib._sel_objectEnumerator1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - NSEnumerator reverseObjectEnumerator() { - final _ret = _lib._objc_msgSend_76(_id, _lib._sel_reverseObjectEnumerator1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - NSOrderedSet get reversedOrderedSet { - final _ret = _lib._objc_msgSend_489(_id, _lib._sel_reversedOrderedSet1); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSArray get array { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_array1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSSet get set1 { - final _ret = _lib._objc_msgSend_490(_id, _lib._sel_set1); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - void enumerateObjectsUsingBlock_( - ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { - _lib._objc_msgSend_111( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); - } - - void enumerateObjectsWithOptions_usingBlock_( - int opts, ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { - _lib._objc_msgSend_112(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); - } - - void enumerateObjectsAtIndexes_options_usingBlock_(NSIndexSet s, int opts, - ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { - _lib._objc_msgSend_113( - _id, - _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, - s._id, - opts, - block._id); - } - - int indexOfObjectPassingTest_( - ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - return _lib._objc_msgSend_114( - _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); - } - - int indexOfObjectWithOptions_passingTest_( - int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - return _lib._objc_msgSend_115(_id, - _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); - } - - int indexOfObjectAtIndexes_options_passingTest_(NSIndexSet s, int opts, - ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - return _lib._objc_msgSend_116( - _id, - _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, - s._id, - opts, - predicate._id); - } - - NSIndexSet indexesOfObjectsPassingTest_( - ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - final _ret = _lib._objc_msgSend_117( - _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet indexesOfObjectsWithOptions_passingTest_( - int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - final _ret = _lib._objc_msgSend_118( - _id, - _lib._sel_indexesOfObjectsWithOptions_passingTest_1, - opts, - predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_(NSIndexSet s, - int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { - final _ret = _lib._objc_msgSend_119( - _id, - _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, - s._id, - opts, - predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - int indexOfObject_inSortedRange_options_usingComparator_( - NSObject object, - _NSRange range, - int opts, - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmp) { - return _lib._objc_msgSend_122( - _id, - _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, - object._id, - range, - opts, - cmp._id); - } - - NSArray sortedArrayUsingComparator_( - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - final _ret = _lib._objc_msgSend_120( - _id, _lib._sel_sortedArrayUsingComparator_1, cmptr._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray sortedArrayWithOptions_usingComparator_( - int opts, ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { - final _ret = _lib._objc_msgSend_121(_id, - _lib._sel_sortedArrayWithOptions_usingComparator_1, opts, cmptr._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString get description { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_69( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_indent_(NSObject? locale, int level) { - final _ret = _lib._objc_msgSend_70( - _id, - _lib._sel_descriptionWithLocale_indent_1, - locale?._id ?? ffi.nullptr, - level); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedSet orderedSet(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_orderedSet1); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedSet orderedSetWithObject_( - ThermionDartTexture1 _lib, NSObject object) { - final _ret = _lib._objc_msgSend_123(_lib._class_NSOrderedSet1, - _lib._sel_orderedSetWithObject_1, object._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedSet orderedSetWithObjects_count_(ThermionDartTexture1 _lib, - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65(_lib._class_NSOrderedSet1, - _lib._sel_orderedSetWithObjects_count_1, objects, cnt); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedSet orderedSetWithObjects_( - ThermionDartTexture1 _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_123(_lib._class_NSOrderedSet1, - _lib._sel_orderedSetWithObjects_1, firstObj._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedSet orderedSetWithOrderedSet_( - ThermionDartTexture1 _lib, NSOrderedSet set) { - final _ret = _lib._objc_msgSend_491(_lib._class_NSOrderedSet1, - _lib._sel_orderedSetWithOrderedSet_1, set._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedSet orderedSetWithOrderedSet_range_copyItems_( - ThermionDartTexture1 _lib, NSOrderedSet set, _NSRange range, bool flag) { - final _ret = _lib._objc_msgSend_492( - _lib._class_NSOrderedSet1, - _lib._sel_orderedSetWithOrderedSet_range_copyItems_1, - set._id, - range, - flag); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static NSOrderedSet orderedSetWithArray_( - ThermionDartTexture1 _lib, NSArray array) { - final _ret = _lib._objc_msgSend_124( - _lib._class_NSOrderedSet1, _lib._sel_orderedSetWithArray_1, array._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedSet orderedSetWithArray_range_copyItems_( - ThermionDartTexture1 _lib, NSArray array, _NSRange range, bool flag) { - final _ret = _lib._objc_msgSend_493( - _lib._class_NSOrderedSet1, - _lib._sel_orderedSetWithArray_range_copyItems_1, - array._id, - range, - flag); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static NSOrderedSet orderedSetWithSet_(ThermionDartTexture1 _lib, NSSet set) { - final _ret = _lib._objc_msgSend_410( - _lib._class_NSOrderedSet1, _lib._sel_orderedSetWithSet_1, set._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedSet orderedSetWithSet_copyItems_( - ThermionDartTexture1 _lib, NSSet set, bool flag) { - final _ret = _lib._objc_msgSend_411(_lib._class_NSOrderedSet1, - _lib._sel_orderedSetWithSet_copyItems_1, set._id, flag); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - NSOrderedSet initWithObject_(NSObject object) { - final _ret = - _lib._objc_msgSend_123(_id, _lib._sel_initWithObject_1, object._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSOrderedSet initWithObjects_(NSObject firstObj) { - final _ret = - _lib._objc_msgSend_123(_id, _lib._sel_initWithObjects_1, firstObj._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSOrderedSet initWithOrderedSet_(NSOrderedSet set) { - final _ret = - _lib._objc_msgSend_491(_id, _lib._sel_initWithOrderedSet_1, set._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSOrderedSet initWithOrderedSet_copyItems_(NSOrderedSet set, bool flag) { - final _ret = _lib._objc_msgSend_494( - _id, _lib._sel_initWithOrderedSet_copyItems_1, set._id, flag); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - NSOrderedSet initWithOrderedSet_range_copyItems_( - NSOrderedSet set, _NSRange range, bool flag) { - final _ret = _lib._objc_msgSend_492(_id, - _lib._sel_initWithOrderedSet_range_copyItems_1, set._id, range, flag); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - NSOrderedSet initWithArray_(NSArray array) { - final _ret = - _lib._objc_msgSend_124(_id, _lib._sel_initWithArray_1, array._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSOrderedSet initWithArray_copyItems_(NSArray set, bool flag) { - final _ret = _lib._objc_msgSend_125( - _id, _lib._sel_initWithArray_copyItems_1, set._id, flag); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - NSOrderedSet initWithArray_range_copyItems_( - NSArray set, _NSRange range, bool flag) { - final _ret = _lib._objc_msgSend_493( - _id, _lib._sel_initWithArray_range_copyItems_1, set._id, range, flag); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - NSOrderedSet initWithSet_(NSSet set) { - final _ret = _lib._objc_msgSend_410(_id, _lib._sel_initWithSet_1, set._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSOrderedSet initWithSet_copyItems_(NSSet set, bool flag) { - final _ret = _lib._objc_msgSend_411( - _id, _lib._sel_initWithSet_copyItems_1, set._id, flag); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - NSObject differenceFromOrderedSet_withOptions_usingEquivalenceTest_( - NSOrderedSet other, - int options, - ObjCBlock_bool_ObjCObject_ObjCObject block) { - final _ret = _lib._objc_msgSend_495( - _id, - _lib._sel_differenceFromOrderedSet_withOptions_usingEquivalenceTest_1, - other._id, - options, - block._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject differenceFromOrderedSet_withOptions_( - NSOrderedSet other, int options) { - final _ret = _lib._objc_msgSend_496(_id, - _lib._sel_differenceFromOrderedSet_withOptions_1, other._id, options); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject differenceFromOrderedSet_(NSOrderedSet other) { - final _ret = _lib._objc_msgSend_491( - _id, _lib._sel_differenceFromOrderedSet_1, other._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSOrderedSet? orderedSetByApplyingDifference_(NSObject difference) { - final _ret = _lib._objc_msgSend_497( - _id, _lib._sel_orderedSetByApplyingDifference_1, difference._id); - return _ret.address == 0 - ? null - : NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - NSObject valueForKey_(NSString key) { - final _ret = _lib._objc_msgSend_31(_id, _lib._sel_valueForKey_1, key._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - void setValue_forKey_(NSObject? value, NSString key) { - _lib._objc_msgSend_134( - _id, _lib._sel_setValue_forKey_1, value?._id ?? ffi.nullptr, key._id); - } - - @override - void addObserver_forKeyPath_options_context_(NSObject observer, - NSString keyPath, int options, ffi.Pointer context) { - _lib._objc_msgSend_138( - _id, - _lib._sel_addObserver_forKeyPath_options_context_1, - observer._id, - keyPath._id, - options, - context); - } - - @override - void removeObserver_forKeyPath_context_( - NSObject observer, NSString keyPath, ffi.Pointer context) { - _lib._objc_msgSend_139(_id, _lib._sel_removeObserver_forKeyPath_context_1, - observer._id, keyPath._id, context); - } - - @override - void removeObserver_forKeyPath_(NSObject observer, NSString keyPath) { - _lib._objc_msgSend_140( - _id, _lib._sel_removeObserver_forKeyPath_1, observer._id, keyPath._id); - } - - NSArray sortedArrayUsingDescriptors_(NSArray sortDescriptors) { - final _ret = _lib._objc_msgSend_67( - _id, _lib._sel_sortedArrayUsingDescriptors_1, sortDescriptors._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSOrderedSet filteredOrderedSetUsingPredicate_(NSPredicate p) { - final _ret = _lib._objc_msgSend_498( - _id, _lib._sel_filteredOrderedSetUsingPredicate_1, p._id); - return NSOrderedSet._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedSet new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_new1); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static NSOrderedSet allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSOrderedSet1, _lib._sel_allocWithZone_1, zone); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static NSOrderedSet alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_alloc1); - return NSOrderedSet._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSOrderedSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSOrderedSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSOrderedSet1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSOrderedSet1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSOrderedSet1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSOrderedSet1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSOrderedSet1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSOrderedSet1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOrderedSet1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSMutableSet extends NSSet { - NSMutableSet._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMutableSet] that points to the same underlying object as [other]. - static NSMutableSet castFrom(T other) { - return NSMutableSet._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSMutableSet] that wraps the given raw object pointer. - static NSMutableSet castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableSet._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMutableSet]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMutableSet1); - } - - void addObject_(NSObject object) { - _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, object._id); - } - - void removeObject_(NSObject object) { - _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, object._id); - } - - @override - NSMutableSet? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableSet init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - NSMutableSet initWithCapacity_(int numItems) { - final _ret = - _lib._objc_msgSend_64(_id, _lib._sel_initWithCapacity_1, numItems); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - void addObjectsFromArray_(NSArray array) { - _lib._objc_msgSend_471(_id, _lib._sel_addObjectsFromArray_1, array._id); - } - - void intersectSet_(NSSet otherSet) { - _lib._objc_msgSend_503(_id, _lib._sel_intersectSet_1, otherSet._id); - } - - void minusSet_(NSSet otherSet) { - _lib._objc_msgSend_503(_id, _lib._sel_minusSet_1, otherSet._id); - } - - void removeAllObjects() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); - } - - void unionSet_(NSSet otherSet) { - _lib._objc_msgSend_503(_id, _lib._sel_unionSet_1, otherSet._id); - } - - void setSet_(NSSet otherSet) { - _lib._objc_msgSend_503(_id, _lib._sel_setSet_1, otherSet._id); - } - - static NSMutableSet setWithCapacity_( - ThermionDartTexture1 _lib, int numItems) { - final _ret = _lib._objc_msgSend_64( - _lib._class_NSMutableSet1, _lib._sel_setWithCapacity_1, numItems); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - void filterUsingPredicate_(NSPredicate predicate) { - _lib._objc_msgSend_486( - _id, _lib._sel_filterUsingPredicate_1, predicate._id); - } - - @override - NSMutableSet initWithObjects_count_( - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65( - _id, _lib._sel_initWithObjects_count_1, objects, cnt); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableSet set1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_set1); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableSet setWithObject_( - ThermionDartTexture1 _lib, NSObject object) { - final _ret = _lib._objc_msgSend_123( - _lib._class_NSMutableSet1, _lib._sel_setWithObject_1, object._id); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableSet setWithObjects_count_(ThermionDartTexture1 _lib, - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_65(_lib._class_NSMutableSet1, - _lib._sel_setWithObjects_count_1, objects, cnt); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableSet setWithObjects_( - ThermionDartTexture1 _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_123( - _lib._class_NSMutableSet1, _lib._sel_setWithObjects_1, firstObj._id); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableSet setWithSet_(ThermionDartTexture1 _lib, NSSet set) { - final _ret = _lib._objc_msgSend_410( - _lib._class_NSMutableSet1, _lib._sel_setWithSet_1, set._id); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableSet setWithArray_(ThermionDartTexture1 _lib, NSArray array) { - final _ret = _lib._objc_msgSend_124( - _lib._class_NSMutableSet1, _lib._sel_setWithArray_1, array._id); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableSet initWithObjects_(NSObject firstObj) { - final _ret = - _lib._objc_msgSend_123(_id, _lib._sel_initWithObjects_1, firstObj._id); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableSet initWithSet_(NSSet set) { - final _ret = _lib._objc_msgSend_410(_id, _lib._sel_initWithSet_1, set._id); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableSet initWithSet_copyItems_(NSSet set, bool flag) { - final _ret = _lib._objc_msgSend_411( - _id, _lib._sel_initWithSet_copyItems_1, set._id, flag); - return NSMutableSet._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableSet initWithArray_(NSArray array) { - final _ret = - _lib._objc_msgSend_124(_id, _lib._sel_initWithArray_1, array._id); - return NSMutableSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableSet new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_new1); - return NSMutableSet._(_ret, _lib, retain: false, release: true); - } - - static NSMutableSet allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableSet1, _lib._sel_allocWithZone_1, zone); - return NSMutableSet._(_ret, _lib, retain: false, release: true); - } - - static NSMutableSet alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_alloc1); - return NSMutableSet._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMutableSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMutableSet1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableSet1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableSet1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMutableSet1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMutableSet1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMutableSet1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSMutableSet1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableSet1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSKeyValueChange { - static const int NSKeyValueChangeSetting = 1; - static const int NSKeyValueChangeInsertion = 2; - static const int NSKeyValueChangeRemoval = 3; - static const int NSKeyValueChangeReplacement = 4; -} - -abstract class NSKeyValueSetMutationKind { - static const int NSKeyValueUnionSetMutation = 1; - static const int NSKeyValueMinusSetMutation = 2; - static const int NSKeyValueIntersectSetMutation = 3; - static const int NSKeyValueSetSetMutation = 4; -} - -class NSKeyedArchiver extends NSCoder { - NSKeyedArchiver._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSKeyedArchiver] that points to the same underlying object as [other]. - static NSKeyedArchiver castFrom(T other) { - return NSKeyedArchiver._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSKeyedArchiver] that wraps the given raw object pointer. - static NSKeyedArchiver castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSKeyedArchiver._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSKeyedArchiver]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSKeyedArchiver1); - } - - NSKeyedArchiver initRequiringSecureCoding_(bool requiresSecureCoding) { - final _ret = _lib._objc_msgSend_513( - _id, _lib._sel_initRequiringSecureCoding_1, requiresSecureCoding); - return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); - } - - static NSData? archivedDataWithRootObject_requiringSecureCoding_error_( - ThermionDartTexture1 _lib, - NSObject object, - bool requiresSecureCoding, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_514( - _lib._class_NSKeyedArchiver1, - _lib._sel_archivedDataWithRootObject_requiringSecureCoding_error_1, - object._id, - requiresSecureCoding, - error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - @override - NSKeyedArchiver init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); - } - - NSKeyedArchiver initForWritingWithMutableData_(NSMutableData data) { - final _ret = _lib._objc_msgSend_520( - _id, _lib._sel_initForWritingWithMutableData_1, data._id); - return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); - } - - static NSData archivedDataWithRootObject_( - ThermionDartTexture1 _lib, NSObject rootObject) { - final _ret = _lib._objc_msgSend_521(_lib._class_NSKeyedArchiver1, - _lib._sel_archivedDataWithRootObject_1, rootObject._id); - return NSData._(_ret, _lib, retain: true, release: true); - } - - static bool archiveRootObject_toFile_( - ThermionDartTexture1 _lib, NSObject rootObject, NSString path) { - return _lib._objc_msgSend_260(_lib._class_NSKeyedArchiver1, - _lib._sel_archiveRootObject_toFile_1, rootObject._id, path._id); - } - - NSObject? get delegate { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set delegate(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); - } - - int get outputFormat { - return _lib._objc_msgSend_522(_id, _lib._sel_outputFormat1); - } - - set outputFormat(int value) { - return _lib._objc_msgSend_523(_id, _lib._sel_setOutputFormat_1, value); - } - - NSData get encodedData { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_encodedData1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - void finishEncoding() { - _lib._objc_msgSend_1(_id, _lib._sel_finishEncoding1); - } - - static void setClassName_forClass_( - ThermionDartTexture1 _lib, NSString? codedName, NSObject cls) { - _lib._objc_msgSend_524( - _lib._class_NSKeyedArchiver1, - _lib._sel_setClassName_forClass_1, - codedName?._id ?? ffi.nullptr, - cls._id); - } - - static NSString? classNameForClass_(ThermionDartTexture1 _lib, NSObject cls) { - final _ret = _lib._objc_msgSend_525( - _lib._class_NSKeyedArchiver1, _lib._sel_classNameForClass_1, cls._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - @override - void encodeObject_forKey_(NSObject? object, NSString key) { - _lib._objc_msgSend_134(_id, _lib._sel_encodeObject_forKey_1, - object?._id ?? ffi.nullptr, key._id); - } - - @override - void encodeConditionalObject_forKey_(NSObject? object, NSString key) { - _lib._objc_msgSend_134(_id, _lib._sel_encodeConditionalObject_forKey_1, - object?._id ?? ffi.nullptr, key._id); - } - - @override - void encodeBool_forKey_(bool value, NSString key) { - _lib._objc_msgSend_295(_id, _lib._sel_encodeBool_forKey_1, value, key._id); - } - - @override - void encodeInt_forKey_(int value, NSString key) { - _lib._objc_msgSend_296(_id, _lib._sel_encodeInt_forKey_1, value, key._id); - } - - @override - void encodeInt32_forKey_(int value, NSString key) { - _lib._objc_msgSend_297(_id, _lib._sel_encodeInt32_forKey_1, value, key._id); - } - - @override - void encodeInt64_forKey_(int value, NSString key) { - _lib._objc_msgSend_298(_id, _lib._sel_encodeInt64_forKey_1, value, key._id); - } - - @override - void encodeFloat_forKey_(double value, NSString key) { - _lib._objc_msgSend_299(_id, _lib._sel_encodeFloat_forKey_1, value, key._id); - } - - @override - void encodeDouble_forKey_(double value, NSString key) { - _lib._objc_msgSend_300( - _id, _lib._sel_encodeDouble_forKey_1, value, key._id); - } - - @override - void encodeBytes_length_forKey_( - ffi.Pointer bytes, int length, NSString key) { - _lib._objc_msgSend_301( - _id, _lib._sel_encodeBytes_length_forKey_1, bytes, length, key._id); - } - - @override - bool get requiresSecureCoding { - return _lib._objc_msgSend_12(_id, _lib._sel_requiresSecureCoding1); - } - - set requiresSecureCoding(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setRequiresSecureCoding_1, value); - } - - static NSKeyedArchiver new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSKeyedArchiver1, _lib._sel_new1); - return NSKeyedArchiver._(_ret, _lib, retain: false, release: true); - } - - static NSKeyedArchiver allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSKeyedArchiver1, _lib._sel_allocWithZone_1, zone); - return NSKeyedArchiver._(_ret, _lib, retain: false, release: true); - } - - static NSKeyedArchiver alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSKeyedArchiver1, _lib._sel_alloc1); - return NSKeyedArchiver._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSKeyedArchiver1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSKeyedArchiver1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSKeyedArchiver1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSKeyedArchiver1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSKeyedArchiver1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSKeyedArchiver1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSKeyedArchiver1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSKeyedArchiver1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSKeyedArchiver1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSMutableData extends NSData { - NSMutableData._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMutableData] that points to the same underlying object as [other]. - static NSMutableData castFrom(T other) { - return NSMutableData._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSMutableData] that wraps the given raw object pointer. - static NSMutableData castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableData._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMutableData]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMutableData1); - } - - ffi.Pointer get mutableBytes { - return _lib._objc_msgSend_20(_id, _lib._sel_mutableBytes1); - } - - @override - int get length { - return _lib._objc_msgSend_10(_id, _lib._sel_length1); - } - - set length(int value) { - return _lib._objc_msgSend_515(_id, _lib._sel_setLength_1, value); - } - - void appendBytes_length_(ffi.Pointer bytes, int length) { - _lib._objc_msgSend_22(_id, _lib._sel_appendBytes_length_1, bytes, length); - } - - void appendData_(NSData other) { - _lib._objc_msgSend_284(_id, _lib._sel_appendData_1, other._id); - } - - void increaseLengthBy_(int extraLength) { - _lib._objc_msgSend_469(_id, _lib._sel_increaseLengthBy_1, extraLength); - } - - void replaceBytesInRange_withBytes_( - _NSRange range, ffi.Pointer bytes) { - _lib._objc_msgSend_516( - _id, _lib._sel_replaceBytesInRange_withBytes_1, range, bytes); - } - - void resetBytesInRange_(_NSRange range) { - _lib._objc_msgSend_475(_id, _lib._sel_resetBytesInRange_1, range); - } - - void setData_(NSData data) { - _lib._objc_msgSend_284(_id, _lib._sel_setData_1, data._id); - } - - void replaceBytesInRange_withBytes_length_(_NSRange range, - ffi.Pointer replacementBytes, int replacementLength) { - _lib._objc_msgSend_517( - _id, - _lib._sel_replaceBytesInRange_withBytes_length_1, - range, - replacementBytes, - replacementLength); - } - - static NSMutableData? dataWithCapacity_( - ThermionDartTexture1 _lib, int aNumItems) { - final _ret = _lib._objc_msgSend_518( - _lib._class_NSMutableData1, _lib._sel_dataWithCapacity_1, aNumItems); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData? dataWithLength_(ThermionDartTexture1 _lib, int length) { - final _ret = _lib._objc_msgSend_518( - _lib._class_NSMutableData1, _lib._sel_dataWithLength_1, length); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - NSMutableData? initWithCapacity_(int capacity) { - final _ret = - _lib._objc_msgSend_518(_id, _lib._sel_initWithCapacity_1, capacity); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - NSMutableData? initWithLength_(int length) { - final _ret = - _lib._objc_msgSend_518(_id, _lib._sel_initWithLength_1, length); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - bool decompressUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - return _lib._objc_msgSend_519( - _id, _lib._sel_decompressUsingAlgorithm_error_1, algorithm, error); - } - - bool compressUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - return _lib._objc_msgSend_519( - _id, _lib._sel_compressUsingAlgorithm_error_1, algorithm, error); - } - - static NSMutableData data(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_data1); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData dataWithBytes_length_( - ThermionDartTexture1 _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_272(_lib._class_NSMutableData1, - _lib._sel_dataWithBytes_length_1, bytes, length); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData dataWithBytesNoCopy_length_( - ThermionDartTexture1 _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_272(_lib._class_NSMutableData1, - _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - static NSMutableData dataWithBytesNoCopy_length_freeWhenDone_( - ThermionDartTexture1 _lib, - ffi.Pointer bytes, - int length, - bool b) { - final _ret = _lib._objc_msgSend_273(_lib._class_NSMutableData1, - _lib._sel_dataWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - static NSMutableData? dataWithContentsOfFile_options_error_( - ThermionDartTexture1 _lib, - NSString path, - int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_274( - _lib._class_NSMutableData1, - _lib._sel_dataWithContentsOfFile_options_error_1, - path._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData? dataWithContentsOfURL_options_error_( - ThermionDartTexture1 _lib, - NSURL url, - int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_275( - _lib._class_NSMutableData1, - _lib._sel_dataWithContentsOfURL_options_error_1, - url._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData? dataWithContentsOfFile_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSMutableData1, - _lib._sel_dataWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData? dataWithContentsOfURL_( - ThermionDartTexture1 _lib, NSURL url) { - final _ret = _lib._objc_msgSend_276( - _lib._class_NSMutableData1, _lib._sel_dataWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData initWithBytes_length_(ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_272( - _id, _lib._sel_initWithBytes_length_1, bytes, length); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData initWithBytesNoCopy_length_( - ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_272( - _id, _lib._sel_initWithBytesNoCopy_length_1, bytes, length); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableData initWithBytesNoCopy_length_freeWhenDone_( - ffi.Pointer bytes, int length, bool b) { - final _ret = _lib._objc_msgSend_273(_id, - _lib._sel_initWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableData initWithBytesNoCopy_length_deallocator_( - ffi.Pointer bytes, - int length, - ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong? deallocator) { - final _ret = _lib._objc_msgSend_277( - _id, - _lib._sel_initWithBytesNoCopy_length_deallocator_1, - bytes, - length, - deallocator?._id ?? ffi.nullptr); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableData? initWithContentsOfFile_options_error_(NSString path, - int readOptionsMask, ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_274( - _id, - _lib._sel_initWithContentsOfFile_options_error_1, - path._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? initWithContentsOfURL_options_error_(NSURL url, - int readOptionsMask, ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_275( - _id, - _lib._sel_initWithContentsOfURL_options_error_1, - url._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_38( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_276(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_278(_id, _lib._sel_initWithData_1, data._id); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData dataWithData_(ThermionDartTexture1 _lib, NSData data) { - final _ret = _lib._objc_msgSend_278( - _lib._class_NSMutableData1, _lib._sel_dataWithData_1, data._id); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? initWithBase64EncodedString_options_( - NSString base64String, int options) { - final _ret = _lib._objc_msgSend_279( - _id, - _lib._sel_initWithBase64EncodedString_options_1, - base64String._id, - options); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? initWithBase64EncodedData_options_( - NSData base64Data, int options) { - final _ret = _lib._objc_msgSend_281(_id, - _lib._sel_initWithBase64EncodedData_options_1, base64Data._id, options); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? decompressedDataUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283(_id, - _lib._sel_decompressedDataUsingAlgorithm_error_1, algorithm, error); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? compressedDataUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283( - _id, _lib._sel_compressedDataUsingAlgorithm_error_1, algorithm, error); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSObject? dataWithContentsOfMappedFile_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSMutableData1, - _lib._sel_dataWithContentsOfMappedFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_new1); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - static NSMutableData allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableData1, _lib._sel_allocWithZone_1, zone); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - static NSMutableData alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_alloc1); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMutableData1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMutableData1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableData1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableData1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMutableData1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMutableData1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMutableData1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSMutableData1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableData1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSPropertyListFormat { - static const int NSPropertyListOpenStepFormat = 1; - static const int NSPropertyListXMLFormat_v1_0 = 100; - static const int NSPropertyListBinaryFormat_v1_0 = 200; -} - -class NSThread extends NSObject { - NSThread._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSThread] that points to the same underlying object as [other]. - static NSThread castFrom(T other) { - return NSThread._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSThread] that wraps the given raw object pointer. - static NSThread castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSThread._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSThread]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSThread1); - } - - static NSThread getCurrentThread(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_530(_lib._class_NSThread1, _lib._sel_currentThread1); - return NSThread._(_ret, _lib, retain: true, release: true); - } - - static void detachNewThreadWithBlock_( - ThermionDartTexture1 _lib, ObjCBlock_ffiVoid block) { - _lib._objc_msgSend_531( - _lib._class_NSThread1, _lib._sel_detachNewThreadWithBlock_1, block._id); - } - - static void detachNewThreadSelector_toTarget_withObject_( - ThermionDartTexture1 _lib, - ffi.Pointer selector, - NSObject target, - NSObject? argument) { - _lib._objc_msgSend_532( - _lib._class_NSThread1, - _lib._sel_detachNewThreadSelector_toTarget_withObject_1, - selector, - target._id, - argument?._id ?? ffi.nullptr); - } - - static bool isMultiThreaded(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSThread1, _lib._sel_isMultiThreaded1); - } - - NSMutableDictionary get threadDictionary { - final _ret = _lib._objc_msgSend_538(_id, _lib._sel_threadDictionary1); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static void sleepUntilDate_(ThermionDartTexture1 _lib, NSDate date) { - _lib._objc_msgSend_539( - _lib._class_NSThread1, _lib._sel_sleepUntilDate_1, date._id); - } - - static void sleepForTimeInterval_(ThermionDartTexture1 _lib, double ti) { - _lib._objc_msgSend_540( - _lib._class_NSThread1, _lib._sel_sleepForTimeInterval_1, ti); - } - - static void exit(ThermionDartTexture1 _lib) { - _lib._objc_msgSend_1(_lib._class_NSThread1, _lib._sel_exit1); - } - - double get threadPriority { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_threadPriority1) - : _lib._objc_msgSend_164(_id, _lib._sel_threadPriority1); - } - - set threadPriority(double value) { - return _lib._objc_msgSend_541(_id, _lib._sel_setThreadPriority_1, value); - } - - int get qualityOfService { - return _lib._objc_msgSend_542(_id, _lib._sel_qualityOfService1); - } - - set qualityOfService(int value) { - return _lib._objc_msgSend_543(_id, _lib._sel_setQualityOfService_1, value); - } - - static NSArray getCallStackReturnAddresses(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSThread1, _lib._sel_callStackReturnAddresses1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray getCallStackSymbols(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSThread1, _lib._sel_callStackSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? get name { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_name1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set name(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); - } - - int get stackSize { - return _lib._objc_msgSend_10(_id, _lib._sel_stackSize1); - } - - set stackSize(int value) { - return _lib._objc_msgSend_515(_id, _lib._sel_setStackSize_1, value); - } - - bool get isMainThread { - return _lib._objc_msgSend_12(_id, _lib._sel_isMainThread1); - } - - static NSThread getMainThread(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_530(_lib._class_NSThread1, _lib._sel_mainThread1); - return NSThread._(_ret, _lib, retain: true, release: true); - } - - @override - NSThread init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSThread._(_ret, _lib, retain: true, release: true); - } - - NSThread initWithTarget_selector_object_( - NSObject target, ffi.Pointer selector, NSObject? argument) { - final _ret = _lib._objc_msgSend_545( - _id, - _lib._sel_initWithTarget_selector_object_1, - target._id, - selector, - argument?._id ?? ffi.nullptr); - return NSThread._(_ret, _lib, retain: true, release: true); - } - - NSThread initWithBlock_(ObjCBlock_ffiVoid block) { - final _ret = - _lib._objc_msgSend_546(_id, _lib._sel_initWithBlock_1, block._id); - return NSThread._(_ret, _lib, retain: true, release: true); - } - - bool get executing { - return _lib._objc_msgSend_12(_id, _lib._sel_isExecuting1); - } - - bool get finished { - return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); - } - - bool get cancelled { - return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); - } - - void cancel() { - _lib._objc_msgSend_1(_id, _lib._sel_cancel1); - } - - void start() { - _lib._objc_msgSend_1(_id, _lib._sel_start1); - } - - void main() { - _lib._objc_msgSend_1(_id, _lib._sel_main1); - } - - static NSThread new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSThread1, _lib._sel_new1); - return NSThread._(_ret, _lib, retain: false, release: true); - } - - static NSThread allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSThread1, _lib._sel_allocWithZone_1, zone); - return NSThread._(_ret, _lib, retain: false, release: true); - } - - static NSThread alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSThread1, _lib._sel_alloc1); - return NSThread._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSThread1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSThread1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSThread1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSThread1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSThread1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSThread1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSThread1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSThread1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSThread1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, -) => - block.ref.target - .cast>() - .asFunction()(); -final _ObjCBlock_ffiVoid_closureRegistry = {}; -int _ObjCBlock_ffiVoid_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_registerClosure(void Function() fn) { - final id = ++_ObjCBlock_ffiVoid_closureRegistryIndex; - _ObjCBlock_ffiVoid_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, -) => - _ObjCBlock_ffiVoid_closureRegistry[block.ref.target.address]!(); - -class ObjCBlock_ffiVoid extends _ObjCBlockBase { - ObjCBlock_ffiVoid._(ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid.fromFunctionPointer(ThermionDartTexture1 lib, - ffi.Pointer> ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_ffiVoid_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid.fromFunction(ThermionDartTexture1 lib, void Function() fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_ffiVoid_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_registerClosure(() => fn())), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid.listener(ThermionDartTexture1 lib, void Function() fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>)>.listener( - _ObjCBlock_ffiVoid_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_registerClosure(() => fn())), - lib); - static ffi.NativeCallable)>? - _dartFuncListenerTrampoline; - - void call() => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>>() - .asFunction)>()( - _id, - ); -} - -class NSMutableDictionary extends NSDictionary { - NSMutableDictionary._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMutableDictionary] that points to the same underlying object as [other]. - static NSMutableDictionary castFrom(T other) { - return NSMutableDictionary._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSMutableDictionary] that wraps the given raw object pointer. - static NSMutableDictionary castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableDictionary._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMutableDictionary]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSMutableDictionary1); - } - - void removeObjectForKey_(NSObject aKey) { - _lib._objc_msgSend_15(_id, _lib._sel_removeObjectForKey_1, aKey._id); - } - - void setObject_forKey_(NSObject anObject, NSObject aKey) { - _lib._objc_msgSend_533( - _id, _lib._sel_setObject_forKey_1, anObject._id, aKey._id); - } - - @override - NSMutableDictionary init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - NSMutableDictionary initWithCapacity_(int numItems) { - final _ret = - _lib._objc_msgSend_64(_id, _lib._sel_initWithCapacity_1, numItems); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableDictionary? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - void addEntriesFromDictionary_(NSDictionary otherDictionary) { - _lib._objc_msgSend_508( - _id, _lib._sel_addEntriesFromDictionary_1, otherDictionary._id); - } - - void removeAllObjects() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); - } - - void removeObjectsForKeys_(NSArray keyArray) { - _lib._objc_msgSend_471(_id, _lib._sel_removeObjectsForKeys_1, keyArray._id); - } - - void setDictionary_(NSDictionary otherDictionary) { - _lib._objc_msgSend_508(_id, _lib._sel_setDictionary_1, otherDictionary._id); - } - - void setObject_forKeyedSubscript_(NSObject? obj, NSObject key) { - _lib._objc_msgSend_534(_id, _lib._sel_setObject_forKeyedSubscript_1, - obj?._id ?? ffi.nullptr, key._id); - } - - static NSMutableDictionary dictionaryWithCapacity_( - ThermionDartTexture1 _lib, int numItems) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithCapacity_1, numItems); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary? dictionaryWithContentsOfFile_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_535(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary? dictionaryWithContentsOfURL_( - ThermionDartTexture1 _lib, NSURL url) { - final _ret = _lib._objc_msgSend_536(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - NSMutableDictionary? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_535( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - NSMutableDictionary? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_536(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionaryWithSharedKeySet_( - ThermionDartTexture1 _lib, NSObject keyset) { - final _ret = _lib._objc_msgSend_537(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithSharedKeySet_1, keyset._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - void setValue_forKey_(NSObject? value, NSString key) { - _lib._objc_msgSend_134( - _id, _lib._sel_setValue_forKey_1, value?._id ?? ffi.nullptr, key._id); - } - - @override - NSMutableDictionary initWithObjects_forKeys_count_( - ffi.Pointer> objects, - ffi.Pointer> keys, - int cnt) { - final _ret = _lib._objc_msgSend_146( - _id, _lib._sel_initWithObjects_forKeys_count_1, objects, keys, cnt); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionary(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableDictionary1, _lib._sel_dictionary1); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionaryWithObject_forKey_( - ThermionDartTexture1 _lib, NSObject object, NSObject key) { - final _ret = _lib._objc_msgSend_157(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithObject_forKey_1, object._id, key._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionaryWithObjects_forKeys_count_( - ThermionDartTexture1 _lib, - ffi.Pointer> objects, - ffi.Pointer> keys, - int cnt) { - final _ret = _lib._objc_msgSend_146(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithObjects_forKeys_count_1, objects, keys, cnt); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionaryWithObjectsAndKeys_( - ThermionDartTexture1 _lib, NSObject firstObject) { - final _ret = _lib._objc_msgSend_123(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithObjectsAndKeys_1, firstObject._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionaryWithDictionary_( - ThermionDartTexture1 _lib, NSDictionary dict) { - final _ret = _lib._objc_msgSend_158(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithDictionary_1, dict._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionaryWithObjects_forKeys_( - ThermionDartTexture1 _lib, NSArray objects, NSArray keys) { - final _ret = _lib._objc_msgSend_159(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithObjects_forKeys_1, objects._id, keys._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableDictionary initWithObjectsAndKeys_(NSObject firstObject) { - final _ret = _lib._objc_msgSend_123( - _id, _lib._sel_initWithObjectsAndKeys_1, firstObject._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableDictionary initWithDictionary_(NSDictionary otherDictionary) { - final _ret = _lib._objc_msgSend_158( - _id, _lib._sel_initWithDictionary_1, otherDictionary._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableDictionary initWithDictionary_copyItems_( - NSDictionary otherDictionary, bool flag) { - final _ret = _lib._objc_msgSend_160(_id, - _lib._sel_initWithDictionary_copyItems_1, otherDictionary._id, flag); - return NSMutableDictionary._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableDictionary initWithObjects_forKeys_(NSArray objects, NSArray keys) { - final _ret = _lib._objc_msgSend_159( - _id, _lib._sel_initWithObjects_forKeys_1, objects._id, keys._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary? dictionaryWithContentsOfURL_error_( - ThermionDartTexture1 _lib, - NSURL url, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_161(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSObject sharedKeySetForKeys_( - ThermionDartTexture1 _lib, NSArray keys) { - final _ret = _lib._objc_msgSend_124(_lib._class_NSMutableDictionary1, - _lib._sel_sharedKeySetForKeys_1, keys._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableDictionary1, _lib._sel_new1); - return NSMutableDictionary._(_ret, _lib, retain: false, release: true); - } - - static NSMutableDictionary allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableDictionary1, _lib._sel_allocWithZone_1, zone); - return NSMutableDictionary._(_ret, _lib, retain: false, release: true); - } - - static NSMutableDictionary alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableDictionary1, _lib._sel_alloc1); - return NSMutableDictionary._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMutableDictionary1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMutableDictionary1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSMutableDictionary1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableDictionary1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMutableDictionary1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMutableDictionary1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMutableDictionary1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSMutableDictionary1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableDictionary1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -class NSArchiver extends NSCoder { - NSArchiver._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSArchiver] that points to the same underlying object as [other]. - static NSArchiver castFrom(T other) { - return NSArchiver._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSArchiver] that wraps the given raw object pointer. - static NSArchiver castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSArchiver._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSArchiver]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSArchiver1); - } - - NSArchiver initForWritingWithMutableData_(NSMutableData mdata) { - final _ret = _lib._objc_msgSend_520( - _id, _lib._sel_initForWritingWithMutableData_1, mdata._id); - return NSArchiver._(_ret, _lib, retain: true, release: true); - } - - NSMutableData get archiverData { - final _ret = _lib._objc_msgSend_549(_id, _lib._sel_archiverData1); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - void encodeRootObject_(NSObject rootObject) { - _lib._objc_msgSend_15(_id, _lib._sel_encodeRootObject_1, rootObject._id); - } - - @override - void encodeConditionalObject_(NSObject? object) { - _lib._objc_msgSend_288( - _id, _lib._sel_encodeConditionalObject_1, object?._id ?? ffi.nullptr); - } - - static NSData archivedDataWithRootObject_( - ThermionDartTexture1 _lib, NSObject rootObject) { - final _ret = _lib._objc_msgSend_521(_lib._class_NSArchiver1, - _lib._sel_archivedDataWithRootObject_1, rootObject._id); - return NSData._(_ret, _lib, retain: true, release: true); - } - - static bool archiveRootObject_toFile_( - ThermionDartTexture1 _lib, NSObject rootObject, NSString path) { - return _lib._objc_msgSend_260(_lib._class_NSArchiver1, - _lib._sel_archiveRootObject_toFile_1, rootObject._id, path._id); - } - - void encodeClassName_intoClassName_( - NSString trueName, NSString inArchiveName) { - _lib._objc_msgSend_550(_id, _lib._sel_encodeClassName_intoClassName_1, - trueName._id, inArchiveName._id); - } - - NSString? classNameEncodedForTrueClassName_(NSString trueName) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_classNameEncodedForTrueClassName_1, trueName._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - void replaceObject_withObject_(NSObject object, NSObject newObject) { - _lib._objc_msgSend_533( - _id, _lib._sel_replaceObject_withObject_1, object._id, newObject._id); - } - - @override - NSArchiver init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSArchiver._(_ret, _lib, retain: true, release: true); - } - - static NSArchiver new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSArchiver1, _lib._sel_new1); - return NSArchiver._(_ret, _lib, retain: false, release: true); - } - - static NSArchiver allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSArchiver1, _lib._sel_allocWithZone_1, zone); - return NSArchiver._(_ret, _lib, retain: false, release: true); - } - - static NSArchiver alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSArchiver1, _lib._sel_alloc1); - return NSArchiver._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSArchiver1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSArchiver1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSArchiver1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSArchiver1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSArchiver1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSArchiver1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSArchiver1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSArchiver1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSArchiver1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSPortCoder extends NSCoder { - NSPortCoder._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSPortCoder] that points to the same underlying object as [other]. - static NSPortCoder castFrom(T other) { - return NSPortCoder._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSPortCoder] that wraps the given raw object pointer. - static NSPortCoder castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSPortCoder._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSPortCoder]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPortCoder1); - } - - bool isBycopy() { - return _lib._objc_msgSend_12(_id, _lib._sel_isBycopy1); - } - - bool isByref() { - return _lib._objc_msgSend_12(_id, _lib._sel_isByref1); - } - - void encodePortObject_(NSPort aport) { - _lib._objc_msgSend_592(_id, _lib._sel_encodePortObject_1, aport._id); - } - - NSPort? decodePortObject() { - final _ret = _lib._objc_msgSend_593(_id, _lib._sel_decodePortObject1); - return _ret.address == 0 - ? null - : NSPort._(_ret, _lib, retain: true, release: true); - } - - NSConnection? connection() { - final _ret = _lib._objc_msgSend_594(_id, _lib._sel_connection1); - return _ret.address == 0 - ? null - : NSConnection._(_ret, _lib, retain: true, release: true); - } - - static NSObject portCoderWithReceivePort_sendPort_components_( - ThermionDartTexture1 _lib, - NSPort? rcvPort, - NSPort? sndPort, - NSArray? comps) { - final _ret = _lib._objc_msgSend_595( - _lib._class_NSPortCoder1, - _lib._sel_portCoderWithReceivePort_sendPort_components_1, - rcvPort?._id ?? ffi.nullptr, - sndPort?._id ?? ffi.nullptr, - comps?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject initWithReceivePort_sendPort_components_( - NSPort? rcvPort, NSPort? sndPort, NSArray? comps) { - final _ret = _lib._objc_msgSend_595( - _id, - _lib._sel_initWithReceivePort_sendPort_components_1, - rcvPort?._id ?? ffi.nullptr, - sndPort?._id ?? ffi.nullptr, - comps?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - void dispatch() { - _lib._objc_msgSend_1(_id, _lib._sel_dispatch1); - } - - @override - NSPortCoder init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSPortCoder._(_ret, _lib, retain: true, release: true); - } - - static NSPortCoder new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSPortCoder1, _lib._sel_new1); - return NSPortCoder._(_ret, _lib, retain: false, release: true); - } - - static NSPortCoder allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSPortCoder1, _lib._sel_allocWithZone_1, zone); - return NSPortCoder._(_ret, _lib, retain: false, release: true); - } - - static NSPortCoder alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPortCoder1, _lib._sel_alloc1); - return NSPortCoder._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSPortCoder1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSPortCoder1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSPortCoder1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSPortCoder1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSPortCoder1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSPortCoder1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSPortCoder1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSPortCoder1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSPortCoder1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSPort extends NSObject { - NSPort._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSPort] that points to the same underlying object as [other]. - static NSPort castFrom(T other) { - return NSPort._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSPort] that wraps the given raw object pointer. - static NSPort castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSPort._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSPort]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPort1); - } - - static NSPort port(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_552(_lib._class_NSPort1, _lib._sel_port1); - return NSPort._(_ret, _lib, retain: true, release: true); - } - - void invalidate() { - _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); - } - - bool get valid { - return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); - } - - void setDelegate_(NSObject? anObject) { - _lib._objc_msgSend_288( - _id, _lib._sel_setDelegate_1, anObject?._id ?? ffi.nullptr); - } - - NSObject? delegate() { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void scheduleInRunLoop_forMode_(NSRunLoop runLoop, NSString mode) { - _lib._objc_msgSend_568( - _id, _lib._sel_scheduleInRunLoop_forMode_1, runLoop._id, mode._id); - } - - void removeFromRunLoop_forMode_(NSRunLoop runLoop, NSString mode) { - _lib._objc_msgSend_568( - _id, _lib._sel_removeFromRunLoop_forMode_1, runLoop._id, mode._id); - } - - int get reservedSpaceLength { - return _lib._objc_msgSend_10(_id, _lib._sel_reservedSpaceLength1); - } - - bool sendBeforeDate_components_from_reserved_( - NSDate limitDate, - NSMutableArray? components, - NSPort? receivePort, - int headerSpaceReserved) { - return _lib._objc_msgSend_569( - _id, - _lib._sel_sendBeforeDate_components_from_reserved_1, - limitDate._id, - components?._id ?? ffi.nullptr, - receivePort?._id ?? ffi.nullptr, - headerSpaceReserved); - } - - bool sendBeforeDate_msgid_components_from_reserved_( - NSDate limitDate, - int msgID, - NSMutableArray? components, - NSPort? receivePort, - int headerSpaceReserved) { - return _lib._objc_msgSend_570( - _id, - _lib._sel_sendBeforeDate_msgid_components_from_reserved_1, - limitDate._id, - msgID, - components?._id ?? ffi.nullptr, - receivePort?._id ?? ffi.nullptr, - headerSpaceReserved); - } - - void addConnection_toRunLoop_forMode_( - NSConnection conn, NSRunLoop runLoop, NSString mode) { - _lib._objc_msgSend_591(_id, _lib._sel_addConnection_toRunLoop_forMode_1, - conn._id, runLoop._id, mode._id); - } - - void removeConnection_fromRunLoop_forMode_( - NSConnection conn, NSRunLoop runLoop, NSString mode) { - _lib._objc_msgSend_591( - _id, - _lib._sel_removeConnection_fromRunLoop_forMode_1, - conn._id, - runLoop._id, - mode._id); - } - - @override - NSPort init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSPort._(_ret, _lib, retain: true, release: true); - } - - static NSPort new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSPort1, _lib._sel_new1); - return NSPort._(_ret, _lib, retain: false, release: true); - } - - static NSPort allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSPort1, _lib._sel_allocWithZone_1, zone); - return NSPort._(_ret, _lib, retain: false, release: true); - } - - static NSPort alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSPort1, _lib._sel_alloc1); - return NSPort._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSPort1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSPort1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSPort1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSPort1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSPort1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSPort1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSPort1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSPort1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSPort1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSRunLoop extends NSObject { - NSRunLoop._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSRunLoop] that points to the same underlying object as [other]. - static NSRunLoop castFrom(T other) { - return NSRunLoop._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSRunLoop] that wraps the given raw object pointer. - static NSRunLoop castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSRunLoop._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSRunLoop]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSRunLoop1); - } - - static NSRunLoop getCurrentRunLoop(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_553( - _lib._class_NSRunLoop1, _lib._sel_currentRunLoop1); - return NSRunLoop._(_ret, _lib, retain: true, release: true); - } - - static NSRunLoop getMainRunLoop(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_553(_lib._class_NSRunLoop1, _lib._sel_mainRunLoop1); - return NSRunLoop._(_ret, _lib, retain: true, release: true); - } - - NSString? get currentMode { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_currentMode1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer<__CFRunLoop> getCFRunLoop() { - return _lib._objc_msgSend_554(_id, _lib._sel_getCFRunLoop1); - } - - void addTimer_forMode_(NSTimer timer, NSString mode) { - _lib._objc_msgSend_561( - _id, _lib._sel_addTimer_forMode_1, timer._id, mode._id); - } - - void addPort_forMode_(NSPort aPort, NSString mode) { - _lib._objc_msgSend_562( - _id, _lib._sel_addPort_forMode_1, aPort._id, mode._id); - } - - void removePort_forMode_(NSPort aPort, NSString mode) { - _lib._objc_msgSend_562( - _id, _lib._sel_removePort_forMode_1, aPort._id, mode._id); - } - - NSDate? limitDateForMode_(NSString mode) { - final _ret = - _lib._objc_msgSend_563(_id, _lib._sel_limitDateForMode_1, mode._id); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - void acceptInputForMode_beforeDate_(NSString mode, NSDate limitDate) { - _lib._objc_msgSend_564(_id, _lib._sel_acceptInputForMode_beforeDate_1, - mode._id, limitDate._id); - } - - void run() { - _lib._objc_msgSend_1(_id, _lib._sel_run1); - } - - void runUntilDate_(NSDate limitDate) { - _lib._objc_msgSend_539(_id, _lib._sel_runUntilDate_1, limitDate._id); - } - - bool runMode_beforeDate_(NSString mode, NSDate limitDate) { - return _lib._objc_msgSend_565( - _id, _lib._sel_runMode_beforeDate_1, mode._id, limitDate._id); - } - - void configureAsServer() { - _lib._objc_msgSend_1(_id, _lib._sel_configureAsServer1); - } - - void performInModes_block_(NSArray modes, ObjCBlock_ffiVoid block) { - _lib._objc_msgSend_566( - _id, _lib._sel_performInModes_block_1, modes._id, block._id); - } - - void performBlock_(ObjCBlock_ffiVoid block) { - _lib._objc_msgSend_531(_id, _lib._sel_performBlock_1, block._id); - } - - void performSelector_target_argument_order_modes_( - ffi.Pointer aSelector, - NSObject target, - NSObject? arg, - int order, - NSArray modes) { - _lib._objc_msgSend_567( - _id, - _lib._sel_performSelector_target_argument_order_modes_1, - aSelector, - target._id, - arg?._id ?? ffi.nullptr, - order, - modes._id); - } - - void cancelPerformSelector_target_argument_( - ffi.Pointer aSelector, NSObject target, NSObject? arg) { - _lib._objc_msgSend_532( - _id, - _lib._sel_cancelPerformSelector_target_argument_1, - aSelector, - target._id, - arg?._id ?? ffi.nullptr); - } - - void cancelPerformSelectorsWithTarget_(NSObject target) { - _lib._objc_msgSend_15( - _id, _lib._sel_cancelPerformSelectorsWithTarget_1, target._id); - } - - @override - NSRunLoop init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSRunLoop._(_ret, _lib, retain: true, release: true); - } - - static NSRunLoop new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSRunLoop1, _lib._sel_new1); - return NSRunLoop._(_ret, _lib, retain: false, release: true); - } - - static NSRunLoop allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSRunLoop1, _lib._sel_allocWithZone_1, zone); - return NSRunLoop._(_ret, _lib, retain: false, release: true); - } - - static NSRunLoop alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSRunLoop1, _lib._sel_alloc1); - return NSRunLoop._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSRunLoop1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSRunLoop1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSRunLoop1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSRunLoop1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSRunLoop1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSRunLoop1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSRunLoop1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSRunLoop1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSRunLoop1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -final class __CFRunLoop extends ffi.Opaque {} - -class NSTimer extends NSObject { - NSTimer._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSTimer] that points to the same underlying object as [other]. - static NSTimer castFrom(T other) { - return NSTimer._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSTimer] that wraps the given raw object pointer. - static NSTimer castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSTimer._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSTimer]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTimer1); - } - - static NSTimer timerWithTimeInterval_invocation_repeats_( - ThermionDartTexture1 _lib, - double ti, - NSInvocation invocation, - bool yesOrNo) { - final _ret = _lib._objc_msgSend_555( - _lib._class_NSTimer1, - _lib._sel_timerWithTimeInterval_invocation_repeats_1, - ti, - invocation._id, - yesOrNo); - return NSTimer._(_ret, _lib, retain: true, release: true); - } - - static NSTimer scheduledTimerWithTimeInterval_invocation_repeats_( - ThermionDartTexture1 _lib, - double ti, - NSInvocation invocation, - bool yesOrNo) { - final _ret = _lib._objc_msgSend_555( - _lib._class_NSTimer1, - _lib._sel_scheduledTimerWithTimeInterval_invocation_repeats_1, - ti, - invocation._id, - yesOrNo); - return NSTimer._(_ret, _lib, retain: true, release: true); - } - - static NSTimer timerWithTimeInterval_target_selector_userInfo_repeats_( - ThermionDartTexture1 _lib, - double ti, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? userInfo, - bool yesOrNo) { - final _ret = _lib._objc_msgSend_556( - _lib._class_NSTimer1, - _lib._sel_timerWithTimeInterval_target_selector_userInfo_repeats_1, - ti, - aTarget._id, - aSelector, - userInfo?._id ?? ffi.nullptr, - yesOrNo); - return NSTimer._(_ret, _lib, retain: true, release: true); - } - - static NSTimer - scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( - ThermionDartTexture1 _lib, - double ti, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? userInfo, - bool yesOrNo) { - final _ret = _lib._objc_msgSend_556( - _lib._class_NSTimer1, - _lib._sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_1, - ti, - aTarget._id, - aSelector, - userInfo?._id ?? ffi.nullptr, - yesOrNo); - return NSTimer._(_ret, _lib, retain: true, release: true); - } - - static NSTimer timerWithTimeInterval_repeats_block_(ThermionDartTexture1 _lib, - double interval, bool repeats, ObjCBlock_ffiVoid_NSTimer block) { - final _ret = _lib._objc_msgSend_557( - _lib._class_NSTimer1, - _lib._sel_timerWithTimeInterval_repeats_block_1, - interval, - repeats, - block._id); - return NSTimer._(_ret, _lib, retain: true, release: true); - } - - static NSTimer scheduledTimerWithTimeInterval_repeats_block_( - ThermionDartTexture1 _lib, - double interval, - bool repeats, - ObjCBlock_ffiVoid_NSTimer block) { - final _ret = _lib._objc_msgSend_557( - _lib._class_NSTimer1, - _lib._sel_scheduledTimerWithTimeInterval_repeats_block_1, - interval, - repeats, - block._id); - return NSTimer._(_ret, _lib, retain: true, release: true); - } - - NSTimer initWithFireDate_interval_repeats_block_(NSDate date, double interval, - bool repeats, ObjCBlock_ffiVoid_NSTimer block) { - final _ret = _lib._objc_msgSend_558( - _id, - _lib._sel_initWithFireDate_interval_repeats_block_1, - date._id, - interval, - repeats, - block._id); - return NSTimer._(_ret, _lib, retain: true, release: true); - } - - NSTimer initWithFireDate_interval_target_selector_userInfo_repeats_( - NSDate date, - double ti, - NSObject t, - ffi.Pointer s, - NSObject? ui, - bool rep) { - final _ret = _lib._objc_msgSend_559( - _id, - _lib._sel_initWithFireDate_interval_target_selector_userInfo_repeats_1, - date._id, - ti, - t._id, - s, - ui?._id ?? ffi.nullptr, - rep); - return NSTimer._(_ret, _lib, retain: true, release: true); - } - - void fire() { - _lib._objc_msgSend_1(_id, _lib._sel_fire1); - } - - NSDate get fireDate { - final _ret = _lib._objc_msgSend_171(_id, _lib._sel_fireDate1); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - set fireDate(NSDate value) { - return _lib._objc_msgSend_560(_id, _lib._sel_setFireDate_1, value._id); - } - - double get timeInterval { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_timeInterval1) - : _lib._objc_msgSend_164(_id, _lib._sel_timeInterval1); - } - - double get tolerance { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_tolerance1) - : _lib._objc_msgSend_164(_id, _lib._sel_tolerance1); - } - - set tolerance(double value) { - return _lib._objc_msgSend_541(_id, _lib._sel_setTolerance_1, value); - } - - void invalidate() { - _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); - } - - bool get valid { - return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); - } - - NSObject? get userInfo { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_userInfo1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - NSTimer init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSTimer._(_ret, _lib, retain: true, release: true); - } - - static NSTimer new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSTimer1, _lib._sel_new1); - return NSTimer._(_ret, _lib, retain: false, release: true); - } - - static NSTimer allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSTimer1, _lib._sel_allocWithZone_1, zone); - return NSTimer._(_ret, _lib, retain: false, release: true); - } - - static NSTimer alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSTimer1, _lib._sel_alloc1); - return NSTimer._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSTimer1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSTimer1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSTimer1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSTimer1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSTimer1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSTimer1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSTimer1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSTimer1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSTimer1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_NSTimer_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSTimer_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSTimer_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSTimer_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSTimer_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSTimer_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSTimer_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSTimer_closureRegistry[block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_NSTimer extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSTimer._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSTimer.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSTimer_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSTimer.fromFunction( - ThermionDartTexture1 lib, void Function(NSTimer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSTimer_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSTimer_registerClosure( - (ffi.Pointer arg0) => - fn(NSTimer._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSTimer.listener( - ThermionDartTexture1 lib, void Function(NSTimer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSTimer_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSTimer_registerClosure( - (ffi.Pointer arg0) => - fn(NSTimer._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSTimer arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0._id); -} - -class NSConnection extends NSObject { - NSConnection._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSConnection] that points to the same underlying object as [other]. - static NSConnection castFrom(T other) { - return NSConnection._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSConnection] that wraps the given raw object pointer. - static NSConnection castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSConnection._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSConnection]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSConnection1); - } - - NSDictionary get statistics { - final _ret = _lib._objc_msgSend_180(_id, _lib._sel_statistics1); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSArray allConnections(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSConnection1, _lib._sel_allConnections1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSConnection defaultConnection(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_571( - _lib._class_NSConnection1, _lib._sel_defaultConnection1); - return NSConnection._(_ret, _lib, retain: true, release: true); - } - - static NSConnection? connectionWithRegisteredName_host_( - ThermionDartTexture1 _lib, NSString name, NSString? hostName) { - final _ret = _lib._objc_msgSend_572( - _lib._class_NSConnection1, - _lib._sel_connectionWithRegisteredName_host_1, - name._id, - hostName?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSConnection._(_ret, _lib, retain: true, release: true); - } - - static NSConnection? connectionWithRegisteredName_host_usingNameServer_( - ThermionDartTexture1 _lib, - NSString name, - NSString? hostName, - NSPortNameServer server) { - final _ret = _lib._objc_msgSend_577( - _lib._class_NSConnection1, - _lib._sel_connectionWithRegisteredName_host_usingNameServer_1, - name._id, - hostName?._id ?? ffi.nullptr, - server._id); - return _ret.address == 0 - ? null - : NSConnection._(_ret, _lib, retain: true, release: true); - } - - static NSDistantObject? rootProxyForConnectionWithRegisteredName_host_( - ThermionDartTexture1 _lib, NSString name, NSString? hostName) { - final _ret = _lib._objc_msgSend_582( - _lib._class_NSConnection1, - _lib._sel_rootProxyForConnectionWithRegisteredName_host_1, - name._id, - hostName?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSDistantObject._(_ret, _lib, retain: true, release: true); - } - - static NSDistantObject? - rootProxyForConnectionWithRegisteredName_host_usingNameServer_( - ThermionDartTexture1 _lib, - NSString name, - NSString? hostName, - NSPortNameServer server) { - final _ret = _lib._objc_msgSend_583( - _lib._class_NSConnection1, - _lib._sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_1, - name._id, - hostName?._id ?? ffi.nullptr, - server._id); - return _ret.address == 0 - ? null - : NSDistantObject._(_ret, _lib, retain: true, release: true); - } - - static NSConnection? serviceConnectionWithName_rootObject_usingNameServer_( - ThermionDartTexture1 _lib, - NSString name, - NSObject root, - NSPortNameServer server) { - final _ret = _lib._objc_msgSend_584( - _lib._class_NSConnection1, - _lib._sel_serviceConnectionWithName_rootObject_usingNameServer_1, - name._id, - root._id, - server._id); - return _ret.address == 0 - ? null - : NSConnection._(_ret, _lib, retain: true, release: true); - } - - static NSConnection? serviceConnectionWithName_rootObject_( - ThermionDartTexture1 _lib, NSString name, NSObject root) { - final _ret = _lib._objc_msgSend_585(_lib._class_NSConnection1, - _lib._sel_serviceConnectionWithName_rootObject_1, name._id, root._id); - return _ret.address == 0 - ? null - : NSConnection._(_ret, _lib, retain: true, release: true); - } - - double get requestTimeout { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_requestTimeout1) - : _lib._objc_msgSend_164(_id, _lib._sel_requestTimeout1); - } - - set requestTimeout(double value) { - return _lib._objc_msgSend_541(_id, _lib._sel_setRequestTimeout_1, value); - } - - double get replyTimeout { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_replyTimeout1) - : _lib._objc_msgSend_164(_id, _lib._sel_replyTimeout1); - } - - set replyTimeout(double value) { - return _lib._objc_msgSend_541(_id, _lib._sel_setReplyTimeout_1, value); - } - - NSObject? get rootObject { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_rootObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set rootObject(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setRootObject_1, value?._id ?? ffi.nullptr); - } - - NSObject? get delegate { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set delegate(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); - } - - bool get independentConversationQueueing { - return _lib._objc_msgSend_12( - _id, _lib._sel_independentConversationQueueing1); - } - - set independentConversationQueueing(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setIndependentConversationQueueing_1, value); - } - - bool get valid { - return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); - } - - NSDistantObject get rootProxy { - final _ret = _lib._objc_msgSend_586(_id, _lib._sel_rootProxy1); - return NSDistantObject._(_ret, _lib, retain: true, release: true); - } - - void invalidate() { - _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); - } - - void addRequestMode_(NSString rmode) { - _lib._objc_msgSend_247(_id, _lib._sel_addRequestMode_1, rmode._id); - } - - void removeRequestMode_(NSString rmode) { - _lib._objc_msgSend_247(_id, _lib._sel_removeRequestMode_1, rmode._id); - } - - NSArray get requestModes { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_requestModes1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - bool registerName_(NSString? name) { - return _lib._objc_msgSend_587( - _id, _lib._sel_registerName_1, name?._id ?? ffi.nullptr); - } - - bool registerName_withNameServer_(NSString? name, NSPortNameServer server) { - return _lib._objc_msgSend_588(_id, _lib._sel_registerName_withNameServer_1, - name?._id ?? ffi.nullptr, server._id); - } - - static NSConnection? connectionWithReceivePort_sendPort_( - ThermionDartTexture1 _lib, NSPort? receivePort, NSPort? sendPort) { - final _ret = _lib._objc_msgSend_589( - _lib._class_NSConnection1, - _lib._sel_connectionWithReceivePort_sendPort_1, - receivePort?._id ?? ffi.nullptr, - sendPort?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSConnection._(_ret, _lib, retain: true, release: true); - } - - static NSObject? currentConversation(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_17( - _lib._class_NSConnection1, _lib._sel_currentConversation1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSConnection? initWithReceivePort_sendPort_( - NSPort? receivePort, NSPort? sendPort) { - final _ret = _lib._objc_msgSend_589( - _id, - _lib._sel_initWithReceivePort_sendPort_1, - receivePort?._id ?? ffi.nullptr, - sendPort?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSConnection._(_ret, _lib, retain: true, release: true); - } - - NSPort get sendPort { - final _ret = _lib._objc_msgSend_552(_id, _lib._sel_sendPort1); - return NSPort._(_ret, _lib, retain: true, release: true); - } - - NSPort get receivePort { - final _ret = _lib._objc_msgSend_552(_id, _lib._sel_receivePort1); - return NSPort._(_ret, _lib, retain: true, release: true); - } - - void enableMultipleThreads() { - _lib._objc_msgSend_1(_id, _lib._sel_enableMultipleThreads1); - } - - bool get multipleThreadsEnabled { - return _lib._objc_msgSend_12(_id, _lib._sel_multipleThreadsEnabled1); - } - - void addRunLoop_(NSRunLoop runloop) { - _lib._objc_msgSend_590(_id, _lib._sel_addRunLoop_1, runloop._id); - } - - void removeRunLoop_(NSRunLoop runloop) { - _lib._objc_msgSend_590(_id, _lib._sel_removeRunLoop_1, runloop._id); - } - - void runInNewThread() { - _lib._objc_msgSend_1(_id, _lib._sel_runInNewThread1); - } - - NSArray get remoteObjects { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_remoteObjects1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get localObjects { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_localObjects1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - void dispatchWithComponents_(NSArray components) { - _lib._objc_msgSend_471( - _id, _lib._sel_dispatchWithComponents_1, components._id); - } - - @override - NSConnection init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSConnection._(_ret, _lib, retain: true, release: true); - } - - static NSConnection new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSConnection1, _lib._sel_new1); - return NSConnection._(_ret, _lib, retain: false, release: true); - } - - static NSConnection allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSConnection1, _lib._sel_allocWithZone_1, zone); - return NSConnection._(_ret, _lib, retain: false, release: true); - } - - static NSConnection alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSConnection1, _lib._sel_alloc1); - return NSConnection._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSConnection1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSConnection1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSConnection1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSConnection1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSConnection1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSConnection1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSConnection1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSConnection1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSConnection1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSPortNameServer extends NSObject { - NSPortNameServer._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSPortNameServer] that points to the same underlying object as [other]. - static NSPortNameServer castFrom(T other) { - return NSPortNameServer._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSPortNameServer] that wraps the given raw object pointer. - static NSPortNameServer castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSPortNameServer._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSPortNameServer]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSPortNameServer1); - } - - static NSPortNameServer systemDefaultPortNameServer( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_573( - _lib._class_NSPortNameServer1, _lib._sel_systemDefaultPortNameServer1); - return NSPortNameServer._(_ret, _lib, retain: true, release: true); - } - - NSPort? portForName_(NSString name) { - final _ret = _lib._objc_msgSend_574(_id, _lib._sel_portForName_1, name._id); - return _ret.address == 0 - ? null - : NSPort._(_ret, _lib, retain: true, release: true); - } - - NSPort? portForName_host_(NSString name, NSString? host) { - final _ret = _lib._objc_msgSend_575( - _id, _lib._sel_portForName_host_1, name._id, host?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSPort._(_ret, _lib, retain: true, release: true); - } - - bool registerPort_name_(NSPort port, NSString name) { - return _lib._objc_msgSend_576( - _id, _lib._sel_registerPort_name_1, port._id, name._id); - } - - bool removePortForName_(NSString name) { - return _lib._objc_msgSend_63(_id, _lib._sel_removePortForName_1, name._id); - } - - @override - NSPortNameServer init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSPortNameServer._(_ret, _lib, retain: true, release: true); - } - - static NSPortNameServer new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPortNameServer1, _lib._sel_new1); - return NSPortNameServer._(_ret, _lib, retain: false, release: true); - } - - static NSPortNameServer allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSPortNameServer1, _lib._sel_allocWithZone_1, zone); - return NSPortNameServer._(_ret, _lib, retain: false, release: true); - } - - static NSPortNameServer alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPortNameServer1, _lib._sel_alloc1); - return NSPortNameServer._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSPortNameServer1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSPortNameServer1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSPortNameServer1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSPortNameServer1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSPortNameServer1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSPortNameServer1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSPortNameServer1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSPortNameServer1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSPortNameServer1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSDistantObject extends NSProxy { - NSDistantObject._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSDistantObject] that points to the same underlying object as [other]. - static NSDistantObject castFrom(T other) { - return NSDistantObject._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSDistantObject] that wraps the given raw object pointer. - static NSDistantObject castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSDistantObject._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSDistantObject]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSDistantObject1); - } - - static NSObject? proxyWithTarget_connection_( - ThermionDartTexture1 _lib, NSObject target, NSConnection connection) { - final _ret = _lib._objc_msgSend_579(_lib._class_NSDistantObject1, - _lib._sel_proxyWithTarget_connection_1, target._id, connection._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSDistantObject? initWithTarget_connection_( - NSObject target, NSConnection connection) { - final _ret = _lib._objc_msgSend_579( - _id, _lib._sel_initWithTarget_connection_1, target._id, connection._id); - return _ret.address == 0 - ? null - : NSDistantObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject proxyWithLocal_connection_( - ThermionDartTexture1 _lib, NSObject target, NSConnection connection) { - final _ret = _lib._objc_msgSend_580(_lib._class_NSDistantObject1, - _lib._sel_proxyWithLocal_connection_1, target._id, connection._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSDistantObject initWithLocal_connection_( - NSObject target, NSConnection connection) { - final _ret = _lib._objc_msgSend_580( - _id, _lib._sel_initWithLocal_connection_1, target._id, connection._id); - return NSDistantObject._(_ret, _lib, retain: true, release: true); - } - - NSDistantObject? initWithCoder_(NSCoder inCoder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, inCoder._id); - return _ret.address == 0 - ? null - : NSDistantObject._(_ret, _lib, retain: true, release: true); - } - - void setProtocolForProxy_(Protocol? proto) { - _lib._objc_msgSend_581( - _id, _lib._sel_setProtocolForProxy_1, proto?._id ?? ffi.nullptr); - } - - NSConnection get connectionForProxy { - final _ret = _lib._objc_msgSend_571(_id, _lib._sel_connectionForProxy1); - return NSConnection._(_ret, _lib, retain: true, release: true); - } - - static NSObject alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSDistantObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - static bool respondsToSelector_( - ThermionDartTexture1 _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_4(_lib._class_NSDistantObject1, - _lib._sel_respondsToSelector_1, aSelector); - } -} - -class NSProxy extends _ObjCWrapper { - NSProxy._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSProxy] that points to the same underlying object as [other]. - static NSProxy castFrom(T other) { - return NSProxy._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSProxy] that wraps the given raw object pointer. - static NSProxy castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSProxy._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSProxy]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProxy1); - } - - static NSObject alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSProxy1, _lib._sel_alloc1); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - static NSObject allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSProxy1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - static NSObject class1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSProxy1, _lib._sel_class1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - void forwardInvocation_(NSInvocation invocation) { - _lib._objc_msgSend_420(_id, _lib._sel_forwardInvocation_1, invocation._id); - } - - NSMethodSignature? methodSignatureForSelector_(ffi.Pointer sel) { - final _ret = _lib._objc_msgSend_578( - _id, _lib._sel_methodSignatureForSelector_1, sel); - return _ret.address == 0 - ? null - : NSMethodSignature._(_ret, _lib, retain: true, release: true); - } - - void dealloc() { - _lib._objc_msgSend_1(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_1(_id, _lib._sel_finalize1); - } - - NSString get description { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get debugDescription { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_debugDescription1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static bool respondsToSelector_( - ThermionDartTexture1 _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_4( - _lib._class_NSProxy1, _lib._sel_respondsToSelector_1, aSelector); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_12(_id, _lib._sel_retainWeakReference1); - } -} - -class NSClassDescription extends NSObject { - NSClassDescription._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSClassDescription] that points to the same underlying object as [other]. - static NSClassDescription castFrom(T other) { - return NSClassDescription._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSClassDescription] that wraps the given raw object pointer. - static NSClassDescription castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSClassDescription._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSClassDescription]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSClassDescription1); - } - - static void registerClassDescription_forClass_(ThermionDartTexture1 _lib, - NSClassDescription description, NSObject aClass) { - _lib._objc_msgSend_597( - _lib._class_NSClassDescription1, - _lib._sel_registerClassDescription_forClass_1, - description._id, - aClass._id); - } - - static void invalidateClassDescriptionCache(ThermionDartTexture1 _lib) { - _lib._objc_msgSend_1(_lib._class_NSClassDescription1, - _lib._sel_invalidateClassDescriptionCache1); - } - - static NSClassDescription? classDescriptionForClass_( - ThermionDartTexture1 _lib, NSObject aClass) { - final _ret = _lib._objc_msgSend_598(_lib._class_NSClassDescription1, - _lib._sel_classDescriptionForClass_1, aClass._id); - return _ret.address == 0 - ? null - : NSClassDescription._(_ret, _lib, retain: true, release: true); - } - - @override - NSArray get attributeKeys { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_attributeKeys1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSArray get toOneRelationshipKeys { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_toOneRelationshipKeys1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSArray get toManyRelationshipKeys { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_toManyRelationshipKeys1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSString? inverseForRelationshipKey_(NSString relationshipKey) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_inverseForRelationshipKey_1, relationshipKey._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - @override - NSClassDescription init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSClassDescription._(_ret, _lib, retain: true, release: true); - } - - static NSClassDescription new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSClassDescription1, _lib._sel_new1); - return NSClassDescription._(_ret, _lib, retain: false, release: true); - } - - static NSClassDescription allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSClassDescription1, _lib._sel_allocWithZone_1, zone); - return NSClassDescription._(_ret, _lib, retain: false, release: true); - } - - static NSClassDescription alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSClassDescription1, _lib._sel_alloc1); - return NSClassDescription._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSClassDescription1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSClassDescription1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSClassDescription1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSClassDescription1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSClassDescription1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSClassDescription1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSClassDescription1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSClassDescription1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSClassDescription1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSScriptObjectSpecifier extends NSObject { - NSScriptObjectSpecifier._( - ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSScriptObjectSpecifier] that points to the same underlying object as [other]. - static NSScriptObjectSpecifier castFrom(T other) { - return NSScriptObjectSpecifier._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSScriptObjectSpecifier] that wraps the given raw object pointer. - static NSScriptObjectSpecifier castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSScriptObjectSpecifier._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSScriptObjectSpecifier]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSScriptObjectSpecifier1); - } - - static NSScriptObjectSpecifier? objectSpecifierWithDescriptor_( - ThermionDartTexture1 _lib, NSAppleEventDescriptor descriptor) { - final _ret = _lib._objc_msgSend_623(_lib._class_NSScriptObjectSpecifier1, - _lib._sel_objectSpecifierWithDescriptor_1, descriptor._id); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); - } - - NSScriptObjectSpecifier initWithContainerSpecifier_key_( - NSScriptObjectSpecifier container, NSString property) { - final _ret = _lib._objc_msgSend_624( - _id, - _lib._sel_initWithContainerSpecifier_key_1, - container._id, - property._id); - return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); - } - - NSScriptObjectSpecifier - initWithContainerClassDescription_containerSpecifier_key_( - NSScriptClassDescription classDesc, - NSScriptObjectSpecifier? container, - NSString property) { - final _ret = _lib._objc_msgSend_644( - _id, - _lib._sel_initWithContainerClassDescription_containerSpecifier_key_1, - classDesc._id, - container?._id ?? ffi.nullptr, - property._id); - return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); - } - - NSScriptObjectSpecifier? initWithCoder_(NSCoder inCoder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, inCoder._id); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); - } - - NSScriptObjectSpecifier? get childSpecifier { - final _ret = _lib._objc_msgSend_631(_id, _lib._sel_childSpecifier1); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); - } - - set childSpecifier(NSScriptObjectSpecifier? value) { - return _lib._objc_msgSend_632( - _id, _lib._sel_setChildSpecifier_1, value?._id ?? ffi.nullptr); - } - - NSScriptObjectSpecifier? get containerSpecifier { - final _ret = _lib._objc_msgSend_631(_id, _lib._sel_containerSpecifier1); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); - } - - set containerSpecifier(NSScriptObjectSpecifier? value) { - return _lib._objc_msgSend_632( - _id, _lib._sel_setContainerSpecifier_1, value?._id ?? ffi.nullptr); - } - - bool get containerIsObjectBeingTested { - return _lib._objc_msgSend_12(_id, _lib._sel_containerIsObjectBeingTested1); - } - - set containerIsObjectBeingTested(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setContainerIsObjectBeingTested_1, value); - } - - bool get containerIsRangeContainerObject { - return _lib._objc_msgSend_12( - _id, _lib._sel_containerIsRangeContainerObject1); - } - - set containerIsRangeContainerObject(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setContainerIsRangeContainerObject_1, value); - } - - NSString get key { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_key1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set key(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setKey_1, value._id); - } - - NSScriptClassDescription? get containerClassDescription { - final _ret = - _lib._objc_msgSend_627(_id, _lib._sel_containerClassDescription1); - return _ret.address == 0 - ? null - : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); - } - - set containerClassDescription(NSScriptClassDescription? value) { - return _lib._objc_msgSend_646(_id, _lib._sel_setContainerClassDescription_1, - value?._id ?? ffi.nullptr); - } - - NSScriptClassDescription? get keyClassDescription { - final _ret = _lib._objc_msgSend_627(_id, _lib._sel_keyClassDescription1); - return _ret.address == 0 - ? null - : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer indicesOfObjectsByEvaluatingWithContainer_count_( - NSObject container, ffi.Pointer count) { - return _lib._objc_msgSend_647( - _id, - _lib._sel_indicesOfObjectsByEvaluatingWithContainer_count_1, - container._id, - count); - } - - NSObject? objectsByEvaluatingWithContainers_(NSObject containers) { - final _ret = _lib._objc_msgSend_16( - _id, _lib._sel_objectsByEvaluatingWithContainers_1, containers._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? get objectsByEvaluatingSpecifier { - final _ret = - _lib._objc_msgSend_17(_id, _lib._sel_objectsByEvaluatingSpecifier1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - int get evaluationErrorNumber { - return _lib._objc_msgSend_82(_id, _lib._sel_evaluationErrorNumber1); - } - - set evaluationErrorNumber(int value) { - return _lib._objc_msgSend_634( - _id, _lib._sel_setEvaluationErrorNumber_1, value); - } - - NSScriptObjectSpecifier? get evaluationErrorSpecifier { - final _ret = - _lib._objc_msgSend_631(_id, _lib._sel_evaluationErrorSpecifier1); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); - } - - NSAppleEventDescriptor? get descriptor { - final _ret = _lib._objc_msgSend_635(_id, _lib._sel_descriptor1); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - @override - NSScriptObjectSpecifier init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); - } - - static NSScriptObjectSpecifier new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSScriptObjectSpecifier1, _lib._sel_new1); - return NSScriptObjectSpecifier._(_ret, _lib, retain: false, release: true); - } - - static NSScriptObjectSpecifier allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSScriptObjectSpecifier1, _lib._sel_allocWithZone_1, zone); - return NSScriptObjectSpecifier._(_ret, _lib, retain: false, release: true); - } - - static NSScriptObjectSpecifier alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSScriptObjectSpecifier1, _lib._sel_alloc1); - return NSScriptObjectSpecifier._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSScriptObjectSpecifier1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSScriptObjectSpecifier1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSScriptObjectSpecifier1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSScriptObjectSpecifier1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSScriptObjectSpecifier1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSScriptObjectSpecifier1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSScriptObjectSpecifier1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSScriptObjectSpecifier1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptObjectSpecifier1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSAppleEventDescriptor extends NSObject { - NSAppleEventDescriptor._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSAppleEventDescriptor] that points to the same underlying object as [other]. - static NSAppleEventDescriptor castFrom(T other) { - return NSAppleEventDescriptor._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSAppleEventDescriptor] that wraps the given raw object pointer. - static NSAppleEventDescriptor castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSAppleEventDescriptor._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSAppleEventDescriptor]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSAppleEventDescriptor1); - } - - static NSAppleEventDescriptor nullDescriptor(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_600( - _lib._class_NSAppleEventDescriptor1, _lib._sel_nullDescriptor1); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor? descriptorWithDescriptorType_bytes_length_( - ThermionDartTexture1 _lib, - int descriptorType, - ffi.Pointer bytes, - int byteCount) { - final _ret = _lib._objc_msgSend_601( - _lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithDescriptorType_bytes_length_1, - descriptorType, - bytes, - byteCount); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor? descriptorWithDescriptorType_data_( - ThermionDartTexture1 _lib, int descriptorType, NSData? data) { - final _ret = _lib._objc_msgSend_602( - _lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithDescriptorType_data_1, - descriptorType, - data?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithBoolean_( - ThermionDartTexture1 _lib, int boolean) { - final _ret = _lib._objc_msgSend_603(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithBoolean_1, boolean); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithEnumCode_( - ThermionDartTexture1 _lib, int enumerator) { - final _ret = _lib._objc_msgSend_604(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithEnumCode_1, enumerator); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithInt32_( - ThermionDartTexture1 _lib, int signedInt) { - final _ret = _lib._objc_msgSend_605(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithInt32_1, signedInt); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithDouble_( - ThermionDartTexture1 _lib, double doubleValue) { - final _ret = _lib._objc_msgSend_606(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithDouble_1, doubleValue); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithTypeCode_( - ThermionDartTexture1 _lib, int typeCode) { - final _ret = _lib._objc_msgSend_604(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithTypeCode_1, typeCode); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_607(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithString_1, string._id); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithDate_( - ThermionDartTexture1 _lib, NSDate date) { - final _ret = _lib._objc_msgSend_608(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithDate_1, date._id); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithFileURL_( - ThermionDartTexture1 _lib, NSURL fileURL) { - final _ret = _lib._objc_msgSend_609(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithFileURL_1, fileURL._id); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor - appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_( - ThermionDartTexture1 _lib, - int eventClass, - int eventID, - NSAppleEventDescriptor? targetDescriptor, - int returnID, - int transactionID) { - final _ret = _lib._objc_msgSend_610( - _lib._class_NSAppleEventDescriptor1, - _lib._sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_1, - eventClass, - eventID, - targetDescriptor?._id ?? ffi.nullptr, - returnID, - transactionID); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor listDescriptor(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_600( - _lib._class_NSAppleEventDescriptor1, _lib._sel_listDescriptor1); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor recordDescriptor(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_600( - _lib._class_NSAppleEventDescriptor1, _lib._sel_recordDescriptor1); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor currentProcessDescriptor( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_600(_lib._class_NSAppleEventDescriptor1, - _lib._sel_currentProcessDescriptor1); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithProcessIdentifier_( - ThermionDartTexture1 _lib, int processIdentifier) { - final _ret = _lib._objc_msgSend_605(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithProcessIdentifier_1, processIdentifier); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithBundleIdentifier_( - ThermionDartTexture1 _lib, NSString bundleIdentifier) { - final _ret = _lib._objc_msgSend_607(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithBundleIdentifier_1, bundleIdentifier._id); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor descriptorWithApplicationURL_( - ThermionDartTexture1 _lib, NSURL applicationURL) { - final _ret = _lib._objc_msgSend_609(_lib._class_NSAppleEventDescriptor1, - _lib._sel_descriptorWithApplicationURL_1, applicationURL._id); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - NSAppleEventDescriptor initWithAEDescNoCopy_(ffi.Pointer aeDesc) { - final _ret = - _lib._objc_msgSend_611(_id, _lib._sel_initWithAEDescNoCopy_1, aeDesc); - return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); - } - - NSAppleEventDescriptor? initWithDescriptorType_bytes_length_( - int descriptorType, ffi.Pointer bytes, int byteCount) { - final _ret = _lib._objc_msgSend_612( - _id, - _lib._sel_initWithDescriptorType_bytes_length_1, - descriptorType, - bytes, - byteCount); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - NSAppleEventDescriptor? initWithDescriptorType_data_( - int descriptorType, NSData? data) { - final _ret = _lib._objc_msgSend_613( - _id, - _lib._sel_initWithDescriptorType_data_1, - descriptorType, - data?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - NSAppleEventDescriptor - initWithEventClass_eventID_targetDescriptor_returnID_transactionID_( - int eventClass, - int eventID, - NSAppleEventDescriptor? targetDescriptor, - int returnID, - int transactionID) { - final _ret = _lib._objc_msgSend_614( - _id, - _lib._sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_1, - eventClass, - eventID, - targetDescriptor?._id ?? ffi.nullptr, - returnID, - transactionID); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - NSAppleEventDescriptor initListDescriptor() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initListDescriptor1); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - NSAppleEventDescriptor initRecordDescriptor() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initRecordDescriptor1); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer get aeDesc { - return _lib._objc_msgSend_615(_id, _lib._sel_aeDesc1); - } - - int get descriptorType { - return _lib._objc_msgSend_213(_id, _lib._sel_descriptorType1); - } - - NSData get data { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_data1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - int get booleanValue { - return _lib._objc_msgSend_233(_id, _lib._sel_booleanValue1); - } - - int get enumCodeValue { - return _lib._objc_msgSend_213(_id, _lib._sel_enumCodeValue1); - } - - int get int32Value { - return _lib._objc_msgSend_236(_id, _lib._sel_int32Value1); - } - - double get doubleValue { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_doubleValue1) - : _lib._objc_msgSend_164(_id, _lib._sel_doubleValue1); - } - - int get typeCodeValue { - return _lib._objc_msgSend_213(_id, _lib._sel_typeCodeValue1); - } - - NSString? get stringValue { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_stringValue1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSDate? get dateValue { - final _ret = _lib._objc_msgSend_182(_id, _lib._sel_dateValue1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSURL? get fileURLValue { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_fileURLValue1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - int get eventClass { - return _lib._objc_msgSend_213(_id, _lib._sel_eventClass1); - } - - int get eventID { - return _lib._objc_msgSend_213(_id, _lib._sel_eventID1); - } - - int get returnID { - return _lib._objc_msgSend_234(_id, _lib._sel_returnID1); - } - - int get transactionID { - return _lib._objc_msgSend_236(_id, _lib._sel_transactionID1); - } - - void setParamDescriptor_forKeyword_( - NSAppleEventDescriptor descriptor, int keyword) { - _lib._objc_msgSend_616(_id, _lib._sel_setParamDescriptor_forKeyword_1, - descriptor._id, keyword); - } - - NSAppleEventDescriptor? paramDescriptorForKeyword_(int keyword) { - final _ret = _lib._objc_msgSend_617( - _id, _lib._sel_paramDescriptorForKeyword_1, keyword); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - void removeParamDescriptorWithKeyword_(int keyword) { - _lib._objc_msgSend_618( - _id, _lib._sel_removeParamDescriptorWithKeyword_1, keyword); - } - - void setAttributeDescriptor_forKeyword_( - NSAppleEventDescriptor descriptor, int keyword) { - _lib._objc_msgSend_616(_id, _lib._sel_setAttributeDescriptor_forKeyword_1, - descriptor._id, keyword); - } - - NSAppleEventDescriptor? attributeDescriptorForKeyword_(int keyword) { - final _ret = _lib._objc_msgSend_617( - _id, _lib._sel_attributeDescriptorForKeyword_1, keyword); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - NSAppleEventDescriptor? sendEventWithOptions_timeout_error_(int sendOptions, - double timeoutInSeconds, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_619( - _id, - _lib._sel_sendEventWithOptions_timeout_error_1, - sendOptions, - timeoutInSeconds, - error); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - bool get isRecordDescriptor { - return _lib._objc_msgSend_12(_id, _lib._sel_isRecordDescriptor1); - } - - int get numberOfItems { - return _lib._objc_msgSend_82(_id, _lib._sel_numberOfItems1); - } - - void insertDescriptor_atIndex_(NSAppleEventDescriptor descriptor, int index) { - _lib._objc_msgSend_620( - _id, _lib._sel_insertDescriptor_atIndex_1, descriptor._id, index); - } - - NSAppleEventDescriptor? descriptorAtIndex_(int index) { - final _ret = - _lib._objc_msgSend_621(_id, _lib._sel_descriptorAtIndex_1, index); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - void removeDescriptorAtIndex_(int index) { - _lib._objc_msgSend_422(_id, _lib._sel_removeDescriptorAtIndex_1, index); - } - - void setDescriptor_forKeyword_( - NSAppleEventDescriptor descriptor, int keyword) { - _lib._objc_msgSend_616( - _id, _lib._sel_setDescriptor_forKeyword_1, descriptor._id, keyword); - } - - NSAppleEventDescriptor? descriptorForKeyword_(int keyword) { - final _ret = - _lib._objc_msgSend_617(_id, _lib._sel_descriptorForKeyword_1, keyword); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - void removeDescriptorWithKeyword_(int keyword) { - _lib._objc_msgSend_618( - _id, _lib._sel_removeDescriptorWithKeyword_1, keyword); - } - - int keywordForDescriptorAtIndex_(int index) { - return _lib._objc_msgSend_622( - _id, _lib._sel_keywordForDescriptorAtIndex_1, index); - } - - NSAppleEventDescriptor? coerceToDescriptorType_(int descriptorType) { - final _ret = _lib._objc_msgSend_617( - _id, _lib._sel_coerceToDescriptorType_1, descriptorType); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - @override - NSAppleEventDescriptor init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - static NSAppleEventDescriptor new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSAppleEventDescriptor1, _lib._sel_new1); - return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); - } - - static NSAppleEventDescriptor allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSAppleEventDescriptor1, _lib._sel_allocWithZone_1, zone); - return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); - } - - static NSAppleEventDescriptor alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSAppleEventDescriptor1, _lib._sel_alloc1); - return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSAppleEventDescriptor1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSAppleEventDescriptor1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSAppleEventDescriptor1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSAppleEventDescriptor1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSAppleEventDescriptor1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSAppleEventDescriptor1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSAppleEventDescriptor1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSAppleEventDescriptor1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSAppleEventDescriptor1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -@ffi.Packed(2) -final class AEDesc extends ffi.Struct { - @ffi.UnsignedInt() - external int descriptorType; - - external ffi.Pointer> dataHandle; -} - -final class OpaqueAEDataStorageType extends ffi.Opaque {} - -abstract class NSAppleEventSendOptions { - static const int NSAppleEventSendNoReply = 1; - static const int NSAppleEventSendQueueReply = 2; - static const int NSAppleEventSendWaitForReply = 3; - static const int NSAppleEventSendNeverInteract = 16; - static const int NSAppleEventSendCanInteract = 32; - static const int NSAppleEventSendAlwaysInteract = 48; - static const int NSAppleEventSendCanSwitchLayer = 64; - static const int NSAppleEventSendDontRecord = 4096; - static const int NSAppleEventSendDontExecute = 8192; - static const int NSAppleEventSendDontAnnotate = 65536; - static const int NSAppleEventSendDefaultOptions = 35; -} - -class NSScriptClassDescription extends NSClassDescription { - NSScriptClassDescription._( - ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSScriptClassDescription] that points to the same underlying object as [other]. - static NSScriptClassDescription castFrom(T other) { - return NSScriptClassDescription._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSScriptClassDescription] that wraps the given raw object pointer. - static NSScriptClassDescription castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSScriptClassDescription._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSScriptClassDescription]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSScriptClassDescription1); - } - - static NSScriptClassDescription? classDescriptionForClass_( - ThermionDartTexture1 _lib, NSObject aClass) { - final _ret = _lib._objc_msgSend_625(_lib._class_NSScriptClassDescription1, - _lib._sel_classDescriptionForClass_1, aClass._id); - return _ret.address == 0 - ? null - : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); - } - - NSScriptClassDescription? initWithSuiteName_className_dictionary_( - NSString suiteName, NSString className, NSDictionary? classDeclaration) { - final _ret = _lib._objc_msgSend_626( - _id, - _lib._sel_initWithSuiteName_className_dictionary_1, - suiteName._id, - className._id, - classDeclaration?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); - } - - NSString? get suiteName { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_suiteName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get className { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_className1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get implementationClassName { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_implementationClassName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSScriptClassDescription? get superclassDescription { - final _ret = _lib._objc_msgSend_627(_id, _lib._sel_superclassDescription1); - return _ret.address == 0 - ? null - : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); - } - - int get appleEventCode { - return _lib._objc_msgSend_213(_id, _lib._sel_appleEventCode1); - } - - bool matchesAppleEventCode_(int appleEventCode) { - return _lib._objc_msgSend_193( - _id, _lib._sel_matchesAppleEventCode_1, appleEventCode); - } - - bool supportsCommand_(NSScriptCommandDescription commandDescription) { - return _lib._objc_msgSend_640( - _id, _lib._sel_supportsCommand_1, commandDescription._id); - } - - ffi.Pointer selectorForCommand_( - NSScriptCommandDescription commandDescription) { - return _lib._objc_msgSend_641( - _id, _lib._sel_selectorForCommand_1, commandDescription._id); - } - - NSString? typeForKey_(NSString key) { - final _ret = _lib._objc_msgSend_185(_id, _lib._sel_typeForKey_1, key._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSScriptClassDescription? classDescriptionForKey_(NSString key) { - final _ret = _lib._objc_msgSend_642( - _id, _lib._sel_classDescriptionForKey_1, key._id); - return _ret.address == 0 - ? null - : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); - } - - int appleEventCodeForKey_(NSString key) { - return _lib._objc_msgSend_628( - _id, _lib._sel_appleEventCodeForKey_1, key._id); - } - - NSString? keyWithAppleEventCode_(int appleEventCode) { - final _ret = _lib._objc_msgSend_643( - _id, _lib._sel_keyWithAppleEventCode_1, appleEventCode); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get defaultSubcontainerAttributeKey { - final _ret = - _lib._objc_msgSend_43(_id, _lib._sel_defaultSubcontainerAttributeKey1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool isLocationRequiredToCreateForKey_(NSString toManyRelationshipKey) { - return _lib._objc_msgSend_63( - _id, - _lib._sel_isLocationRequiredToCreateForKey_1, - toManyRelationshipKey._id); - } - - bool hasPropertyForKey_(NSString key) { - return _lib._objc_msgSend_63(_id, _lib._sel_hasPropertyForKey_1, key._id); - } - - bool hasOrderedToManyRelationshipForKey_(NSString key) { - return _lib._objc_msgSend_63( - _id, _lib._sel_hasOrderedToManyRelationshipForKey_1, key._id); - } - - bool hasReadablePropertyForKey_(NSString key) { - return _lib._objc_msgSend_63( - _id, _lib._sel_hasReadablePropertyForKey_1, key._id); - } - - bool hasWritablePropertyForKey_(NSString key) { - return _lib._objc_msgSend_63( - _id, _lib._sel_hasWritablePropertyForKey_1, key._id); - } - - bool isReadOnlyKey_(NSString key) { - return _lib._objc_msgSend_63(_id, _lib._sel_isReadOnlyKey_1, key._id); - } - - static void registerClassDescription_forClass_(ThermionDartTexture1 _lib, - NSClassDescription description, NSObject aClass) { - _lib._objc_msgSend_597( - _lib._class_NSScriptClassDescription1, - _lib._sel_registerClassDescription_forClass_1, - description._id, - aClass._id); - } - - static void invalidateClassDescriptionCache(ThermionDartTexture1 _lib) { - _lib._objc_msgSend_1(_lib._class_NSScriptClassDescription1, - _lib._sel_invalidateClassDescriptionCache1); - } - - @override - NSScriptClassDescription init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); - } - - static NSScriptClassDescription new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSScriptClassDescription1, _lib._sel_new1); - return NSScriptClassDescription._(_ret, _lib, retain: false, release: true); - } - - static NSScriptClassDescription allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSScriptClassDescription1, _lib._sel_allocWithZone_1, zone); - return NSScriptClassDescription._(_ret, _lib, retain: false, release: true); - } - - static NSScriptClassDescription alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSScriptClassDescription1, _lib._sel_alloc1); - return NSScriptClassDescription._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSScriptClassDescription1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSScriptClassDescription1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSScriptClassDescription1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSScriptClassDescription1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSScriptClassDescription1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSScriptClassDescription1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSScriptClassDescription1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSScriptClassDescription1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptClassDescription1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSScriptCommandDescription extends NSObject { - NSScriptCommandDescription._( - ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSScriptCommandDescription] that points to the same underlying object as [other]. - static NSScriptCommandDescription castFrom(T other) { - return NSScriptCommandDescription._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSScriptCommandDescription] that wraps the given raw object pointer. - static NSScriptCommandDescription castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSScriptCommandDescription._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSScriptCommandDescription]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSScriptCommandDescription1); - } - - @override - NSObject init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSScriptCommandDescription? initWithSuiteName_commandName_dictionary_( - NSString suiteName, - NSString commandName, - NSDictionary? commandDeclaration) { - final _ret = _lib._objc_msgSend_626( - _id, - _lib._sel_initWithSuiteName_commandName_dictionary_1, - suiteName._id, - commandName._id, - commandDeclaration?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSScriptCommandDescription._(_ret, _lib, retain: true, release: true); - } - - NSScriptCommandDescription? initWithCoder_(NSCoder inCoder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, inCoder._id); - return _ret.address == 0 - ? null - : NSScriptCommandDescription._(_ret, _lib, retain: true, release: true); - } - - NSString get suiteName { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_suiteName1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get commandName { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_commandName1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int get appleEventClassCode { - return _lib._objc_msgSend_213(_id, _lib._sel_appleEventClassCode1); - } - - int get appleEventCode { - return _lib._objc_msgSend_213(_id, _lib._sel_appleEventCode1); - } - - NSString get commandClassName { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_commandClassName1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get returnType { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_returnType1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - int get appleEventCodeForReturnType { - return _lib._objc_msgSend_213(_id, _lib._sel_appleEventCodeForReturnType1); - } - - NSArray get argumentNames { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_argumentNames1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? typeForArgumentWithName_(NSString argumentName) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_typeForArgumentWithName_1, argumentName._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - int appleEventCodeForArgumentWithName_(NSString argumentName) { - return _lib._objc_msgSend_628( - _id, _lib._sel_appleEventCodeForArgumentWithName_1, argumentName._id); - } - - bool isOptionalArgumentWithName_(NSString argumentName) { - return _lib._objc_msgSend_63( - _id, _lib._sel_isOptionalArgumentWithName_1, argumentName._id); - } - - NSScriptCommand createCommandInstance() { - final _ret = _lib._objc_msgSend_638(_id, _lib._sel_createCommandInstance1); - return NSScriptCommand._(_ret, _lib, retain: true, release: true); - } - - NSScriptCommand createCommandInstanceWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_639( - _id, _lib._sel_createCommandInstanceWithZone_1, zone); - return NSScriptCommand._(_ret, _lib, retain: true, release: true); - } - - static NSScriptCommandDescription new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSScriptCommandDescription1, _lib._sel_new1); - return NSScriptCommandDescription._(_ret, _lib, - retain: false, release: true); - } - - static NSScriptCommandDescription allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3(_lib._class_NSScriptCommandDescription1, - _lib._sel_allocWithZone_1, zone); - return NSScriptCommandDescription._(_ret, _lib, - retain: false, release: true); - } - - static NSScriptCommandDescription alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSScriptCommandDescription1, _lib._sel_alloc1); - return NSScriptCommandDescription._(_ret, _lib, - retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSScriptCommandDescription1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSScriptCommandDescription1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSScriptCommandDescription1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSScriptCommandDescription1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSScriptCommandDescription1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSScriptCommandDescription1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSScriptCommandDescription1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSScriptCommandDescription1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptCommandDescription1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSScriptCommand extends NSObject { - NSScriptCommand._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSScriptCommand] that points to the same underlying object as [other]. - static NSScriptCommand castFrom(T other) { - return NSScriptCommand._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSScriptCommand] that wraps the given raw object pointer. - static NSScriptCommand castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSScriptCommand._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSScriptCommand]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSScriptCommand1); - } - - NSScriptCommand initWithCommandDescription_( - NSScriptCommandDescription commandDef) { - final _ret = _lib._objc_msgSend_629( - _id, _lib._sel_initWithCommandDescription_1, commandDef._id); - return NSScriptCommand._(_ret, _lib, retain: true, release: true); - } - - NSScriptCommand? initWithCoder_(NSCoder inCoder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, inCoder._id); - return _ret.address == 0 - ? null - : NSScriptCommand._(_ret, _lib, retain: true, release: true); - } - - NSScriptCommandDescription get commandDescription { - final _ret = _lib._objc_msgSend_630(_id, _lib._sel_commandDescription1); - return NSScriptCommandDescription._(_ret, _lib, - retain: true, release: true); - } - - NSObject? get directParameter { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_directParameter1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set directParameter(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setDirectParameter_1, value?._id ?? ffi.nullptr); - } - - NSScriptObjectSpecifier? get receiversSpecifier { - final _ret = _lib._objc_msgSend_631(_id, _lib._sel_receiversSpecifier1); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); - } - - set receiversSpecifier(NSScriptObjectSpecifier? value) { - return _lib._objc_msgSend_632( - _id, _lib._sel_setReceiversSpecifier_1, value?._id ?? ffi.nullptr); - } - - NSObject? get evaluatedReceivers { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_evaluatedReceivers1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? get arguments { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_arguments1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set arguments(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, _lib._sel_setArguments_1, value?._id ?? ffi.nullptr); - } - - NSDictionary? get evaluatedArguments { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_evaluatedArguments1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - bool get wellFormed { - return _lib._objc_msgSend_12(_id, _lib._sel_isWellFormed1); - } - - NSObject? performDefaultImplementation() { - final _ret = - _lib._objc_msgSend_17(_id, _lib._sel_performDefaultImplementation1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? executeCommand() { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_executeCommand1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - int get scriptErrorNumber { - return _lib._objc_msgSend_82(_id, _lib._sel_scriptErrorNumber1); - } - - set scriptErrorNumber(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setScriptErrorNumber_1, value); - } - - NSAppleEventDescriptor? get scriptErrorOffendingObjectDescriptor { - final _ret = _lib._objc_msgSend_635( - _id, _lib._sel_scriptErrorOffendingObjectDescriptor1); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - set scriptErrorOffendingObjectDescriptor(NSAppleEventDescriptor? value) { - return _lib._objc_msgSend_636( - _id, - _lib._sel_setScriptErrorOffendingObjectDescriptor_1, - value?._id ?? ffi.nullptr); - } - - NSAppleEventDescriptor? get scriptErrorExpectedTypeDescriptor { - final _ret = _lib._objc_msgSend_635( - _id, _lib._sel_scriptErrorExpectedTypeDescriptor1); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - set scriptErrorExpectedTypeDescriptor(NSAppleEventDescriptor? value) { - return _lib._objc_msgSend_636( - _id, - _lib._sel_setScriptErrorExpectedTypeDescriptor_1, - value?._id ?? ffi.nullptr); - } - - NSString? get scriptErrorString { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_scriptErrorString1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set scriptErrorString(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setScriptErrorString_1, value?._id ?? ffi.nullptr); - } - - static NSScriptCommand? currentCommand(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_637( - _lib._class_NSScriptCommand1, _lib._sel_currentCommand1); - return _ret.address == 0 - ? null - : NSScriptCommand._(_ret, _lib, retain: true, release: true); - } - - NSAppleEventDescriptor? get appleEvent { - final _ret = _lib._objc_msgSend_635(_id, _lib._sel_appleEvent1); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); - } - - void suspendExecution() { - _lib._objc_msgSend_1(_id, _lib._sel_suspendExecution1); - } - - void resumeExecutionWithResult_(NSObject? result) { - _lib._objc_msgSend_288( - _id, _lib._sel_resumeExecutionWithResult_1, result?._id ?? ffi.nullptr); - } - - @override - NSScriptCommand init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSScriptCommand._(_ret, _lib, retain: true, release: true); - } - - static NSScriptCommand new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSScriptCommand1, _lib._sel_new1); - return NSScriptCommand._(_ret, _lib, retain: false, release: true); - } - - static NSScriptCommand allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSScriptCommand1, _lib._sel_allocWithZone_1, zone); - return NSScriptCommand._(_ret, _lib, retain: false, release: true); - } - - static NSScriptCommand alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSScriptCommand1, _lib._sel_alloc1); - return NSScriptCommand._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSScriptCommand1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSScriptCommand1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSScriptCommand1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSScriptCommand1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSScriptCommand1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSScriptCommand1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSScriptCommand1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSScriptCommand1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSScriptCommand1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSItemProvider extends NSObject { - NSItemProvider._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSItemProvider] that points to the same underlying object as [other]. - static NSItemProvider castFrom(T other) { - return NSItemProvider._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSItemProvider] that wraps the given raw object pointer. - static NSItemProvider castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSItemProvider._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSItemProvider]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSItemProvider1); - } - - @override - NSItemProvider init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSItemProvider._(_ret, _lib, retain: true, release: true); - } - - void registerDataRepresentationForTypeIdentifier_visibility_loadHandler_( - NSString typeIdentifier, - int visibility, - ObjCBlock_NSProgress_ffiVoidNSDataNSError loadHandler) { - _lib._objc_msgSend_672( - _id, - _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, - typeIdentifier._id, - visibility, - loadHandler._id); - } - - void - registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_( - NSString typeIdentifier, - int fileOptions, - int visibility, - ObjCBlock_NSProgress_ffiVoidNSURLboolNSError loadHandler) { - _lib._objc_msgSend_673( - _id, - _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, - typeIdentifier._id, - fileOptions, - visibility, - loadHandler._id); - } - - NSArray get registeredTypeIdentifiers { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_registeredTypeIdentifiers1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray registeredTypeIdentifiersWithFileOptions_(int fileOptions) { - final _ret = _lib._objc_msgSend_674( - _id, _lib._sel_registeredTypeIdentifiersWithFileOptions_1, fileOptions); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - bool hasItemConformingToTypeIdentifier_(NSString typeIdentifier) { - return _lib._objc_msgSend_63( - _id, _lib._sel_hasItemConformingToTypeIdentifier_1, typeIdentifier._id); - } - - bool hasRepresentationConformingToTypeIdentifier_fileOptions_( - NSString typeIdentifier, int fileOptions) { - return _lib._objc_msgSend_675( - _id, - _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, - typeIdentifier._id, - fileOptions); - } - - NSProgress loadDataRepresentationForTypeIdentifier_completionHandler_( - NSString typeIdentifier, - ObjCBlock_ffiVoid_NSData_NSError completionHandler) { - final _ret = _lib._objc_msgSend_676( - _id, - _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier._id, - completionHandler._id); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - NSProgress loadFileRepresentationForTypeIdentifier_completionHandler_( - NSString typeIdentifier, - ObjCBlock_ffiVoid_NSURL_NSError completionHandler) { - final _ret = _lib._objc_msgSend_677( - _id, - _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier._id, - completionHandler._id); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_( - NSString typeIdentifier, - ObjCBlock_ffiVoid_NSURL_bool_NSError completionHandler) { - final _ret = _lib._objc_msgSend_678( - _id, - _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier._id, - completionHandler._id); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - NSString? get suggestedName { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_suggestedName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set suggestedName(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); - } - - NSItemProvider initWithObject_(NSObject object) { - final _ret = - _lib._objc_msgSend_123(_id, _lib._sel_initWithObject_1, object._id); - return NSItemProvider._(_ret, _lib, retain: true, release: true); - } - - void registerObject_visibility_(NSObject object, int visibility) { - _lib._objc_msgSend_679( - _id, _lib._sel_registerObject_visibility_1, object._id, visibility); - } - - void registerObjectOfClass_visibility_loadHandler_( - NSObject aClass, - int visibility, - ObjCBlock_NSProgress_ffiVoidObjCObjectNSError loadHandler) { - _lib._objc_msgSend_680( - _id, - _lib._sel_registerObjectOfClass_visibility_loadHandler_1, - aClass._id, - visibility, - loadHandler._id); - } - - bool canLoadObjectOfClass_(NSObject aClass) { - return _lib._objc_msgSend_0( - _id, _lib._sel_canLoadObjectOfClass_1, aClass._id); - } - - NSProgress loadObjectOfClass_completionHandler_( - NSObject aClass, ObjCBlock_ffiVoid_ObjCObject_NSError completionHandler) { - final _ret = _lib._objc_msgSend_681( - _id, - _lib._sel_loadObjectOfClass_completionHandler_1, - aClass._id, - completionHandler._id); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - NSItemProvider initWithItem_typeIdentifier_( - NSObject? item, NSString? typeIdentifier) { - final _ret = _lib._objc_msgSend_682( - _id, - _lib._sel_initWithItem_typeIdentifier_1, - item?._id ?? ffi.nullptr, - typeIdentifier?._id ?? ffi.nullptr); - return NSItemProvider._(_ret, _lib, retain: true, release: true); - } - - NSItemProvider? initWithContentsOfURL_(NSURL fileURL) { - final _ret = _lib._objc_msgSend_276( - _id, _lib._sel_initWithContentsOfURL_1, fileURL._id); - return _ret.address == 0 - ? null - : NSItemProvider._(_ret, _lib, retain: true, release: true); - } - - void registerItemForTypeIdentifier_loadHandler_( - NSString typeIdentifier, - ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary - loadHandler) { - _lib._objc_msgSend_683( - _id, - _lib._sel_registerItemForTypeIdentifier_loadHandler_1, - typeIdentifier._id, - loadHandler._id); - } - - void loadItemForTypeIdentifier_options_completionHandler_( - NSString typeIdentifier, - NSDictionary? options, - ObjCBlock_ffiVoid_ObjCObject_NSError1? completionHandler) { - _lib._objc_msgSend_684( - _id, - _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, - typeIdentifier._id, - options?._id ?? ffi.nullptr, - completionHandler?._id ?? ffi.nullptr); - } - - ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary? - get previewImageHandler { - final _ret = _lib._objc_msgSend_685(_id, _lib._sel_previewImageHandler1); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary._( - _ret, _lib, - retain: true, release: true); - } - - set previewImageHandler( - ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary? - value) { - return _lib._objc_msgSend_686( - _id, _lib._sel_setPreviewImageHandler_1, value?._id ?? ffi.nullptr); - } - - void loadPreviewImageWithOptions_completionHandler_(NSDictionary options, - ObjCBlock_ffiVoid_ObjCObject_NSError1 completionHandler) { - _lib._objc_msgSend_687( - _id, - _lib._sel_loadPreviewImageWithOptions_completionHandler_1, - options._id, - completionHandler._id); - } - - static NSItemProvider new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSItemProvider1, _lib._sel_new1); - return NSItemProvider._(_ret, _lib, retain: false, release: true); - } - - static NSItemProvider allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSItemProvider1, _lib._sel_allocWithZone_1, zone); - return NSItemProvider._(_ret, _lib, retain: false, release: true); - } - - static NSItemProvider alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSItemProvider1, _lib._sel_alloc1); - return NSItemProvider._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSItemProvider1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSItemProvider1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSItemProvider1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSItemProvider1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSItemProvider1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSItemProvider1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSItemProvider1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSItemProvider1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSItemProvider1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSItemProviderRepresentationVisibility { - static const int NSItemProviderRepresentationVisibilityAll = 0; - static const int NSItemProviderRepresentationVisibilityTeam = 1; - static const int NSItemProviderRepresentationVisibilityGroup = 2; - static const int NSItemProviderRepresentationVisibilityOwnProcess = 3; -} - -ffi.Pointer< - ObjCObject> _ObjCBlock_NSProgress_ffiVoidNSDataNSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer<_ObjCBlock>)>()(arg0); -final _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistry = - Function(ffi.Pointer<_ObjCBlock>)>{}; -int _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_registerClosure( - ffi.Pointer Function(ffi.Pointer<_ObjCBlock>) fn) { - final id = ++_ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistryIndex; - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_NSProgress_ffiVoidNSDataNSError extends _ObjCBlockBase { - ObjCBlock_NSProgress_ffiVoidNSDataNSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_NSProgress_ffiVoidNSDataNSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction< - ffi.Pointer< - ObjCObject> - Function(ffi.Pointer<_ObjCBlock> arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_NSProgress_ffiVoidNSDataNSError.fromFunction( - ThermionDartTexture1 lib, - NSProgress? Function(ObjCBlock_ffiVoid_NSData_NSError) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureTrampoline) - .cast(), - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_registerClosure((ffi - .Pointer<_ObjCBlock> - arg0) => - fn(ObjCBlock_ffiVoid_NSData_NSError._(arg0, lib, retain: true, release: true)) - ?._retainAndReturnId() ?? - ffi.nullptr)), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - NSProgress? call(ObjCBlock_ffiVoid_NSData_NSError arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>() - (_id, arg0._id) - .address == - 0 - ? null - : NSProgress._( - _id.ref.invoke - .cast Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>()(_id, arg0._id), - _lib, - retain: false, - release: true); -} - -class NSProgress extends NSObject { - NSProgress._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSProgress] that points to the same underlying object as [other]. - static NSProgress castFrom(T other) { - return NSProgress._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSProgress] that wraps the given raw object pointer. - static NSProgress castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSProgress._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSProgress]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProgress1); - } - - static NSProgress? currentProgress(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_658( - _lib._class_NSProgress1, _lib._sel_currentProgress1); - return _ret.address == 0 - ? null - : NSProgress._(_ret, _lib, retain: true, release: true); - } - - static NSProgress progressWithTotalUnitCount_( - ThermionDartTexture1 _lib, int unitCount) { - final _ret = _lib._objc_msgSend_659(_lib._class_NSProgress1, - _lib._sel_progressWithTotalUnitCount_1, unitCount); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - static NSProgress discreteProgressWithTotalUnitCount_( - ThermionDartTexture1 _lib, int unitCount) { - final _ret = _lib._objc_msgSend_659(_lib._class_NSProgress1, - _lib._sel_discreteProgressWithTotalUnitCount_1, unitCount); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - static NSProgress progressWithTotalUnitCount_parent_pendingUnitCount_( - ThermionDartTexture1 _lib, - int unitCount, - NSProgress parent, - int portionOfParentTotalUnitCount) { - final _ret = _lib._objc_msgSend_660( - _lib._class_NSProgress1, - _lib._sel_progressWithTotalUnitCount_parent_pendingUnitCount_1, - unitCount, - parent._id, - portionOfParentTotalUnitCount); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - NSProgress initWithParent_userInfo_( - NSProgress? parentProgressOrNil, NSObject? userInfoOrNil) { - final _ret = _lib._objc_msgSend_661( - _id, - _lib._sel_initWithParent_userInfo_1, - parentProgressOrNil?._id ?? ffi.nullptr, - userInfoOrNil?._id ?? ffi.nullptr); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - void becomeCurrentWithPendingUnitCount_(int unitCount) { - _lib._objc_msgSend_662( - _id, _lib._sel_becomeCurrentWithPendingUnitCount_1, unitCount); - } - - void performAsCurrentWithPendingUnitCount_usingBlock_( - int unitCount, ObjCBlock_ffiVoid work) { - _lib._objc_msgSend_663( - _id, - _lib._sel_performAsCurrentWithPendingUnitCount_usingBlock_1, - unitCount, - work._id); - } - - void resignCurrent() { - _lib._objc_msgSend_1(_id, _lib._sel_resignCurrent1); - } - - void addChild_withPendingUnitCount_(NSProgress child, int inUnitCount) { - _lib._objc_msgSend_664( - _id, _lib._sel_addChild_withPendingUnitCount_1, child._id, inUnitCount); - } - - int get totalUnitCount { - return _lib._objc_msgSend_665(_id, _lib._sel_totalUnitCount1); - } - - set totalUnitCount(int value) { - return _lib._objc_msgSend_666(_id, _lib._sel_setTotalUnitCount_1, value); - } - - int get completedUnitCount { - return _lib._objc_msgSend_665(_id, _lib._sel_completedUnitCount1); - } - - set completedUnitCount(int value) { - return _lib._objc_msgSend_666( - _id, _lib._sel_setCompletedUnitCount_1, value); - } - - NSString get localizedDescription { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_localizedDescription1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set localizedDescription(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setLocalizedDescription_1, value._id); - } - - NSString get localizedAdditionalDescription { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_localizedAdditionalDescription1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set localizedAdditionalDescription(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setLocalizedAdditionalDescription_1, value._id); - } - - bool get cancellable { - return _lib._objc_msgSend_12(_id, _lib._sel_isCancellable1); - } - - set cancellable(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setCancellable_1, value); - } - - bool get pausable { - return _lib._objc_msgSend_12(_id, _lib._sel_isPausable1); - } - - set pausable(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setPausable_1, value); - } - - bool get cancelled { - return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); - } - - bool get paused { - return _lib._objc_msgSend_12(_id, _lib._sel_isPaused1); - } - - ObjCBlock_ffiVoid? get cancellationHandler { - final _ret = _lib._objc_msgSend_667(_id, _lib._sel_cancellationHandler1); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid._(_ret, _lib, retain: true, release: true); - } - - set cancellationHandler(ObjCBlock_ffiVoid? value) { - return _lib._objc_msgSend_668( - _id, _lib._sel_setCancellationHandler_1, value?._id ?? ffi.nullptr); - } - - ObjCBlock_ffiVoid? get pausingHandler { - final _ret = _lib._objc_msgSend_667(_id, _lib._sel_pausingHandler1); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid._(_ret, _lib, retain: true, release: true); - } - - set pausingHandler(ObjCBlock_ffiVoid? value) { - return _lib._objc_msgSend_668( - _id, _lib._sel_setPausingHandler_1, value?._id ?? ffi.nullptr); - } - - ObjCBlock_ffiVoid? get resumingHandler { - final _ret = _lib._objc_msgSend_667(_id, _lib._sel_resumingHandler1); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid._(_ret, _lib, retain: true, release: true); - } - - set resumingHandler(ObjCBlock_ffiVoid? value) { - return _lib._objc_msgSend_668( - _id, _lib._sel_setResumingHandler_1, value?._id ?? ffi.nullptr); - } - - void setUserInfoObject_forKey_(NSObject? objectOrNil, NSString key) { - _lib._objc_msgSend_134(_id, _lib._sel_setUserInfoObject_forKey_1, - objectOrNil?._id ?? ffi.nullptr, key._id); - } - - bool get indeterminate { - return _lib._objc_msgSend_12(_id, _lib._sel_isIndeterminate1); - } - - double get fractionCompleted { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_fractionCompleted1) - : _lib._objc_msgSend_164(_id, _lib._sel_fractionCompleted1); - } - - bool get finished { - return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); - } - - void cancel() { - _lib._objc_msgSend_1(_id, _lib._sel_cancel1); - } - - void pause() { - _lib._objc_msgSend_1(_id, _lib._sel_pause1); - } - - void resume() { - _lib._objc_msgSend_1(_id, _lib._sel_resume1); - } - - NSObject get userInfo { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_userInfo1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSString? get kind { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_kind1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set kind(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setKind_1, value?._id ?? ffi.nullptr); - } - - NSNumber? get estimatedTimeRemaining { - final _ret = _lib._objc_msgSend_214(_id, _lib._sel_estimatedTimeRemaining1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - set estimatedTimeRemaining(NSNumber? value) { - return _lib._objc_msgSend_669( - _id, _lib._sel_setEstimatedTimeRemaining_1, value?._id ?? ffi.nullptr); - } - - NSNumber? get throughput { - final _ret = _lib._objc_msgSend_214(_id, _lib._sel_throughput1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - set throughput(NSNumber? value) { - return _lib._objc_msgSend_669( - _id, _lib._sel_setThroughput_1, value?._id ?? ffi.nullptr); - } - - NSString? get fileOperationKind { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_fileOperationKind1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set fileOperationKind(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setFileOperationKind_1, value?._id ?? ffi.nullptr); - } - - NSURL? get fileURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_fileURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - set fileURL(NSURL? value) { - return _lib._objc_msgSend_670( - _id, _lib._sel_setFileURL_1, value?._id ?? ffi.nullptr); - } - - NSNumber? get fileTotalCount { - final _ret = _lib._objc_msgSend_214(_id, _lib._sel_fileTotalCount1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - set fileTotalCount(NSNumber? value) { - return _lib._objc_msgSend_669( - _id, _lib._sel_setFileTotalCount_1, value?._id ?? ffi.nullptr); - } - - NSNumber? get fileCompletedCount { - final _ret = _lib._objc_msgSend_214(_id, _lib._sel_fileCompletedCount1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - set fileCompletedCount(NSNumber? value) { - return _lib._objc_msgSend_669( - _id, _lib._sel_setFileCompletedCount_1, value?._id ?? ffi.nullptr); - } - - void publish() { - _lib._objc_msgSend_1(_id, _lib._sel_publish1); - } - - void unpublish() { - _lib._objc_msgSend_1(_id, _lib._sel_unpublish1); - } - - static NSObject addSubscriberForFileURL_withPublishingHandler_( - ThermionDartTexture1 _lib, - NSURL url, - ObjCBlock_ffiVoid_NSProgress publishingHandler) { - final _ret = _lib._objc_msgSend_671( - _lib._class_NSProgress1, - _lib._sel_addSubscriberForFileURL_withPublishingHandler_1, - url._id, - publishingHandler._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static void removeSubscriber_( - ThermionDartTexture1 _lib, NSObject subscriber) { - _lib._objc_msgSend_15( - _lib._class_NSProgress1, _lib._sel_removeSubscriber_1, subscriber._id); - } - - bool get old { - return _lib._objc_msgSend_12(_id, _lib._sel_isOld1); - } - - @override - NSProgress init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - static NSProgress new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSProgress1, _lib._sel_new1); - return NSProgress._(_ret, _lib, retain: false, release: true); - } - - static NSProgress allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSProgress1, _lib._sel_allocWithZone_1, zone); - return NSProgress._(_ret, _lib, retain: false, release: true); - } - - static NSProgress alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSProgress1, _lib._sel_alloc1); - return NSProgress._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSProgress1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSProgress1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSProgress1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSProgress1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSProgress1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSProgress1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSProgress1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSProgress1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSProgress1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -ffi.Pointer<_ObjCBlock> _ObjCBlock_ffiVoid_NSProgress_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer<_ObjCBlock> Function(ffi.Pointer)>()(arg0); -final _ObjCBlock_ffiVoid_NSProgress_closureRegistry = - Function(ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSProgress_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSProgress_registerClosure( - ffi.Pointer<_ObjCBlock> Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSProgress_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSProgress_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -ffi.Pointer<_ObjCBlock> _ObjCBlock_ffiVoid_NSProgress_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSProgress_closureRegistry[block.ref.target.address]!( - arg0); - -class ObjCBlock_ffiVoid_NSProgress extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSProgress._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSProgress.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSProgress_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSProgress.fromFunction( - ThermionDartTexture1 lib, ObjCBlock_ffiVoid? Function(NSProgress) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSProgress_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSProgress_registerClosure( - (ffi.Pointer arg0) => - fn(NSProgress._(arg0, lib, retain: true, release: true)) - ?._retainAndReturnId() ?? - ffi.nullptr)), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - ObjCBlock_ffiVoid? call(NSProgress arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>() - (_id, arg0._id) - .address == - 0 - ? null - : ObjCBlock_ffiVoid._( - _id.ref.invoke - .cast Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>()(_id, arg0._id), - _lib, - retain: false, - release: true); -} - -void _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSData_NSError_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSData_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSData_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSData_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSData_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_NSData_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSData_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSData_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSData_NSError.fromFunction( - ThermionDartTexture1 lib, void Function(NSData?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSData_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSData_NSError.listener( - ThermionDartTexture1 lib, void Function(NSData?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSData_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, - retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSData? arg0, NSError? arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1?._id ?? ffi.nullptr); -} - -abstract class NSItemProviderFileOptions { - static const int NSItemProviderFileOptionOpenInPlace = 1; -} - -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>)>()(arg0); -final _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistry = - Function(ffi.Pointer<_ObjCBlock>)>{}; -int _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_registerClosure( - ffi.Pointer Function(ffi.Pointer<_ObjCBlock>) fn) { - final id = - ++_ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistryIndex; - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_NSProgress_ffiVoidNSURLboolNSError extends _ObjCBlockBase { - ObjCBlock_NSProgress_ffiVoidNSURLboolNSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_NSProgress_ffiVoidNSURLboolNSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_NSProgress_ffiVoidNSURLboolNSError.fromFunction( - ThermionDartTexture1 lib, - NSProgress? Function(ObjCBlock_ffiVoid_NSURL_bool_NSError) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureTrampoline) - .cast(), - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_registerClosure( - (ffi.Pointer<_ObjCBlock> arg0) => - fn(ObjCBlock_ffiVoid_NSURL_bool_NSError._(arg0, lib, retain: true, release: true)) - ?._retainAndReturnId() ?? - ffi.nullptr)), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - NSProgress? call(ObjCBlock_ffiVoid_NSURL_bool_NSError arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>() - (_id, arg0._id) - .address == - 0 - ? null - : NSProgress._( - _id.ref.invoke - .cast Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>()(_id, arg0._id), - _lib, - retain: false, - release: true); -} - -void _ObjCBlock_ffiVoid_NSURL_bool_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, bool, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistry = , bool, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSURL_bool_NSError_registerClosure( - void Function(ffi.Pointer, bool, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSURL_bool_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSURL_bool_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURL_bool_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_bool_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURL_bool_NSError.fromFunction( - ThermionDartTexture1 lib, void Function(NSURL?, bool, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Bool, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSURL_bool_NSError_registerClosure( - (ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) => fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1, - arg2.address == 0 - ? null - : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSURL_bool_NSError.listener( - ThermionDartTexture1 lib, void Function(NSURL?, bool, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Bool, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSURL_bool_NSError_registerClosure( - (ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) => fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1, - arg2.address == 0 - ? null - : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Bool, ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSURL? arg0, bool arg1, NSError? arg2) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Bool arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - bool, ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1, arg2?._id ?? ffi.nullptr); -} - -void _ObjCBlock_ffiVoid_NSURL_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSURL_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSURL_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSURL_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistry[block.ref.target.address]!( - arg0, arg1); - -class ObjCBlock_ffiVoid_NSURL_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSURL_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURL_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURL_NSError.fromFunction( - ThermionDartTexture1 lib, void Function(NSURL?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSURL_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSURL_NSError.listener( - ThermionDartTexture1 lib, void Function(NSURL?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURL_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSURL_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSURL? arg0, NSError? arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1?._id ?? ffi.nullptr); -} - -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>)>()(arg0); -final _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistry = - Function(ffi.Pointer<_ObjCBlock>)>{}; -int _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_registerClosure( - ffi.Pointer Function(ffi.Pointer<_ObjCBlock>) fn) { - final id = - ++_ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistryIndex; - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_NSProgress_ffiVoidObjCObjectNSError extends _ObjCBlockBase { - ObjCBlock_NSProgress_ffiVoidObjCObjectNSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_NSProgress_ffiVoidObjCObjectNSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_NSProgress_ffiVoidObjCObjectNSError.fromFunction( - ThermionDartTexture1 lib, - NSProgress? Function(ObjCBlock_ffiVoid_ObjCObject_NSError) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureTrampoline) - .cast(), - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_registerClosure( - (ffi.Pointer<_ObjCBlock> arg0) => - fn(ObjCBlock_ffiVoid_ObjCObject_NSError._(arg0, lib, retain: true, release: true)) - ?._retainAndReturnId() ?? - ffi.nullptr)), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - NSProgress? call(ObjCBlock_ffiVoid_ObjCObject_NSError arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>() - (_id, arg0._id) - .address == - 0 - ? null - : NSProgress._( - _id.ref.invoke - .cast Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>()(_id, arg0._id), - _lib, - retain: false, - release: true); -} - -void _ObjCBlock_ffiVoid_ObjCObject_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ObjCObject_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_ObjCObject_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ObjCObject_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_NSError.fromFunction( - ThermionDartTexture1 lib, void Function(NSObject?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 ? null : NSObject._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ObjCObject_NSError.listener( - ThermionDartTexture1 lib, void Function(NSObject?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi - .NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ObjCObject_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSObject._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSObject? arg0, NSError? arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1?._id ?? ffi.nullptr); -} - -void - _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureRegistry = - , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_registerClosure( - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureRegistryIndex; - _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureRegistry[ - id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary.fromFunction( - ThermionDartTexture1 lib, - void Function(ObjCBlock_ffiVoid_ObjCObject_NSError1, NSObject, NSDictionary) - fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer<_ObjCBlock>, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_registerClosure( - (ffi.Pointer<_ObjCBlock> arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - ObjCBlock_ffiVoid_ObjCObject_NSError1._(arg0, lib, retain: true, release: true), - NSObject._(arg1, lib, retain: true, release: true), - NSDictionary._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary.listener( - ThermionDartTexture1 lib, - void Function(ObjCBlock_ffiVoid_ObjCObject_NSError1, NSObject, NSDictionary) - fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable, ffi.Pointer<_ObjCBlock>, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_registerClosure( - (ffi.Pointer<_ObjCBlock> arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - ObjCBlock_ffiVoid_ObjCObject_NSError1._(arg0, lib, retain: true, release: true), - NSObject._(arg1, lib, retain: true, release: true), - NSDictionary._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(ObjCBlock_ffiVoid_ObjCObject_NSError1 arg0, NSObject arg1, - NSDictionary arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>()( - _id, arg0._id, arg1._id, arg2._id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_NSError1_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ObjCObject_NSError1_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_ObjCObject_NSError1_closureRegistryIndex; - _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_ObjCObject_NSError1 extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ObjCObject_NSError1._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_NSError1.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSError1_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_NSError1.fromFunction( - ThermionDartTexture1 lib, void Function(NSObject?, NSError) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSError1_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 ? null : NSObject._(arg0, lib, retain: true, release: true), - NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ObjCObject_NSError1.listener( - ThermionDartTexture1 lib, void Function(NSObject?, NSError) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi - .NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSError1_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSObject._(arg0, lib, retain: true, release: true), - NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSObject? arg0, NSError arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1._id); -} - -class NSMutableString extends NSString { - NSMutableString._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMutableString] that points to the same underlying object as [other]. - static NSMutableString castFrom(T other) { - return NSMutableString._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSMutableString] that wraps the given raw object pointer. - static NSMutableString castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableString._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMutableString]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSMutableString1); - } - - void replaceCharactersInRange_withString_(_NSRange range, NSString aString) { - _lib._objc_msgSend_688(_id, _lib._sel_replaceCharactersInRange_withString_1, - range, aString._id); - } - - void insertString_atIndex_(NSString aString, int loc) { - _lib._objc_msgSend_689( - _id, _lib._sel_insertString_atIndex_1, aString._id, loc); - } - - void deleteCharactersInRange_(_NSRange range) { - _lib._objc_msgSend_475(_id, _lib._sel_deleteCharactersInRange_1, range); - } - - void appendString_(NSString aString) { - _lib._objc_msgSend_247(_id, _lib._sel_appendString_1, aString._id); - } - - void appendFormat_(NSString format) { - _lib._objc_msgSend_247(_id, _lib._sel_appendFormat_1, format._id); - } - - void setString_(NSString aString) { - _lib._objc_msgSend_247(_id, _lib._sel_setString_1, aString._id); - } - - int replaceOccurrencesOfString_withString_options_range_(NSString target, - NSString replacement, int options, _NSRange searchRange) { - return _lib._objc_msgSend_690( - _id, - _lib._sel_replaceOccurrencesOfString_withString_options_range_1, - target._id, - replacement._id, - options, - searchRange); - } - - bool applyTransform_reverse_range_updatedRange_(NSString transform, - bool reverse, _NSRange range, ffi.Pointer<_NSRange> resultingRange) { - return _lib._objc_msgSend_691( - _id, - _lib._sel_applyTransform_reverse_range_updatedRange_1, - transform._id, - reverse, - range, - resultingRange); - } - - NSMutableString initWithCapacity_(int capacity) { - final _ret = - _lib._objc_msgSend_692(_id, _lib._sel_initWithCapacity_1, capacity); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString stringWithCapacity_( - ThermionDartTexture1 _lib, int capacity) { - final _ret = _lib._objc_msgSend_692( - _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static ffi.Pointer getAvailableStringEncodings( - ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_356( - _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); - } - - static NSString localizedNameOfStringEncoding_( - ThermionDartTexture1 _lib, int encoding) { - final _ret = _lib._objc_msgSend_331(_lib._class_NSMutableString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static int getDefaultCStringEncoding(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_10( - _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); - } - - @override - NSMutableString initWithCharactersNoCopy_length_freeWhenDone_( - ffi.Pointer characters, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_368( - _id, - _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, - characters, - length, - freeBuffer); - return NSMutableString._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableString initWithCharactersNoCopy_length_deallocator_( - ffi.Pointer chars, - int len, - ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong? deallocator) { - final _ret = _lib._objc_msgSend_369( - _id, - _lib._sel_initWithCharactersNoCopy_length_deallocator_1, - chars, - len, - deallocator?._id ?? ffi.nullptr); - return NSMutableString._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableString initWithCharacters_length_( - ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_370( - _id, _lib._sel_initWithCharacters_length_1, characters, length); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithUTF8String_( - ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_371( - _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString initWithString_(NSString aString) { - final _ret = - _lib._objc_msgSend_31(_id, _lib._sel_initWithString_1, aString._id); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString initWithFormat_(NSString format) { - final _ret = - _lib._objc_msgSend_31(_id, _lib._sel_initWithFormat_1, format._id); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString initWithFormat_arguments_( - NSString format, ffi.Pointer argList) { - final _ret = _lib._objc_msgSend_372( - _id, _lib._sel_initWithFormat_arguments_1, format._id, argList); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString initWithFormat_locale_(NSString format, NSObject? locale) { - final _ret = _lib._objc_msgSend_373(_id, _lib._sel_initWithFormat_locale_1, - format._id, locale?._id ?? ffi.nullptr); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString initWithFormat_locale_arguments_( - NSString format, NSObject? locale, ffi.Pointer argList) { - final _ret = _lib._objc_msgSend_374( - _id, - _lib._sel_initWithFormat_locale_arguments_1, - format._id, - locale?._id ?? ffi.nullptr, - argList); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithValidatedFormat_validFormatSpecifiers_error_( - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_375( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithValidatedFormat_validFormatSpecifiers_locale_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_376( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? - initWithValidatedFormat_validFormatSpecifiers_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_377( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1, - format._id, - validFormatSpecifiers._id, - argList, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? - initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - ffi.Pointer argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_378( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - argList, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithData_encoding_(NSData data, int encoding) { - final _ret = _lib._objc_msgSend_379( - _id, _lib._sel_initWithData_encoding_1, data._id, encoding); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithBytes_length_encoding_( - ffi.Pointer bytes, int len, int encoding) { - final _ret = _lib._objc_msgSend_380( - _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithBytesNoCopy_length_encoding_freeWhenDone_( - ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { - final _ret = _lib._objc_msgSend_381( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, - bytes, - len, - encoding, - freeBuffer); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableString? initWithBytesNoCopy_length_encoding_deallocator_( - ffi.Pointer bytes, - int len, - int encoding, - ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong? deallocator) { - final _ret = _lib._objc_msgSend_382( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, - bytes, - len, - encoding, - deallocator?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: false, release: true); - } - - static NSMutableString string(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_string1); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString stringWithString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSMutableString1, _lib._sel_stringWithString_1, string._id); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString stringWithCharacters_length_(ThermionDartTexture1 _lib, - ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_370(_lib._class_NSMutableString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? stringWithUTF8String_( - ThermionDartTexture1 _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_371(_lib._class_NSMutableString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString stringWithFormat_( - ThermionDartTexture1 _lib, NSString format) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSMutableString1, _lib._sel_stringWithFormat_1, format._id); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString localizedStringWithFormat_( - ThermionDartTexture1 _lib, NSString format) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSMutableString1, - _lib._sel_localizedStringWithFormat_1, format._id); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? - stringWithValidatedFormat_validFormatSpecifiers_error_( - ThermionDartTexture1 _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_375( - _lib._class_NSMutableString1, - _lib._sel_stringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? - localizedStringWithValidatedFormat_validFormatSpecifiers_error_( - ThermionDartTexture1 _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_375( - _lib._class_NSMutableString1, - _lib._sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithCString_encoding_( - ffi.Pointer nullTerminatedCString, int encoding) { - final _ret = _lib._objc_msgSend_383(_id, - _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? stringWithCString_encoding_( - ThermionDartTexture1 _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_383(_lib._class_NSMutableString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithContentsOfURL_encoding_error_( - NSURL url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_384(_id, - _lib._sel_initWithContentsOfURL_encoding_error_1, url._id, enc, error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithContentsOfFile_encoding_error_( - NSString path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_385( - _id, - _lib._sel_initWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? stringWithContentsOfURL_encoding_error_( - ThermionDartTexture1 _lib, - NSURL url, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_384( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? stringWithContentsOfFile_encoding_error_( - ThermionDartTexture1 _lib, - NSString path, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_385( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithContentsOfURL_usedEncoding_error_( - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_386( - _id, - _lib._sel_initWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableString? initWithContentsOfFile_usedEncoding_error_( - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_387( - _id, - _lib._sel_initWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? stringWithContentsOfURL_usedEncoding_error_( - ThermionDartTexture1 _lib, - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_386( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? stringWithContentsOfFile_usedEncoding_error_( - ThermionDartTexture1 _lib, - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_387( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - ThermionDartTexture1 _lib, - NSData data, - NSDictionary? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_388( - _lib._class_NSMutableString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data._id, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - static NSObject? stringWithContentsOfFile_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithContentsOfURL_( - ThermionDartTexture1 _lib, NSURL url) { - final _ret = _lib._objc_msgSend_276(_lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithCString_length_( - ThermionDartTexture1 _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_383(_lib._class_NSMutableString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithCString_( - ThermionDartTexture1 _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_371( - _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSString pathWithComponents_( - ThermionDartTexture1 _lib, NSArray components) { - final _ret = _lib._objc_msgSend_395(_lib._class_NSMutableString1, - _lib._sel_pathWithComponents_1, components._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_new1); - return NSMutableString._(_ret, _lib, retain: false, release: true); - } - - static NSMutableString allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableString1, _lib._sel_allocWithZone_1, zone); - return NSMutableString._(_ret, _lib, retain: false, release: true); - } - - static NSMutableString alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_alloc1); - return NSMutableString._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMutableString1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMutableString1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSMutableString1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableString1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMutableString1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMutableString1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMutableString1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSMutableString1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableString1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSNotification extends NSObject { - NSNotification._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSNotification] that points to the same underlying object as [other]. - static NSNotification castFrom(T other) { - return NSNotification._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSNotification] that wraps the given raw object pointer. - static NSNotification castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSNotification._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSNotification]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSNotification1); - } - - NSString get name { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_name1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSObject? get object { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_object1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? get userInfo { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_userInfo1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSNotification initWithName_object_userInfo_( - NSString name, NSObject? object, NSDictionary? userInfo) { - final _ret = _lib._objc_msgSend_693( - _id, - _lib._sel_initWithName_object_userInfo_1, - name._id, - object?._id ?? ffi.nullptr, - userInfo?._id ?? ffi.nullptr); - return NSNotification._(_ret, _lib, retain: true, release: true); - } - - NSNotification? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSNotification._(_ret, _lib, retain: true, release: true); - } - - static NSNotification notificationWithName_object_( - ThermionDartTexture1 _lib, NSString aName, NSObject? anObject) { - final _ret = _lib._objc_msgSend_373( - _lib._class_NSNotification1, - _lib._sel_notificationWithName_object_1, - aName._id, - anObject?._id ?? ffi.nullptr); - return NSNotification._(_ret, _lib, retain: true, release: true); - } - - static NSNotification notificationWithName_object_userInfo_( - ThermionDartTexture1 _lib, - NSString aName, - NSObject? anObject, - NSDictionary? aUserInfo) { - final _ret = _lib._objc_msgSend_693( - _lib._class_NSNotification1, - _lib._sel_notificationWithName_object_userInfo_1, - aName._id, - anObject?._id ?? ffi.nullptr, - aUserInfo?._id ?? ffi.nullptr); - return NSNotification._(_ret, _lib, retain: true, release: true); - } - - @override - NSNotification init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSNotification._(_ret, _lib, retain: true, release: true); - } - - static NSNotification new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSNotification1, _lib._sel_new1); - return NSNotification._(_ret, _lib, retain: false, release: true); - } - - static NSNotification allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSNotification1, _lib._sel_allocWithZone_1, zone); - return NSNotification._(_ret, _lib, retain: false, release: true); - } - - static NSNotification alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSNotification1, _lib._sel_alloc1); - return NSNotification._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSNotification1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSNotification1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSNotification1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSNotification1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSNotification1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSNotification1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSNotification1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSNotification1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSNotification1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSBundle extends NSObject { - NSBundle._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSBundle] that points to the same underlying object as [other]. - static NSBundle castFrom(T other) { - return NSBundle._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSBundle] that wraps the given raw object pointer. - static NSBundle castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSBundle._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSBundle]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSBundle1); - } - - static NSBundle getMainBundle(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_694(_lib._class_NSBundle1, _lib._sel_mainBundle1); - return NSBundle._(_ret, _lib, retain: true, release: true); - } - - static NSBundle? bundleWithPath_(ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38( - _lib._class_NSBundle1, _lib._sel_bundleWithPath_1, path._id); - return _ret.address == 0 - ? null - : NSBundle._(_ret, _lib, retain: true, release: true); - } - - NSBundle? initWithPath_(NSString path) { - final _ret = _lib._objc_msgSend_38(_id, _lib._sel_initWithPath_1, path._id); - return _ret.address == 0 - ? null - : NSBundle._(_ret, _lib, retain: true, release: true); - } - - static NSBundle? bundleWithURL_(ThermionDartTexture1 _lib, NSURL url) { - final _ret = _lib._objc_msgSend_276( - _lib._class_NSBundle1, _lib._sel_bundleWithURL_1, url._id); - return _ret.address == 0 - ? null - : NSBundle._(_ret, _lib, retain: true, release: true); - } - - NSBundle? initWithURL_(NSURL url) { - final _ret = _lib._objc_msgSend_276(_id, _lib._sel_initWithURL_1, url._id); - return _ret.address == 0 - ? null - : NSBundle._(_ret, _lib, retain: true, release: true); - } - - static NSBundle bundleForClass_(ThermionDartTexture1 _lib, NSObject aClass) { - final _ret = _lib._objc_msgSend_695( - _lib._class_NSBundle1, _lib._sel_bundleForClass_1, aClass._id); - return NSBundle._(_ret, _lib, retain: true, release: true); - } - - static NSBundle? bundleWithIdentifier_( - ThermionDartTexture1 _lib, NSString identifier) { - final _ret = _lib._objc_msgSend_696(_lib._class_NSBundle1, - _lib._sel_bundleWithIdentifier_1, identifier._id); - return _ret.address == 0 - ? null - : NSBundle._(_ret, _lib, retain: true, release: true); - } - - static NSArray getAllBundles(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_84(_lib._class_NSBundle1, _lib._sel_allBundles1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray getAllFrameworks(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_84(_lib._class_NSBundle1, _lib._sel_allFrameworks1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - bool load() { - return _lib._objc_msgSend_12(_id, _lib._sel_load1); - } - - bool get loaded { - return _lib._objc_msgSend_12(_id, _lib._sel_isLoaded1); - } - - bool unload() { - return _lib._objc_msgSend_12(_id, _lib._sel_unload1); - } - - bool preflightAndReturnError_(ffi.Pointer> error) { - return _lib._objc_msgSend_242( - _id, _lib._sel_preflightAndReturnError_1, error); - } - - bool loadAndReturnError_(ffi.Pointer> error) { - return _lib._objc_msgSend_242(_id, _lib._sel_loadAndReturnError_1, error); - } - - NSURL get bundleURL { - final _ret = _lib._objc_msgSend_465(_id, _lib._sel_bundleURL1); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get resourceURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_resourceURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get executableURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_executableURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? URLForAuxiliaryExecutable_(NSString executableName) { - final _ret = _lib._objc_msgSend_256( - _id, _lib._sel_URLForAuxiliaryExecutable_1, executableName._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get privateFrameworksURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_privateFrameworksURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get sharedFrameworksURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_sharedFrameworksURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get sharedSupportURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_sharedSupportURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get builtInPlugInsURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_builtInPlugInsURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get appStoreReceiptURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_appStoreReceiptURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSString get bundlePath { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_bundlePath1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get resourcePath { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_resourcePath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get executablePath { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_executablePath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? pathForAuxiliaryExecutable_(NSString executableName) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_pathForAuxiliaryExecutable_1, executableName._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get privateFrameworksPath { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_privateFrameworksPath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get sharedFrameworksPath { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_sharedFrameworksPath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get sharedSupportPath { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_sharedSupportPath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get builtInPlugInsPath { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_builtInPlugInsPath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSURL? URLForResource_withExtension_subdirectory_inBundleWithURL_( - ThermionDartTexture1 _lib, - NSString? name, - NSString? ext, - NSString? subpath, - NSURL bundleURL) { - final _ret = _lib._objc_msgSend_697( - _lib._class_NSBundle1, - _lib._sel_URLForResource_withExtension_subdirectory_inBundleWithURL_1, - name?._id ?? ffi.nullptr, - ext?._id ?? ffi.nullptr, - subpath?._id ?? ffi.nullptr, - bundleURL._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSArray? URLsForResourcesWithExtension_subdirectory_inBundleWithURL_( - ThermionDartTexture1 _lib, - NSString? ext, - NSString? subpath, - NSURL bundleURL) { - final _ret = _lib._objc_msgSend_698( - _lib._class_NSBundle1, - _lib._sel_URLsForResourcesWithExtension_subdirectory_inBundleWithURL_1, - ext?._id ?? ffi.nullptr, - subpath?._id ?? ffi.nullptr, - bundleURL._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSURL? URLForResource_withExtension_(NSString? name, NSString? ext) { - final _ret = _lib._objc_msgSend_699( - _id, - _lib._sel_URLForResource_withExtension_1, - name?._id ?? ffi.nullptr, - ext?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? URLForResource_withExtension_subdirectory_( - NSString? name, NSString? ext, NSString? subpath) { - final _ret = _lib._objc_msgSend_700( - _id, - _lib._sel_URLForResource_withExtension_subdirectory_1, - name?._id ?? ffi.nullptr, - ext?._id ?? ffi.nullptr, - subpath?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? URLForResource_withExtension_subdirectory_localization_(NSString? name, - NSString? ext, NSString? subpath, NSString? localizationName) { - final _ret = _lib._objc_msgSend_701( - _id, - _lib._sel_URLForResource_withExtension_subdirectory_localization_1, - name?._id ?? ffi.nullptr, - ext?._id ?? ffi.nullptr, - subpath?._id ?? ffi.nullptr, - localizationName?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSArray? URLsForResourcesWithExtension_subdirectory_( - NSString? ext, NSString? subpath) { - final _ret = _lib._objc_msgSend_702( - _id, - _lib._sel_URLsForResourcesWithExtension_subdirectory_1, - ext?._id ?? ffi.nullptr, - subpath?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray? URLsForResourcesWithExtension_subdirectory_localization_( - NSString? ext, NSString? subpath, NSString? localizationName) { - final _ret = _lib._objc_msgSend_703( - _id, - _lib._sel_URLsForResourcesWithExtension_subdirectory_localization_1, - ext?._id ?? ffi.nullptr, - subpath?._id ?? ffi.nullptr, - localizationName?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSString? pathForResource_ofType_inDirectory_( - ThermionDartTexture1 _lib, - NSString? name, - NSString? ext, - NSString bundlePath) { - final _ret = _lib._objc_msgSend_704( - _lib._class_NSBundle1, - _lib._sel_pathForResource_ofType_inDirectory_1, - name?._id ?? ffi.nullptr, - ext?._id ?? ffi.nullptr, - bundlePath._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSArray pathsForResourcesOfType_inDirectory_( - ThermionDartTexture1 _lib, NSString? ext, NSString bundlePath) { - final _ret = _lib._objc_msgSend_705( - _lib._class_NSBundle1, - _lib._sel_pathsForResourcesOfType_inDirectory_1, - ext?._id ?? ffi.nullptr, - bundlePath._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? pathForResource_ofType_(NSString? name, NSString? ext) { - final _ret = _lib._objc_msgSend_706(_id, _lib._sel_pathForResource_ofType_1, - name?._id ?? ffi.nullptr, ext?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? pathForResource_ofType_inDirectory_forLocalization_(NSString? name, - NSString? ext, NSString? subpath, NSString? localizationName) { - final _ret = _lib._objc_msgSend_707( - _id, - _lib._sel_pathForResource_ofType_inDirectory_forLocalization_1, - name?._id ?? ffi.nullptr, - ext?._id ?? ffi.nullptr, - subpath?._id ?? ffi.nullptr, - localizationName?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray pathsForResourcesOfType_inDirectory_forLocalization_( - NSString? ext, NSString? subpath, NSString? localizationName) { - final _ret = _lib._objc_msgSend_708( - _id, - _lib._sel_pathsForResourcesOfType_inDirectory_forLocalization_1, - ext?._id ?? ffi.nullptr, - subpath?._id ?? ffi.nullptr, - localizationName?._id ?? ffi.nullptr); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString localizedStringForKey_value_table_( - NSString key, NSString? value, NSString? tableName) { - final _ret = _lib._objc_msgSend_709( - _id, - _lib._sel_localizedStringForKey_value_table_1, - key._id, - value?._id ?? ffi.nullptr, - tableName?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSAttributedString localizedAttributedStringForKey_value_table_( - NSString key, NSString? value, NSString? tableName) { - final _ret = _lib._objc_msgSend_731( - _id, - _lib._sel_localizedAttributedStringForKey_value_table_1, - key._id, - value?._id ?? ffi.nullptr, - tableName?._id ?? ffi.nullptr); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - NSString? get bundleIdentifier { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_bundleIdentifier1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? get infoDictionary { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_infoDictionary1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? get localizedInfoDictionary { - final _ret = - _lib._objc_msgSend_389(_id, _lib._sel_localizedInfoDictionary1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSObject? objectForInfoDictionaryKey_(NSString key) { - final _ret = _lib._objc_msgSend_38( - _id, _lib._sel_objectForInfoDictionaryKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? classNamed_(NSString className) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_classNamed_1, className._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? get principalClass { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_principalClass1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSArray get preferredLocalizations { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_preferredLocalizations1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get localizations { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_localizations1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? get developmentLocalization { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_developmentLocalization1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSArray preferredLocalizationsFromArray_( - ThermionDartTexture1 _lib, NSArray localizationsArray) { - final _ret = _lib._objc_msgSend_67(_lib._class_NSBundle1, - _lib._sel_preferredLocalizationsFromArray_1, localizationsArray._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray preferredLocalizationsFromArray_forPreferences_( - ThermionDartTexture1 _lib, - NSArray localizationsArray, - NSArray? preferencesArray) { - final _ret = _lib._objc_msgSend_732( - _lib._class_NSBundle1, - _lib._sel_preferredLocalizationsFromArray_forPreferences_1, - localizationsArray._id, - preferencesArray?._id ?? ffi.nullptr); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray? get executableArchitectures { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_executableArchitectures1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - void setPreservationPriority_forTags_(double priority, NSSet tags) { - _lib._objc_msgSend_733( - _id, _lib._sel_setPreservationPriority_forTags_1, priority, tags._id); - } - - double preservationPriorityForTag_(NSString tag) { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_307_fpret( - _id, _lib._sel_preservationPriorityForTag_1, tag._id) - : _lib._objc_msgSend_307( - _id, _lib._sel_preservationPriorityForTag_1, tag._id); - } - - @override - NSBundle init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSBundle._(_ret, _lib, retain: true, release: true); - } - - static NSBundle new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSBundle1, _lib._sel_new1); - return NSBundle._(_ret, _lib, retain: false, release: true); - } - - static NSBundle allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSBundle1, _lib._sel_allocWithZone_1, zone); - return NSBundle._(_ret, _lib, retain: false, release: true); - } - - static NSBundle alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSBundle1, _lib._sel_alloc1); - return NSBundle._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSBundle1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSBundle1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSBundle1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSBundle1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSBundle1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSBundle1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSBundle1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSBundle1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSBundle1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSAttributedString extends NSObject { - NSAttributedString._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSAttributedString] that points to the same underlying object as [other]. - static NSAttributedString castFrom(T other) { - return NSAttributedString._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSAttributedString] that wraps the given raw object pointer. - static NSAttributedString castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSAttributedString._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSAttributedString]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSAttributedString1); - } - - NSString get string { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_string1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSDictionary attributesAtIndex_effectiveRange_( - int location, ffi.Pointer<_NSRange> range) { - final _ret = _lib._objc_msgSend_710( - _id, _lib._sel_attributesAtIndex_effectiveRange_1, location, range); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - int get length { - return _lib._objc_msgSend_10(_id, _lib._sel_length1); - } - - NSObject? attribute_atIndex_effectiveRange_( - NSString attrName, int location, ffi.Pointer<_NSRange> range) { - final _ret = _lib._objc_msgSend_711( - _id, - _lib._sel_attribute_atIndex_effectiveRange_1, - attrName._id, - location, - range); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSAttributedString attributedSubstringFromRange_(_NSRange range) { - final _ret = _lib._objc_msgSend_712( - _id, _lib._sel_attributedSubstringFromRange_1, range); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - NSDictionary attributesAtIndex_longestEffectiveRange_inRange_( - int location, ffi.Pointer<_NSRange> range, _NSRange rangeLimit) { - final _ret = _lib._objc_msgSend_713( - _id, - _lib._sel_attributesAtIndex_longestEffectiveRange_inRange_1, - location, - range, - rangeLimit); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSObject? attribute_atIndex_longestEffectiveRange_inRange_(NSString attrName, - int location, ffi.Pointer<_NSRange> range, _NSRange rangeLimit) { - final _ret = _lib._objc_msgSend_714( - _id, - _lib._sel_attribute_atIndex_longestEffectiveRange_inRange_1, - attrName._id, - location, - range, - rangeLimit); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - bool isEqualToAttributedString_(NSAttributedString other) { - return _lib._objc_msgSend_715( - _id, _lib._sel_isEqualToAttributedString_1, other._id); - } - - NSAttributedString initWithString_(NSString str) { - final _ret = - _lib._objc_msgSend_31(_id, _lib._sel_initWithString_1, str._id); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - NSAttributedString initWithString_attributes_( - NSString str, NSDictionary? attrs) { - final _ret = _lib._objc_msgSend_716( - _id, - _lib._sel_initWithString_attributes_1, - str._id, - attrs?._id ?? ffi.nullptr); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - NSAttributedString initWithAttributedString_(NSAttributedString attrStr) { - final _ret = _lib._objc_msgSend_717( - _id, _lib._sel_initWithAttributedString_1, attrStr._id); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - void enumerateAttributesInRange_options_usingBlock_(_NSRange enumerationRange, - int opts, ObjCBlock_ffiVoid_NSDictionary_NSRange_bool block) { - _lib._objc_msgSend_718( - _id, - _lib._sel_enumerateAttributesInRange_options_usingBlock_1, - enumerationRange, - opts, - block._id); - } - - void enumerateAttribute_inRange_options_usingBlock_( - NSString attrName, - _NSRange enumerationRange, - int opts, - ObjCBlock_ffiVoid_ObjCObject_NSRange_bool block) { - _lib._objc_msgSend_719( - _id, - _lib._sel_enumerateAttribute_inRange_options_usingBlock_1, - attrName._id, - enumerationRange, - opts, - block._id); - } - - NSAttributedString? - initWithContentsOfMarkdownFileAtURL_options_baseURL_error_( - NSURL markdownFile, - NSAttributedStringMarkdownParsingOptions? options, - NSURL? baseURL, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_724( - _id, - _lib._sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_1, - markdownFile._id, - options?._id ?? ffi.nullptr, - baseURL?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - NSAttributedString? initWithMarkdown_options_baseURL_error_( - NSData markdown, - NSAttributedStringMarkdownParsingOptions? options, - NSURL? baseURL, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_725( - _id, - _lib._sel_initWithMarkdown_options_baseURL_error_1, - markdown._id, - options?._id ?? ffi.nullptr, - baseURL?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - NSAttributedString? initWithMarkdownString_options_baseURL_error_( - NSString markdownString, - NSAttributedStringMarkdownParsingOptions? options, - NSURL? baseURL, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_726( - _id, - _lib._sel_initWithMarkdownString_options_baseURL_error_1, - markdownString._id, - options?._id ?? ffi.nullptr, - baseURL?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - NSAttributedString initWithFormat_options_locale_( - NSAttributedString format, int options, NSLocale? locale) { - final _ret = _lib._objc_msgSend_727( - _id, - _lib._sel_initWithFormat_options_locale_1, - format._id, - options, - locale?._id ?? ffi.nullptr); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - NSAttributedString initWithFormat_options_locale_arguments_( - NSAttributedString format, - int options, - NSLocale? locale, - ffi.Pointer arguments) { - final _ret = _lib._objc_msgSend_728( - _id, - _lib._sel_initWithFormat_options_locale_arguments_1, - format._id, - options, - locale?._id ?? ffi.nullptr, - arguments); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - static NSAttributedString localizedAttributedStringWithFormat_( - ThermionDartTexture1 _lib, NSAttributedString format) { - final _ret = _lib._objc_msgSend_717(_lib._class_NSAttributedString1, - _lib._sel_localizedAttributedStringWithFormat_1, format._id); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - static NSAttributedString localizedAttributedStringWithFormat_options_( - ThermionDartTexture1 _lib, NSAttributedString format, int options) { - final _ret = _lib._objc_msgSend_729( - _lib._class_NSAttributedString1, - _lib._sel_localizedAttributedStringWithFormat_options_1, - format._id, - options); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - NSAttributedString attributedStringByInflectingString() { - final _ret = _lib._objc_msgSend_730( - _id, _lib._sel_attributedStringByInflectingString1); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - @override - NSAttributedString init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - static NSAttributedString new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSAttributedString1, _lib._sel_new1); - return NSAttributedString._(_ret, _lib, retain: false, release: true); - } - - static NSAttributedString allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSAttributedString1, _lib._sel_allocWithZone_1, zone); - return NSAttributedString._(_ret, _lib, retain: false, release: true); - } - - static NSAttributedString alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSAttributedString1, _lib._sel_alloc1); - return NSAttributedString._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSAttributedString1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSAttributedString1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSAttributedString1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSAttributedString1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSAttributedString1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSAttributedString1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSAttributedString1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSAttributedString1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSAttributedString1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSAttributedStringEnumerationOptions { - static const int NSAttributedStringEnumerationReverse = 2; - static const int - NSAttributedStringEnumerationLongestEffectiveRangeNotRequired = 1048576; -} - -void _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, _NSRange, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureRegistry = , _NSRange, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_registerClosure( - void Function(ffi.Pointer, _NSRange, ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSDictionary_NSRange_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSDictionary_NSRange_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSDictionary_NSRange_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSDictionary_NSRange_bool.fromFunction( - ThermionDartTexture1 lib, - void Function(NSDictionary, _NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_registerClosure( - (ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2) => - fn(NSDictionary._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSDictionary_NSRange_bool.listener(ThermionDartTexture1 lib, - void Function(NSDictionary, _NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_registerClosure( - (ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2) => - fn(NSDictionary._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - _NSRange, ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSDictionary arg0, _NSRange arg1, ffi.Pointer arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - ffi.Pointer)>()(_id, arg0._id, arg1, arg2); -} - -void _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, _NSRange, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureRegistry = , _NSRange, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_registerClosure( - void Function(ffi.Pointer, _NSRange, ffi.Pointer) - fn) { - final id = ++_ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_ObjCObject_NSRange_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ObjCObject_NSRange_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_NSRange_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_ObjCObject_NSRange_bool.fromFunction( - ThermionDartTexture1 lib, - void Function(NSObject?, _NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_registerClosure( - (ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2) => - fn(arg0.address == 0 ? null : NSObject._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_ObjCObject_NSRange_bool.listener(ThermionDartTexture1 lib, - void Function(NSObject?, _NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - _NSRange, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_registerClosure( - (ffi.Pointer arg0, _NSRange arg1, - ffi.Pointer arg2) => - fn(arg0.address == 0 ? null : NSObject._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - _NSRange, ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSObject? arg0, _NSRange arg1, ffi.Pointer arg2) => _id - .ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - _NSRange arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - _NSRange, ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1, arg2); -} - -class NSAttributedStringMarkdownParsingOptions extends NSObject { - NSAttributedStringMarkdownParsingOptions._( - ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSAttributedStringMarkdownParsingOptions] that points to the same underlying object as [other]. - static NSAttributedStringMarkdownParsingOptions - castFrom(T other) { - return NSAttributedStringMarkdownParsingOptions._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSAttributedStringMarkdownParsingOptions] that wraps the given raw object pointer. - static NSAttributedStringMarkdownParsingOptions castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSAttributedStringMarkdownParsingOptions._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSAttributedStringMarkdownParsingOptions]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSAttributedStringMarkdownParsingOptions1); - } - - @override - NSAttributedStringMarkdownParsingOptions init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, - retain: true, release: true); - } - - bool get allowsExtendedAttributes { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsExtendedAttributes1); - } - - set allowsExtendedAttributes(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAllowsExtendedAttributes_1, value); - } - - int get interpretedSyntax { - return _lib._objc_msgSend_720(_id, _lib._sel_interpretedSyntax1); - } - - set interpretedSyntax(int value) { - return _lib._objc_msgSend_721(_id, _lib._sel_setInterpretedSyntax_1, value); - } - - int get failurePolicy { - return _lib._objc_msgSend_722(_id, _lib._sel_failurePolicy1); - } - - set failurePolicy(int value) { - return _lib._objc_msgSend_723(_id, _lib._sel_setFailurePolicy_1, value); - } - - NSString? get languageCode { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_languageCode1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set languageCode(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setLanguageCode_1, value?._id ?? ffi.nullptr); - } - - bool get appliesSourcePositionAttributes { - return _lib._objc_msgSend_12( - _id, _lib._sel_appliesSourcePositionAttributes1); - } - - set appliesSourcePositionAttributes(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAppliesSourcePositionAttributes_1, value); - } - - static NSAttributedStringMarkdownParsingOptions new1( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSAttributedStringMarkdownParsingOptions1, _lib._sel_new1); - return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, - retain: false, release: true); - } - - static NSAttributedStringMarkdownParsingOptions allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_allocWithZone_1, - zone); - return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, - retain: false, release: true); - } - - static NSAttributedStringMarkdownParsingOptions alloc( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_alloc1); - return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, - retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62( - _lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, - key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63( - _lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_automaticallyNotifiesObserversForKey_1, - key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSAttributedStringMarkdownParsingOptions1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSAttributedStringMarkdownInterpretedSyntax { - static const int NSAttributedStringMarkdownInterpretedSyntaxFull = 0; - static const int NSAttributedStringMarkdownInterpretedSyntaxInlineOnly = 1; - static const int - NSAttributedStringMarkdownInterpretedSyntaxInlineOnlyPreservingWhitespace = - 2; -} - -abstract class NSAttributedStringMarkdownParsingFailurePolicy { - static const int NSAttributedStringMarkdownParsingFailureReturnError = 0; - static const int - NSAttributedStringMarkdownParsingFailureReturnPartiallyParsedIfPossible = - 1; -} - -abstract class NSAttributedStringFormattingOptions { - static const int - NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging = 1; - static const int NSAttributedStringFormattingApplyReplacementIndexAttribute = - 2; -} - -class NSMutableAttributedString extends NSAttributedString { - NSMutableAttributedString._( - ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMutableAttributedString] that points to the same underlying object as [other]. - static NSMutableAttributedString castFrom(T other) { - return NSMutableAttributedString._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSMutableAttributedString] that wraps the given raw object pointer. - static NSMutableAttributedString castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableAttributedString._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMutableAttributedString]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSMutableAttributedString1); - } - - void replaceCharactersInRange_withString_(_NSRange range, NSString str) { - _lib._objc_msgSend_688( - _id, _lib._sel_replaceCharactersInRange_withString_1, range, str._id); - } - - void setAttributes_range_(NSDictionary? attrs, _NSRange range) { - _lib._objc_msgSend_734( - _id, _lib._sel_setAttributes_range_1, attrs?._id ?? ffi.nullptr, range); - } - - NSMutableString get mutableString { - final _ret = _lib._objc_msgSend_735(_id, _lib._sel_mutableString1); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - void addAttribute_value_range_( - NSString name, NSObject value, _NSRange range) { - _lib._objc_msgSend_736( - _id, _lib._sel_addAttribute_value_range_1, name._id, value._id, range); - } - - void addAttributes_range_(NSDictionary attrs, _NSRange range) { - _lib._objc_msgSend_737( - _id, _lib._sel_addAttributes_range_1, attrs._id, range); - } - - void removeAttribute_range_(NSString name, _NSRange range) { - _lib._objc_msgSend_738( - _id, _lib._sel_removeAttribute_range_1, name._id, range); - } - - void replaceCharactersInRange_withAttributedString_( - _NSRange range, NSAttributedString attrString) { - _lib._objc_msgSend_739( - _id, - _lib._sel_replaceCharactersInRange_withAttributedString_1, - range, - attrString._id); - } - - void insertAttributedString_atIndex_(NSAttributedString attrString, int loc) { - _lib._objc_msgSend_740( - _id, _lib._sel_insertAttributedString_atIndex_1, attrString._id, loc); - } - - void appendAttributedString_(NSAttributedString attrString) { - _lib._objc_msgSend_741( - _id, _lib._sel_appendAttributedString_1, attrString._id); - } - - void deleteCharactersInRange_(_NSRange range) { - _lib._objc_msgSend_475(_id, _lib._sel_deleteCharactersInRange_1, range); - } - - void setAttributedString_(NSAttributedString attrString) { - _lib._objc_msgSend_741( - _id, _lib._sel_setAttributedString_1, attrString._id); - } - - void beginEditing() { - _lib._objc_msgSend_1(_id, _lib._sel_beginEditing1); - } - - void endEditing() { - _lib._objc_msgSend_1(_id, _lib._sel_endEditing1); - } - - void appendLocalizedFormat_(NSAttributedString format) { - _lib._objc_msgSend_741(_id, _lib._sel_appendLocalizedFormat_1, format._id); - } - - @override - NSMutableAttributedString initWithString_(NSString str) { - final _ret = - _lib._objc_msgSend_31(_id, _lib._sel_initWithString_1, str._id); - return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableAttributedString initWithString_attributes_( - NSString str, NSDictionary? attrs) { - final _ret = _lib._objc_msgSend_716( - _id, - _lib._sel_initWithString_attributes_1, - str._id, - attrs?._id ?? ffi.nullptr); - return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableAttributedString initWithAttributedString_( - NSAttributedString attrStr) { - final _ret = _lib._objc_msgSend_717( - _id, _lib._sel_initWithAttributedString_1, attrStr._id); - return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableAttributedString? - initWithContentsOfMarkdownFileAtURL_options_baseURL_error_( - NSURL markdownFile, - NSAttributedStringMarkdownParsingOptions? options, - NSURL? baseURL, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_724( - _id, - _lib._sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_1, - markdownFile._id, - options?._id ?? ffi.nullptr, - baseURL?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableAttributedString? initWithMarkdown_options_baseURL_error_( - NSData markdown, - NSAttributedStringMarkdownParsingOptions? options, - NSURL? baseURL, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_725( - _id, - _lib._sel_initWithMarkdown_options_baseURL_error_1, - markdown._id, - options?._id ?? ffi.nullptr, - baseURL?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableAttributedString? initWithMarkdownString_options_baseURL_error_( - NSString markdownString, - NSAttributedStringMarkdownParsingOptions? options, - NSURL? baseURL, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_726( - _id, - _lib._sel_initWithMarkdownString_options_baseURL_error_1, - markdownString._id, - options?._id ?? ffi.nullptr, - baseURL?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableAttributedString initWithFormat_options_locale_( - NSAttributedString format, int options, NSLocale? locale) { - final _ret = _lib._objc_msgSend_727( - _id, - _lib._sel_initWithFormat_options_locale_1, - format._id, - options, - locale?._id ?? ffi.nullptr); - return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableAttributedString initWithFormat_options_locale_arguments_( - NSAttributedString format, - int options, - NSLocale? locale, - ffi.Pointer arguments) { - final _ret = _lib._objc_msgSend_728( - _id, - _lib._sel_initWithFormat_options_locale_arguments_1, - format._id, - options, - locale?._id ?? ffi.nullptr, - arguments); - return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableAttributedString localizedAttributedStringWithFormat_( - ThermionDartTexture1 _lib, NSAttributedString format) { - final _ret = _lib._objc_msgSend_717(_lib._class_NSMutableAttributedString1, - _lib._sel_localizedAttributedStringWithFormat_1, format._id); - return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableAttributedString localizedAttributedStringWithFormat_options_( - ThermionDartTexture1 _lib, NSAttributedString format, int options) { - final _ret = _lib._objc_msgSend_729( - _lib._class_NSMutableAttributedString1, - _lib._sel_localizedAttributedStringWithFormat_options_1, - format._id, - options); - return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableAttributedString init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableAttributedString new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableAttributedString1, _lib._sel_new1); - return NSMutableAttributedString._(_ret, _lib, - retain: false, release: true); - } - - static NSMutableAttributedString allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3(_lib._class_NSMutableAttributedString1, - _lib._sel_allocWithZone_1, zone); - return NSMutableAttributedString._(_ret, _lib, - retain: false, release: true); - } - - static NSMutableAttributedString alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableAttributedString1, _lib._sel_alloc1); - return NSMutableAttributedString._(_ret, _lib, - retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMutableAttributedString1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMutableAttributedString1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSMutableAttributedString1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableAttributedString1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMutableAttributedString1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMutableAttributedString1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMutableAttributedString1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSMutableAttributedString1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSMutableAttributedString1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSDateFormatter extends NSFormatter { - NSDateFormatter._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSDateFormatter] that points to the same underlying object as [other]. - static NSDateFormatter castFrom(T other) { - return NSDateFormatter._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSDateFormatter] that wraps the given raw object pointer. - static NSDateFormatter castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSDateFormatter._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSDateFormatter]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSDateFormatter1); - } - - int get formattingContext { - return _lib._objc_msgSend_747(_id, _lib._sel_formattingContext1); - } - - set formattingContext(int value) { - return _lib._objc_msgSend_748(_id, _lib._sel_setFormattingContext_1, value); - } - - bool getObjectValue_forString_range_error_( - ffi.Pointer> obj, - NSString string, - ffi.Pointer<_NSRange> rangep, - ffi.Pointer> error) { - return _lib._objc_msgSend_749( - _id, - _lib._sel_getObjectValue_forString_range_error_1, - obj, - string._id, - rangep, - error); - } - - NSString stringFromDate_(NSDate date) { - final _ret = - _lib._objc_msgSend_750(_id, _lib._sel_stringFromDate_1, date._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSDate? dateFromString_(NSString string) { - final _ret = - _lib._objc_msgSend_563(_id, _lib._sel_dateFromString_1, string._id); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - static NSString localizedStringFromDate_dateStyle_timeStyle_( - ThermionDartTexture1 _lib, NSDate date, int dstyle, int tstyle) { - final _ret = _lib._objc_msgSend_751( - _lib._class_NSDateFormatter1, - _lib._sel_localizedStringFromDate_dateStyle_timeStyle_1, - date._id, - dstyle, - tstyle); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? dateFormatFromTemplate_options_locale_( - ThermionDartTexture1 _lib, NSString tmplate, int opts, NSLocale? locale) { - final _ret = _lib._objc_msgSend_752( - _lib._class_NSDateFormatter1, - _lib._sel_dateFormatFromTemplate_options_locale_1, - tmplate._id, - opts, - locale?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static int getDefaultFormatterBehavior(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_753( - _lib._class_NSDateFormatter1, _lib._sel_defaultFormatterBehavior1); - } - - static void setDefaultFormatterBehavior( - ThermionDartTexture1 _lib, int value) { - return _lib._objc_msgSend_754(_lib._class_NSDateFormatter1, - _lib._sel_setDefaultFormatterBehavior_1, value); - } - - void setLocalizedDateFormatFromTemplate_(NSString dateFormatTemplate) { - _lib._objc_msgSend_247(_id, _lib._sel_setLocalizedDateFormatFromTemplate_1, - dateFormatTemplate._id); - } - - NSString get dateFormat { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_dateFormat1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set dateFormat(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setDateFormat_1, value._id); - } - - int get dateStyle { - return _lib._objc_msgSend_755(_id, _lib._sel_dateStyle1); - } - - set dateStyle(int value) { - return _lib._objc_msgSend_756(_id, _lib._sel_setDateStyle_1, value); - } - - int get timeStyle { - return _lib._objc_msgSend_755(_id, _lib._sel_timeStyle1); - } - - set timeStyle(int value) { - return _lib._objc_msgSend_756(_id, _lib._sel_setTimeStyle_1, value); - } - - NSLocale get locale { - final _ret = _lib._objc_msgSend_196(_id, _lib._sel_locale1); - return NSLocale._(_ret, _lib, retain: true, release: true); - } - - set locale(NSLocale value) { - return _lib._objc_msgSend_757(_id, _lib._sel_setLocale_1, value._id); - } - - bool get generatesCalendarDates { - return _lib._objc_msgSend_12(_id, _lib._sel_generatesCalendarDates1); - } - - set generatesCalendarDates(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setGeneratesCalendarDates_1, value); - } - - int get formatterBehavior { - return _lib._objc_msgSend_753(_id, _lib._sel_formatterBehavior1); - } - - set formatterBehavior(int value) { - return _lib._objc_msgSend_754(_id, _lib._sel_setFormatterBehavior_1, value); - } - - NSTimeZone get timeZone { - final _ret = _lib._objc_msgSend_178(_id, _lib._sel_timeZone1); - return NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - set timeZone(NSTimeZone value) { - return _lib._objc_msgSend_179(_id, _lib._sel_setTimeZone_1, value._id); - } - - NSCalendar get calendar { - final _ret = _lib._objc_msgSend_758(_id, _lib._sel_calendar1); - return NSCalendar._(_ret, _lib, retain: true, release: true); - } - - set calendar(NSCalendar value) { - return _lib._objc_msgSend_794(_id, _lib._sel_setCalendar_1, value._id); - } - - bool get lenient { - return _lib._objc_msgSend_12(_id, _lib._sel_isLenient1); - } - - set lenient(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setLenient_1, value); - } - - NSDate? get twoDigitStartDate { - final _ret = _lib._objc_msgSend_182(_id, _lib._sel_twoDigitStartDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - set twoDigitStartDate(NSDate? value) { - return _lib._objc_msgSend_795( - _id, _lib._sel_setTwoDigitStartDate_1, value?._id ?? ffi.nullptr); - } - - NSDate? get defaultDate { - final _ret = _lib._objc_msgSend_182(_id, _lib._sel_defaultDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - set defaultDate(NSDate? value) { - return _lib._objc_msgSend_795( - _id, _lib._sel_setDefaultDate_1, value?._id ?? ffi.nullptr); - } - - NSArray get eraSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_eraSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set eraSymbols(NSArray value) { - return _lib._objc_msgSend_796(_id, _lib._sel_setEraSymbols_1, value._id); - } - - NSArray get monthSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_monthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set monthSymbols(NSArray value) { - return _lib._objc_msgSend_796(_id, _lib._sel_setMonthSymbols_1, value._id); - } - - NSArray get shortMonthSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_shortMonthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set shortMonthSymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setShortMonthSymbols_1, value._id); - } - - NSArray get weekdaySymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_weekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set weekdaySymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setWeekdaySymbols_1, value._id); - } - - NSArray get shortWeekdaySymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_shortWeekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set shortWeekdaySymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setShortWeekdaySymbols_1, value._id); - } - - NSString get AMSymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_AMSymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set AMSymbol(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setAMSymbol_1, value._id); - } - - NSString get PMSymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_PMSymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set PMSymbol(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setPMSymbol_1, value._id); - } - - NSArray get longEraSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_longEraSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set longEraSymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setLongEraSymbols_1, value._id); - } - - NSArray get veryShortMonthSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_veryShortMonthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set veryShortMonthSymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setVeryShortMonthSymbols_1, value._id); - } - - NSArray get standaloneMonthSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_standaloneMonthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set standaloneMonthSymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setStandaloneMonthSymbols_1, value._id); - } - - NSArray get shortStandaloneMonthSymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_shortStandaloneMonthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set shortStandaloneMonthSymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setShortStandaloneMonthSymbols_1, value._id); - } - - NSArray get veryShortStandaloneMonthSymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_veryShortStandaloneMonthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set veryShortStandaloneMonthSymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setVeryShortStandaloneMonthSymbols_1, value._id); - } - - NSArray get veryShortWeekdaySymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_veryShortWeekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set veryShortWeekdaySymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setVeryShortWeekdaySymbols_1, value._id); - } - - NSArray get standaloneWeekdaySymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_standaloneWeekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set standaloneWeekdaySymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setStandaloneWeekdaySymbols_1, value._id); - } - - NSArray get shortStandaloneWeekdaySymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_shortStandaloneWeekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set shortStandaloneWeekdaySymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setShortStandaloneWeekdaySymbols_1, value._id); - } - - NSArray get veryShortStandaloneWeekdaySymbols { - final _ret = _lib._objc_msgSend_84( - _id, _lib._sel_veryShortStandaloneWeekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set veryShortStandaloneWeekdaySymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setVeryShortStandaloneWeekdaySymbols_1, value._id); - } - - NSArray get quarterSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_quarterSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set quarterSymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setQuarterSymbols_1, value._id); - } - - NSArray get shortQuarterSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_shortQuarterSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set shortQuarterSymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setShortQuarterSymbols_1, value._id); - } - - NSArray get standaloneQuarterSymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_standaloneQuarterSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set standaloneQuarterSymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setStandaloneQuarterSymbols_1, value._id); - } - - NSArray get shortStandaloneQuarterSymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_shortStandaloneQuarterSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - set shortStandaloneQuarterSymbols(NSArray value) { - return _lib._objc_msgSend_796( - _id, _lib._sel_setShortStandaloneQuarterSymbols_1, value._id); - } - - NSDate? get gregorianStartDate { - final _ret = _lib._objc_msgSend_182(_id, _lib._sel_gregorianStartDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - set gregorianStartDate(NSDate? value) { - return _lib._objc_msgSend_795( - _id, _lib._sel_setGregorianStartDate_1, value?._id ?? ffi.nullptr); - } - - bool get doesRelativeDateFormatting { - return _lib._objc_msgSend_12(_id, _lib._sel_doesRelativeDateFormatting1); - } - - set doesRelativeDateFormatting(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setDoesRelativeDateFormatting_1, value); - } - - NSObject initWithDateFormat_allowNaturalLanguage_( - NSString format, bool flag) { - final _ret = _lib._objc_msgSend_30(_id, - _lib._sel_initWithDateFormat_allowNaturalLanguage_1, format._id, flag); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - bool allowsNaturalLanguage() { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsNaturalLanguage1); - } - - @override - NSDateFormatter init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSDateFormatter._(_ret, _lib, retain: true, release: true); - } - - static NSDateFormatter new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSDateFormatter1, _lib._sel_new1); - return NSDateFormatter._(_ret, _lib, retain: false, release: true); - } - - static NSDateFormatter allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSDateFormatter1, _lib._sel_allocWithZone_1, zone); - return NSDateFormatter._(_ret, _lib, retain: false, release: true); - } - - static NSDateFormatter alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSDateFormatter1, _lib._sel_alloc1); - return NSDateFormatter._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSDateFormatter1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSDateFormatter1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSDateFormatter1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSDateFormatter1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSDateFormatter1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSDateFormatter1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSDateFormatter1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSDateFormatter1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSDateFormatter1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSFormatter extends NSObject { - NSFormatter._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSFormatter] that points to the same underlying object as [other]. - static NSFormatter castFrom(T other) { - return NSFormatter._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSFormatter] that wraps the given raw object pointer. - static NSFormatter castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSFormatter._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSFormatter]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFormatter1); - } - - NSString? stringForObjectValue_(NSObject? obj) { - final _ret = _lib._objc_msgSend_742( - _id, _lib._sel_stringForObjectValue_1, obj?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSAttributedString? attributedStringForObjectValue_withDefaultAttributes_( - NSObject obj, NSDictionary? attrs) { - final _ret = _lib._objc_msgSend_743( - _id, - _lib._sel_attributedStringForObjectValue_withDefaultAttributes_1, - obj._id, - attrs?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - NSString? editingStringForObjectValue_(NSObject obj) { - final _ret = _lib._objc_msgSend_525( - _id, _lib._sel_editingStringForObjectValue_1, obj._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool getObjectValue_forString_errorDescription_( - ffi.Pointer> obj, - NSString string, - ffi.Pointer> error) { - return _lib._objc_msgSend_744( - _id, - _lib._sel_getObjectValue_forString_errorDescription_1, - obj, - string._id, - error); - } - - bool isPartialStringValid_newEditingString_errorDescription_( - NSString partialString, - ffi.Pointer> newString, - ffi.Pointer> error) { - return _lib._objc_msgSend_745( - _id, - _lib._sel_isPartialStringValid_newEditingString_errorDescription_1, - partialString._id, - newString, - error); - } - - bool - isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_( - ffi.Pointer> partialStringPtr, - ffi.Pointer<_NSRange> proposedSelRangePtr, - NSString origString, - _NSRange origSelRange, - ffi.Pointer> error) { - return _lib._objc_msgSend_746( - _id, - _lib._sel_isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_1, - partialStringPtr, - proposedSelRangePtr, - origString._id, - origSelRange, - error); - } - - @override - NSFormatter init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSFormatter._(_ret, _lib, retain: true, release: true); - } - - static NSFormatter new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSFormatter1, _lib._sel_new1); - return NSFormatter._(_ret, _lib, retain: false, release: true); - } - - static NSFormatter allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSFormatter1, _lib._sel_allocWithZone_1, zone); - return NSFormatter._(_ret, _lib, retain: false, release: true); - } - - static NSFormatter alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSFormatter1, _lib._sel_alloc1); - return NSFormatter._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSFormatter1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSFormatter1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSFormatter1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSFormatter1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSFormatter1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSFormatter1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSFormatter1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSFormatter1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSFormatter1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSFormattingContext { - static const int NSFormattingContextUnknown = 0; - static const int NSFormattingContextDynamic = 1; - static const int NSFormattingContextStandalone = 2; - static const int NSFormattingContextListItem = 3; - static const int NSFormattingContextBeginningOfSentence = 4; - static const int NSFormattingContextMiddleOfSentence = 5; -} - -abstract class NSDateFormatterStyle { - static const int NSDateFormatterNoStyle = 0; - static const int NSDateFormatterShortStyle = 1; - static const int NSDateFormatterMediumStyle = 2; - static const int NSDateFormatterLongStyle = 3; - static const int NSDateFormatterFullStyle = 4; -} - -abstract class NSDateFormatterBehavior { - static const int NSDateFormatterBehaviorDefault = 0; - static const int NSDateFormatterBehavior10_0 = 1000; - static const int NSDateFormatterBehavior10_4 = 1040; -} - -class NSCalendar extends NSObject { - NSCalendar._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSCalendar] that points to the same underlying object as [other]. - static NSCalendar castFrom(T other) { - return NSCalendar._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSCalendar] that wraps the given raw object pointer. - static NSCalendar castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSCalendar._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSCalendar]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSCalendar1); - } - - static NSCalendar getCurrentCalendar(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_758( - _lib._class_NSCalendar1, _lib._sel_currentCalendar1); - return NSCalendar._(_ret, _lib, retain: true, release: true); - } - - static NSCalendar getAutoupdatingCurrentCalendar(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_758( - _lib._class_NSCalendar1, _lib._sel_autoupdatingCurrentCalendar1); - return NSCalendar._(_ret, _lib, retain: true, release: true); - } - - static NSCalendar? calendarWithIdentifier_( - ThermionDartTexture1 _lib, NSString calendarIdentifierConstant) { - final _ret = _lib._objc_msgSend_759(_lib._class_NSCalendar1, - _lib._sel_calendarWithIdentifier_1, calendarIdentifierConstant._id); - return _ret.address == 0 - ? null - : NSCalendar._(_ret, _lib, retain: true, release: true); - } - - @override - NSCalendar init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSCalendar._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithCalendarIdentifier_(NSString ident) { - final _ret = _lib._objc_msgSend_38( - _id, _lib._sel_initWithCalendarIdentifier_1, ident._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSString get calendarIdentifier { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_calendarIdentifier1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSLocale? get locale { - final _ret = _lib._objc_msgSend_760(_id, _lib._sel_locale1); - return _ret.address == 0 - ? null - : NSLocale._(_ret, _lib, retain: true, release: true); - } - - set locale(NSLocale? value) { - return _lib._objc_msgSend_761( - _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); - } - - NSTimeZone get timeZone { - final _ret = _lib._objc_msgSend_178(_id, _lib._sel_timeZone1); - return NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - set timeZone(NSTimeZone value) { - return _lib._objc_msgSend_179(_id, _lib._sel_setTimeZone_1, value._id); - } - - int get firstWeekday { - return _lib._objc_msgSend_10(_id, _lib._sel_firstWeekday1); - } - - set firstWeekday(int value) { - return _lib._objc_msgSend_515(_id, _lib._sel_setFirstWeekday_1, value); - } - - int get minimumDaysInFirstWeek { - return _lib._objc_msgSend_10(_id, _lib._sel_minimumDaysInFirstWeek1); - } - - set minimumDaysInFirstWeek(int value) { - return _lib._objc_msgSend_515( - _id, _lib._sel_setMinimumDaysInFirstWeek_1, value); - } - - NSArray get eraSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_eraSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get longEraSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_longEraSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get monthSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_monthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get shortMonthSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_shortMonthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get veryShortMonthSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_veryShortMonthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get standaloneMonthSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_standaloneMonthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get shortStandaloneMonthSymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_shortStandaloneMonthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get veryShortStandaloneMonthSymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_veryShortStandaloneMonthSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get weekdaySymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_weekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get shortWeekdaySymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_shortWeekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get veryShortWeekdaySymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_veryShortWeekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get standaloneWeekdaySymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_standaloneWeekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get shortStandaloneWeekdaySymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_shortStandaloneWeekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get veryShortStandaloneWeekdaySymbols { - final _ret = _lib._objc_msgSend_84( - _id, _lib._sel_veryShortStandaloneWeekdaySymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get quarterSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_quarterSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get shortQuarterSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_shortQuarterSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get standaloneQuarterSymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_standaloneQuarterSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get shortStandaloneQuarterSymbols { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_shortStandaloneQuarterSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString get AMSymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_AMSymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get PMSymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_PMSymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void minimumRangeOfUnit_(ffi.Pointer<_NSRange> stret, int unit) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_762_stret( - stret, _id, _lib._sel_minimumRangeOfUnit_1, unit) - : stret.ref = - _lib._objc_msgSend_762(_id, _lib._sel_minimumRangeOfUnit_1, unit); - } - - void maximumRangeOfUnit_(ffi.Pointer<_NSRange> stret, int unit) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_762_stret( - stret, _id, _lib._sel_maximumRangeOfUnit_1, unit) - : stret.ref = - _lib._objc_msgSend_762(_id, _lib._sel_maximumRangeOfUnit_1, unit); - } - - void rangeOfUnit_inUnit_forDate_( - ffi.Pointer<_NSRange> stret, int smaller, int larger, NSDate date) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_763_stret(stret, _id, - _lib._sel_rangeOfUnit_inUnit_forDate_1, smaller, larger, date._id) - : stret.ref = _lib._objc_msgSend_763(_id, - _lib._sel_rangeOfUnit_inUnit_forDate_1, smaller, larger, date._id); - } - - int ordinalityOfUnit_inUnit_forDate_(int smaller, int larger, NSDate date) { - return _lib._objc_msgSend_764(_id, - _lib._sel_ordinalityOfUnit_inUnit_forDate_1, smaller, larger, date._id); - } - - bool rangeOfUnit_startDate_interval_forDate_( - int unit, - ffi.Pointer> datep, - ffi.Pointer tip, - NSDate date) { - return _lib._objc_msgSend_765( - _id, - _lib._sel_rangeOfUnit_startDate_interval_forDate_1, - unit, - datep, - tip, - date._id); - } - - NSDate? dateFromComponents_(NSDateComponents comps) { - final _ret = - _lib._objc_msgSend_773(_id, _lib._sel_dateFromComponents_1, comps._id); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDateComponents components_fromDate_(int unitFlags, NSDate date) { - final _ret = _lib._objc_msgSend_774( - _id, _lib._sel_components_fromDate_1, unitFlags, date._id); - return NSDateComponents._(_ret, _lib, retain: true, release: true); - } - - NSDate? dateByAddingComponents_toDate_options_( - NSDateComponents comps, NSDate date, int opts) { - final _ret = _lib._objc_msgSend_775( - _id, - _lib._sel_dateByAddingComponents_toDate_options_1, - comps._id, - date._id, - opts); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDateComponents components_fromDate_toDate_options_( - int unitFlags, NSDate startingDate, NSDate resultDate, int opts) { - final _ret = _lib._objc_msgSend_776( - _id, - _lib._sel_components_fromDate_toDate_options_1, - unitFlags, - startingDate._id, - resultDate._id, - opts); - return NSDateComponents._(_ret, _lib, retain: true, release: true); - } - - void getEra_year_month_day_fromDate_( - ffi.Pointer eraValuePointer, - ffi.Pointer yearValuePointer, - ffi.Pointer monthValuePointer, - ffi.Pointer dayValuePointer, - NSDate date) { - _lib._objc_msgSend_777( - _id, - _lib._sel_getEra_year_month_day_fromDate_1, - eraValuePointer, - yearValuePointer, - monthValuePointer, - dayValuePointer, - date._id); - } - - void getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_( - ffi.Pointer eraValuePointer, - ffi.Pointer yearValuePointer, - ffi.Pointer weekValuePointer, - ffi.Pointer weekdayValuePointer, - NSDate date) { - _lib._objc_msgSend_777( - _id, - _lib._sel_getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_1, - eraValuePointer, - yearValuePointer, - weekValuePointer, - weekdayValuePointer, - date._id); - } - - void getHour_minute_second_nanosecond_fromDate_( - ffi.Pointer hourValuePointer, - ffi.Pointer minuteValuePointer, - ffi.Pointer secondValuePointer, - ffi.Pointer nanosecondValuePointer, - NSDate date) { - _lib._objc_msgSend_777( - _id, - _lib._sel_getHour_minute_second_nanosecond_fromDate_1, - hourValuePointer, - minuteValuePointer, - secondValuePointer, - nanosecondValuePointer, - date._id); - } - - int component_fromDate_(int unit, NSDate date) { - return _lib._objc_msgSend_778( - _id, _lib._sel_component_fromDate_1, unit, date._id); - } - - NSDate? dateWithEra_year_month_day_hour_minute_second_nanosecond_( - int eraValue, - int yearValue, - int monthValue, - int dayValue, - int hourValue, - int minuteValue, - int secondValue, - int nanosecondValue) { - final _ret = _lib._objc_msgSend_779( - _id, - _lib._sel_dateWithEra_year_month_day_hour_minute_second_nanosecond_1, - eraValue, - yearValue, - monthValue, - dayValue, - hourValue, - minuteValue, - secondValue, - nanosecondValue); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate? - dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_( - int eraValue, - int yearValue, - int weekValue, - int weekdayValue, - int hourValue, - int minuteValue, - int secondValue, - int nanosecondValue) { - final _ret = _lib._objc_msgSend_779( - _id, - _lib._sel_dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_1, - eraValue, - yearValue, - weekValue, - weekdayValue, - hourValue, - minuteValue, - secondValue, - nanosecondValue); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate startOfDayForDate_(NSDate date) { - final _ret = - _lib._objc_msgSend_167(_id, _lib._sel_startOfDayForDate_1, date._id); - return NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDateComponents componentsInTimeZone_fromDate_( - NSTimeZone timezone, NSDate date) { - final _ret = _lib._objc_msgSend_780( - _id, _lib._sel_componentsInTimeZone_fromDate_1, timezone._id, date._id); - return NSDateComponents._(_ret, _lib, retain: true, release: true); - } - - int compareDate_toDate_toUnitGranularity_( - NSDate date1, NSDate date2, int unit) { - return _lib._objc_msgSend_781( - _id, - _lib._sel_compareDate_toDate_toUnitGranularity_1, - date1._id, - date2._id, - unit); - } - - bool isDate_equalToDate_toUnitGranularity_( - NSDate date1, NSDate date2, int unit) { - return _lib._objc_msgSend_782( - _id, - _lib._sel_isDate_equalToDate_toUnitGranularity_1, - date1._id, - date2._id, - unit); - } - - bool isDate_inSameDayAsDate_(NSDate date1, NSDate date2) { - return _lib._objc_msgSend_783( - _id, _lib._sel_isDate_inSameDayAsDate_1, date1._id, date2._id); - } - - bool isDateInToday_(NSDate date) { - return _lib._objc_msgSend_169(_id, _lib._sel_isDateInToday_1, date._id); - } - - bool isDateInYesterday_(NSDate date) { - return _lib._objc_msgSend_169(_id, _lib._sel_isDateInYesterday_1, date._id); - } - - bool isDateInTomorrow_(NSDate date) { - return _lib._objc_msgSend_169(_id, _lib._sel_isDateInTomorrow_1, date._id); - } - - bool isDateInWeekend_(NSDate date) { - return _lib._objc_msgSend_169(_id, _lib._sel_isDateInWeekend_1, date._id); - } - - bool rangeOfWeekendStartDate_interval_containingDate_( - ffi.Pointer> datep, - ffi.Pointer tip, - NSDate date) { - return _lib._objc_msgSend_784( - _id, - _lib._sel_rangeOfWeekendStartDate_interval_containingDate_1, - datep, - tip, - date._id); - } - - bool nextWeekendStartDate_interval_options_afterDate_( - ffi.Pointer> datep, - ffi.Pointer tip, - int options, - NSDate date) { - return _lib._objc_msgSend_785( - _id, - _lib._sel_nextWeekendStartDate_interval_options_afterDate_1, - datep, - tip, - options, - date._id); - } - - NSDateComponents components_fromDateComponents_toDateComponents_options_( - int unitFlags, - NSDateComponents startingDateComp, - NSDateComponents resultDateComp, - int options) { - final _ret = _lib._objc_msgSend_786( - _id, - _lib._sel_components_fromDateComponents_toDateComponents_options_1, - unitFlags, - startingDateComp._id, - resultDateComp._id, - options); - return NSDateComponents._(_ret, _lib, retain: true, release: true); - } - - NSDate? dateByAddingUnit_value_toDate_options_( - int unit, int value, NSDate date, int options) { - final _ret = _lib._objc_msgSend_787( - _id, - _lib._sel_dateByAddingUnit_value_toDate_options_1, - unit, - value, - date._id, - options); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - void enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_( - NSDate start, - NSDateComponents comps, - int opts, - ObjCBlock_ffiVoid_NSDate_bool_bool block) { - _lib._objc_msgSend_788( - _id, - _lib._sel_enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_1, - start._id, - comps._id, - opts, - block._id); - } - - NSDate? nextDateAfterDate_matchingComponents_options_( - NSDate date, NSDateComponents comps, int options) { - final _ret = _lib._objc_msgSend_789( - _id, - _lib._sel_nextDateAfterDate_matchingComponents_options_1, - date._id, - comps._id, - options); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate? nextDateAfterDate_matchingUnit_value_options_( - NSDate date, int unit, int value, int options) { - final _ret = _lib._objc_msgSend_790( - _id, - _lib._sel_nextDateAfterDate_matchingUnit_value_options_1, - date._id, - unit, - value, - options); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate? nextDateAfterDate_matchingHour_minute_second_options_(NSDate date, - int hourValue, int minuteValue, int secondValue, int options) { - final _ret = _lib._objc_msgSend_791( - _id, - _lib._sel_nextDateAfterDate_matchingHour_minute_second_options_1, - date._id, - hourValue, - minuteValue, - secondValue, - options); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate? dateBySettingUnit_value_ofDate_options_( - int unit, int v, NSDate date, int opts) { - final _ret = _lib._objc_msgSend_787( - _id, - _lib._sel_dateBySettingUnit_value_ofDate_options_1, - unit, - v, - date._id, - opts); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSDate? dateBySettingHour_minute_second_ofDate_options_( - int h, int m, int s, NSDate date, int opts) { - final _ret = _lib._objc_msgSend_792( - _id, - _lib._sel_dateBySettingHour_minute_second_ofDate_options_1, - h, - m, - s, - date._id, - opts); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - bool date_matchesComponents_(NSDate date, NSDateComponents components) { - return _lib._objc_msgSend_793( - _id, _lib._sel_date_matchesComponents_1, date._id, components._id); - } - - static NSCalendar new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSCalendar1, _lib._sel_new1); - return NSCalendar._(_ret, _lib, retain: false, release: true); - } - - static NSCalendar allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSCalendar1, _lib._sel_allocWithZone_1, zone); - return NSCalendar._(_ret, _lib, retain: false, release: true); - } - - static NSCalendar alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSCalendar1, _lib._sel_alloc1); - return NSCalendar._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSCalendar1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSCalendar1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSCalendar1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSCalendar1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSCalendar1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSCalendar1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSCalendar1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSCalendar1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSCalendar1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSCalendarUnit { - static const int NSCalendarUnitEra = 2; - static const int NSCalendarUnitYear = 4; - static const int NSCalendarUnitMonth = 8; - static const int NSCalendarUnitDay = 16; - static const int NSCalendarUnitHour = 32; - static const int NSCalendarUnitMinute = 64; - static const int NSCalendarUnitSecond = 128; - static const int NSCalendarUnitWeekday = 512; - static const int NSCalendarUnitWeekdayOrdinal = 1024; - static const int NSCalendarUnitQuarter = 2048; - static const int NSCalendarUnitWeekOfMonth = 4096; - static const int NSCalendarUnitWeekOfYear = 8192; - static const int NSCalendarUnitYearForWeekOfYear = 16384; - static const int NSCalendarUnitNanosecond = 32768; - static const int NSCalendarUnitCalendar = 1048576; - static const int NSCalendarUnitTimeZone = 2097152; - static const int NSEraCalendarUnit = 2; - static const int NSYearCalendarUnit = 4; - static const int NSMonthCalendarUnit = 8; - static const int NSDayCalendarUnit = 16; - static const int NSHourCalendarUnit = 32; - static const int NSMinuteCalendarUnit = 64; - static const int NSSecondCalendarUnit = 128; - static const int NSWeekCalendarUnit = 256; - static const int NSWeekdayCalendarUnit = 512; - static const int NSWeekdayOrdinalCalendarUnit = 1024; - static const int NSQuarterCalendarUnit = 2048; - static const int NSWeekOfMonthCalendarUnit = 4096; - static const int NSWeekOfYearCalendarUnit = 8192; - static const int NSYearForWeekOfYearCalendarUnit = 16384; - static const int NSCalendarCalendarUnit = 1048576; - static const int NSTimeZoneCalendarUnit = 2097152; -} - -class NSDateComponents extends NSObject { - NSDateComponents._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSDateComponents] that points to the same underlying object as [other]. - static NSDateComponents castFrom(T other) { - return NSDateComponents._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSDateComponents] that wraps the given raw object pointer. - static NSDateComponents castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSDateComponents._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSDateComponents]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSDateComponents1); - } - - NSCalendar? get calendar { - final _ret = _lib._objc_msgSend_766(_id, _lib._sel_calendar1); - return _ret.address == 0 - ? null - : NSCalendar._(_ret, _lib, retain: true, release: true); - } - - set calendar(NSCalendar? value) { - return _lib._objc_msgSend_767( - _id, _lib._sel_setCalendar_1, value?._id ?? ffi.nullptr); - } - - NSTimeZone? get timeZone { - final _ret = _lib._objc_msgSend_768(_id, _lib._sel_timeZone1); - return _ret.address == 0 - ? null - : NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - set timeZone(NSTimeZone? value) { - return _lib._objc_msgSend_769( - _id, _lib._sel_setTimeZone_1, value?._id ?? ffi.nullptr); - } - - int get era { - return _lib._objc_msgSend_82(_id, _lib._sel_era1); - } - - set era(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setEra_1, value); - } - - int get year { - return _lib._objc_msgSend_82(_id, _lib._sel_year1); - } - - set year(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setYear_1, value); - } - - int get month { - return _lib._objc_msgSend_82(_id, _lib._sel_month1); - } - - set month(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setMonth_1, value); - } - - int get day { - return _lib._objc_msgSend_82(_id, _lib._sel_day1); - } - - set day(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setDay_1, value); - } - - int get hour { - return _lib._objc_msgSend_82(_id, _lib._sel_hour1); - } - - set hour(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setHour_1, value); - } - - int get minute { - return _lib._objc_msgSend_82(_id, _lib._sel_minute1); - } - - set minute(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setMinute_1, value); - } - - int get second { - return _lib._objc_msgSend_82(_id, _lib._sel_second1); - } - - set second(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setSecond_1, value); - } - - int get nanosecond { - return _lib._objc_msgSend_82(_id, _lib._sel_nanosecond1); - } - - set nanosecond(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setNanosecond_1, value); - } - - int get weekday { - return _lib._objc_msgSend_82(_id, _lib._sel_weekday1); - } - - set weekday(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setWeekday_1, value); - } - - int get weekdayOrdinal { - return _lib._objc_msgSend_82(_id, _lib._sel_weekdayOrdinal1); - } - - set weekdayOrdinal(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setWeekdayOrdinal_1, value); - } - - int get quarter { - return _lib._objc_msgSend_82(_id, _lib._sel_quarter1); - } - - set quarter(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setQuarter_1, value); - } - - int get weekOfMonth { - return _lib._objc_msgSend_82(_id, _lib._sel_weekOfMonth1); - } - - set weekOfMonth(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setWeekOfMonth_1, value); - } - - int get weekOfYear { - return _lib._objc_msgSend_82(_id, _lib._sel_weekOfYear1); - } - - set weekOfYear(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setWeekOfYear_1, value); - } - - int get yearForWeekOfYear { - return _lib._objc_msgSend_82(_id, _lib._sel_yearForWeekOfYear1); - } - - set yearForWeekOfYear(int value) { - return _lib._objc_msgSend_634(_id, _lib._sel_setYearForWeekOfYear_1, value); - } - - bool get leapMonth { - return _lib._objc_msgSend_12(_id, _lib._sel_isLeapMonth1); - } - - set leapMonth(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setLeapMonth_1, value); - } - - NSDate? get date { - final _ret = _lib._objc_msgSend_182(_id, _lib._sel_date1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - int week() { - return _lib._objc_msgSend_82(_id, _lib._sel_week1); - } - - void setWeek_(int v) { - _lib._objc_msgSend_422(_id, _lib._sel_setWeek_1, v); - } - - void setValue_forComponent_(int value, int unit) { - _lib._objc_msgSend_770(_id, _lib._sel_setValue_forComponent_1, value, unit); - } - - int valueForComponent_(int unit) { - return _lib._objc_msgSend_771(_id, _lib._sel_valueForComponent_1, unit); - } - - bool get validDate { - return _lib._objc_msgSend_12(_id, _lib._sel_isValidDate1); - } - - bool isValidDateInCalendar_(NSCalendar calendar) { - return _lib._objc_msgSend_772( - _id, _lib._sel_isValidDateInCalendar_1, calendar._id); - } - - @override - NSDateComponents init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSDateComponents._(_ret, _lib, retain: true, release: true); - } - - static NSDateComponents new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSDateComponents1, _lib._sel_new1); - return NSDateComponents._(_ret, _lib, retain: false, release: true); - } - - static NSDateComponents allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSDateComponents1, _lib._sel_allocWithZone_1, zone); - return NSDateComponents._(_ret, _lib, retain: false, release: true); - } - - static NSDateComponents alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSDateComponents1, _lib._sel_alloc1); - return NSDateComponents._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSDateComponents1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSDateComponents1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSDateComponents1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSDateComponents1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSDateComponents1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSDateComponents1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSDateComponents1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSDateComponents1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSDateComponents1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSCalendarOptions { - static const int NSCalendarWrapComponents = 1; - static const int NSCalendarMatchStrictly = 2; - static const int NSCalendarSearchBackwards = 4; - static const int NSCalendarMatchPreviousTimePreservingSmallerUnits = 256; - static const int NSCalendarMatchNextTimePreservingSmallerUnits = 512; - static const int NSCalendarMatchNextTime = 1024; - static const int NSCalendarMatchFirst = 4096; - static const int NSCalendarMatchLast = 8192; -} - -void _ObjCBlock_ffiVoid_NSDate_bool_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, bool, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSDate_bool_bool_closureRegistry = , bool, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSDate_bool_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSDate_bool_bool_registerClosure( - void Function(ffi.Pointer, bool, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSDate_bool_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSDate_bool_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSDate_bool_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSDate_bool_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSDate_bool_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSDate_bool_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSDate_bool_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDate_bool_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSDate_bool_bool.fromFunction(ThermionDartTexture1 lib, - void Function(NSDate?, bool, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDate_bool_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSDate_bool_bool_registerClosure( - (ffi.Pointer arg0, bool arg1, - ffi.Pointer arg2) => - fn(arg0.address == 0 ? null : NSDate._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSDate_bool_bool.listener(ThermionDartTexture1 lib, - void Function(NSDate?, bool, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSDate_bool_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSDate_bool_bool_registerClosure( - (ffi.Pointer arg0, bool arg1, - ffi.Pointer arg2) => - fn(arg0.address == 0 ? null : NSDate._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Bool, ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSDate? arg0, bool arg1, ffi.Pointer arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Bool arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, bool, ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1, arg2); -} - -class NSNumberFormatter extends NSFormatter { - NSNumberFormatter._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSNumberFormatter] that points to the same underlying object as [other]. - static NSNumberFormatter castFrom(T other) { - return NSNumberFormatter._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSNumberFormatter] that wraps the given raw object pointer. - static NSNumberFormatter castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSNumberFormatter._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSNumberFormatter]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSNumberFormatter1); - } - - int get formattingContext { - return _lib._objc_msgSend_747(_id, _lib._sel_formattingContext1); - } - - set formattingContext(int value) { - return _lib._objc_msgSend_748(_id, _lib._sel_setFormattingContext_1, value); - } - - bool getObjectValue_forString_range_error_( - ffi.Pointer> obj, - NSString string, - ffi.Pointer<_NSRange> rangep, - ffi.Pointer> error) { - return _lib._objc_msgSend_749( - _id, - _lib._sel_getObjectValue_forString_range_error_1, - obj, - string._id, - rangep, - error); - } - - NSString? stringFromNumber_(NSNumber number) { - final _ret = - _lib._objc_msgSend_797(_id, _lib._sel_stringFromNumber_1, number._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSNumber? numberFromString_(NSString string) { - final _ret = - _lib._objc_msgSend_798(_id, _lib._sel_numberFromString_1, string._id); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSString localizedStringFromNumber_numberStyle_( - ThermionDartTexture1 _lib, NSNumber num, int nstyle) { - final _ret = _lib._objc_msgSend_799(_lib._class_NSNumberFormatter1, - _lib._sel_localizedStringFromNumber_numberStyle_1, num._id, nstyle); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static int defaultFormatterBehavior(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_800( - _lib._class_NSNumberFormatter1, _lib._sel_defaultFormatterBehavior1); - } - - static void setDefaultFormatterBehavior_( - ThermionDartTexture1 _lib, int behavior) { - _lib._objc_msgSend_801(_lib._class_NSNumberFormatter1, - _lib._sel_setDefaultFormatterBehavior_1, behavior); - } - - int get numberStyle { - return _lib._objc_msgSend_802(_id, _lib._sel_numberStyle1); - } - - set numberStyle(int value) { - return _lib._objc_msgSend_803(_id, _lib._sel_setNumberStyle_1, value); - } - - NSLocale get locale { - final _ret = _lib._objc_msgSend_196(_id, _lib._sel_locale1); - return NSLocale._(_ret, _lib, retain: true, release: true); - } - - set locale(NSLocale value) { - return _lib._objc_msgSend_757(_id, _lib._sel_setLocale_1, value._id); - } - - bool get generatesDecimalNumbers { - return _lib._objc_msgSend_12(_id, _lib._sel_generatesDecimalNumbers1); - } - - set generatesDecimalNumbers(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setGeneratesDecimalNumbers_1, value); - } - - int get formatterBehavior { - return _lib._objc_msgSend_800(_id, _lib._sel_formatterBehavior1); - } - - set formatterBehavior(int value) { - return _lib._objc_msgSend_804(_id, _lib._sel_setFormatterBehavior_1, value); - } - - NSString get negativeFormat { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_negativeFormat1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set negativeFormat(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setNegativeFormat_1, value._id); - } - - NSDictionary? get textAttributesForNegativeValues { - final _ret = - _lib._objc_msgSend_389(_id, _lib._sel_textAttributesForNegativeValues1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set textAttributesForNegativeValues(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, - _lib._sel_setTextAttributesForNegativeValues_1, - value?._id ?? ffi.nullptr); - } - - NSString get positiveFormat { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_positiveFormat1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set positiveFormat(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setPositiveFormat_1, value._id); - } - - NSDictionary? get textAttributesForPositiveValues { - final _ret = - _lib._objc_msgSend_389(_id, _lib._sel_textAttributesForPositiveValues1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set textAttributesForPositiveValues(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, - _lib._sel_setTextAttributesForPositiveValues_1, - value?._id ?? ffi.nullptr); - } - - bool get allowsFloats { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsFloats1); - } - - set allowsFloats(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setAllowsFloats_1, value); - } - - NSString get decimalSeparator { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_decimalSeparator1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set decimalSeparator(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setDecimalSeparator_1, value._id); - } - - bool get alwaysShowsDecimalSeparator { - return _lib._objc_msgSend_12(_id, _lib._sel_alwaysShowsDecimalSeparator1); - } - - set alwaysShowsDecimalSeparator(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAlwaysShowsDecimalSeparator_1, value); - } - - NSString get currencyDecimalSeparator { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_currencyDecimalSeparator1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set currencyDecimalSeparator(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setCurrencyDecimalSeparator_1, value._id); - } - - bool get usesGroupingSeparator { - return _lib._objc_msgSend_12(_id, _lib._sel_usesGroupingSeparator1); - } - - set usesGroupingSeparator(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setUsesGroupingSeparator_1, value); - } - - NSString get groupingSeparator { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_groupingSeparator1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set groupingSeparator(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setGroupingSeparator_1, value._id); - } - - NSString? get zeroSymbol { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_zeroSymbol1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set zeroSymbol(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setZeroSymbol_1, value?._id ?? ffi.nullptr); - } - - NSDictionary? get textAttributesForZero { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_textAttributesForZero1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set textAttributesForZero(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, _lib._sel_setTextAttributesForZero_1, value?._id ?? ffi.nullptr); - } - - NSString get nilSymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_nilSymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set nilSymbol(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setNilSymbol_1, value._id); - } - - NSDictionary? get textAttributesForNil { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_textAttributesForNil1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set textAttributesForNil(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, _lib._sel_setTextAttributesForNil_1, value?._id ?? ffi.nullptr); - } - - NSString get notANumberSymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_notANumberSymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set notANumberSymbol(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setNotANumberSymbol_1, value._id); - } - - NSDictionary? get textAttributesForNotANumber { - final _ret = - _lib._objc_msgSend_389(_id, _lib._sel_textAttributesForNotANumber1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set textAttributesForNotANumber(NSDictionary? value) { - return _lib._objc_msgSend_633(_id, - _lib._sel_setTextAttributesForNotANumber_1, value?._id ?? ffi.nullptr); - } - - NSString get positiveInfinitySymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_positiveInfinitySymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set positiveInfinitySymbol(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setPositiveInfinitySymbol_1, value._id); - } - - NSDictionary? get textAttributesForPositiveInfinity { - final _ret = _lib._objc_msgSend_389( - _id, _lib._sel_textAttributesForPositiveInfinity1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set textAttributesForPositiveInfinity(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, - _lib._sel_setTextAttributesForPositiveInfinity_1, - value?._id ?? ffi.nullptr); - } - - NSString get negativeInfinitySymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_negativeInfinitySymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set negativeInfinitySymbol(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setNegativeInfinitySymbol_1, value._id); - } - - NSDictionary? get textAttributesForNegativeInfinity { - final _ret = _lib._objc_msgSend_389( - _id, _lib._sel_textAttributesForNegativeInfinity1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set textAttributesForNegativeInfinity(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, - _lib._sel_setTextAttributesForNegativeInfinity_1, - value?._id ?? ffi.nullptr); - } - - NSString get positivePrefix { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_positivePrefix1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set positivePrefix(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setPositivePrefix_1, value._id); - } - - NSString get positiveSuffix { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_positiveSuffix1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set positiveSuffix(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setPositiveSuffix_1, value._id); - } - - NSString get negativePrefix { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_negativePrefix1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set negativePrefix(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setNegativePrefix_1, value._id); - } - - NSString get negativeSuffix { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_negativeSuffix1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set negativeSuffix(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setNegativeSuffix_1, value._id); - } - - NSString get currencyCode { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_currencyCode1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set currencyCode(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setCurrencyCode_1, value._id); - } - - NSString get currencySymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_currencySymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set currencySymbol(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setCurrencySymbol_1, value._id); - } - - NSString get internationalCurrencySymbol { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_internationalCurrencySymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set internationalCurrencySymbol(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setInternationalCurrencySymbol_1, value._id); - } - - NSString get percentSymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_percentSymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set percentSymbol(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setPercentSymbol_1, value._id); - } - - NSString get perMillSymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_perMillSymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set perMillSymbol(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setPerMillSymbol_1, value._id); - } - - NSString get minusSign { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_minusSign1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set minusSign(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setMinusSign_1, value._id); - } - - NSString get plusSign { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_plusSign1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set plusSign(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setPlusSign_1, value._id); - } - - NSString get exponentSymbol { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_exponentSymbol1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set exponentSymbol(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setExponentSymbol_1, value._id); - } - - int get groupingSize { - return _lib._objc_msgSend_10(_id, _lib._sel_groupingSize1); - } - - set groupingSize(int value) { - return _lib._objc_msgSend_515(_id, _lib._sel_setGroupingSize_1, value); - } - - int get secondaryGroupingSize { - return _lib._objc_msgSend_10(_id, _lib._sel_secondaryGroupingSize1); - } - - set secondaryGroupingSize(int value) { - return _lib._objc_msgSend_515( - _id, _lib._sel_setSecondaryGroupingSize_1, value); - } - - NSNumber? get multiplier { - final _ret = _lib._objc_msgSend_214(_id, _lib._sel_multiplier1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - set multiplier(NSNumber? value) { - return _lib._objc_msgSend_669( - _id, _lib._sel_setMultiplier_1, value?._id ?? ffi.nullptr); - } - - int get formatWidth { - return _lib._objc_msgSend_10(_id, _lib._sel_formatWidth1); - } - - set formatWidth(int value) { - return _lib._objc_msgSend_515(_id, _lib._sel_setFormatWidth_1, value); - } - - NSString get paddingCharacter { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_paddingCharacter1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set paddingCharacter(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setPaddingCharacter_1, value._id); - } - - int get paddingPosition { - return _lib._objc_msgSend_805(_id, _lib._sel_paddingPosition1); - } - - set paddingPosition(int value) { - return _lib._objc_msgSend_806(_id, _lib._sel_setPaddingPosition_1, value); - } - - int get roundingMode { - return _lib._objc_msgSend_807(_id, _lib._sel_roundingMode1); - } - - set roundingMode(int value) { - return _lib._objc_msgSend_808(_id, _lib._sel_setRoundingMode_1, value); - } - - NSNumber get roundingIncrement { - final _ret = _lib._objc_msgSend_809(_id, _lib._sel_roundingIncrement1); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - set roundingIncrement(NSNumber value) { - return _lib._objc_msgSend_810( - _id, _lib._sel_setRoundingIncrement_1, value._id); - } - - int get minimumIntegerDigits { - return _lib._objc_msgSend_10(_id, _lib._sel_minimumIntegerDigits1); - } - - set minimumIntegerDigits(int value) { - return _lib._objc_msgSend_515( - _id, _lib._sel_setMinimumIntegerDigits_1, value); - } - - int get maximumIntegerDigits { - return _lib._objc_msgSend_10(_id, _lib._sel_maximumIntegerDigits1); - } - - set maximumIntegerDigits(int value) { - return _lib._objc_msgSend_515( - _id, _lib._sel_setMaximumIntegerDigits_1, value); - } - - int get minimumFractionDigits { - return _lib._objc_msgSend_10(_id, _lib._sel_minimumFractionDigits1); - } - - set minimumFractionDigits(int value) { - return _lib._objc_msgSend_515( - _id, _lib._sel_setMinimumFractionDigits_1, value); - } - - int get maximumFractionDigits { - return _lib._objc_msgSend_10(_id, _lib._sel_maximumFractionDigits1); - } - - set maximumFractionDigits(int value) { - return _lib._objc_msgSend_515( - _id, _lib._sel_setMaximumFractionDigits_1, value); - } - - NSNumber? get minimum { - final _ret = _lib._objc_msgSend_214(_id, _lib._sel_minimum1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - set minimum(NSNumber? value) { - return _lib._objc_msgSend_669( - _id, _lib._sel_setMinimum_1, value?._id ?? ffi.nullptr); - } - - NSNumber? get maximum { - final _ret = _lib._objc_msgSend_214(_id, _lib._sel_maximum1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - set maximum(NSNumber? value) { - return _lib._objc_msgSend_669( - _id, _lib._sel_setMaximum_1, value?._id ?? ffi.nullptr); - } - - NSString get currencyGroupingSeparator { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_currencyGroupingSeparator1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set currencyGroupingSeparator(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setCurrencyGroupingSeparator_1, value._id); - } - - bool get lenient { - return _lib._objc_msgSend_12(_id, _lib._sel_isLenient1); - } - - set lenient(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setLenient_1, value); - } - - bool get usesSignificantDigits { - return _lib._objc_msgSend_12(_id, _lib._sel_usesSignificantDigits1); - } - - set usesSignificantDigits(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setUsesSignificantDigits_1, value); - } - - int get minimumSignificantDigits { - return _lib._objc_msgSend_10(_id, _lib._sel_minimumSignificantDigits1); - } - - set minimumSignificantDigits(int value) { - return _lib._objc_msgSend_515( - _id, _lib._sel_setMinimumSignificantDigits_1, value); - } - - int get maximumSignificantDigits { - return _lib._objc_msgSend_10(_id, _lib._sel_maximumSignificantDigits1); - } - - set maximumSignificantDigits(int value) { - return _lib._objc_msgSend_515( - _id, _lib._sel_setMaximumSignificantDigits_1, value); - } - - bool get partialStringValidationEnabled { - return _lib._objc_msgSend_12( - _id, _lib._sel_isPartialStringValidationEnabled1); - } - - set partialStringValidationEnabled(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setPartialStringValidationEnabled_1, value); - } - - bool get hasThousandSeparators { - return _lib._objc_msgSend_12(_id, _lib._sel_hasThousandSeparators1); - } - - set hasThousandSeparators(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setHasThousandSeparators_1, value); - } - - NSString get thousandSeparator { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_thousandSeparator1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set thousandSeparator(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setThousandSeparator_1, value._id); - } - - bool get localizesFormat { - return _lib._objc_msgSend_12(_id, _lib._sel_localizesFormat1); - } - - set localizesFormat(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setLocalizesFormat_1, value); - } - - NSString get format { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_format1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set format(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setFormat_1, value._id); - } - - NSAttributedString get attributedStringForZero { - final _ret = - _lib._objc_msgSend_730(_id, _lib._sel_attributedStringForZero1); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - set attributedStringForZero(NSAttributedString value) { - return _lib._objc_msgSend_811( - _id, _lib._sel_setAttributedStringForZero_1, value._id); - } - - NSAttributedString get attributedStringForNil { - final _ret = _lib._objc_msgSend_730(_id, _lib._sel_attributedStringForNil1); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - set attributedStringForNil(NSAttributedString value) { - return _lib._objc_msgSend_811( - _id, _lib._sel_setAttributedStringForNil_1, value._id); - } - - NSAttributedString get attributedStringForNotANumber { - final _ret = - _lib._objc_msgSend_730(_id, _lib._sel_attributedStringForNotANumber1); - return NSAttributedString._(_ret, _lib, retain: true, release: true); - } - - set attributedStringForNotANumber(NSAttributedString value) { - return _lib._objc_msgSend_811( - _id, _lib._sel_setAttributedStringForNotANumber_1, value._id); - } - - NSDecimalNumberHandler get roundingBehavior { - final _ret = _lib._objc_msgSend_812(_id, _lib._sel_roundingBehavior1); - return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); - } - - set roundingBehavior(NSDecimalNumberHandler value) { - return _lib._objc_msgSend_814( - _id, _lib._sel_setRoundingBehavior_1, value._id); - } - - @override - NSNumberFormatter init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSNumberFormatter._(_ret, _lib, retain: true, release: true); - } - - static NSNumberFormatter new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSNumberFormatter1, _lib._sel_new1); - return NSNumberFormatter._(_ret, _lib, retain: false, release: true); - } - - static NSNumberFormatter allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSNumberFormatter1, _lib._sel_allocWithZone_1, zone); - return NSNumberFormatter._(_ret, _lib, retain: false, release: true); - } - - static NSNumberFormatter alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSNumberFormatter1, _lib._sel_alloc1); - return NSNumberFormatter._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSNumberFormatter1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSNumberFormatter1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSNumberFormatter1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSNumberFormatter1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSNumberFormatter1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSNumberFormatter1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSNumberFormatter1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSNumberFormatter1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSNumberFormatter1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSNumberFormatterStyle { - static const int NSNumberFormatterNoStyle = 0; - static const int NSNumberFormatterDecimalStyle = 1; - static const int NSNumberFormatterCurrencyStyle = 2; - static const int NSNumberFormatterPercentStyle = 3; - static const int NSNumberFormatterScientificStyle = 4; - static const int NSNumberFormatterSpellOutStyle = 5; - static const int NSNumberFormatterOrdinalStyle = 6; - static const int NSNumberFormatterCurrencyISOCodeStyle = 8; - static const int NSNumberFormatterCurrencyPluralStyle = 9; - static const int NSNumberFormatterCurrencyAccountingStyle = 10; -} - -abstract class NSNumberFormatterBehavior { - static const int NSNumberFormatterBehaviorDefault = 0; - static const int NSNumberFormatterBehavior10_0 = 1000; - static const int NSNumberFormatterBehavior10_4 = 1040; -} - -abstract class NSNumberFormatterPadPosition { - static const int NSNumberFormatterPadBeforePrefix = 0; - static const int NSNumberFormatterPadAfterPrefix = 1; - static const int NSNumberFormatterPadBeforeSuffix = 2; - static const int NSNumberFormatterPadAfterSuffix = 3; -} - -abstract class NSNumberFormatterRoundingMode { - static const int NSNumberFormatterRoundCeiling = 0; - static const int NSNumberFormatterRoundFloor = 1; - static const int NSNumberFormatterRoundDown = 2; - static const int NSNumberFormatterRoundUp = 3; - static const int NSNumberFormatterRoundHalfEven = 4; - static const int NSNumberFormatterRoundHalfDown = 5; - static const int NSNumberFormatterRoundHalfUp = 6; -} - -class NSDecimalNumberHandler extends NSObject { - NSDecimalNumberHandler._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSDecimalNumberHandler] that points to the same underlying object as [other]. - static NSDecimalNumberHandler castFrom(T other) { - return NSDecimalNumberHandler._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSDecimalNumberHandler] that wraps the given raw object pointer. - static NSDecimalNumberHandler castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSDecimalNumberHandler._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSDecimalNumberHandler]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSDecimalNumberHandler1); - } - - static NSDecimalNumberHandler getDefaultDecimalNumberHandler( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_812(_lib._class_NSDecimalNumberHandler1, - _lib._sel_defaultDecimalNumberHandler1); - return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); - } - - NSDecimalNumberHandler - initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_( - int roundingMode, - int scale, - bool exact, - bool overflow, - bool underflow, - bool divideByZero) { - final _ret = _lib._objc_msgSend_813( - _id, - _lib._sel_initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1, - roundingMode, - scale, - exact, - overflow, - underflow, - divideByZero); - return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); - } - - static NSDecimalNumberHandler - decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_( - ThermionDartTexture1 _lib, - int roundingMode, - int scale, - bool exact, - bool overflow, - bool underflow, - bool divideByZero) { - final _ret = _lib._objc_msgSend_813( - _lib._class_NSDecimalNumberHandler1, - _lib._sel_decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1, - roundingMode, - scale, - exact, - overflow, - underflow, - divideByZero); - return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); - } - - @override - NSDecimalNumberHandler init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); - } - - static NSDecimalNumberHandler new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSDecimalNumberHandler1, _lib._sel_new1); - return NSDecimalNumberHandler._(_ret, _lib, retain: false, release: true); - } - - static NSDecimalNumberHandler allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSDecimalNumberHandler1, _lib._sel_allocWithZone_1, zone); - return NSDecimalNumberHandler._(_ret, _lib, retain: false, release: true); - } - - static NSDecimalNumberHandler alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSDecimalNumberHandler1, _lib._sel_alloc1); - return NSDecimalNumberHandler._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSDecimalNumberHandler1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSDecimalNumberHandler1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSDecimalNumberHandler1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSDecimalNumberHandler1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSDecimalNumberHandler1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSDecimalNumberHandler1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSDecimalNumberHandler1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSDecimalNumberHandler1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSDecimalNumberHandler1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSRoundingMode { - static const int NSRoundPlain = 0; - static const int NSRoundDown = 1; - static const int NSRoundUp = 2; - static const int NSRoundBankers = 3; -} - -class NSScanner extends NSObject { - NSScanner._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSScanner] that points to the same underlying object as [other]. - static NSScanner castFrom(T other) { - return NSScanner._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSScanner] that wraps the given raw object pointer. - static NSScanner castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSScanner._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSScanner]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSScanner1); - } - - NSString get string { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_string1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int get scanLocation { - return _lib._objc_msgSend_10(_id, _lib._sel_scanLocation1); - } - - set scanLocation(int value) { - return _lib._objc_msgSend_515(_id, _lib._sel_setScanLocation_1, value); - } - - NSCharacterSet? get charactersToBeSkipped { - final _ret = _lib._objc_msgSend_815(_id, _lib._sel_charactersToBeSkipped1); - return _ret.address == 0 - ? null - : NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - set charactersToBeSkipped(NSCharacterSet? value) { - return _lib._objc_msgSend_816( - _id, _lib._sel_setCharactersToBeSkipped_1, value?._id ?? ffi.nullptr); - } - - bool get caseSensitive { - return _lib._objc_msgSend_12(_id, _lib._sel_caseSensitive1); - } - - set caseSensitive(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setCaseSensitive_1, value); - } - - NSObject? get locale { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_locale1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set locale(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); - } - - NSScanner initWithString_(NSString string) { - final _ret = - _lib._objc_msgSend_31(_id, _lib._sel_initWithString_1, string._id); - return NSScanner._(_ret, _lib, retain: true, release: true); - } - - bool scanInt_(ffi.Pointer result) { - return _lib._objc_msgSend_817(_id, _lib._sel_scanInt_1, result); - } - - bool scanInteger_(ffi.Pointer result) { - return _lib._objc_msgSend_818(_id, _lib._sel_scanInteger_1, result); - } - - bool scanLongLong_(ffi.Pointer result) { - return _lib._objc_msgSend_819(_id, _lib._sel_scanLongLong_1, result); - } - - bool scanUnsignedLongLong_(ffi.Pointer result) { - return _lib._objc_msgSend_820( - _id, _lib._sel_scanUnsignedLongLong_1, result); - } - - bool scanFloat_(ffi.Pointer result) { - return _lib._objc_msgSend_821(_id, _lib._sel_scanFloat_1, result); - } - - bool scanDouble_(ffi.Pointer result) { - return _lib._objc_msgSend_822(_id, _lib._sel_scanDouble_1, result); - } - - bool scanHexInt_(ffi.Pointer result) { - return _lib._objc_msgSend_823(_id, _lib._sel_scanHexInt_1, result); - } - - bool scanHexLongLong_(ffi.Pointer result) { - return _lib._objc_msgSend_820(_id, _lib._sel_scanHexLongLong_1, result); - } - - bool scanHexFloat_(ffi.Pointer result) { - return _lib._objc_msgSend_821(_id, _lib._sel_scanHexFloat_1, result); - } - - bool scanHexDouble_(ffi.Pointer result) { - return _lib._objc_msgSend_822(_id, _lib._sel_scanHexDouble_1, result); - } - - bool scanString_intoString_( - NSString string, ffi.Pointer> result) { - return _lib._objc_msgSend_824( - _id, _lib._sel_scanString_intoString_1, string._id, result); - } - - bool scanCharactersFromSet_intoString_( - NSCharacterSet set, ffi.Pointer> result) { - return _lib._objc_msgSend_825( - _id, _lib._sel_scanCharactersFromSet_intoString_1, set._id, result); - } - - bool scanUpToString_intoString_( - NSString string, ffi.Pointer> result) { - return _lib._objc_msgSend_824( - _id, _lib._sel_scanUpToString_intoString_1, string._id, result); - } - - bool scanUpToCharactersFromSet_intoString_( - NSCharacterSet set, ffi.Pointer> result) { - return _lib._objc_msgSend_825( - _id, _lib._sel_scanUpToCharactersFromSet_intoString_1, set._id, result); - } - - bool get atEnd { - return _lib._objc_msgSend_12(_id, _lib._sel_isAtEnd1); - } - - static NSScanner scannerWithString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSScanner1, _lib._sel_scannerWithString_1, string._id); - return NSScanner._(_ret, _lib, retain: true, release: true); - } - - static NSObject localizedScannerWithString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSScanner1, - _lib._sel_localizedScannerWithString_1, string._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - bool scanDecimal_(ffi.Pointer dcm) { - return _lib._objc_msgSend_826(_id, _lib._sel_scanDecimal_1, dcm); - } - - @override - NSScanner init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSScanner._(_ret, _lib, retain: true, release: true); - } - - static NSScanner new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSScanner1, _lib._sel_new1); - return NSScanner._(_ret, _lib, retain: false, release: true); - } - - static NSScanner allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSScanner1, _lib._sel_allocWithZone_1, zone); - return NSScanner._(_ret, _lib, retain: false, release: true); - } - - static NSScanner alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSScanner1, _lib._sel_alloc1); - return NSScanner._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSScanner1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSScanner1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSScanner1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSScanner1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSScanner1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSScanner1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSScanner1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSScanner1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSScanner1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -final class NSDecimal extends ffi.Opaque {} - -class NSException extends NSObject { - NSException._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSException] that points to the same underlying object as [other]. - static NSException castFrom(T other) { - return NSException._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSException] that wraps the given raw object pointer. - static NSException castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSException._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSException]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSException1); - } - - static NSException exceptionWithName_reason_userInfo_( - ThermionDartTexture1 _lib, - NSString name, - NSString? reason, - NSDictionary? userInfo) { - final _ret = _lib._objc_msgSend_827( - _lib._class_NSException1, - _lib._sel_exceptionWithName_reason_userInfo_1, - name._id, - reason?._id ?? ffi.nullptr, - userInfo?._id ?? ffi.nullptr); - return NSException._(_ret, _lib, retain: true, release: true); - } - - NSException initWithName_reason_userInfo_( - NSString aName, NSString? aReason, NSDictionary? aUserInfo) { - final _ret = _lib._objc_msgSend_828( - _id, - _lib._sel_initWithName_reason_userInfo_1, - aName._id, - aReason?._id ?? ffi.nullptr, - aUserInfo?._id ?? ffi.nullptr); - return NSException._(_ret, _lib, retain: true, release: true); - } - - NSString get name { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_name1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get reason { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_reason1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? get userInfo { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_userInfo1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSArray get callStackReturnAddresses { - final _ret = - _lib._objc_msgSend_84(_id, _lib._sel_callStackReturnAddresses1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get callStackSymbols { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_callStackSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - void raise() { - _lib._objc_msgSend_1(_id, _lib._sel_raise1); - } - - static void raise_format_( - ThermionDartTexture1 _lib, NSString name, NSString format) { - _lib._objc_msgSend_550(_lib._class_NSException1, _lib._sel_raise_format_1, - name._id, format._id); - } - - static void raise_format_arguments_(ThermionDartTexture1 _lib, NSString name, - NSString format, ffi.Pointer argList) { - _lib._objc_msgSend_829(_lib._class_NSException1, - _lib._sel_raise_format_arguments_1, name._id, format._id, argList); - } - - @override - NSException init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSException._(_ret, _lib, retain: true, release: true); - } - - static NSException new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSException1, _lib._sel_new1); - return NSException._(_ret, _lib, retain: false, release: true); - } - - static NSException allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSException1, _lib._sel_allocWithZone_1, zone); - return NSException._(_ret, _lib, retain: false, release: true); - } - - static NSException alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSException1, _lib._sel_alloc1); - return NSException._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSException1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSException1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSException1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSException1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSException1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSException1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSException1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSException1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSException1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSFileHandle extends NSObject { - NSFileHandle._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSFileHandle] that points to the same underlying object as [other]. - static NSFileHandle castFrom(T other) { - return NSFileHandle._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSFileHandle] that wraps the given raw object pointer. - static NSFileHandle castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSFileHandle._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSFileHandle]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileHandle1); - } - - NSData get availableData { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_availableData1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSFileHandle initWithFileDescriptor_closeOnDealloc_(int fd, bool closeopt) { - final _ret = _lib._objc_msgSend_830( - _id, _lib._sel_initWithFileDescriptor_closeOnDealloc_1, fd, closeopt); - return NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - NSFileHandle? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - NSData? readDataToEndOfFileAndReturnError_( - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_831( - _id, _lib._sel_readDataToEndOfFileAndReturnError_1, error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? readDataUpToLength_error_( - int length, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_832( - _id, _lib._sel_readDataUpToLength_error_1, length, error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - bool writeData_error_( - NSData data, ffi.Pointer> error) { - return _lib._objc_msgSend_833( - _id, _lib._sel_writeData_error_1, data._id, error); - } - - bool getOffset_error_(ffi.Pointer offsetInFile, - ffi.Pointer> error) { - return _lib._objc_msgSend_834( - _id, _lib._sel_getOffset_error_1, offsetInFile, error); - } - - bool seekToEndReturningOffset_error_( - ffi.Pointer offsetInFile, - ffi.Pointer> error) { - return _lib._objc_msgSend_834( - _id, _lib._sel_seekToEndReturningOffset_error_1, offsetInFile, error); - } - - bool seekToOffset_error_( - int offset, ffi.Pointer> error) { - return _lib._objc_msgSend_835( - _id, _lib._sel_seekToOffset_error_1, offset, error); - } - - bool truncateAtOffset_error_( - int offset, ffi.Pointer> error) { - return _lib._objc_msgSend_835( - _id, _lib._sel_truncateAtOffset_error_1, offset, error); - } - - bool synchronizeAndReturnError_(ffi.Pointer> error) { - return _lib._objc_msgSend_242( - _id, _lib._sel_synchronizeAndReturnError_1, error); - } - - bool closeAndReturnError_(ffi.Pointer> error) { - return _lib._objc_msgSend_242(_id, _lib._sel_closeAndReturnError_1, error); - } - - static NSFileHandle getFileHandleWithStandardInput( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_836( - _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardInput1); - return NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - static NSFileHandle getFileHandleWithStandardOutput( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_836( - _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardOutput1); - return NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - static NSFileHandle getFileHandleWithStandardError( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_836( - _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardError1); - return NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - static NSFileHandle getFileHandleWithNullDevice(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_836( - _lib._class_NSFileHandle1, _lib._sel_fileHandleWithNullDevice1); - return NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - static NSFileHandle? fileHandleForReadingAtPath_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSFileHandle1, - _lib._sel_fileHandleForReadingAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - static NSFileHandle? fileHandleForWritingAtPath_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSFileHandle1, - _lib._sel_fileHandleForWritingAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - static NSFileHandle? fileHandleForUpdatingAtPath_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSFileHandle1, - _lib._sel_fileHandleForUpdatingAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - static NSFileHandle? fileHandleForReadingFromURL_error_( - ThermionDartTexture1 _lib, - NSURL url, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_837(_lib._class_NSFileHandle1, - _lib._sel_fileHandleForReadingFromURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - static NSFileHandle? fileHandleForWritingToURL_error_( - ThermionDartTexture1 _lib, - NSURL url, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_837(_lib._class_NSFileHandle1, - _lib._sel_fileHandleForWritingToURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - static NSFileHandle? fileHandleForUpdatingURL_error_( - ThermionDartTexture1 _lib, - NSURL url, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_837(_lib._class_NSFileHandle1, - _lib._sel_fileHandleForUpdatingURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - void readInBackgroundAndNotifyForModes_(NSArray? modes) { - _lib._objc_msgSend_838(_id, _lib._sel_readInBackgroundAndNotifyForModes_1, - modes?._id ?? ffi.nullptr); - } - - void readInBackgroundAndNotify() { - _lib._objc_msgSend_1(_id, _lib._sel_readInBackgroundAndNotify1); - } - - void readToEndOfFileInBackgroundAndNotifyForModes_(NSArray? modes) { - _lib._objc_msgSend_838( - _id, - _lib._sel_readToEndOfFileInBackgroundAndNotifyForModes_1, - modes?._id ?? ffi.nullptr); - } - - void readToEndOfFileInBackgroundAndNotify() { - _lib._objc_msgSend_1(_id, _lib._sel_readToEndOfFileInBackgroundAndNotify1); - } - - void acceptConnectionInBackgroundAndNotifyForModes_(NSArray? modes) { - _lib._objc_msgSend_838( - _id, - _lib._sel_acceptConnectionInBackgroundAndNotifyForModes_1, - modes?._id ?? ffi.nullptr); - } - - void acceptConnectionInBackgroundAndNotify() { - _lib._objc_msgSend_1(_id, _lib._sel_acceptConnectionInBackgroundAndNotify1); - } - - void waitForDataInBackgroundAndNotifyForModes_(NSArray? modes) { - _lib._objc_msgSend_838( - _id, - _lib._sel_waitForDataInBackgroundAndNotifyForModes_1, - modes?._id ?? ffi.nullptr); - } - - void waitForDataInBackgroundAndNotify() { - _lib._objc_msgSend_1(_id, _lib._sel_waitForDataInBackgroundAndNotify1); - } - - ObjCBlock_ffiVoid_NSFileHandle? get readabilityHandler { - final _ret = _lib._objc_msgSend_839(_id, _lib._sel_readabilityHandler1); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid_NSFileHandle._(_ret, _lib, - retain: true, release: true); - } - - set readabilityHandler(ObjCBlock_ffiVoid_NSFileHandle? value) { - return _lib._objc_msgSend_840( - _id, _lib._sel_setReadabilityHandler_1, value?._id ?? ffi.nullptr); - } - - ObjCBlock_ffiVoid_NSFileHandle? get writeabilityHandler { - final _ret = _lib._objc_msgSend_839(_id, _lib._sel_writeabilityHandler1); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid_NSFileHandle._(_ret, _lib, - retain: true, release: true); - } - - set writeabilityHandler(ObjCBlock_ffiVoid_NSFileHandle? value) { - return _lib._objc_msgSend_840( - _id, _lib._sel_setWriteabilityHandler_1, value?._id ?? ffi.nullptr); - } - - NSFileHandle initWithFileDescriptor_(int fd) { - final _ret = - _lib._objc_msgSend_841(_id, _lib._sel_initWithFileDescriptor_1, fd); - return NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - int get fileDescriptor { - return _lib._objc_msgSend_236(_id, _lib._sel_fileDescriptor1); - } - - NSData readDataToEndOfFile() { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_readDataToEndOfFile1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSData readDataOfLength_(int length) { - final _ret = - _lib._objc_msgSend_842(_id, _lib._sel_readDataOfLength_1, length); - return NSData._(_ret, _lib, retain: true, release: true); - } - - void writeData_(NSData data) { - _lib._objc_msgSend_284(_id, _lib._sel_writeData_1, data._id); - } - - int get offsetInFile { - return _lib._objc_msgSend_163(_id, _lib._sel_offsetInFile1); - } - - int seekToEndOfFile() { - return _lib._objc_msgSend_163(_id, _lib._sel_seekToEndOfFile1); - } - - void seekToFileOffset_(int offset) { - _lib._objc_msgSend_843(_id, _lib._sel_seekToFileOffset_1, offset); - } - - void truncateFileAtOffset_(int offset) { - _lib._objc_msgSend_843(_id, _lib._sel_truncateFileAtOffset_1, offset); - } - - void synchronizeFile() { - _lib._objc_msgSend_1(_id, _lib._sel_synchronizeFile1); - } - - void closeFile() { - _lib._objc_msgSend_1(_id, _lib._sel_closeFile1); - } - - @override - NSFileHandle init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSFileHandle._(_ret, _lib, retain: true, release: true); - } - - static NSFileHandle new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSFileHandle1, _lib._sel_new1); - return NSFileHandle._(_ret, _lib, retain: false, release: true); - } - - static NSFileHandle allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSFileHandle1, _lib._sel_allocWithZone_1, zone); - return NSFileHandle._(_ret, _lib, retain: false, release: true); - } - - static NSFileHandle alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSFileHandle1, _lib._sel_alloc1); - return NSFileHandle._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSFileHandle1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSFileHandle1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSFileHandle1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSFileHandle1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSFileHandle1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSFileHandle1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSFileHandle1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSFileHandle1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSFileHandle1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_NSFileHandle_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSFileHandle_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSFileHandle_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSFileHandle_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSFileHandle_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSFileHandle_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSFileHandle_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSFileHandle_closureRegistry[block.ref.target.address]!( - arg0); - -class ObjCBlock_ffiVoid_NSFileHandle extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSFileHandle._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSFileHandle.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSFileHandle_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSFileHandle.fromFunction( - ThermionDartTexture1 lib, void Function(NSFileHandle) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSFileHandle_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSFileHandle_registerClosure((ffi - .Pointer - arg0) => - fn(NSFileHandle._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSFileHandle.listener( - ThermionDartTexture1 lib, void Function(NSFileHandle) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSFileHandle_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSFileHandle_registerClosure( - (ffi.Pointer arg0) => fn(NSFileHandle._( - arg0, lib, - retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSFileHandle arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0._id); -} - -class NSHTTPCookieStorage extends NSObject { - NSHTTPCookieStorage._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSHTTPCookieStorage] that points to the same underlying object as [other]. - static NSHTTPCookieStorage castFrom(T other) { - return NSHTTPCookieStorage._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSHTTPCookieStorage] that wraps the given raw object pointer. - static NSHTTPCookieStorage castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSHTTPCookieStorage._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSHTTPCookieStorage]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSHTTPCookieStorage1); - } - - static NSHTTPCookieStorage getSharedHTTPCookieStorage( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_844( - _lib._class_NSHTTPCookieStorage1, _lib._sel_sharedHTTPCookieStorage1); - return NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); - } - - static NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier_( - ThermionDartTexture1 _lib, NSString identifier) { - final _ret = _lib._objc_msgSend_845( - _lib._class_NSHTTPCookieStorage1, - _lib._sel_sharedCookieStorageForGroupContainerIdentifier_1, - identifier._id); - return NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); - } - - NSArray? get cookies { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_cookies1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - void setCookie_(NSHTTPCookie cookie) { - _lib._objc_msgSend_849(_id, _lib._sel_setCookie_1, cookie._id); - } - - void deleteCookie_(NSHTTPCookie cookie) { - _lib._objc_msgSend_849(_id, _lib._sel_deleteCookie_1, cookie._id); - } - - void removeCookiesSinceDate_(NSDate date) { - _lib._objc_msgSend_539(_id, _lib._sel_removeCookiesSinceDate_1, date._id); - } - - NSArray? cookiesForURL_(NSURL URL) { - final _ret = - _lib._objc_msgSend_132(_id, _lib._sel_cookiesForURL_1, URL._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - void setCookies_forURL_mainDocumentURL_( - NSArray cookies, NSURL? URL, NSURL? mainDocumentURL) { - _lib._objc_msgSend_850( - _id, - _lib._sel_setCookies_forURL_mainDocumentURL_1, - cookies._id, - URL?._id ?? ffi.nullptr, - mainDocumentURL?._id ?? ffi.nullptr); - } - - int get cookieAcceptPolicy { - return _lib._objc_msgSend_851(_id, _lib._sel_cookieAcceptPolicy1); - } - - set cookieAcceptPolicy(int value) { - return _lib._objc_msgSend_852( - _id, _lib._sel_setCookieAcceptPolicy_1, value); - } - - NSArray sortedCookiesUsingDescriptors_(NSArray sortOrder) { - final _ret = _lib._objc_msgSend_67( - _id, _lib._sel_sortedCookiesUsingDescriptors_1, sortOrder._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - void storeCookies_forTask_(NSArray cookies, NSURLSessionTask task) { - _lib._objc_msgSend_878( - _id, _lib._sel_storeCookies_forTask_1, cookies._id, task._id); - } - - void getCookiesForTask_completionHandler_( - NSURLSessionTask task, ObjCBlock_ffiVoid_NSArray completionHandler) { - _lib._objc_msgSend_879(_id, _lib._sel_getCookiesForTask_completionHandler_1, - task._id, completionHandler._id); - } - - @override - NSHTTPCookieStorage init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); - } - - static NSHTTPCookieStorage new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSHTTPCookieStorage1, _lib._sel_new1); - return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); - } - - static NSHTTPCookieStorage allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSHTTPCookieStorage1, _lib._sel_allocWithZone_1, zone); - return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); - } - - static NSHTTPCookieStorage alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSHTTPCookieStorage1, _lib._sel_alloc1); - return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSHTTPCookieStorage1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSHTTPCookieStorage1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSHTTPCookieStorage1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSHTTPCookieStorage1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSHTTPCookieStorage1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSHTTPCookieStorage1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSHTTPCookieStorage1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSHTTPCookieStorage1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSHTTPCookieStorage1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSHTTPCookie extends NSObject { - NSHTTPCookie._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSHTTPCookie] that points to the same underlying object as [other]. - static NSHTTPCookie castFrom(T other) { - return NSHTTPCookie._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSHTTPCookie] that wraps the given raw object pointer. - static NSHTTPCookie castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSHTTPCookie._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSHTTPCookie]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSHTTPCookie1); - } - - NSHTTPCookie? initWithProperties_(NSDictionary properties) { - final _ret = _lib._objc_msgSend_846( - _id, _lib._sel_initWithProperties_1, properties._id); - return _ret.address == 0 - ? null - : NSHTTPCookie._(_ret, _lib, retain: true, release: true); - } - - static NSHTTPCookie? cookieWithProperties_( - ThermionDartTexture1 _lib, NSDictionary properties) { - final _ret = _lib._objc_msgSend_847(_lib._class_NSHTTPCookie1, - _lib._sel_cookieWithProperties_1, properties._id); - return _ret.address == 0 - ? null - : NSHTTPCookie._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary requestHeaderFieldsWithCookies_( - ThermionDartTexture1 _lib, NSArray cookies) { - final _ret = _lib._objc_msgSend_507(_lib._class_NSHTTPCookie1, - _lib._sel_requestHeaderFieldsWithCookies_1, cookies._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSArray cookiesWithResponseHeaderFields_forURL_( - ThermionDartTexture1 _lib, NSDictionary headerFields, NSURL URL) { - final _ret = _lib._objc_msgSend_848( - _lib._class_NSHTTPCookie1, - _lib._sel_cookiesWithResponseHeaderFields_forURL_1, - headerFields._id, - URL._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? get properties { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_properties1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - int get version { - return _lib._objc_msgSend_10(_id, _lib._sel_version1); - } - - NSString get name { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_name1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get value { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_value1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSDate? get expiresDate { - final _ret = _lib._objc_msgSend_182(_id, _lib._sel_expiresDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - bool get sessionOnly { - return _lib._objc_msgSend_12(_id, _lib._sel_isSessionOnly1); - } - - NSString get domain { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_domain1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get path { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_path1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - bool get secure { - return _lib._objc_msgSend_12(_id, _lib._sel_isSecure1); - } - - bool get HTTPOnly { - return _lib._objc_msgSend_12(_id, _lib._sel_isHTTPOnly1); - } - - NSString? get comment { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_comment1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSURL? get commentURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_commentURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSArray? get portList { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_portList1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? get sameSitePolicy { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_sameSitePolicy1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - @override - NSHTTPCookie init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSHTTPCookie._(_ret, _lib, retain: true, release: true); - } - - static NSHTTPCookie new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSHTTPCookie1, _lib._sel_new1); - return NSHTTPCookie._(_ret, _lib, retain: false, release: true); - } - - static NSHTTPCookie allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSHTTPCookie1, _lib._sel_allocWithZone_1, zone); - return NSHTTPCookie._(_ret, _lib, retain: false, release: true); - } - - static NSHTTPCookie alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSHTTPCookie1, _lib._sel_alloc1); - return NSHTTPCookie._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSHTTPCookie1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSHTTPCookie1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSHTTPCookie1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSHTTPCookie1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSHTTPCookie1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSHTTPCookie1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSHTTPCookie1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSHTTPCookie1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSHTTPCookie1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSHTTPCookieAcceptPolicy { - static const int NSHTTPCookieAcceptPolicyAlways = 0; - static const int NSHTTPCookieAcceptPolicyNever = 1; - static const int NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain = 2; -} - -class NSURLSessionTask extends NSObject { - NSURLSessionTask._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSessionTask] that points to the same underlying object as [other]. - static NSURLSessionTask castFrom(T other) { - return NSURLSessionTask._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLSessionTask] that wraps the given raw object pointer. - static NSURLSessionTask castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionTask._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLSessionTask]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLSessionTask1); - } - - int get taskIdentifier { - return _lib._objc_msgSend_10(_id, _lib._sel_taskIdentifier1); - } - - NSURLRequest? get originalRequest { - final _ret = _lib._objc_msgSend_872(_id, _lib._sel_originalRequest1); - return _ret.address == 0 - ? null - : NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - NSURLRequest? get currentRequest { - final _ret = _lib._objc_msgSend_872(_id, _lib._sel_currentRequest1); - return _ret.address == 0 - ? null - : NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - NSURLResponse? get response { - final _ret = _lib._objc_msgSend_874(_id, _lib._sel_response1); - return _ret.address == 0 - ? null - : NSURLResponse._(_ret, _lib, retain: true, release: true); - } - - NSObject? get delegate { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set delegate(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); - } - - NSProgress get progress { - final _ret = _lib._objc_msgSend_875(_id, _lib._sel_progress1); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - NSDate? get earliestBeginDate { - final _ret = _lib._objc_msgSend_182(_id, _lib._sel_earliestBeginDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - set earliestBeginDate(NSDate? value) { - return _lib._objc_msgSend_795( - _id, _lib._sel_setEarliestBeginDate_1, value?._id ?? ffi.nullptr); - } - - int get countOfBytesClientExpectsToSend { - return _lib._objc_msgSend_665( - _id, _lib._sel_countOfBytesClientExpectsToSend1); - } - - set countOfBytesClientExpectsToSend(int value) { - return _lib._objc_msgSend_666( - _id, _lib._sel_setCountOfBytesClientExpectsToSend_1, value); - } - - int get countOfBytesClientExpectsToReceive { - return _lib._objc_msgSend_665( - _id, _lib._sel_countOfBytesClientExpectsToReceive1); - } - - set countOfBytesClientExpectsToReceive(int value) { - return _lib._objc_msgSend_666( - _id, _lib._sel_setCountOfBytesClientExpectsToReceive_1, value); - } - - int get countOfBytesSent { - return _lib._objc_msgSend_665(_id, _lib._sel_countOfBytesSent1); - } - - int get countOfBytesReceived { - return _lib._objc_msgSend_665(_id, _lib._sel_countOfBytesReceived1); - } - - int get countOfBytesExpectedToSend { - return _lib._objc_msgSend_665(_id, _lib._sel_countOfBytesExpectedToSend1); - } - - int get countOfBytesExpectedToReceive { - return _lib._objc_msgSend_665( - _id, _lib._sel_countOfBytesExpectedToReceive1); - } - - NSString? get taskDescription { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_taskDescription1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set taskDescription(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setTaskDescription_1, value?._id ?? ffi.nullptr); - } - - void cancel() { - _lib._objc_msgSend_1(_id, _lib._sel_cancel1); - } - - int get state { - return _lib._objc_msgSend_876(_id, _lib._sel_state1); - } - - NSError? get error { - final _ret = _lib._objc_msgSend_321(_id, _lib._sel_error1); - return _ret.address == 0 - ? null - : NSError._(_ret, _lib, retain: true, release: true); - } - - void suspend() { - _lib._objc_msgSend_1(_id, _lib._sel_suspend1); - } - - void resume() { - _lib._objc_msgSend_1(_id, _lib._sel_resume1); - } - - double get priority { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_238_fpret(_id, _lib._sel_priority1) - : _lib._objc_msgSend_238(_id, _lib._sel_priority1); - } - - set priority(double value) { - return _lib._objc_msgSend_877(_id, _lib._sel_setPriority_1, value); - } - - bool get prefersIncrementalDelivery { - return _lib._objc_msgSend_12(_id, _lib._sel_prefersIncrementalDelivery1); - } - - set prefersIncrementalDelivery(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setPrefersIncrementalDelivery_1, value); - } - - @override - NSURLSessionTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionTask._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionTask new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLSessionTask1, _lib._sel_new1); - return NSURLSessionTask._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionTask allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionTask1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionTask._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionTask alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLSessionTask1, _lib._sel_alloc1); - return NSURLSessionTask._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLSessionTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLSessionTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLSessionTask1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLSessionTask1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLSessionTask1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLSessionTask1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLSessionTask1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLSessionTask1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionTask1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSURLRequest extends NSObject { - NSURLRequest._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLRequest] that points to the same underlying object as [other]. - static NSURLRequest castFrom(T other) { - return NSURLRequest._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSURLRequest] that wraps the given raw object pointer. - static NSURLRequest castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLRequest._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLRequest]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLRequest1); - } - - static NSURLRequest requestWithURL_(ThermionDartTexture1 _lib, NSURL URL) { - final _ret = _lib._objc_msgSend_261( - _lib._class_NSURLRequest1, _lib._sel_requestWithURL_1, URL._id); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - static bool getSupportsSecureCoding(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLRequest1, _lib._sel_supportsSecureCoding1); - } - - static NSURLRequest requestWithURL_cachePolicy_timeoutInterval_( - ThermionDartTexture1 _lib, - NSURL URL, - int cachePolicy, - double timeoutInterval) { - final _ret = _lib._objc_msgSend_853( - _lib._class_NSURLRequest1, - _lib._sel_requestWithURL_cachePolicy_timeoutInterval_1, - URL._id, - cachePolicy, - timeoutInterval); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - NSURLRequest initWithURL_(NSURL URL) { - final _ret = _lib._objc_msgSend_261(_id, _lib._sel_initWithURL_1, URL._id); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - NSURLRequest initWithURL_cachePolicy_timeoutInterval_( - NSURL URL, int cachePolicy, double timeoutInterval) { - final _ret = _lib._objc_msgSend_853( - _id, - _lib._sel_initWithURL_cachePolicy_timeoutInterval_1, - URL._id, - cachePolicy, - timeoutInterval); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - NSURL? get URL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_URL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - int get cachePolicy { - return _lib._objc_msgSend_854(_id, _lib._sel_cachePolicy1); - } - - double get timeoutInterval { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_timeoutInterval1) - : _lib._objc_msgSend_164(_id, _lib._sel_timeoutInterval1); - } - - NSURL? get mainDocumentURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_mainDocumentURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - int get networkServiceType { - return _lib._objc_msgSend_855(_id, _lib._sel_networkServiceType1); - } - - bool get allowsCellularAccess { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); - } - - bool get allowsExpensiveNetworkAccess { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); - } - - bool get allowsConstrainedNetworkAccess { - return _lib._objc_msgSend_12( - _id, _lib._sel_allowsConstrainedNetworkAccess1); - } - - bool get assumesHTTP3Capable { - return _lib._objc_msgSend_12(_id, _lib._sel_assumesHTTP3Capable1); - } - - int get attribution { - return _lib._objc_msgSend_856(_id, _lib._sel_attribution1); - } - - bool get requiresDNSSECValidation { - return _lib._objc_msgSend_12(_id, _lib._sel_requiresDNSSECValidation1); - } - - NSString? get HTTPMethod { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_HTTPMethod1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? get allHTTPHeaderFields { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_allHTTPHeaderFields1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSString? valueForHTTPHeaderField_(NSString field) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_valueForHTTPHeaderField_1, field._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSData? get HTTPBody { - final _ret = _lib._objc_msgSend_285(_id, _lib._sel_HTTPBody1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSInputStream? get HTTPBodyStream { - final _ret = _lib._objc_msgSend_871(_id, _lib._sel_HTTPBodyStream1); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - bool get HTTPShouldHandleCookies { - return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldHandleCookies1); - } - - bool get HTTPShouldUsePipelining { - return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); - } - - @override - NSURLRequest init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - static NSURLRequest new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLRequest1, _lib._sel_new1); - return NSURLRequest._(_ret, _lib, retain: false, release: true); - } - - static NSURLRequest allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLRequest1, _lib._sel_allocWithZone_1, zone); - return NSURLRequest._(_ret, _lib, retain: false, release: true); - } - - static NSURLRequest alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLRequest1, _lib._sel_alloc1); - return NSURLRequest._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLRequest1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLRequest1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLRequest1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLRequest1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLRequest1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLRequest1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLRequest1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSURLRequest1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLRequest1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSURLRequestCachePolicy { - static const int NSURLRequestUseProtocolCachePolicy = 0; - static const int NSURLRequestReloadIgnoringLocalCacheData = 1; - static const int NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4; - static const int NSURLRequestReloadIgnoringCacheData = 1; - static const int NSURLRequestReturnCacheDataElseLoad = 2; - static const int NSURLRequestReturnCacheDataDontLoad = 3; - static const int NSURLRequestReloadRevalidatingCacheData = 5; -} - -abstract class NSURLRequestNetworkServiceType { - static const int NSURLNetworkServiceTypeDefault = 0; - static const int NSURLNetworkServiceTypeVoIP = 1; - static const int NSURLNetworkServiceTypeVideo = 2; - static const int NSURLNetworkServiceTypeBackground = 3; - static const int NSURLNetworkServiceTypeVoice = 4; - static const int NSURLNetworkServiceTypeResponsiveData = 6; - static const int NSURLNetworkServiceTypeAVStreaming = 8; - static const int NSURLNetworkServiceTypeResponsiveAV = 9; - static const int NSURLNetworkServiceTypeCallSignaling = 11; -} - -abstract class NSURLRequestAttribution { - static const int NSURLRequestAttributionDeveloper = 0; - static const int NSURLRequestAttributionUser = 1; -} - -class NSInputStream extends NSStream { - NSInputStream._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSInputStream] that points to the same underlying object as [other]. - static NSInputStream castFrom(T other) { - return NSInputStream._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSInputStream] that wraps the given raw object pointer. - static NSInputStream castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSInputStream._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSInputStream]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSInputStream1); - } - - int read_maxLength_(ffi.Pointer buffer, int len) { - return _lib._objc_msgSend_859(_id, _lib._sel_read_maxLength_1, buffer, len); - } - - bool getBuffer_length_(ffi.Pointer> buffer, - ffi.Pointer len) { - return _lib._objc_msgSend_869( - _id, _lib._sel_getBuffer_length_1, buffer, len); - } - - bool get hasBytesAvailable { - return _lib._objc_msgSend_12(_id, _lib._sel_hasBytesAvailable1); - } - - NSInputStream initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_278(_id, _lib._sel_initWithData_1, data._id); - return NSInputStream._(_ret, _lib, retain: true, release: true); - } - - NSInputStream? initWithURL_(NSURL url) { - final _ret = _lib._objc_msgSend_276(_id, _lib._sel_initWithURL_1, url._id); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - NSInputStream? initWithFileAtPath_(NSString path) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_initWithFileAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - static NSInputStream? inputStreamWithData_( - ThermionDartTexture1 _lib, NSData data) { - final _ret = _lib._objc_msgSend_870( - _lib._class_NSInputStream1, _lib._sel_inputStreamWithData_1, data._id); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - static NSInputStream? inputStreamWithFileAtPath_( - ThermionDartTexture1 _lib, NSString path) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSInputStream1, - _lib._sel_inputStreamWithFileAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - static NSInputStream? inputStreamWithURL_( - ThermionDartTexture1 _lib, NSURL url) { - final _ret = _lib._objc_msgSend_276( - _lib._class_NSInputStream1, _lib._sel_inputStreamWithURL_1, url._id); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - static void getStreamsToHostWithName_port_inputStream_outputStream_( - ThermionDartTexture1 _lib, - NSString hostname, - int port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_863( - _lib._class_NSInputStream1, - _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, - hostname._id, - port, - inputStream, - outputStream); - } - - static void getStreamsToHost_port_inputStream_outputStream_( - ThermionDartTexture1 _lib, - NSHost host, - int port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_867( - _lib._class_NSInputStream1, - _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, - host._id, - port, - inputStream, - outputStream); - } - - static void getBoundStreamsWithBufferSize_inputStream_outputStream_( - ThermionDartTexture1 _lib, - int bufferSize, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_868( - _lib._class_NSInputStream1, - _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, - bufferSize, - inputStream, - outputStream); - } - - @override - NSInputStream init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSInputStream._(_ret, _lib, retain: true, release: true); - } - - static NSInputStream new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSInputStream1, _lib._sel_new1); - return NSInputStream._(_ret, _lib, retain: false, release: true); - } - - static NSInputStream allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSInputStream1, _lib._sel_allocWithZone_1, zone); - return NSInputStream._(_ret, _lib, retain: false, release: true); - } - - static NSInputStream alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSInputStream1, _lib._sel_alloc1); - return NSInputStream._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSInputStream1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSInputStream1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSInputStream1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSInputStream1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSInputStream1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSInputStream1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSInputStream1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSInputStream1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSInputStream1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSStream extends NSObject { - NSStream._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSStream] that points to the same underlying object as [other]. - static NSStream castFrom(T other) { - return NSStream._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSStream] that wraps the given raw object pointer. - static NSStream castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSStream._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSStream]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSStream1); - } - - void open() { - _lib._objc_msgSend_1(_id, _lib._sel_open1); - } - - void close() { - _lib._objc_msgSend_1(_id, _lib._sel_close1); - } - - NSObject? get delegate { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set delegate(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); - } - - NSObject? propertyForKey_(NSString key) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_propertyForKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - bool setProperty_forKey_(NSObject? property, NSString key) { - return _lib._objc_msgSend_857(_id, _lib._sel_setProperty_forKey_1, - property?._id ?? ffi.nullptr, key._id); - } - - void scheduleInRunLoop_forMode_(NSRunLoop aRunLoop, NSString mode) { - _lib._objc_msgSend_568( - _id, _lib._sel_scheduleInRunLoop_forMode_1, aRunLoop._id, mode._id); - } - - void removeFromRunLoop_forMode_(NSRunLoop aRunLoop, NSString mode) { - _lib._objc_msgSend_568( - _id, _lib._sel_removeFromRunLoop_forMode_1, aRunLoop._id, mode._id); - } - - int get streamStatus { - return _lib._objc_msgSend_858(_id, _lib._sel_streamStatus1); - } - - NSError? get streamError { - final _ret = _lib._objc_msgSend_321(_id, _lib._sel_streamError1); - return _ret.address == 0 - ? null - : NSError._(_ret, _lib, retain: true, release: true); - } - - static void getStreamsToHostWithName_port_inputStream_outputStream_( - ThermionDartTexture1 _lib, - NSString hostname, - int port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_863( - _lib._class_NSStream1, - _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, - hostname._id, - port, - inputStream, - outputStream); - } - - static void getStreamsToHost_port_inputStream_outputStream_( - ThermionDartTexture1 _lib, - NSHost host, - int port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_867( - _lib._class_NSStream1, - _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, - host._id, - port, - inputStream, - outputStream); - } - - static void getBoundStreamsWithBufferSize_inputStream_outputStream_( - ThermionDartTexture1 _lib, - int bufferSize, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_868( - _lib._class_NSStream1, - _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, - bufferSize, - inputStream, - outputStream); - } - - @override - NSStream init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSStream._(_ret, _lib, retain: true, release: true); - } - - static NSStream new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSStream1, _lib._sel_new1); - return NSStream._(_ret, _lib, retain: false, release: true); - } - - static NSStream allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSStream1, _lib._sel_allocWithZone_1, zone); - return NSStream._(_ret, _lib, retain: false, release: true); - } - - static NSStream alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSStream1, _lib._sel_alloc1); - return NSStream._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSStream1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSStream1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSStream1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSStream1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSStream1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSStream1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSStream1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSStream1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSStream1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSStreamStatus { - static const int NSStreamStatusNotOpen = 0; - static const int NSStreamStatusOpening = 1; - static const int NSStreamStatusOpen = 2; - static const int NSStreamStatusReading = 3; - static const int NSStreamStatusWriting = 4; - static const int NSStreamStatusAtEnd = 5; - static const int NSStreamStatusClosed = 6; - static const int NSStreamStatusError = 7; -} - -class NSOutputStream extends NSStream { - NSOutputStream._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSOutputStream] that points to the same underlying object as [other]. - static NSOutputStream castFrom(T other) { - return NSOutputStream._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSOutputStream] that wraps the given raw object pointer. - static NSOutputStream castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSOutputStream._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSOutputStream]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSOutputStream1); - } - - int write_maxLength_(ffi.Pointer buffer, int len) { - return _lib._objc_msgSend_859( - _id, _lib._sel_write_maxLength_1, buffer, len); - } - - bool get hasSpaceAvailable { - return _lib._objc_msgSend_12(_id, _lib._sel_hasSpaceAvailable1); - } - - NSOutputStream initToMemory() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initToMemory1); - return NSOutputStream._(_ret, _lib, retain: true, release: true); - } - - NSOutputStream initToBuffer_capacity_( - ffi.Pointer buffer, int capacity) { - final _ret = _lib._objc_msgSend_860( - _id, _lib._sel_initToBuffer_capacity_1, buffer, capacity); - return NSOutputStream._(_ret, _lib, retain: true, release: true); - } - - NSOutputStream? initWithURL_append_(NSURL url, bool shouldAppend) { - final _ret = _lib._objc_msgSend_861( - _id, _lib._sel_initWithURL_append_1, url._id, shouldAppend); - return _ret.address == 0 - ? null - : NSOutputStream._(_ret, _lib, retain: true, release: true); - } - - NSOutputStream? initToFileAtPath_append_(NSString path, bool shouldAppend) { - final _ret = _lib._objc_msgSend_862( - _id, _lib._sel_initToFileAtPath_append_1, path._id, shouldAppend); - return _ret.address == 0 - ? null - : NSOutputStream._(_ret, _lib, retain: true, release: true); - } - - static NSOutputStream outputStreamToMemory(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOutputStream1, _lib._sel_outputStreamToMemory1); - return NSOutputStream._(_ret, _lib, retain: true, release: true); - } - - static NSOutputStream outputStreamToBuffer_capacity_( - ThermionDartTexture1 _lib, ffi.Pointer buffer, int capacity) { - final _ret = _lib._objc_msgSend_860(_lib._class_NSOutputStream1, - _lib._sel_outputStreamToBuffer_capacity_1, buffer, capacity); - return NSOutputStream._(_ret, _lib, retain: true, release: true); - } - - static NSOutputStream outputStreamToFileAtPath_append_( - ThermionDartTexture1 _lib, NSString path, bool shouldAppend) { - final _ret = _lib._objc_msgSend_30(_lib._class_NSOutputStream1, - _lib._sel_outputStreamToFileAtPath_append_1, path._id, shouldAppend); - return NSOutputStream._(_ret, _lib, retain: true, release: true); - } - - static NSOutputStream? outputStreamWithURL_append_( - ThermionDartTexture1 _lib, NSURL url, bool shouldAppend) { - final _ret = _lib._objc_msgSend_861(_lib._class_NSOutputStream1, - _lib._sel_outputStreamWithURL_append_1, url._id, shouldAppend); - return _ret.address == 0 - ? null - : NSOutputStream._(_ret, _lib, retain: true, release: true); - } - - static void getStreamsToHostWithName_port_inputStream_outputStream_( - ThermionDartTexture1 _lib, - NSString hostname, - int port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_863( - _lib._class_NSOutputStream1, - _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, - hostname._id, - port, - inputStream, - outputStream); - } - - static void getStreamsToHost_port_inputStream_outputStream_( - ThermionDartTexture1 _lib, - NSHost host, - int port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_867( - _lib._class_NSOutputStream1, - _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, - host._id, - port, - inputStream, - outputStream); - } - - static void getBoundStreamsWithBufferSize_inputStream_outputStream_( - ThermionDartTexture1 _lib, - int bufferSize, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_868( - _lib._class_NSOutputStream1, - _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, - bufferSize, - inputStream, - outputStream); - } - - @override - NSOutputStream init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSOutputStream._(_ret, _lib, retain: true, release: true); - } - - static NSOutputStream new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOutputStream1, _lib._sel_new1); - return NSOutputStream._(_ret, _lib, retain: false, release: true); - } - - static NSOutputStream allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSOutputStream1, _lib._sel_allocWithZone_1, zone); - return NSOutputStream._(_ret, _lib, retain: false, release: true); - } - - static NSOutputStream alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOutputStream1, _lib._sel_alloc1); - return NSOutputStream._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSOutputStream1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSOutputStream1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSOutputStream1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSOutputStream1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSOutputStream1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSOutputStream1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSOutputStream1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSOutputStream1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOutputStream1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSHost extends NSObject { - NSHost._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSHost] that points to the same underlying object as [other]. - static NSHost castFrom(T other) { - return NSHost._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSHost] that wraps the given raw object pointer. - static NSHost castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSHost._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSHost]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSHost1); - } - - static NSHost currentHost(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_currentHost1); - return NSHost._(_ret, _lib, retain: true, release: true); - } - - static NSHost hostWithName_(ThermionDartTexture1 _lib, NSString? name) { - final _ret = _lib._objc_msgSend_864(_lib._class_NSHost1, - _lib._sel_hostWithName_1, name?._id ?? ffi.nullptr); - return NSHost._(_ret, _lib, retain: true, release: true); - } - - static NSHost hostWithAddress_(ThermionDartTexture1 _lib, NSString address) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSHost1, _lib._sel_hostWithAddress_1, address._id); - return NSHost._(_ret, _lib, retain: true, release: true); - } - - bool isEqualToHost_(NSHost aHost) { - return _lib._objc_msgSend_865(_id, _lib._sel_isEqualToHost_1, aHost._id); - } - - NSString? get name { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_name1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray get names { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_names1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? get address { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_address1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray get addresses { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_addresses1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? get localizedName { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_localizedName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static void setHostCacheEnabled_(ThermionDartTexture1 _lib, bool flag) { - _lib._objc_msgSend_866( - _lib._class_NSHost1, _lib._sel_setHostCacheEnabled_1, flag); - } - - static bool isHostCacheEnabled(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSHost1, _lib._sel_isHostCacheEnabled1); - } - - static void flushHostCache(ThermionDartTexture1 _lib) { - _lib._objc_msgSend_1(_lib._class_NSHost1, _lib._sel_flushHostCache1); - } - - @override - NSHost init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSHost._(_ret, _lib, retain: true, release: true); - } - - static NSHost new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_new1); - return NSHost._(_ret, _lib, retain: false, release: true); - } - - static NSHost allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSHost1, _lib._sel_allocWithZone_1, zone); - return NSHost._(_ret, _lib, retain: false, release: true); - } - - static NSHost alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_alloc1); - return NSHost._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSHost1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSHost1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSHost1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSHost1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSHost1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSHost1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSHost1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSHost1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSHost1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSURLResponse extends NSObject { - NSURLResponse._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLResponse] that points to the same underlying object as [other]. - static NSURLResponse castFrom(T other) { - return NSURLResponse._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSURLResponse] that wraps the given raw object pointer. - static NSURLResponse castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLResponse._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLResponse]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLResponse1); - } - - NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( - NSURL URL, NSString? MIMEType, int length, NSString? name) { - final _ret = _lib._objc_msgSend_873( - _id, - _lib._sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1, - URL._id, - MIMEType?._id ?? ffi.nullptr, - length, - name?._id ?? ffi.nullptr); - return NSURLResponse._(_ret, _lib, retain: true, release: true); - } - - NSURL? get URL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_URL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSString? get MIMEType { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_MIMEType1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - int get expectedContentLength { - return _lib._objc_msgSend_237(_id, _lib._sel_expectedContentLength1); - } - - NSString? get textEncodingName { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_textEncodingName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get suggestedFilename { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_suggestedFilename1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - @override - NSURLResponse init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLResponse._(_ret, _lib, retain: true, release: true); - } - - static NSURLResponse new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLResponse1, _lib._sel_new1); - return NSURLResponse._(_ret, _lib, retain: false, release: true); - } - - static NSURLResponse allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLResponse1, _lib._sel_allocWithZone_1, zone); - return NSURLResponse._(_ret, _lib, retain: false, release: true); - } - - static NSURLResponse alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLResponse1, _lib._sel_alloc1); - return NSURLResponse._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLResponse1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLResponse1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLResponse1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLResponse1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLResponse1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLResponse1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLResponse1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSURLResponse1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLResponse1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSURLSessionTaskState { - static const int NSURLSessionTaskStateRunning = 0; - static const int NSURLSessionTaskStateSuspended = 1; - static const int NSURLSessionTaskStateCanceling = 2; - static const int NSURLSessionTaskStateCompleted = 3; -} - -void _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSArray_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSArray_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSArray_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSArray_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSArray_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSArray_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSArray_closureRegistry[block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_NSArray extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSArray._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSArray.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSArray.fromFunction( - ThermionDartTexture1 lib, void Function(NSArray?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSArray_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSArray._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSArray.listener( - ThermionDartTexture1 lib, void Function(NSArray?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSArray_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSArray_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSArray._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSArray? arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0?._id ?? ffi.nullptr); -} - -class NSIndexPath extends NSObject { - NSIndexPath._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSIndexPath] that points to the same underlying object as [other]. - static NSIndexPath castFrom(T other) { - return NSIndexPath._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSIndexPath] that wraps the given raw object pointer. - static NSIndexPath castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSIndexPath._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSIndexPath]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSIndexPath1); - } - - static NSIndexPath indexPathWithIndex_(ThermionDartTexture1 _lib, int index) { - final _ret = _lib._objc_msgSend_64( - _lib._class_NSIndexPath1, _lib._sel_indexPathWithIndex_1, index); - return NSIndexPath._(_ret, _lib, retain: true, release: true); - } - - static NSIndexPath indexPathWithIndexes_length_(ThermionDartTexture1 _lib, - ffi.Pointer indexes, int length) { - final _ret = _lib._objc_msgSend_880(_lib._class_NSIndexPath1, - _lib._sel_indexPathWithIndexes_length_1, indexes, length); - return NSIndexPath._(_ret, _lib, retain: true, release: true); - } - - NSIndexPath initWithIndexes_length_( - ffi.Pointer indexes, int length) { - final _ret = _lib._objc_msgSend_880( - _id, _lib._sel_initWithIndexes_length_1, indexes, length); - return NSIndexPath._(_ret, _lib, retain: true, release: true); - } - - NSIndexPath initWithIndex_(int index) { - final _ret = _lib._objc_msgSend_64(_id, _lib._sel_initWithIndex_1, index); - return NSIndexPath._(_ret, _lib, retain: true, release: true); - } - - NSIndexPath indexPathByAddingIndex_(int index) { - final _ret = - _lib._objc_msgSend_881(_id, _lib._sel_indexPathByAddingIndex_1, index); - return NSIndexPath._(_ret, _lib, retain: true, release: true); - } - - NSIndexPath indexPathByRemovingLastIndex() { - final _ret = - _lib._objc_msgSend_882(_id, _lib._sel_indexPathByRemovingLastIndex1); - return NSIndexPath._(_ret, _lib, retain: true, release: true); - } - - int indexAtPosition_(int position) { - return _lib._objc_msgSend_93(_id, _lib._sel_indexAtPosition_1, position); - } - - int get length { - return _lib._objc_msgSend_10(_id, _lib._sel_length1); - } - - void getIndexes_range_( - ffi.Pointer indexes, _NSRange positionRange) { - _lib._objc_msgSend_883( - _id, _lib._sel_getIndexes_range_1, indexes, positionRange); - } - - int compare_(NSIndexPath otherObject) { - return _lib._objc_msgSend_884(_id, _lib._sel_compare_1, otherObject._id); - } - - void getIndexes_(ffi.Pointer indexes) { - _lib._objc_msgSend_885(_id, _lib._sel_getIndexes_1, indexes); - } - - @override - NSIndexPath init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSIndexPath._(_ret, _lib, retain: true, release: true); - } - - static NSIndexPath new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSIndexPath1, _lib._sel_new1); - return NSIndexPath._(_ret, _lib, retain: false, release: true); - } - - static NSIndexPath allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSIndexPath1, _lib._sel_allocWithZone_1, zone); - return NSIndexPath._(_ret, _lib, retain: false, release: true); - } - - static NSIndexPath alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSIndexPath1, _lib._sel_alloc1); - return NSIndexPath._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSIndexPath1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSIndexPath1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSIndexPath1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSIndexPath1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSIndexPath1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSIndexPath1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSIndexPath1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSIndexPath1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSIndexPath1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSInflectionRule extends NSObject { - NSInflectionRule._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSInflectionRule] that points to the same underlying object as [other]. - static NSInflectionRule castFrom(T other) { - return NSInflectionRule._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSInflectionRule] that wraps the given raw object pointer. - static NSInflectionRule castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSInflectionRule._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSInflectionRule]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSInflectionRule1); - } - - @override - NSObject init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSInflectionRule getAutomaticRule(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_886( - _lib._class_NSInflectionRule1, _lib._sel_automaticRule1); - return NSInflectionRule._(_ret, _lib, retain: true, release: true); - } - - static bool canInflectLanguage_( - ThermionDartTexture1 _lib, NSString language) { - return _lib._objc_msgSend_63(_lib._class_NSInflectionRule1, - _lib._sel_canInflectLanguage_1, language._id); - } - - static bool getCanInflectPreferredLocalization(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSInflectionRule1, - _lib._sel_canInflectPreferredLocalization1); - } - - static NSInflectionRule new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSInflectionRule1, _lib._sel_new1); - return NSInflectionRule._(_ret, _lib, retain: false, release: true); - } - - static NSInflectionRule allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSInflectionRule1, _lib._sel_allocWithZone_1, zone); - return NSInflectionRule._(_ret, _lib, retain: false, release: true); - } - - static NSInflectionRule alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSInflectionRule1, _lib._sel_alloc1); - return NSInflectionRule._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSInflectionRule1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSInflectionRule1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSInflectionRule1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSInflectionRule1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSInflectionRule1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSInflectionRule1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSInflectionRule1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSInflectionRule1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSInflectionRule1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSMorphology extends NSObject { - NSMorphology._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMorphology] that points to the same underlying object as [other]. - static NSMorphology castFrom(T other) { - return NSMorphology._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSMorphology] that wraps the given raw object pointer. - static NSMorphology castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMorphology._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMorphology]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMorphology1); - } - - int get grammaticalGender { - return _lib._objc_msgSend_887(_id, _lib._sel_grammaticalGender1); - } - - set grammaticalGender(int value) { - return _lib._objc_msgSend_888(_id, _lib._sel_setGrammaticalGender_1, value); - } - - int get partOfSpeech { - return _lib._objc_msgSend_889(_id, _lib._sel_partOfSpeech1); - } - - set partOfSpeech(int value) { - return _lib._objc_msgSend_890(_id, _lib._sel_setPartOfSpeech_1, value); - } - - int get number { - return _lib._objc_msgSend_891(_id, _lib._sel_number1); - } - - set number(int value) { - return _lib._objc_msgSend_892(_id, _lib._sel_setNumber_1, value); - } - - NSMorphologyCustomPronoun? customPronounForLanguage_(NSString language) { - final _ret = _lib._objc_msgSend_893( - _id, _lib._sel_customPronounForLanguage_1, language._id); - return _ret.address == 0 - ? null - : NSMorphologyCustomPronoun._(_ret, _lib, retain: true, release: true); - } - - bool setCustomPronoun_forLanguage_error_(NSMorphologyCustomPronoun? features, - NSString language, ffi.Pointer> error) { - return _lib._objc_msgSend_894( - _id, - _lib._sel_setCustomPronoun_forLanguage_error_1, - features?._id ?? ffi.nullptr, - language._id, - error); - } - - bool get unspecified { - return _lib._objc_msgSend_12(_id, _lib._sel_isUnspecified1); - } - - static NSMorphology getUserMorphology(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_895( - _lib._class_NSMorphology1, _lib._sel_userMorphology1); - return NSMorphology._(_ret, _lib, retain: true, release: true); - } - - @override - NSMorphology init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMorphology._(_ret, _lib, retain: true, release: true); - } - - static NSMorphology new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMorphology1, _lib._sel_new1); - return NSMorphology._(_ret, _lib, retain: false, release: true); - } - - static NSMorphology allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMorphology1, _lib._sel_allocWithZone_1, zone); - return NSMorphology._(_ret, _lib, retain: false, release: true); - } - - static NSMorphology alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMorphology1, _lib._sel_alloc1); - return NSMorphology._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMorphology1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMorphology1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMorphology1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMorphology1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMorphology1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMorphology1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMorphology1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSMorphology1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMorphology1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSGrammaticalGender { - static const int NSGrammaticalGenderNotSet = 0; - static const int NSGrammaticalGenderFeminine = 1; - static const int NSGrammaticalGenderMasculine = 2; - static const int NSGrammaticalGenderNeuter = 3; -} - -abstract class NSGrammaticalPartOfSpeech { - static const int NSGrammaticalPartOfSpeechNotSet = 0; - static const int NSGrammaticalPartOfSpeechDeterminer = 1; - static const int NSGrammaticalPartOfSpeechPronoun = 2; - static const int NSGrammaticalPartOfSpeechLetter = 3; - static const int NSGrammaticalPartOfSpeechAdverb = 4; - static const int NSGrammaticalPartOfSpeechParticle = 5; - static const int NSGrammaticalPartOfSpeechAdjective = 6; - static const int NSGrammaticalPartOfSpeechAdposition = 7; - static const int NSGrammaticalPartOfSpeechVerb = 8; - static const int NSGrammaticalPartOfSpeechNoun = 9; - static const int NSGrammaticalPartOfSpeechConjunction = 10; - static const int NSGrammaticalPartOfSpeechNumeral = 11; - static const int NSGrammaticalPartOfSpeechInterjection = 12; - static const int NSGrammaticalPartOfSpeechPreposition = 13; - static const int NSGrammaticalPartOfSpeechAbbreviation = 14; -} - -abstract class NSGrammaticalNumber { - static const int NSGrammaticalNumberNotSet = 0; - static const int NSGrammaticalNumberSingular = 1; - static const int NSGrammaticalNumberZero = 2; - static const int NSGrammaticalNumberPlural = 3; - static const int NSGrammaticalNumberPluralTwo = 4; - static const int NSGrammaticalNumberPluralFew = 5; - static const int NSGrammaticalNumberPluralMany = 6; -} - -class NSMorphologyCustomPronoun extends NSObject { - NSMorphologyCustomPronoun._( - ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMorphologyCustomPronoun] that points to the same underlying object as [other]. - static NSMorphologyCustomPronoun castFrom(T other) { - return NSMorphologyCustomPronoun._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSMorphologyCustomPronoun] that wraps the given raw object pointer. - static NSMorphologyCustomPronoun castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMorphologyCustomPronoun._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMorphologyCustomPronoun]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSMorphologyCustomPronoun1); - } - - static bool isSupportedForLanguage_( - ThermionDartTexture1 _lib, NSString language) { - return _lib._objc_msgSend_63(_lib._class_NSMorphologyCustomPronoun1, - _lib._sel_isSupportedForLanguage_1, language._id); - } - - static NSArray requiredKeysForLanguage_( - ThermionDartTexture1 _lib, NSString language) { - final _ret = _lib._objc_msgSend_357(_lib._class_NSMorphologyCustomPronoun1, - _lib._sel_requiredKeysForLanguage_1, language._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? get subjectForm { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_subjectForm1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set subjectForm(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setSubjectForm_1, value?._id ?? ffi.nullptr); - } - - NSString? get objectForm { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_objectForm1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set objectForm(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setObjectForm_1, value?._id ?? ffi.nullptr); - } - - NSString? get possessiveForm { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_possessiveForm1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set possessiveForm(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setPossessiveForm_1, value?._id ?? ffi.nullptr); - } - - NSString? get possessiveAdjectiveForm { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_possessiveAdjectiveForm1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set possessiveAdjectiveForm(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setPossessiveAdjectiveForm_1, value?._id ?? ffi.nullptr); - } - - NSString? get reflexiveForm { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_reflexiveForm1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set reflexiveForm(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setReflexiveForm_1, value?._id ?? ffi.nullptr); - } - - @override - NSMorphologyCustomPronoun init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMorphologyCustomPronoun._(_ret, _lib, retain: true, release: true); - } - - static NSMorphologyCustomPronoun new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMorphologyCustomPronoun1, _lib._sel_new1); - return NSMorphologyCustomPronoun._(_ret, _lib, - retain: false, release: true); - } - - static NSMorphologyCustomPronoun allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3(_lib._class_NSMorphologyCustomPronoun1, - _lib._sel_allocWithZone_1, zone); - return NSMorphologyCustomPronoun._(_ret, _lib, - retain: false, release: true); - } - - static NSMorphologyCustomPronoun alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMorphologyCustomPronoun1, _lib._sel_alloc1); - return NSMorphologyCustomPronoun._(_ret, _lib, - retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMorphologyCustomPronoun1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMorphologyCustomPronoun1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSMorphologyCustomPronoun1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMorphologyCustomPronoun1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMorphologyCustomPronoun1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMorphologyCustomPronoun1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMorphologyCustomPronoun1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSMorphologyCustomPronoun1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSMorphologyCustomPronoun1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSOperationQueue extends NSObject { - NSOperationQueue._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSOperationQueue] that points to the same underlying object as [other]. - static NSOperationQueue castFrom(T other) { - return NSOperationQueue._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSOperationQueue] that wraps the given raw object pointer. - static NSOperationQueue castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSOperationQueue._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSOperationQueue]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSOperationQueue1); - } - - NSProgress get progress { - final _ret = _lib._objc_msgSend_875(_id, _lib._sel_progress1); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - void addOperation_(NSOperation op) { - _lib._objc_msgSend_896(_id, _lib._sel_addOperation_1, op._id); - } - - void addOperations_waitUntilFinished_(NSArray ops, bool wait) { - _lib._objc_msgSend_899( - _id, _lib._sel_addOperations_waitUntilFinished_1, ops._id, wait); - } - - void addOperationWithBlock_(ObjCBlock_ffiVoid block) { - _lib._objc_msgSend_531(_id, _lib._sel_addOperationWithBlock_1, block._id); - } - - void addBarrierBlock_(ObjCBlock_ffiVoid barrier) { - _lib._objc_msgSend_531(_id, _lib._sel_addBarrierBlock_1, barrier._id); - } - - int get maxConcurrentOperationCount { - return _lib._objc_msgSend_82(_id, _lib._sel_maxConcurrentOperationCount1); - } - - set maxConcurrentOperationCount(int value) { - return _lib._objc_msgSend_634( - _id, _lib._sel_setMaxConcurrentOperationCount_1, value); - } - - bool get suspended { - return _lib._objc_msgSend_12(_id, _lib._sel_isSuspended1); - } - - set suspended(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setSuspended_1, value); - } - - NSString? get name { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_name1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set name(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); - } - - int get qualityOfService { - return _lib._objc_msgSend_542(_id, _lib._sel_qualityOfService1); - } - - set qualityOfService(int value) { - return _lib._objc_msgSend_543(_id, _lib._sel_setQualityOfService_1, value); - } - - NSObject? get underlyingQueue { - final _ret = _lib._objc_msgSend_900(_id, _lib._sel_underlyingQueue1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set underlyingQueue(NSObject? value) { - return _lib._objc_msgSend_901( - _id, _lib._sel_setUnderlyingQueue_1, value?._id ?? ffi.nullptr); - } - - void cancelAllOperations() { - _lib._objc_msgSend_1(_id, _lib._sel_cancelAllOperations1); - } - - void waitUntilAllOperationsAreFinished() { - _lib._objc_msgSend_1(_id, _lib._sel_waitUntilAllOperationsAreFinished1); - } - - static NSOperationQueue? getCurrentQueue(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_902( - _lib._class_NSOperationQueue1, _lib._sel_currentQueue1); - return _ret.address == 0 - ? null - : NSOperationQueue._(_ret, _lib, retain: true, release: true); - } - - static NSOperationQueue getMainQueue(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_903( - _lib._class_NSOperationQueue1, _lib._sel_mainQueue1); - return NSOperationQueue._(_ret, _lib, retain: true, release: true); - } - - NSArray get operations { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_operations1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - int get operationCount { - return _lib._objc_msgSend_10(_id, _lib._sel_operationCount1); - } - - @override - NSOperationQueue init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSOperationQueue._(_ret, _lib, retain: true, release: true); - } - - static NSOperationQueue new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOperationQueue1, _lib._sel_new1); - return NSOperationQueue._(_ret, _lib, retain: false, release: true); - } - - static NSOperationQueue allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSOperationQueue1, _lib._sel_allocWithZone_1, zone); - return NSOperationQueue._(_ret, _lib, retain: false, release: true); - } - - static NSOperationQueue alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOperationQueue1, _lib._sel_alloc1); - return NSOperationQueue._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSOperationQueue1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSOperationQueue1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSOperationQueue1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSOperationQueue1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSOperationQueue1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSOperationQueue1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSOperationQueue1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSOperationQueue1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOperationQueue1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSOperation extends NSObject { - NSOperation._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSOperation] that points to the same underlying object as [other]. - static NSOperation castFrom(T other) { - return NSOperation._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSOperation] that wraps the given raw object pointer. - static NSOperation castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSOperation._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSOperation]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOperation1); - } - - void start() { - _lib._objc_msgSend_1(_id, _lib._sel_start1); - } - - void main() { - _lib._objc_msgSend_1(_id, _lib._sel_main1); - } - - bool get cancelled { - return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); - } - - void cancel() { - _lib._objc_msgSend_1(_id, _lib._sel_cancel1); - } - - bool get executing { - return _lib._objc_msgSend_12(_id, _lib._sel_isExecuting1); - } - - bool get finished { - return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); - } - - bool get concurrent { - return _lib._objc_msgSend_12(_id, _lib._sel_isConcurrent1); - } - - bool get asynchronous { - return _lib._objc_msgSend_12(_id, _lib._sel_isAsynchronous1); - } - - bool get ready { - return _lib._objc_msgSend_12(_id, _lib._sel_isReady1); - } - - void addDependency_(NSOperation op) { - _lib._objc_msgSend_896(_id, _lib._sel_addDependency_1, op._id); - } - - void removeDependency_(NSOperation op) { - _lib._objc_msgSend_896(_id, _lib._sel_removeDependency_1, op._id); - } - - NSArray get dependencies { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_dependencies1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - int get queuePriority { - return _lib._objc_msgSend_897(_id, _lib._sel_queuePriority1); - } - - set queuePriority(int value) { - return _lib._objc_msgSend_898(_id, _lib._sel_setQueuePriority_1, value); - } - - ObjCBlock_ffiVoid? get completionBlock { - final _ret = _lib._objc_msgSend_667(_id, _lib._sel_completionBlock1); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid._(_ret, _lib, retain: true, release: true); - } - - set completionBlock(ObjCBlock_ffiVoid? value) { - return _lib._objc_msgSend_668( - _id, _lib._sel_setCompletionBlock_1, value?._id ?? ffi.nullptr); - } - - void waitUntilFinished() { - _lib._objc_msgSend_1(_id, _lib._sel_waitUntilFinished1); - } - - double get threadPriority { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_threadPriority1) - : _lib._objc_msgSend_164(_id, _lib._sel_threadPriority1); - } - - set threadPriority(double value) { - return _lib._objc_msgSend_541(_id, _lib._sel_setThreadPriority_1, value); - } - - int get qualityOfService { - return _lib._objc_msgSend_542(_id, _lib._sel_qualityOfService1); - } - - set qualityOfService(int value) { - return _lib._objc_msgSend_543(_id, _lib._sel_setQualityOfService_1, value); - } - - NSString? get name { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_name1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set name(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); - } - - @override - NSOperation init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSOperation._(_ret, _lib, retain: true, release: true); - } - - static NSOperation new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSOperation1, _lib._sel_new1); - return NSOperation._(_ret, _lib, retain: false, release: true); - } - - static NSOperation allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSOperation1, _lib._sel_allocWithZone_1, zone); - return NSOperation._(_ret, _lib, retain: false, release: true); - } - - static NSOperation alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOperation1, _lib._sel_alloc1); - return NSOperation._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSOperation1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSOperation1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSOperation1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSOperation1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSOperation1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSOperation1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSOperation1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSOperation1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOperation1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSOperationQueuePriority { - static const int NSOperationQueuePriorityVeryLow = -8; - static const int NSOperationQueuePriorityLow = -4; - static const int NSOperationQueuePriorityNormal = 0; - static const int NSOperationQueuePriorityHigh = 4; - static const int NSOperationQueuePriorityVeryHigh = 8; -} - -class NSPointerArray extends NSObject { - NSPointerArray._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSPointerArray] that points to the same underlying object as [other]. - static NSPointerArray castFrom(T other) { - return NSPointerArray._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSPointerArray] that wraps the given raw object pointer. - static NSPointerArray castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSPointerArray._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSPointerArray]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSPointerArray1); - } - - NSPointerArray initWithOptions_(int options) { - final _ret = - _lib._objc_msgSend_904(_id, _lib._sel_initWithOptions_1, options); - return NSPointerArray._(_ret, _lib, retain: true, release: true); - } - - NSPointerArray initWithPointerFunctions_(NSPointerFunctions functions) { - final _ret = _lib._objc_msgSend_918( - _id, _lib._sel_initWithPointerFunctions_1, functions._id); - return NSPointerArray._(_ret, _lib, retain: true, release: true); - } - - static NSPointerArray pointerArrayWithOptions_( - ThermionDartTexture1 _lib, int options) { - final _ret = _lib._objc_msgSend_919(_lib._class_NSPointerArray1, - _lib._sel_pointerArrayWithOptions_1, options); - return NSPointerArray._(_ret, _lib, retain: true, release: true); - } - - static NSPointerArray pointerArrayWithPointerFunctions_( - ThermionDartTexture1 _lib, NSPointerFunctions functions) { - final _ret = _lib._objc_msgSend_920(_lib._class_NSPointerArray1, - _lib._sel_pointerArrayWithPointerFunctions_1, functions._id); - return NSPointerArray._(_ret, _lib, retain: true, release: true); - } - - NSPointerFunctions get pointerFunctions { - final _ret = _lib._objc_msgSend_921(_id, _lib._sel_pointerFunctions1); - return NSPointerFunctions._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer pointerAtIndex_(int index) { - return _lib._objc_msgSend_922(_id, _lib._sel_pointerAtIndex_1, index); - } - - void addPointer_(ffi.Pointer pointer) { - _lib._objc_msgSend_51(_id, _lib._sel_addPointer_1, pointer); - } - - void removePointerAtIndex_(int index) { - _lib._objc_msgSend_469(_id, _lib._sel_removePointerAtIndex_1, index); - } - - void insertPointer_atIndex_(ffi.Pointer item, int index) { - _lib._objc_msgSend_22(_id, _lib._sel_insertPointer_atIndex_1, item, index); - } - - void replacePointerAtIndex_withPointer_( - int index, ffi.Pointer item) { - _lib._objc_msgSend_923( - _id, _lib._sel_replacePointerAtIndex_withPointer_1, index, item); - } - - void compact() { - _lib._objc_msgSend_1(_id, _lib._sel_compact1); - } - - int get count { - return _lib._objc_msgSend_10(_id, _lib._sel_count1); - } - - set count(int value) { - return _lib._objc_msgSend_515(_id, _lib._sel_setCount_1, value); - } - - static NSObject pointerArrayWithStrongObjects(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSPointerArray1, _lib._sel_pointerArrayWithStrongObjects1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject pointerArrayWithWeakObjects(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSPointerArray1, _lib._sel_pointerArrayWithWeakObjects1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSPointerArray strongObjectsPointerArray(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_924( - _lib._class_NSPointerArray1, _lib._sel_strongObjectsPointerArray1); - return NSPointerArray._(_ret, _lib, retain: true, release: true); - } - - static NSPointerArray weakObjectsPointerArray(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_924( - _lib._class_NSPointerArray1, _lib._sel_weakObjectsPointerArray1); - return NSPointerArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get allObjects { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_allObjects1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSPointerArray init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSPointerArray._(_ret, _lib, retain: true, release: true); - } - - static NSPointerArray new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPointerArray1, _lib._sel_new1); - return NSPointerArray._(_ret, _lib, retain: false, release: true); - } - - static NSPointerArray allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSPointerArray1, _lib._sel_allocWithZone_1, zone); - return NSPointerArray._(_ret, _lib, retain: false, release: true); - } - - static NSPointerArray alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPointerArray1, _lib._sel_alloc1); - return NSPointerArray._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSPointerArray1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSPointerArray1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSPointerArray1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSPointerArray1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSPointerArray1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSPointerArray1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSPointerArray1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSPointerArray1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSPointerArray1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSPointerFunctionsOptions { - static const int NSPointerFunctionsStrongMemory = 0; - static const int NSPointerFunctionsZeroingWeakMemory = 1; - static const int NSPointerFunctionsOpaqueMemory = 2; - static const int NSPointerFunctionsMallocMemory = 3; - static const int NSPointerFunctionsMachVirtualMemory = 4; - static const int NSPointerFunctionsWeakMemory = 5; - static const int NSPointerFunctionsObjectPersonality = 0; - static const int NSPointerFunctionsOpaquePersonality = 256; - static const int NSPointerFunctionsObjectPointerPersonality = 512; - static const int NSPointerFunctionsCStringPersonality = 768; - static const int NSPointerFunctionsStructPersonality = 1024; - static const int NSPointerFunctionsIntegerPersonality = 1280; - static const int NSPointerFunctionsCopyIn = 65536; -} - -class NSPointerFunctions extends NSObject { - NSPointerFunctions._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSPointerFunctions] that points to the same underlying object as [other]. - static NSPointerFunctions castFrom(T other) { - return NSPointerFunctions._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSPointerFunctions] that wraps the given raw object pointer. - static NSPointerFunctions castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSPointerFunctions._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSPointerFunctions]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSPointerFunctions1); - } - - NSPointerFunctions initWithOptions_(int options) { - final _ret = - _lib._objc_msgSend_904(_id, _lib._sel_initWithOptions_1, options); - return NSPointerFunctions._(_ret, _lib, retain: true, release: true); - } - - static NSPointerFunctions pointerFunctionsWithOptions_( - ThermionDartTexture1 _lib, int options) { - final _ret = _lib._objc_msgSend_905(_lib._class_NSPointerFunctions1, - _lib._sel_pointerFunctionsWithOptions_1, options); - return NSPointerFunctions._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>>)>> - get hashFunction { - return _lib._objc_msgSend_906(_id, _lib._sel_hashFunction1); - } - - set hashFunction( - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - value) { - return _lib._objc_msgSend_907(_id, _lib._sel_setHashFunction_1, value); - } - - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>>)>> - get isEqualFunction { - return _lib._objc_msgSend_908(_id, _lib._sel_isEqualFunction1); - } - - set isEqualFunction( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - value) { - return _lib._objc_msgSend_909(_id, _lib._sel_setIsEqualFunction_1, value); - } - - ffi.Pointer< - ffi.NativeFunction)>> - get sizeFunction { - return _lib._objc_msgSend_910(_id, _lib._sel_sizeFunction1); - } - - set sizeFunction( - ffi.Pointer< - ffi - .NativeFunction)>> - value) { - return _lib._objc_msgSend_911(_id, _lib._sel_setSizeFunction_1, value); - } - - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>> - get descriptionFunction { - return _lib._objc_msgSend_912(_id, _lib._sel_descriptionFunction1); - } - - set descriptionFunction( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>> - value) { - return _lib._objc_msgSend_913( - _id, _lib._sel_setDescriptionFunction_1, value); - } - - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>>)>> - get relinquishFunction { - return _lib._objc_msgSend_914(_id, _lib._sel_relinquishFunction1); - } - - set relinquishFunction( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>)>> - value) { - return _lib._objc_msgSend_915( - _id, _lib._sel_setRelinquishFunction_1, value); - } - - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer)>>, - ffi.Bool)>> get acquireFunction { - return _lib._objc_msgSend_916(_id, _lib._sel_acquireFunction1); - } - - set acquireFunction( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer)>>, - ffi.Bool)>> - value) { - return _lib._objc_msgSend_917(_id, _lib._sel_setAcquireFunction_1, value); - } - - bool get usesStrongWriteBarrier { - return _lib._objc_msgSend_12(_id, _lib._sel_usesStrongWriteBarrier1); - } - - set usesStrongWriteBarrier(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setUsesStrongWriteBarrier_1, value); - } - - bool get usesWeakReadAndWriteBarriers { - return _lib._objc_msgSend_12(_id, _lib._sel_usesWeakReadAndWriteBarriers1); - } - - set usesWeakReadAndWriteBarriers(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setUsesWeakReadAndWriteBarriers_1, value); - } - - @override - NSPointerFunctions init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSPointerFunctions._(_ret, _lib, retain: true, release: true); - } - - static NSPointerFunctions new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPointerFunctions1, _lib._sel_new1); - return NSPointerFunctions._(_ret, _lib, retain: false, release: true); - } - - static NSPointerFunctions allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSPointerFunctions1, _lib._sel_allocWithZone_1, zone); - return NSPointerFunctions._(_ret, _lib, retain: false, release: true); - } - - static NSPointerFunctions alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPointerFunctions1, _lib._sel_alloc1); - return NSPointerFunctions._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSPointerFunctions1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSPointerFunctions1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSPointerFunctions1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSPointerFunctions1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSPointerFunctions1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSPointerFunctions1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSPointerFunctions1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSPointerFunctions1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSPointerFunctions1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSProcessInfo extends NSObject { - NSProcessInfo._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSProcessInfo] that points to the same underlying object as [other]. - static NSProcessInfo castFrom(T other) { - return NSProcessInfo._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSProcessInfo] that wraps the given raw object pointer. - static NSProcessInfo castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSProcessInfo._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSProcessInfo]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProcessInfo1); - } - - static NSProcessInfo getProcessInfo(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_925( - _lib._class_NSProcessInfo1, _lib._sel_processInfo1); - return NSProcessInfo._(_ret, _lib, retain: true, release: true); - } - - NSDictionary get environment { - final _ret = _lib._objc_msgSend_180(_id, _lib._sel_environment1); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSArray get arguments { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_arguments1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString get hostName { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_hostName1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get processName { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_processName1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set processName(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setProcessName_1, value._id); - } - - int get processIdentifier { - return _lib._objc_msgSend_236(_id, _lib._sel_processIdentifier1); - } - - NSString get globallyUniqueString { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_globallyUniqueString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int operatingSystem() { - return _lib._objc_msgSend_10(_id, _lib._sel_operatingSystem1); - } - - NSString operatingSystemName() { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_operatingSystemName1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get operatingSystemVersionString { - final _ret = - _lib._objc_msgSend_21(_id, _lib._sel_operatingSystemVersionString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void getOperatingSystemVersion(ffi.Pointer stret) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_926_stret( - stret, _id, _lib._sel_operatingSystemVersion1) - : stret.ref = - _lib._objc_msgSend_926(_id, _lib._sel_operatingSystemVersion1); - } - - int get processorCount { - return _lib._objc_msgSend_10(_id, _lib._sel_processorCount1); - } - - int get activeProcessorCount { - return _lib._objc_msgSend_10(_id, _lib._sel_activeProcessorCount1); - } - - int get physicalMemory { - return _lib._objc_msgSend_163(_id, _lib._sel_physicalMemory1); - } - - bool isOperatingSystemAtLeastVersion_(NSOperatingSystemVersion version) { - return _lib._objc_msgSend_927( - _id, _lib._sel_isOperatingSystemAtLeastVersion_1, version); - } - - double get systemUptime { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_systemUptime1) - : _lib._objc_msgSend_164(_id, _lib._sel_systemUptime1); - } - - void disableSuddenTermination() { - _lib._objc_msgSend_1(_id, _lib._sel_disableSuddenTermination1); - } - - void enableSuddenTermination() { - _lib._objc_msgSend_1(_id, _lib._sel_enableSuddenTermination1); - } - - void disableAutomaticTermination_(NSString reason) { - _lib._objc_msgSend_247( - _id, _lib._sel_disableAutomaticTermination_1, reason._id); - } - - void enableAutomaticTermination_(NSString reason) { - _lib._objc_msgSend_247( - _id, _lib._sel_enableAutomaticTermination_1, reason._id); - } - - bool get automaticTerminationSupportEnabled { - return _lib._objc_msgSend_12( - _id, _lib._sel_automaticTerminationSupportEnabled1); - } - - set automaticTerminationSupportEnabled(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAutomaticTerminationSupportEnabled_1, value); - } - - NSObject beginActivityWithOptions_reason_(int options, NSString reason) { - final _ret = _lib._objc_msgSend_928( - _id, _lib._sel_beginActivityWithOptions_reason_1, options, reason._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - void endActivity_(NSObject activity) { - _lib._objc_msgSend_15(_id, _lib._sel_endActivity_1, activity._id); - } - - void performActivityWithOptions_reason_usingBlock_( - int options, NSString reason, ObjCBlock_ffiVoid block) { - _lib._objc_msgSend_929( - _id, - _lib._sel_performActivityWithOptions_reason_usingBlock_1, - options, - reason._id, - block._id); - } - - void performExpiringActivityWithReason_usingBlock_( - NSString reason, ObjCBlock_ffiVoid_bool block) { - _lib._objc_msgSend_930( - _id, - _lib._sel_performExpiringActivityWithReason_usingBlock_1, - reason._id, - block._id); - } - - NSString get userName { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_userName1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get fullUserName { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_fullUserName1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int get thermalState { - return _lib._objc_msgSend_931(_id, _lib._sel_thermalState1); - } - - bool get lowPowerModeEnabled { - return _lib._objc_msgSend_12(_id, _lib._sel_isLowPowerModeEnabled1); - } - - bool get macCatalystApp { - return _lib._objc_msgSend_12(_id, _lib._sel_isMacCatalystApp1); - } - - bool get iOSAppOnMac { - return _lib._objc_msgSend_12(_id, _lib._sel_isiOSAppOnMac1); - } - - @override - NSProcessInfo init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSProcessInfo._(_ret, _lib, retain: true, release: true); - } - - static NSProcessInfo new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSProcessInfo1, _lib._sel_new1); - return NSProcessInfo._(_ret, _lib, retain: false, release: true); - } - - static NSProcessInfo allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSProcessInfo1, _lib._sel_allocWithZone_1, zone); - return NSProcessInfo._(_ret, _lib, retain: false, release: true); - } - - static NSProcessInfo alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSProcessInfo1, _lib._sel_alloc1); - return NSProcessInfo._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSProcessInfo1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSProcessInfo1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSProcessInfo1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSProcessInfo1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSProcessInfo1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSProcessInfo1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSProcessInfo1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSProcessInfo1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSProcessInfo1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -final class NSOperatingSystemVersion extends ffi.Struct { - @ffi.Long() - external int majorVersion; - - @ffi.Long() - external int minorVersion; - - @ffi.Long() - external int patchVersion; -} - -abstract class NSActivityOptions { - static const int NSActivityIdleDisplaySleepDisabled = 1099511627776; - static const int NSActivityIdleSystemSleepDisabled = 1048576; - static const int NSActivitySuddenTerminationDisabled = 16384; - static const int NSActivityAutomaticTerminationDisabled = 32768; - static const int NSActivityAnimationTrackingEnabled = 35184372088832; - static const int NSActivityTrackingEnabled = 70368744177664; - static const int NSActivityUserInitiated = 16777215; - static const int NSActivityUserInitiatedAllowingIdleSystemSleep = 15728639; - static const int NSActivityBackground = 255; - static const int NSActivityLatencyCritical = 1095216660480; - static const int NSActivityUserInteractive = 1095233437695; -} - -void _ObjCBlock_ffiVoid_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, bool arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -final _ObjCBlock_ffiVoid_bool_closureRegistry = {}; -int _ObjCBlock_ffiVoid_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_bool_registerClosure( - void Function(bool) fn) { - final id = ++_ObjCBlock_ffiVoid_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, bool arg0) => - _ObjCBlock_ffiVoid_bool_closureRegistry[block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_bool._(ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_bool.fromFunctionPointer(ThermionDartTexture1 lib, - ffi.Pointer> ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Bool)>(_ObjCBlock_ffiVoid_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_bool.fromFunction( - ThermionDartTexture1 lib, void Function(bool) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Bool)>( - _ObjCBlock_ffiVoid_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_bool_registerClosure( - (bool arg0) => fn(arg0))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_bool.listener( - ThermionDartTexture1 lib, void Function(bool) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Bool)>.listener( - _ObjCBlock_ffiVoid_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_bool_registerClosure( - (bool arg0) => fn(arg0))), - lib); - static ffi - .NativeCallable, ffi.Bool)>? - _dartFuncListenerTrampoline; - - void call(bool arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0)>>() - .asFunction, bool)>()(_id, arg0); -} - -abstract class NSProcessInfoThermalState { - static const int NSProcessInfoThermalStateNominal = 0; - static const int NSProcessInfoThermalStateFair = 1; - static const int NSProcessInfoThermalStateSerious = 2; - static const int NSProcessInfoThermalStateCritical = 3; -} - -class NSTextCheckingResult extends NSObject { - NSTextCheckingResult._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSTextCheckingResult] that points to the same underlying object as [other]. - static NSTextCheckingResult castFrom(T other) { - return NSTextCheckingResult._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSTextCheckingResult] that wraps the given raw object pointer. - static NSTextCheckingResult castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSTextCheckingResult._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSTextCheckingResult]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSTextCheckingResult1); - } - - int get resultType { - return _lib._objc_msgSend_932(_id, _lib._sel_resultType1); - } - - void getRange(ffi.Pointer<_NSRange> stret) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_53_stret(stret, _id, _lib._sel_range1) - : stret.ref = _lib._objc_msgSend_53(_id, _lib._sel_range1); - } - - NSOrthography? get orthography { - final _ret = _lib._objc_msgSend_933(_id, _lib._sel_orthography1); - return _ret.address == 0 - ? null - : NSOrthography._(_ret, _lib, retain: true, release: true); - } - - NSArray? get grammarDetails { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_grammarDetails1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSDate? get date { - final _ret = _lib._objc_msgSend_182(_id, _lib._sel_date1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - NSTimeZone? get timeZone { - final _ret = _lib._objc_msgSend_768(_id, _lib._sel_timeZone1); - return _ret.address == 0 - ? null - : NSTimeZone._(_ret, _lib, retain: true, release: true); - } - - double get duration { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_duration1) - : _lib._objc_msgSend_164(_id, _lib._sel_duration1); - } - - NSDictionary? get components { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_components1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSURL? get URL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_URL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSString? get replacementString { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_replacementString1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray? get alternativeStrings { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_alternativeStrings1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSRegularExpression? get regularExpression { - final _ret = _lib._objc_msgSend_945(_id, _lib._sel_regularExpression1); - return _ret.address == 0 - ? null - : NSRegularExpression._(_ret, _lib, retain: true, release: true); - } - - NSString? get phoneNumber { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_phoneNumber1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - int get numberOfRanges { - return _lib._objc_msgSend_10(_id, _lib._sel_numberOfRanges1); - } - - void rangeAtIndex_(ffi.Pointer<_NSRange> stret, int idx) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_346_stret( - stret, _id, _lib._sel_rangeAtIndex_1, idx) - : stret.ref = - _lib._objc_msgSend_346(_id, _lib._sel_rangeAtIndex_1, idx); - } - - void rangeWithName_(ffi.Pointer<_NSRange> stret, NSString name) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_339_stret( - stret, _id, _lib._sel_rangeWithName_1, name._id) - : stret.ref = - _lib._objc_msgSend_339(_id, _lib._sel_rangeWithName_1, name._id); - } - - NSTextCheckingResult resultByAdjustingRangesWithOffset_(int offset) { - final _ret = _lib._objc_msgSend_946( - _id, _lib._sel_resultByAdjustingRangesWithOffset_1, offset); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? get addressComponents { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_addressComponents1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult orthographyCheckingResultWithRange_orthography_( - ThermionDartTexture1 _lib, _NSRange range, NSOrthography orthography) { - final _ret = _lib._objc_msgSend_947( - _lib._class_NSTextCheckingResult1, - _lib._sel_orthographyCheckingResultWithRange_orthography_1, - range, - orthography._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult spellCheckingResultWithRange_( - ThermionDartTexture1 _lib, _NSRange range) { - final _ret = _lib._objc_msgSend_948(_lib._class_NSTextCheckingResult1, - _lib._sel_spellCheckingResultWithRange_1, range); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult grammarCheckingResultWithRange_details_( - ThermionDartTexture1 _lib, _NSRange range, NSArray details) { - final _ret = _lib._objc_msgSend_949(_lib._class_NSTextCheckingResult1, - _lib._sel_grammarCheckingResultWithRange_details_1, range, details._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult dateCheckingResultWithRange_date_( - ThermionDartTexture1 _lib, _NSRange range, NSDate date) { - final _ret = _lib._objc_msgSend_950(_lib._class_NSTextCheckingResult1, - _lib._sel_dateCheckingResultWithRange_date_1, range, date._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult - dateCheckingResultWithRange_date_timeZone_duration_( - ThermionDartTexture1 _lib, - _NSRange range, - NSDate date, - NSTimeZone timeZone, - double duration) { - final _ret = _lib._objc_msgSend_951( - _lib._class_NSTextCheckingResult1, - _lib._sel_dateCheckingResultWithRange_date_timeZone_duration_1, - range, - date._id, - timeZone._id, - duration); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult addressCheckingResultWithRange_components_( - ThermionDartTexture1 _lib, _NSRange range, NSDictionary components) { - final _ret = _lib._objc_msgSend_952( - _lib._class_NSTextCheckingResult1, - _lib._sel_addressCheckingResultWithRange_components_1, - range, - components._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult linkCheckingResultWithRange_URL_( - ThermionDartTexture1 _lib, _NSRange range, NSURL url) { - final _ret = _lib._objc_msgSend_953(_lib._class_NSTextCheckingResult1, - _lib._sel_linkCheckingResultWithRange_URL_1, range, url._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult quoteCheckingResultWithRange_replacementString_( - ThermionDartTexture1 _lib, _NSRange range, NSString replacementString) { - final _ret = _lib._objc_msgSend_954( - _lib._class_NSTextCheckingResult1, - _lib._sel_quoteCheckingResultWithRange_replacementString_1, - range, - replacementString._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult dashCheckingResultWithRange_replacementString_( - ThermionDartTexture1 _lib, _NSRange range, NSString replacementString) { - final _ret = _lib._objc_msgSend_954( - _lib._class_NSTextCheckingResult1, - _lib._sel_dashCheckingResultWithRange_replacementString_1, - range, - replacementString._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult - replacementCheckingResultWithRange_replacementString_( - ThermionDartTexture1 _lib, - _NSRange range, - NSString replacementString) { - final _ret = _lib._objc_msgSend_954( - _lib._class_NSTextCheckingResult1, - _lib._sel_replacementCheckingResultWithRange_replacementString_1, - range, - replacementString._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult - correctionCheckingResultWithRange_replacementString_( - ThermionDartTexture1 _lib, - _NSRange range, - NSString replacementString) { - final _ret = _lib._objc_msgSend_954( - _lib._class_NSTextCheckingResult1, - _lib._sel_correctionCheckingResultWithRange_replacementString_1, - range, - replacementString._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult - correctionCheckingResultWithRange_replacementString_alternativeStrings_( - ThermionDartTexture1 _lib, - _NSRange range, - NSString replacementString, - NSArray alternativeStrings) { - final _ret = _lib._objc_msgSend_955( - _lib._class_NSTextCheckingResult1, - _lib._sel_correctionCheckingResultWithRange_replacementString_alternativeStrings_1, - range, - replacementString._id, - alternativeStrings._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult - regularExpressionCheckingResultWithRanges_count_regularExpression_( - ThermionDartTexture1 _lib, - ffi.Pointer<_NSRange> ranges, - int count, - NSRegularExpression regularExpression) { - final _ret = _lib._objc_msgSend_956( - _lib._class_NSTextCheckingResult1, - _lib._sel_regularExpressionCheckingResultWithRanges_count_regularExpression_1, - ranges, - count, - regularExpression._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult phoneNumberCheckingResultWithRange_phoneNumber_( - ThermionDartTexture1 _lib, _NSRange range, NSString phoneNumber) { - final _ret = _lib._objc_msgSend_954( - _lib._class_NSTextCheckingResult1, - _lib._sel_phoneNumberCheckingResultWithRange_phoneNumber_1, - range, - phoneNumber._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult - transitInformationCheckingResultWithRange_components_( - ThermionDartTexture1 _lib, _NSRange range, NSDictionary components) { - final _ret = _lib._objc_msgSend_952( - _lib._class_NSTextCheckingResult1, - _lib._sel_transitInformationCheckingResultWithRange_components_1, - range, - components._id); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - @override - NSTextCheckingResult init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - static NSTextCheckingResult new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSTextCheckingResult1, _lib._sel_new1); - return NSTextCheckingResult._(_ret, _lib, retain: false, release: true); - } - - static NSTextCheckingResult allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSTextCheckingResult1, _lib._sel_allocWithZone_1, zone); - return NSTextCheckingResult._(_ret, _lib, retain: false, release: true); - } - - static NSTextCheckingResult alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSTextCheckingResult1, _lib._sel_alloc1); - return NSTextCheckingResult._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSTextCheckingResult1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSTextCheckingResult1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSTextCheckingResult1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSTextCheckingResult1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSTextCheckingResult1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSTextCheckingResult1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSTextCheckingResult1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSTextCheckingResult1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSTextCheckingResult1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSTextCheckingType { - static const int NSTextCheckingTypeOrthography = 1; - static const int NSTextCheckingTypeSpelling = 2; - static const int NSTextCheckingTypeGrammar = 4; - static const int NSTextCheckingTypeDate = 8; - static const int NSTextCheckingTypeAddress = 16; - static const int NSTextCheckingTypeLink = 32; - static const int NSTextCheckingTypeQuote = 64; - static const int NSTextCheckingTypeDash = 128; - static const int NSTextCheckingTypeReplacement = 256; - static const int NSTextCheckingTypeCorrection = 512; - static const int NSTextCheckingTypeRegularExpression = 1024; - static const int NSTextCheckingTypePhoneNumber = 2048; - static const int NSTextCheckingTypeTransitInformation = 4096; -} - -class NSRegularExpression extends NSObject { - NSRegularExpression._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSRegularExpression] that points to the same underlying object as [other]. - static NSRegularExpression castFrom(T other) { - return NSRegularExpression._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSRegularExpression] that wraps the given raw object pointer. - static NSRegularExpression castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSRegularExpression._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSRegularExpression]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSRegularExpression1); - } - - static NSRegularExpression? regularExpressionWithPattern_options_error_( - ThermionDartTexture1 _lib, - NSString pattern, - int options, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_934( - _lib._class_NSRegularExpression1, - _lib._sel_regularExpressionWithPattern_options_error_1, - pattern._id, - options, - error); - return _ret.address == 0 - ? null - : NSRegularExpression._(_ret, _lib, retain: true, release: true); - } - - NSRegularExpression? initWithPattern_options_error_(NSString pattern, - int options, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_935(_id, - _lib._sel_initWithPattern_options_error_1, pattern._id, options, error); - return _ret.address == 0 - ? null - : NSRegularExpression._(_ret, _lib, retain: true, release: true); - } - - NSString get pattern { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_pattern1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int get options { - return _lib._objc_msgSend_936(_id, _lib._sel_options1); - } - - int get numberOfCaptureGroups { - return _lib._objc_msgSend_10(_id, _lib._sel_numberOfCaptureGroups1); - } - - static NSString escapedPatternForString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_68(_lib._class_NSRegularExpression1, - _lib._sel_escapedPatternForString_1, string._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void enumerateMatchesInString_options_range_usingBlock_( - NSString string, - int options, - _NSRange range, - ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool block) { - _lib._objc_msgSend_937( - _id, - _lib._sel_enumerateMatchesInString_options_range_usingBlock_1, - string._id, - options, - range, - block._id); - } - - NSArray matchesInString_options_range_( - NSString string, int options, _NSRange range) { - final _ret = _lib._objc_msgSend_938(_id, - _lib._sel_matchesInString_options_range_1, string._id, options, range); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - int numberOfMatchesInString_options_range_( - NSString string, int options, _NSRange range) { - return _lib._objc_msgSend_939( - _id, - _lib._sel_numberOfMatchesInString_options_range_1, - string._id, - options, - range); - } - - NSTextCheckingResult? firstMatchInString_options_range_( - NSString string, int options, _NSRange range) { - final _ret = _lib._objc_msgSend_940( - _id, - _lib._sel_firstMatchInString_options_range_1, - string._id, - options, - range); - return _ret.address == 0 - ? null - : NSTextCheckingResult._(_ret, _lib, retain: true, release: true); - } - - void rangeOfFirstMatchInString_options_range_(ffi.Pointer<_NSRange> stret, - NSString string, int options, _NSRange range) { - _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_941_stret( - stret, - _id, - _lib._sel_rangeOfFirstMatchInString_options_range_1, - string._id, - options, - range) - : stret.ref = _lib._objc_msgSend_941( - _id, - _lib._sel_rangeOfFirstMatchInString_options_range_1, - string._id, - options, - range); - } - - NSString stringByReplacingMatchesInString_options_range_withTemplate_( - NSString string, int options, _NSRange range, NSString templ) { - final _ret = _lib._objc_msgSend_942( - _id, - _lib._sel_stringByReplacingMatchesInString_options_range_withTemplate_1, - string._id, - options, - range, - templ._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int replaceMatchesInString_options_range_withTemplate_( - NSMutableString string, int options, _NSRange range, NSString templ) { - return _lib._objc_msgSend_943( - _id, - _lib._sel_replaceMatchesInString_options_range_withTemplate_1, - string._id, - options, - range, - templ._id); - } - - NSString replacementStringForResult_inString_offset_template_( - NSTextCheckingResult result, - NSString string, - int offset, - NSString templ) { - final _ret = _lib._objc_msgSend_944( - _id, - _lib._sel_replacementStringForResult_inString_offset_template_1, - result._id, - string._id, - offset, - templ._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString escapedTemplateForString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_68(_lib._class_NSRegularExpression1, - _lib._sel_escapedTemplateForString_1, string._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - @override - NSRegularExpression init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSRegularExpression._(_ret, _lib, retain: true, release: true); - } - - static NSRegularExpression new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSRegularExpression1, _lib._sel_new1); - return NSRegularExpression._(_ret, _lib, retain: false, release: true); - } - - static NSRegularExpression allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSRegularExpression1, _lib._sel_allocWithZone_1, zone); - return NSRegularExpression._(_ret, _lib, retain: false, release: true); - } - - static NSRegularExpression alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSRegularExpression1, _lib._sel_alloc1); - return NSRegularExpression._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSRegularExpression1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSRegularExpression1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSRegularExpression1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSRegularExpression1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSRegularExpression1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSRegularExpression1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSRegularExpression1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSRegularExpression1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSRegularExpression1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSRegularExpressionOptions { - static const int NSRegularExpressionCaseInsensitive = 1; - static const int NSRegularExpressionAllowCommentsAndWhitespace = 2; - static const int NSRegularExpressionIgnoreMetacharacters = 4; - static const int NSRegularExpressionDotMatchesLineSeparators = 8; - static const int NSRegularExpressionAnchorsMatchLines = 16; - static const int NSRegularExpressionUseUnixLineSeparators = 32; - static const int NSRegularExpressionUseUnicodeWordBoundaries = 64; -} - -abstract class NSMatchingOptions { - static const int NSMatchingReportProgress = 1; - static const int NSMatchingReportCompletion = 2; - static const int NSMatchingAnchored = 4; - static const int NSMatchingWithTransparentBounds = 8; - static const int NSMatchingWithoutAnchoringBounds = 16; -} - -void - _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Int32 arg1, ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, int, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureRegistry = - , int, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_registerClosure( - void Function(ffi.Pointer, int, ffi.Pointer) fn) { - final id = - ++_ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureRegistry[ - id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Int32 arg1, ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool.fromFunction( - ThermionDartTexture1 lib, - void Function(NSTextCheckingResult?, int, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_registerClosure( - (ffi.Pointer arg0, int arg1, - ffi.Pointer arg2) => - fn(arg0.address == 0 ? null : NSTextCheckingResult._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool.listener( - ThermionDartTexture1 lib, - void Function(NSTextCheckingResult?, int, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_registerClosure( - (ffi.Pointer arg0, int arg1, - ffi.Pointer arg2) => - fn(arg0.address == 0 ? null : NSTextCheckingResult._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Int32, ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSTextCheckingResult? arg0, int arg1, ffi.Pointer arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, int, ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1, arg2); -} - -abstract class NSMatchingFlags { - static const int NSMatchingProgress = 1; - static const int NSMatchingCompleted = 2; - static const int NSMatchingHitEnd = 4; - static const int NSMatchingRequiredEnd = 8; - static const int NSMatchingInternalError = 16; -} - -class NSURLCache extends NSObject { - NSURLCache._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLCache] that points to the same underlying object as [other]. - static NSURLCache castFrom(T other) { - return NSURLCache._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSURLCache] that wraps the given raw object pointer. - static NSURLCache castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLCache._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLCache]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLCache1); - } - - static NSURLCache getSharedURLCache(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_957( - _lib._class_NSURLCache1, _lib._sel_sharedURLCache1); - return NSURLCache._(_ret, _lib, retain: true, release: true); - } - - static void setSharedURLCache(ThermionDartTexture1 _lib, NSURLCache value) { - return _lib._objc_msgSend_958( - _lib._class_NSURLCache1, _lib._sel_setSharedURLCache_1, value._id); - } - - NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( - int memoryCapacity, int diskCapacity, NSString? path) { - final _ret = _lib._objc_msgSend_959( - _id, - _lib._sel_initWithMemoryCapacity_diskCapacity_diskPath_1, - memoryCapacity, - diskCapacity, - path?._id ?? ffi.nullptr); - return NSURLCache._(_ret, _lib, retain: true, release: true); - } - - NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( - int memoryCapacity, int diskCapacity, NSURL? directoryURL) { - final _ret = _lib._objc_msgSend_960( - _id, - _lib._sel_initWithMemoryCapacity_diskCapacity_directoryURL_1, - memoryCapacity, - diskCapacity, - directoryURL?._id ?? ffi.nullptr); - return NSURLCache._(_ret, _lib, retain: true, release: true); - } - - NSCachedURLResponse? cachedResponseForRequest_(NSURLRequest request) { - final _ret = _lib._objc_msgSend_965( - _id, _lib._sel_cachedResponseForRequest_1, request._id); - return _ret.address == 0 - ? null - : NSCachedURLResponse._(_ret, _lib, retain: true, release: true); - } - - void storeCachedResponse_forRequest_( - NSCachedURLResponse cachedResponse, NSURLRequest request) { - _lib._objc_msgSend_966(_id, _lib._sel_storeCachedResponse_forRequest_1, - cachedResponse._id, request._id); - } - - void removeCachedResponseForRequest_(NSURLRequest request) { - _lib._objc_msgSend_967( - _id, _lib._sel_removeCachedResponseForRequest_1, request._id); - } - - void removeAllCachedResponses() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllCachedResponses1); - } - - void removeCachedResponsesSinceDate_(NSDate date) { - _lib._objc_msgSend_539( - _id, _lib._sel_removeCachedResponsesSinceDate_1, date._id); - } - - int get memoryCapacity { - return _lib._objc_msgSend_10(_id, _lib._sel_memoryCapacity1); - } - - set memoryCapacity(int value) { - return _lib._objc_msgSend_515(_id, _lib._sel_setMemoryCapacity_1, value); - } - - int get diskCapacity { - return _lib._objc_msgSend_10(_id, _lib._sel_diskCapacity1); - } - - set diskCapacity(int value) { - return _lib._objc_msgSend_515(_id, _lib._sel_setDiskCapacity_1, value); - } - - int get currentMemoryUsage { - return _lib._objc_msgSend_10(_id, _lib._sel_currentMemoryUsage1); - } - - int get currentDiskUsage { - return _lib._objc_msgSend_10(_id, _lib._sel_currentDiskUsage1); - } - - void storeCachedResponse_forDataTask_( - NSCachedURLResponse cachedResponse, NSURLSessionDataTask dataTask) { - _lib._objc_msgSend_968(_id, _lib._sel_storeCachedResponse_forDataTask_1, - cachedResponse._id, dataTask._id); - } - - void getCachedResponseForDataTask_completionHandler_( - NSURLSessionDataTask dataTask, - ObjCBlock_ffiVoid_NSCachedURLResponse completionHandler) { - _lib._objc_msgSend_969( - _id, - _lib._sel_getCachedResponseForDataTask_completionHandler_1, - dataTask._id, - completionHandler._id); - } - - void removeCachedResponseForDataTask_(NSURLSessionDataTask dataTask) { - _lib._objc_msgSend_970( - _id, _lib._sel_removeCachedResponseForDataTask_1, dataTask._id); - } - - @override - NSURLCache init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLCache._(_ret, _lib, retain: true, release: true); - } - - static NSURLCache new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLCache1, _lib._sel_new1); - return NSURLCache._(_ret, _lib, retain: false, release: true); - } - - static NSURLCache allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLCache1, _lib._sel_allocWithZone_1, zone); - return NSURLCache._(_ret, _lib, retain: false, release: true); - } - - static NSURLCache alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLCache1, _lib._sel_alloc1); - return NSURLCache._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLCache1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLCache1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLCache1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLCache1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLCache1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLCache1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLCache1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSURLCache1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLCache1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSCachedURLResponse extends NSObject { - NSCachedURLResponse._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSCachedURLResponse] that points to the same underlying object as [other]. - static NSCachedURLResponse castFrom(T other) { - return NSCachedURLResponse._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSCachedURLResponse] that wraps the given raw object pointer. - static NSCachedURLResponse castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSCachedURLResponse._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSCachedURLResponse]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSCachedURLResponse1); - } - - NSCachedURLResponse initWithResponse_data_( - NSURLResponse response, NSData data) { - final _ret = _lib._objc_msgSend_961( - _id, _lib._sel_initWithResponse_data_1, response._id, data._id); - return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); - } - - NSCachedURLResponse initWithResponse_data_userInfo_storagePolicy_( - NSURLResponse response, - NSData data, - NSDictionary? userInfo, - int storagePolicy) { - final _ret = _lib._objc_msgSend_962( - _id, - _lib._sel_initWithResponse_data_userInfo_storagePolicy_1, - response._id, - data._id, - userInfo?._id ?? ffi.nullptr, - storagePolicy); - return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); - } - - NSURLResponse get response { - final _ret = _lib._objc_msgSend_963(_id, _lib._sel_response1); - return NSURLResponse._(_ret, _lib, retain: true, release: true); - } - - NSData get data { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_data1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? get userInfo { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_userInfo1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - int get storagePolicy { - return _lib._objc_msgSend_964(_id, _lib._sel_storagePolicy1); - } - - @override - NSCachedURLResponse init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); - } - - static NSCachedURLResponse new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSCachedURLResponse1, _lib._sel_new1); - return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); - } - - static NSCachedURLResponse allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSCachedURLResponse1, _lib._sel_allocWithZone_1, zone); - return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); - } - - static NSCachedURLResponse alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSCachedURLResponse1, _lib._sel_alloc1); - return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSCachedURLResponse1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSCachedURLResponse1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSCachedURLResponse1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSCachedURLResponse1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSCachedURLResponse1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSCachedURLResponse1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSCachedURLResponse1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSCachedURLResponse1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSCachedURLResponse1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSURLCacheStoragePolicy { - static const int NSURLCacheStorageAllowed = 0; - static const int NSURLCacheStorageAllowedInMemoryOnly = 1; - static const int NSURLCacheStorageNotAllowed = 2; -} - -class NSURLSessionDataTask extends NSURLSessionTask { - NSURLSessionDataTask._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSessionDataTask] that points to the same underlying object as [other]. - static NSURLSessionDataTask castFrom(T other) { - return NSURLSessionDataTask._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLSessionDataTask] that wraps the given raw object pointer. - static NSURLSessionDataTask castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionDataTask._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLSessionDataTask]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLSessionDataTask1); - } - - @override - NSURLSessionDataTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionDataTask new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLSessionDataTask1, _lib._sel_new1); - return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionDataTask allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionDataTask1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionDataTask alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionDataTask1, _lib._sel_alloc1); - return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLSessionDataTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLSessionDataTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLSessionDataTask1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLSessionDataTask1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLSessionDataTask1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLSessionDataTask1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLSessionDataTask1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLSessionDataTask1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionDataTask1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_NSCachedURLResponse extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSCachedURLResponse._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSCachedURLResponse.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSCachedURLResponse.fromFunction( - ThermionDartTexture1 lib, void Function(NSCachedURLResponse?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSCachedURLResponse_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSCachedURLResponse._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSCachedURLResponse.listener( - ThermionDartTexture1 lib, void Function(NSCachedURLResponse?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSCachedURLResponse_registerClosure( - (ffi.Pointer arg0) => fn( - arg0.address == 0 ? null : NSCachedURLResponse._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSCachedURLResponse? arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0?._id ?? ffi.nullptr); -} - -class NSURLConnection extends NSObject { - NSURLConnection._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLConnection] that points to the same underlying object as [other]. - static NSURLConnection castFrom(T other) { - return NSURLConnection._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLConnection] that wraps the given raw object pointer. - static NSURLConnection castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLConnection._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLConnection]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLConnection1); - } - - NSURLConnection? initWithRequest_delegate_startImmediately_( - NSURLRequest request, NSObject? delegate, bool startImmediately) { - final _ret = _lib._objc_msgSend_971( - _id, - _lib._sel_initWithRequest_delegate_startImmediately_1, - request._id, - delegate?._id ?? ffi.nullptr, - startImmediately); - return _ret.address == 0 - ? null - : NSURLConnection._(_ret, _lib, retain: true, release: true); - } - - NSURLConnection? initWithRequest_delegate_( - NSURLRequest request, NSObject? delegate) { - final _ret = _lib._objc_msgSend_972( - _id, - _lib._sel_initWithRequest_delegate_1, - request._id, - delegate?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURLConnection._(_ret, _lib, retain: true, release: true); - } - - static NSURLConnection? connectionWithRequest_delegate_( - ThermionDartTexture1 _lib, NSURLRequest request, NSObject? delegate) { - final _ret = _lib._objc_msgSend_973( - _lib._class_NSURLConnection1, - _lib._sel_connectionWithRequest_delegate_1, - request._id, - delegate?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURLConnection._(_ret, _lib, retain: true, release: true); - } - - NSURLRequest get originalRequest { - final _ret = _lib._objc_msgSend_974(_id, _lib._sel_originalRequest1); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - NSURLRequest get currentRequest { - final _ret = _lib._objc_msgSend_974(_id, _lib._sel_currentRequest1); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - void start() { - _lib._objc_msgSend_1(_id, _lib._sel_start1); - } - - void cancel() { - _lib._objc_msgSend_1(_id, _lib._sel_cancel1); - } - - void scheduleInRunLoop_forMode_(NSRunLoop aRunLoop, NSString mode) { - _lib._objc_msgSend_568( - _id, _lib._sel_scheduleInRunLoop_forMode_1, aRunLoop._id, mode._id); - } - - void unscheduleFromRunLoop_forMode_(NSRunLoop aRunLoop, NSString mode) { - _lib._objc_msgSend_568( - _id, _lib._sel_unscheduleFromRunLoop_forMode_1, aRunLoop._id, mode._id); - } - - void setDelegateQueue_(NSOperationQueue? queue) { - _lib._objc_msgSend_975( - _id, _lib._sel_setDelegateQueue_1, queue?._id ?? ffi.nullptr); - } - - static bool canHandleRequest_( - ThermionDartTexture1 _lib, NSURLRequest request) { - return _lib._objc_msgSend_976(_lib._class_NSURLConnection1, - _lib._sel_canHandleRequest_1, request._id); - } - - static NSData? sendSynchronousRequest_returningResponse_error_( - ThermionDartTexture1 _lib, - NSURLRequest request, - ffi.Pointer> response, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_977( - _lib._class_NSURLConnection1, - _lib._sel_sendSynchronousRequest_returningResponse_error_1, - request._id, - response, - error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - static void sendAsynchronousRequest_queue_completionHandler_( - ThermionDartTexture1 _lib, - NSURLRequest request, - NSOperationQueue queue, - ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError handler) { - _lib._objc_msgSend_978( - _lib._class_NSURLConnection1, - _lib._sel_sendAsynchronousRequest_queue_completionHandler_1, - request._id, - queue._id, - handler._id); - } - - @override - NSURLConnection init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLConnection._(_ret, _lib, retain: true, release: true); - } - - static NSURLConnection new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLConnection1, _lib._sel_new1); - return NSURLConnection._(_ret, _lib, retain: false, release: true); - } - - static NSURLConnection allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLConnection1, _lib._sel_allocWithZone_1, zone); - return NSURLConnection._(_ret, _lib, retain: false, release: true); - } - - static NSURLConnection alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLConnection1, _lib._sel_alloc1); - return NSURLConnection._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLConnection1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLConnection1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLConnection1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLConnection1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLConnection1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLConnection1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLConnection1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLConnection1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLConnection1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError.fromFunction( - ThermionDartTexture1 lib, - void Function(NSURLResponse?, NSData?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 - ? null - : NSURLResponse._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSData._(arg1, lib, retain: true, release: true), - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError.listener( - ThermionDartTexture1 lib, - void Function(NSURLResponse?, NSData?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 - ? null - : NSURLResponse._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSData._(arg1, lib, retain: true, release: true), - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSURLResponse? arg0, NSData? arg1, NSError? arg2) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - _id, - arg0?._id ?? ffi.nullptr, - arg1?._id ?? ffi.nullptr, - arg2?._id ?? ffi.nullptr); -} - -class NSURLCredential extends NSObject { - NSURLCredential._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLCredential] that points to the same underlying object as [other]. - static NSURLCredential castFrom(T other) { - return NSURLCredential._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLCredential] that wraps the given raw object pointer. - static NSURLCredential castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLCredential._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLCredential]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLCredential1); - } - - int get persistence { - return _lib._objc_msgSend_979(_id, _lib._sel_persistence1); - } - - NSURLCredential initWithUser_password_persistence_( - NSString user, NSString password, int persistence) { - final _ret = _lib._objc_msgSend_980( - _id, - _lib._sel_initWithUser_password_persistence_1, - user._id, - password._id, - persistence); - return NSURLCredential._(_ret, _lib, retain: true, release: true); - } - - static NSURLCredential credentialWithUser_password_persistence_( - ThermionDartTexture1 _lib, - NSString user, - NSString password, - int persistence) { - final _ret = _lib._objc_msgSend_981( - _lib._class_NSURLCredential1, - _lib._sel_credentialWithUser_password_persistence_1, - user._id, - password._id, - persistence); - return NSURLCredential._(_ret, _lib, retain: true, release: true); - } - - NSString? get user { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_user1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get password { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_password1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool get hasPassword { - return _lib._objc_msgSend_12(_id, _lib._sel_hasPassword1); - } - - NSURLCredential initWithIdentity_certificates_persistence_( - ffi.Pointer<__SecIdentity> identity, - NSArray? certArray, - int persistence) { - final _ret = _lib._objc_msgSend_982( - _id, - _lib._sel_initWithIdentity_certificates_persistence_1, - identity, - certArray?._id ?? ffi.nullptr, - persistence); - return NSURLCredential._(_ret, _lib, retain: true, release: true); - } - - static NSURLCredential credentialWithIdentity_certificates_persistence_( - ThermionDartTexture1 _lib, - ffi.Pointer<__SecIdentity> identity, - NSArray? certArray, - int persistence) { - final _ret = _lib._objc_msgSend_983( - _lib._class_NSURLCredential1, - _lib._sel_credentialWithIdentity_certificates_persistence_1, - identity, - certArray?._id ?? ffi.nullptr, - persistence); - return NSURLCredential._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer<__SecIdentity> get identity { - return _lib._objc_msgSend_984(_id, _lib._sel_identity1); - } - - NSArray get certificates { - final _ret = _lib._objc_msgSend_84(_id, _lib._sel_certificates1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSURLCredential initWithTrust_(ffi.Pointer<__SecTrust> trust) { - final _ret = _lib._objc_msgSend_985(_id, _lib._sel_initWithTrust_1, trust); - return NSURLCredential._(_ret, _lib, retain: true, release: true); - } - - static NSURLCredential credentialForTrust_( - ThermionDartTexture1 _lib, ffi.Pointer<__SecTrust> trust) { - final _ret = _lib._objc_msgSend_986( - _lib._class_NSURLCredential1, _lib._sel_credentialForTrust_1, trust); - return NSURLCredential._(_ret, _lib, retain: true, release: true); - } - - @override - NSURLCredential init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLCredential._(_ret, _lib, retain: true, release: true); - } - - static NSURLCredential new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLCredential1, _lib._sel_new1); - return NSURLCredential._(_ret, _lib, retain: false, release: true); - } - - static NSURLCredential allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLCredential1, _lib._sel_allocWithZone_1, zone); - return NSURLCredential._(_ret, _lib, retain: false, release: true); - } - - static NSURLCredential alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLCredential1, _lib._sel_alloc1); - return NSURLCredential._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLCredential1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLCredential1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLCredential1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLCredential1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLCredential1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLCredential1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLCredential1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLCredential1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLCredential1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSURLCredentialPersistence { - static const int NSURLCredentialPersistenceNone = 0; - static const int NSURLCredentialPersistenceForSession = 1; - static const int NSURLCredentialPersistencePermanent = 2; - static const int NSURLCredentialPersistenceSynchronizable = 3; -} - -final class __SecIdentity extends ffi.Opaque {} - -final class __SecTrust extends ffi.Opaque {} - -class NSURLProtectionSpace extends NSObject { - NSURLProtectionSpace._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLProtectionSpace] that points to the same underlying object as [other]. - static NSURLProtectionSpace castFrom(T other) { - return NSURLProtectionSpace._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLProtectionSpace] that wraps the given raw object pointer. - static NSURLProtectionSpace castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLProtectionSpace._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLProtectionSpace]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLProtectionSpace1); - } - - NSURLProtectionSpace initWithHost_port_protocol_realm_authenticationMethod_( - NSString host, - int port, - NSString? protocol, - NSString? realm, - NSString? authenticationMethod) { - final _ret = _lib._objc_msgSend_987( - _id, - _lib._sel_initWithHost_port_protocol_realm_authenticationMethod_1, - host._id, - port, - protocol?._id ?? ffi.nullptr, - realm?._id ?? ffi.nullptr, - authenticationMethod?._id ?? ffi.nullptr); - return NSURLProtectionSpace._(_ret, _lib, retain: true, release: true); - } - - NSURLProtectionSpace initWithProxyHost_port_type_realm_authenticationMethod_( - NSString host, - int port, - NSString? type, - NSString? realm, - NSString? authenticationMethod) { - final _ret = _lib._objc_msgSend_987( - _id, - _lib._sel_initWithProxyHost_port_type_realm_authenticationMethod_1, - host._id, - port, - type?._id ?? ffi.nullptr, - realm?._id ?? ffi.nullptr, - authenticationMethod?._id ?? ffi.nullptr); - return NSURLProtectionSpace._(_ret, _lib, retain: true, release: true); - } - - NSString? get realm { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_realm1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool get receivesCredentialSecurely { - return _lib._objc_msgSend_12(_id, _lib._sel_receivesCredentialSecurely1); - } - - bool get isProxy { - return _lib._objc_msgSend_12(_id, _lib._sel_isProxy1); - } - - NSString get host { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_host1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int get port { - return _lib._objc_msgSend_82(_id, _lib._sel_port1); - } - - NSString? get proxyType { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_proxyType1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get protocol { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_protocol1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get authenticationMethod { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_authenticationMethod1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray? get distinguishedNames { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_distinguishedNames1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer<__SecTrust> get serverTrust { - return _lib._objc_msgSend_988(_id, _lib._sel_serverTrust1); - } - - @override - NSURLProtectionSpace init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLProtectionSpace._(_ret, _lib, retain: true, release: true); - } - - static NSURLProtectionSpace new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLProtectionSpace1, _lib._sel_new1); - return NSURLProtectionSpace._(_ret, _lib, retain: false, release: true); - } - - static NSURLProtectionSpace allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLProtectionSpace1, _lib._sel_allocWithZone_1, zone); - return NSURLProtectionSpace._(_ret, _lib, retain: false, release: true); - } - - static NSURLProtectionSpace alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLProtectionSpace1, _lib._sel_alloc1); - return NSURLProtectionSpace._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLProtectionSpace1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLProtectionSpace1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLProtectionSpace1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLProtectionSpace1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLProtectionSpace1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLProtectionSpace1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLProtectionSpace1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLProtectionSpace1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLProtectionSpace1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSURLCredentialStorage extends NSObject { - NSURLCredentialStorage._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLCredentialStorage] that points to the same underlying object as [other]. - static NSURLCredentialStorage castFrom(T other) { - return NSURLCredentialStorage._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLCredentialStorage] that wraps the given raw object pointer. - static NSURLCredentialStorage castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLCredentialStorage._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLCredentialStorage]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLCredentialStorage1); - } - - static NSURLCredentialStorage getSharedCredentialStorage( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_989(_lib._class_NSURLCredentialStorage1, - _lib._sel_sharedCredentialStorage1); - return NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? credentialsForProtectionSpace_(NSURLProtectionSpace space) { - final _ret = _lib._objc_msgSend_990( - _id, _lib._sel_credentialsForProtectionSpace_1, space._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary get allCredentials { - final _ret = _lib._objc_msgSend_180(_id, _lib._sel_allCredentials1); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - void setCredential_forProtectionSpace_( - NSURLCredential credential, NSURLProtectionSpace space) { - _lib._objc_msgSend_991(_id, _lib._sel_setCredential_forProtectionSpace_1, - credential._id, space._id); - } - - void removeCredential_forProtectionSpace_( - NSURLCredential credential, NSURLProtectionSpace space) { - _lib._objc_msgSend_991(_id, _lib._sel_removeCredential_forProtectionSpace_1, - credential._id, space._id); - } - - void removeCredential_forProtectionSpace_options_(NSURLCredential credential, - NSURLProtectionSpace space, NSDictionary? options) { - _lib._objc_msgSend_992( - _id, - _lib._sel_removeCredential_forProtectionSpace_options_1, - credential._id, - space._id, - options?._id ?? ffi.nullptr); - } - - NSURLCredential? defaultCredentialForProtectionSpace_( - NSURLProtectionSpace space) { - final _ret = _lib._objc_msgSend_993( - _id, _lib._sel_defaultCredentialForProtectionSpace_1, space._id); - return _ret.address == 0 - ? null - : NSURLCredential._(_ret, _lib, retain: true, release: true); - } - - void setDefaultCredential_forProtectionSpace_( - NSURLCredential credential, NSURLProtectionSpace space) { - _lib._objc_msgSend_991( - _id, - _lib._sel_setDefaultCredential_forProtectionSpace_1, - credential._id, - space._id); - } - - void getCredentialsForProtectionSpace_task_completionHandler_( - NSURLProtectionSpace protectionSpace, - NSURLSessionTask task, - ObjCBlock_ffiVoid_NSDictionary completionHandler) { - _lib._objc_msgSend_994( - _id, - _lib._sel_getCredentialsForProtectionSpace_task_completionHandler_1, - protectionSpace._id, - task._id, - completionHandler._id); - } - - void setCredential_forProtectionSpace_task_(NSURLCredential credential, - NSURLProtectionSpace protectionSpace, NSURLSessionTask task) { - _lib._objc_msgSend_995( - _id, - _lib._sel_setCredential_forProtectionSpace_task_1, - credential._id, - protectionSpace._id, - task._id); - } - - void removeCredential_forProtectionSpace_options_task_( - NSURLCredential credential, - NSURLProtectionSpace protectionSpace, - NSDictionary? options, - NSURLSessionTask task) { - _lib._objc_msgSend_996( - _id, - _lib._sel_removeCredential_forProtectionSpace_options_task_1, - credential._id, - protectionSpace._id, - options?._id ?? ffi.nullptr, - task._id); - } - - void getDefaultCredentialForProtectionSpace_task_completionHandler_( - NSURLProtectionSpace space, - NSURLSessionTask task, - ObjCBlock_ffiVoid_NSURLCredential completionHandler) { - _lib._objc_msgSend_997( - _id, - _lib._sel_getDefaultCredentialForProtectionSpace_task_completionHandler_1, - space._id, - task._id, - completionHandler._id); - } - - void setDefaultCredential_forProtectionSpace_task_(NSURLCredential credential, - NSURLProtectionSpace protectionSpace, NSURLSessionTask task) { - _lib._objc_msgSend_995( - _id, - _lib._sel_setDefaultCredential_forProtectionSpace_task_1, - credential._id, - protectionSpace._id, - task._id); - } - - @override - NSURLCredentialStorage init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); - } - - static NSURLCredentialStorage new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLCredentialStorage1, _lib._sel_new1); - return NSURLCredentialStorage._(_ret, _lib, retain: false, release: true); - } - - static NSURLCredentialStorage allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLCredentialStorage1, _lib._sel_allocWithZone_1, zone); - return NSURLCredentialStorage._(_ret, _lib, retain: false, release: true); - } - - static NSURLCredentialStorage alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLCredentialStorage1, _lib._sel_alloc1); - return NSURLCredentialStorage._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLCredentialStorage1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLCredentialStorage1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLCredentialStorage1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLCredentialStorage1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLCredentialStorage1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLCredentialStorage1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLCredentialStorage1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLCredentialStorage1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLCredentialStorage1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_NSDictionary_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSDictionary_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSDictionary_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSDictionary_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSDictionary_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSDictionary_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSDictionary_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSDictionary_closureRegistry[block.ref.target.address]!( - arg0); - -class ObjCBlock_ffiVoid_NSDictionary extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSDictionary._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSDictionary.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDictionary_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSDictionary.fromFunction( - ThermionDartTexture1 lib, void Function(NSDictionary?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDictionary_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSDictionary_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSDictionary._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSDictionary.listener( - ThermionDartTexture1 lib, void Function(NSDictionary?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSDictionary_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSDictionary_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSDictionary._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSDictionary? arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0?._id ?? ffi.nullptr); -} - -void _ObjCBlock_ffiVoid_NSURLCredential_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSURLCredential_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSURLCredential_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSURLCredential_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSURLCredential_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSURLCredential_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSURLCredential_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSURLCredential_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_NSURLCredential extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSURLCredential._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURLCredential.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLCredential_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURLCredential.fromFunction( - ThermionDartTexture1 lib, void Function(NSURLCredential?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLCredential_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSURLCredential_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSURLCredential._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSURLCredential.listener( - ThermionDartTexture1 lib, void Function(NSURLCredential?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLCredential_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSURLCredential_registerClosure( - (ffi.Pointer arg0) => fn( - arg0.address == 0 ? null : NSURLCredential._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSURLCredential? arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0?._id ?? ffi.nullptr); -} - -class NSURLProtocol extends NSObject { - NSURLProtocol._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLProtocol] that points to the same underlying object as [other]. - static NSURLProtocol castFrom(T other) { - return NSURLProtocol._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSURLProtocol] that wraps the given raw object pointer. - static NSURLProtocol castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLProtocol._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLProtocol]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLProtocol1); - } - - NSURLProtocol initWithRequest_cachedResponse_client_(NSURLRequest request, - NSCachedURLResponse? cachedResponse, NSObject? client) { - final _ret = _lib._objc_msgSend_998( - _id, - _lib._sel_initWithRequest_cachedResponse_client_1, - request._id, - cachedResponse?._id ?? ffi.nullptr, - client?._id ?? ffi.nullptr); - return NSURLProtocol._(_ret, _lib, retain: true, release: true); - } - - NSObject? get client { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_client1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSURLRequest get request { - final _ret = _lib._objc_msgSend_974(_id, _lib._sel_request1); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - NSCachedURLResponse? get cachedResponse { - final _ret = _lib._objc_msgSend_999(_id, _lib._sel_cachedResponse1); - return _ret.address == 0 - ? null - : NSCachedURLResponse._(_ret, _lib, retain: true, release: true); - } - - static bool canInitWithRequest_( - ThermionDartTexture1 _lib, NSURLRequest request) { - return _lib._objc_msgSend_976(_lib._class_NSURLProtocol1, - _lib._sel_canInitWithRequest_1, request._id); - } - - static NSURLRequest canonicalRequestForRequest_( - ThermionDartTexture1 _lib, NSURLRequest request) { - final _ret = _lib._objc_msgSend_1000(_lib._class_NSURLProtocol1, - _lib._sel_canonicalRequestForRequest_1, request._id); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - static bool requestIsCacheEquivalent_toRequest_( - ThermionDartTexture1 _lib, NSURLRequest a, NSURLRequest b) { - return _lib._objc_msgSend_1001(_lib._class_NSURLProtocol1, - _lib._sel_requestIsCacheEquivalent_toRequest_1, a._id, b._id); - } - - void startLoading() { - _lib._objc_msgSend_1(_id, _lib._sel_startLoading1); - } - - void stopLoading() { - _lib._objc_msgSend_1(_id, _lib._sel_stopLoading1); - } - - static NSObject? propertyForKey_inRequest_( - ThermionDartTexture1 _lib, NSString key, NSURLRequest request) { - final _ret = _lib._objc_msgSend_1002(_lib._class_NSURLProtocol1, - _lib._sel_propertyForKey_inRequest_1, key._id, request._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static void setProperty_forKey_inRequest_(ThermionDartTexture1 _lib, - NSObject value, NSString key, NSMutableURLRequest request) { - _lib._objc_msgSend_1009( - _lib._class_NSURLProtocol1, - _lib._sel_setProperty_forKey_inRequest_1, - value._id, - key._id, - request._id); - } - - static void removePropertyForKey_inRequest_( - ThermionDartTexture1 _lib, NSString key, NSMutableURLRequest request) { - _lib._objc_msgSend_1010(_lib._class_NSURLProtocol1, - _lib._sel_removePropertyForKey_inRequest_1, key._id, request._id); - } - - static bool registerClass_( - ThermionDartTexture1 _lib, NSObject protocolClass) { - return _lib._objc_msgSend_0(_lib._class_NSURLProtocol1, - _lib._sel_registerClass_1, protocolClass._id); - } - - static void unregisterClass_( - ThermionDartTexture1 _lib, NSObject protocolClass) { - _lib._objc_msgSend_15(_lib._class_NSURLProtocol1, - _lib._sel_unregisterClass_1, protocolClass._id); - } - - static bool canInitWithTask_( - ThermionDartTexture1 _lib, NSURLSessionTask task) { - return _lib._objc_msgSend_1011( - _lib._class_NSURLProtocol1, _lib._sel_canInitWithTask_1, task._id); - } - - NSURLProtocol initWithTask_cachedResponse_client_(NSURLSessionTask task, - NSCachedURLResponse? cachedResponse, NSObject? client) { - final _ret = _lib._objc_msgSend_1012( - _id, - _lib._sel_initWithTask_cachedResponse_client_1, - task._id, - cachedResponse?._id ?? ffi.nullptr, - client?._id ?? ffi.nullptr); - return NSURLProtocol._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionTask? get task { - final _ret = _lib._objc_msgSend_1013(_id, _lib._sel_task1); - return _ret.address == 0 - ? null - : NSURLSessionTask._(_ret, _lib, retain: true, release: true); - } - - @override - NSURLProtocol init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLProtocol._(_ret, _lib, retain: true, release: true); - } - - static NSURLProtocol new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLProtocol1, _lib._sel_new1); - return NSURLProtocol._(_ret, _lib, retain: false, release: true); - } - - static NSURLProtocol allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLProtocol1, _lib._sel_allocWithZone_1, zone); - return NSURLProtocol._(_ret, _lib, retain: false, release: true); - } - - static NSURLProtocol alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLProtocol1, _lib._sel_alloc1); - return NSURLProtocol._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLProtocol1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLProtocol1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLProtocol1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLProtocol1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLProtocol1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLProtocol1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLProtocol1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSURLProtocol1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLProtocol1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSMutableURLRequest extends NSURLRequest { - NSMutableURLRequest._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMutableURLRequest] that points to the same underlying object as [other]. - static NSMutableURLRequest castFrom(T other) { - return NSMutableURLRequest._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSMutableURLRequest] that wraps the given raw object pointer. - static NSMutableURLRequest castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableURLRequest._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMutableURLRequest]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSMutableURLRequest1); - } - - @override - NSURL? get URL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_URL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - set URL(NSURL? value) { - return _lib._objc_msgSend_670( - _id, _lib._sel_setURL_1, value?._id ?? ffi.nullptr); - } - - @override - int get cachePolicy { - return _lib._objc_msgSend_854(_id, _lib._sel_cachePolicy1); - } - - set cachePolicy(int value) { - return _lib._objc_msgSend_1003(_id, _lib._sel_setCachePolicy_1, value); - } - - @override - double get timeoutInterval { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret(_id, _lib._sel_timeoutInterval1) - : _lib._objc_msgSend_164(_id, _lib._sel_timeoutInterval1); - } - - set timeoutInterval(double value) { - return _lib._objc_msgSend_541(_id, _lib._sel_setTimeoutInterval_1, value); - } - - @override - NSURL? get mainDocumentURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_mainDocumentURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - set mainDocumentURL(NSURL? value) { - return _lib._objc_msgSend_670( - _id, _lib._sel_setMainDocumentURL_1, value?._id ?? ffi.nullptr); - } - - @override - int get networkServiceType { - return _lib._objc_msgSend_855(_id, _lib._sel_networkServiceType1); - } - - set networkServiceType(int value) { - return _lib._objc_msgSend_1004( - _id, _lib._sel_setNetworkServiceType_1, value); - } - - @override - bool get allowsCellularAccess { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); - } - - set allowsCellularAccess(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAllowsCellularAccess_1, value); - } - - @override - bool get allowsExpensiveNetworkAccess { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); - } - - set allowsExpensiveNetworkAccess(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAllowsExpensiveNetworkAccess_1, value); - } - - @override - bool get allowsConstrainedNetworkAccess { - return _lib._objc_msgSend_12( - _id, _lib._sel_allowsConstrainedNetworkAccess1); - } - - set allowsConstrainedNetworkAccess(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAllowsConstrainedNetworkAccess_1, value); - } - - @override - bool get assumesHTTP3Capable { - return _lib._objc_msgSend_12(_id, _lib._sel_assumesHTTP3Capable1); - } - - set assumesHTTP3Capable(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAssumesHTTP3Capable_1, value); - } - - @override - int get attribution { - return _lib._objc_msgSend_856(_id, _lib._sel_attribution1); - } - - set attribution(int value) { - return _lib._objc_msgSend_1005(_id, _lib._sel_setAttribution_1, value); - } - - @override - bool get requiresDNSSECValidation { - return _lib._objc_msgSend_12(_id, _lib._sel_requiresDNSSECValidation1); - } - - set requiresDNSSECValidation(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setRequiresDNSSECValidation_1, value); - } - - NSString get HTTPMethod { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_HTTPMethod1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set HTTPMethod(NSString value) { - return _lib._objc_msgSend_645(_id, _lib._sel_setHTTPMethod_1, value._id); - } - - @override - NSDictionary? get allHTTPHeaderFields { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_allHTTPHeaderFields1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set allHTTPHeaderFields(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, _lib._sel_setAllHTTPHeaderFields_1, value?._id ?? ffi.nullptr); - } - - void setValue_forHTTPHeaderField_(NSString? value, NSString field) { - _lib._objc_msgSend_1006(_id, _lib._sel_setValue_forHTTPHeaderField_1, - value?._id ?? ffi.nullptr, field._id); - } - - void addValue_forHTTPHeaderField_(NSString value, NSString field) { - _lib._objc_msgSend_550( - _id, _lib._sel_addValue_forHTTPHeaderField_1, value._id, field._id); - } - - @override - NSData? get HTTPBody { - final _ret = _lib._objc_msgSend_285(_id, _lib._sel_HTTPBody1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - set HTTPBody(NSData? value) { - return _lib._objc_msgSend_1007( - _id, _lib._sel_setHTTPBody_1, value?._id ?? ffi.nullptr); - } - - @override - NSInputStream? get HTTPBodyStream { - final _ret = _lib._objc_msgSend_871(_id, _lib._sel_HTTPBodyStream1); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - set HTTPBodyStream(NSInputStream? value) { - return _lib._objc_msgSend_1008( - _id, _lib._sel_setHTTPBodyStream_1, value?._id ?? ffi.nullptr); - } - - @override - bool get HTTPShouldHandleCookies { - return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldHandleCookies1); - } - - set HTTPShouldHandleCookies(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setHTTPShouldHandleCookies_1, value); - } - - @override - bool get HTTPShouldUsePipelining { - return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); - } - - set HTTPShouldUsePipelining(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setHTTPShouldUsePipelining_1, value); - } - - static NSMutableURLRequest requestWithURL_( - ThermionDartTexture1 _lib, NSURL URL) { - final _ret = _lib._objc_msgSend_261( - _lib._class_NSMutableURLRequest1, _lib._sel_requestWithURL_1, URL._id); - return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); - } - - static bool getSupportsSecureCoding(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableURLRequest1, _lib._sel_supportsSecureCoding1); - } - - static NSMutableURLRequest requestWithURL_cachePolicy_timeoutInterval_( - ThermionDartTexture1 _lib, - NSURL URL, - int cachePolicy, - double timeoutInterval) { - final _ret = _lib._objc_msgSend_853( - _lib._class_NSMutableURLRequest1, - _lib._sel_requestWithURL_cachePolicy_timeoutInterval_1, - URL._id, - cachePolicy, - timeoutInterval); - return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableURLRequest initWithURL_(NSURL URL) { - final _ret = _lib._objc_msgSend_261(_id, _lib._sel_initWithURL_1, URL._id); - return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableURLRequest initWithURL_cachePolicy_timeoutInterval_( - NSURL URL, int cachePolicy, double timeoutInterval) { - final _ret = _lib._objc_msgSend_853( - _id, - _lib._sel_initWithURL_cachePolicy_timeoutInterval_1, - URL._id, - cachePolicy, - timeoutInterval); - return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableURLRequest init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); - } - - static NSMutableURLRequest new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableURLRequest1, _lib._sel_new1); - return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); - } - - static NSMutableURLRequest allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableURLRequest1, _lib._sel_allocWithZone_1, zone); - return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); - } - - static NSMutableURLRequest alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableURLRequest1, _lib._sel_alloc1); - return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSMutableURLRequest1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSMutableURLRequest1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSMutableURLRequest1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableURLRequest1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSMutableURLRequest1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSMutableURLRequest1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSMutableURLRequest1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSMutableURLRequest1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableURLRequest1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSXMLParser extends NSObject { - NSXMLParser._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSXMLParser] that points to the same underlying object as [other]. - static NSXMLParser castFrom(T other) { - return NSXMLParser._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSXMLParser] that wraps the given raw object pointer. - static NSXMLParser castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSXMLParser._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSXMLParser]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLParser1); - } - - NSXMLParser? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_276(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSXMLParser._(_ret, _lib, retain: true, release: true); - } - - NSXMLParser initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_278(_id, _lib._sel_initWithData_1, data._id); - return NSXMLParser._(_ret, _lib, retain: true, release: true); - } - - NSXMLParser initWithStream_(NSInputStream stream) { - final _ret = - _lib._objc_msgSend_1014(_id, _lib._sel_initWithStream_1, stream._id); - return NSXMLParser._(_ret, _lib, retain: true, release: true); - } - - NSObject? get delegate { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set delegate(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); - } - - bool get shouldProcessNamespaces { - return _lib._objc_msgSend_12(_id, _lib._sel_shouldProcessNamespaces1); - } - - set shouldProcessNamespaces(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setShouldProcessNamespaces_1, value); - } - - bool get shouldReportNamespacePrefixes { - return _lib._objc_msgSend_12(_id, _lib._sel_shouldReportNamespacePrefixes1); - } - - set shouldReportNamespacePrefixes(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setShouldReportNamespacePrefixes_1, value); - } - - int get externalEntityResolvingPolicy { - return _lib._objc_msgSend_1015( - _id, _lib._sel_externalEntityResolvingPolicy1); - } - - set externalEntityResolvingPolicy(int value) { - return _lib._objc_msgSend_1016( - _id, _lib._sel_setExternalEntityResolvingPolicy_1, value); - } - - NSSet? get allowedExternalEntityURLs { - final _ret = - _lib._objc_msgSend_318(_id, _lib._sel_allowedExternalEntityURLs1); - return _ret.address == 0 - ? null - : NSSet._(_ret, _lib, retain: true, release: true); - } - - set allowedExternalEntityURLs(NSSet? value) { - return _lib._objc_msgSend_1017(_id, - _lib._sel_setAllowedExternalEntityURLs_1, value?._id ?? ffi.nullptr); - } - - bool parse() { - return _lib._objc_msgSend_12(_id, _lib._sel_parse1); - } - - void abortParsing() { - _lib._objc_msgSend_1(_id, _lib._sel_abortParsing1); - } - - NSError? get parserError { - final _ret = _lib._objc_msgSend_321(_id, _lib._sel_parserError1); - return _ret.address == 0 - ? null - : NSError._(_ret, _lib, retain: true, release: true); - } - - bool get shouldResolveExternalEntities { - return _lib._objc_msgSend_12(_id, _lib._sel_shouldResolveExternalEntities1); - } - - set shouldResolveExternalEntities(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setShouldResolveExternalEntities_1, value); - } - - NSString? get publicID { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_publicID1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get systemID { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_systemID1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - int get lineNumber { - return _lib._objc_msgSend_82(_id, _lib._sel_lineNumber1); - } - - int get columnNumber { - return _lib._objc_msgSend_82(_id, _lib._sel_columnNumber1); - } - - @override - NSXMLParser init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSXMLParser._(_ret, _lib, retain: true, release: true); - } - - static NSXMLParser new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLParser1, _lib._sel_new1); - return NSXMLParser._(_ret, _lib, retain: false, release: true); - } - - static NSXMLParser allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSXMLParser1, _lib._sel_allocWithZone_1, zone); - return NSXMLParser._(_ret, _lib, retain: false, release: true); - } - - static NSXMLParser alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLParser1, _lib._sel_alloc1); - return NSXMLParser._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSXMLParser1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSXMLParser1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLParser1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLParser1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSXMLParser1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSXMLParser1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSXMLParser1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSXMLParser1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSXMLParser1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSXMLParserExternalEntityResolvingPolicy { - static const int NSXMLParserResolveExternalEntitiesNever = 0; - static const int NSXMLParserResolveExternalEntitiesNoNetwork = 1; - static const int NSXMLParserResolveExternalEntitiesSameOriginOnly = 2; - static const int NSXMLParserResolveExternalEntitiesAlways = 3; -} - -class NSFileWrapper extends NSObject { - NSFileWrapper._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSFileWrapper] that points to the same underlying object as [other]. - static NSFileWrapper castFrom(T other) { - return NSFileWrapper._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSFileWrapper] that wraps the given raw object pointer. - static NSFileWrapper castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSFileWrapper._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSFileWrapper]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileWrapper1); - } - - NSFileWrapper? initWithURL_options_error_( - NSURL url, int options, ffi.Pointer> outError) { - final _ret = _lib._objc_msgSend_1018( - _id, _lib._sel_initWithURL_options_error_1, url._id, options, outError); - return _ret.address == 0 - ? null - : NSFileWrapper._(_ret, _lib, retain: true, release: true); - } - - NSFileWrapper initDirectoryWithFileWrappers_( - NSDictionary childrenByPreferredName) { - final _ret = _lib._objc_msgSend_158(_id, - _lib._sel_initDirectoryWithFileWrappers_1, childrenByPreferredName._id); - return NSFileWrapper._(_ret, _lib, retain: true, release: true); - } - - NSFileWrapper initRegularFileWithContents_(NSData contents) { - final _ret = _lib._objc_msgSend_278( - _id, _lib._sel_initRegularFileWithContents_1, contents._id); - return NSFileWrapper._(_ret, _lib, retain: true, release: true); - } - - NSFileWrapper initSymbolicLinkWithDestinationURL_(NSURL url) { - final _ret = _lib._objc_msgSend_261( - _id, _lib._sel_initSymbolicLinkWithDestinationURL_1, url._id); - return NSFileWrapper._(_ret, _lib, retain: true, release: true); - } - - NSFileWrapper? initWithSerializedRepresentation_( - NSData serializeRepresentation) { - final _ret = _lib._objc_msgSend_870( - _id, - _lib._sel_initWithSerializedRepresentation_1, - serializeRepresentation._id); - return _ret.address == 0 - ? null - : NSFileWrapper._(_ret, _lib, retain: true, release: true); - } - - NSFileWrapper? initWithCoder_(NSCoder inCoder) { - final _ret = - _lib._objc_msgSend_46(_id, _lib._sel_initWithCoder_1, inCoder._id); - return _ret.address == 0 - ? null - : NSFileWrapper._(_ret, _lib, retain: true, release: true); - } - - bool get directory { - return _lib._objc_msgSend_12(_id, _lib._sel_isDirectory1); - } - - bool get regularFile { - return _lib._objc_msgSend_12(_id, _lib._sel_isRegularFile1); - } - - bool get symbolicLink { - return _lib._objc_msgSend_12(_id, _lib._sel_isSymbolicLink1); - } - - NSString? get preferredFilename { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_preferredFilename1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set preferredFilename(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setPreferredFilename_1, value?._id ?? ffi.nullptr); - } - - NSString? get filename { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_filename1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set filename(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setFilename_1, value?._id ?? ffi.nullptr); - } - - NSDictionary get fileAttributes { - final _ret = _lib._objc_msgSend_180(_id, _lib._sel_fileAttributes1); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set fileAttributes(NSDictionary value) { - return _lib._objc_msgSend_181( - _id, _lib._sel_setFileAttributes_1, value._id); - } - - bool matchesContentsOfURL_(NSURL url) { - return _lib._objc_msgSend_264( - _id, _lib._sel_matchesContentsOfURL_1, url._id); - } - - bool readFromURL_options_error_( - NSURL url, int options, ffi.Pointer> outError) { - return _lib._objc_msgSend_1019( - _id, _lib._sel_readFromURL_options_error_1, url._id, options, outError); - } - - bool writeToURL_options_originalContentsURL_error_( - NSURL url, - int options, - NSURL? originalContentsURL, - ffi.Pointer> outError) { - return _lib._objc_msgSend_1020( - _id, - _lib._sel_writeToURL_options_originalContentsURL_error_1, - url._id, - options, - originalContentsURL?._id ?? ffi.nullptr, - outError); - } - - NSData? get serializedRepresentation { - final _ret = - _lib._objc_msgSend_285(_id, _lib._sel_serializedRepresentation1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSString addFileWrapper_(NSFileWrapper child) { - final _ret = - _lib._objc_msgSend_1021(_id, _lib._sel_addFileWrapper_1, child._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString addRegularFileWithContents_preferredFilename_( - NSData data, NSString fileName) { - final _ret = _lib._objc_msgSend_1022( - _id, - _lib._sel_addRegularFileWithContents_preferredFilename_1, - data._id, - fileName._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void removeFileWrapper_(NSFileWrapper child) { - _lib._objc_msgSend_1023(_id, _lib._sel_removeFileWrapper_1, child._id); - } - - NSDictionary? get fileWrappers { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_fileWrappers1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSString? keyForFileWrapper_(NSFileWrapper child) { - final _ret = - _lib._objc_msgSend_1024(_id, _lib._sel_keyForFileWrapper_1, child._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSData? get regularFileContents { - final _ret = _lib._objc_msgSend_285(_id, _lib._sel_regularFileContents1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSURL? get symbolicLinkDestinationURL { - final _ret = - _lib._objc_msgSend_44(_id, _lib._sel_symbolicLinkDestinationURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithPath_(NSString path) { - final _ret = _lib._objc_msgSend_38(_id, _lib._sel_initWithPath_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject initSymbolicLinkWithDestination_(NSString path) { - final _ret = _lib._objc_msgSend_31( - _id, _lib._sel_initSymbolicLinkWithDestination_1, path._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - bool needsToBeUpdatedFromPath_(NSString path) { - return _lib._objc_msgSend_63( - _id, _lib._sel_needsToBeUpdatedFromPath_1, path._id); - } - - bool updateFromPath_(NSString path) { - return _lib._objc_msgSend_63(_id, _lib._sel_updateFromPath_1, path._id); - } - - bool writeToFile_atomically_updateFilenames_( - NSString path, bool atomicFlag, bool updateFilenamesFlag) { - return _lib._objc_msgSend_1025( - _id, - _lib._sel_writeToFile_atomically_updateFilenames_1, - path._id, - atomicFlag, - updateFilenamesFlag); - } - - NSString addFileWithPath_(NSString path) { - final _ret = - _lib._objc_msgSend_68(_id, _lib._sel_addFileWithPath_1, path._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString addSymbolicLinkWithDestination_preferredFilename_( - NSString path, NSString filename) { - final _ret = _lib._objc_msgSend_363( - _id, - _lib._sel_addSymbolicLinkWithDestination_preferredFilename_1, - path._id, - filename._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString symbolicLinkDestination() { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_symbolicLinkDestination1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - @override - NSFileWrapper init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSFileWrapper._(_ret, _lib, retain: true, release: true); - } - - static NSFileWrapper new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSFileWrapper1, _lib._sel_new1); - return NSFileWrapper._(_ret, _lib, retain: false, release: true); - } - - static NSFileWrapper allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSFileWrapper1, _lib._sel_allocWithZone_1, zone); - return NSFileWrapper._(_ret, _lib, retain: false, release: true); - } - - static NSFileWrapper alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSFileWrapper1, _lib._sel_alloc1); - return NSFileWrapper._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSFileWrapper1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSFileWrapper1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSFileWrapper1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSFileWrapper1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSFileWrapper1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSFileWrapper1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSFileWrapper1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSFileWrapper1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSFileWrapper1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSFileWrapperReadingOptions { - static const int NSFileWrapperReadingImmediate = 1; - static const int NSFileWrapperReadingWithoutMapping = 2; -} - -abstract class NSFileWrapperWritingOptions { - static const int NSFileWrapperWritingAtomic = 1; - static const int NSFileWrapperWritingWithNameUpdating = 2; -} - -class NSURLSession extends NSObject { - NSURLSession._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSession] that points to the same underlying object as [other]. - static NSURLSession castFrom(T other) { - return NSURLSession._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSURLSession] that wraps the given raw object pointer. - static NSURLSession castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSession._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLSession]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLSession1); - } - - static NSURLSession getSharedSession(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_1026( - _lib._class_NSURLSession1, _lib._sel_sharedSession1); - return NSURLSession._(_ret, _lib, retain: true, release: true); - } - - static NSURLSession sessionWithConfiguration_( - ThermionDartTexture1 _lib, NSURLSessionConfiguration configuration) { - final _ret = _lib._objc_msgSend_1042(_lib._class_NSURLSession1, - _lib._sel_sessionWithConfiguration_1, configuration._id); - return NSURLSession._(_ret, _lib, retain: true, release: true); - } - - static NSURLSession sessionWithConfiguration_delegate_delegateQueue_( - ThermionDartTexture1 _lib, - NSURLSessionConfiguration configuration, - NSObject? delegate, - NSOperationQueue? queue) { - final _ret = _lib._objc_msgSend_1043( - _lib._class_NSURLSession1, - _lib._sel_sessionWithConfiguration_delegate_delegateQueue_1, - configuration._id, - delegate?._id ?? ffi.nullptr, - queue?._id ?? ffi.nullptr); - return NSURLSession._(_ret, _lib, retain: true, release: true); - } - - NSOperationQueue get delegateQueue { - final _ret = _lib._objc_msgSend_903(_id, _lib._sel_delegateQueue1); - return NSOperationQueue._(_ret, _lib, retain: true, release: true); - } - - NSObject? get delegate { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionConfiguration get configuration { - final _ret = _lib._objc_msgSend_1027(_id, _lib._sel_configuration1); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } - - NSString? get sessionDescription { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_sessionDescription1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set sessionDescription(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setSessionDescription_1, value?._id ?? ffi.nullptr); - } - - void finishTasksAndInvalidate() { - _lib._objc_msgSend_1(_id, _lib._sel_finishTasksAndInvalidate1); - } - - void invalidateAndCancel() { - _lib._objc_msgSend_1(_id, _lib._sel_invalidateAndCancel1); - } - - void resetWithCompletionHandler_(ObjCBlock_ffiVoid completionHandler) { - _lib._objc_msgSend_531( - _id, _lib._sel_resetWithCompletionHandler_1, completionHandler._id); - } - - void flushWithCompletionHandler_(ObjCBlock_ffiVoid completionHandler) { - _lib._objc_msgSend_531( - _id, _lib._sel_flushWithCompletionHandler_1, completionHandler._id); - } - - void getTasksWithCompletionHandler_( - ObjCBlock_ffiVoid_NSArray_NSArray_NSArray completionHandler) { - _lib._objc_msgSend_1044( - _id, _lib._sel_getTasksWithCompletionHandler_1, completionHandler._id); - } - - void getAllTasksWithCompletionHandler_( - ObjCBlock_ffiVoid_NSArray1 completionHandler) { - _lib._objc_msgSend_1045(_id, _lib._sel_getAllTasksWithCompletionHandler_1, - completionHandler._id); - } - - NSURLSessionDataTask dataTaskWithRequest_(NSURLRequest request) { - final _ret = _lib._objc_msgSend_1046( - _id, _lib._sel_dataTaskWithRequest_1, request._id); - return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionDataTask dataTaskWithURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_1047(_id, _lib._sel_dataTaskWithURL_1, url._id); - return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionUploadTask uploadTaskWithRequest_fromFile_( - NSURLRequest request, NSURL fileURL) { - final _ret = _lib._objc_msgSend_1048(_id, - _lib._sel_uploadTaskWithRequest_fromFile_1, request._id, fileURL._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionUploadTask uploadTaskWithRequest_fromData_( - NSURLRequest request, NSData bodyData) { - final _ret = _lib._objc_msgSend_1049(_id, - _lib._sel_uploadTaskWithRequest_fromData_1, request._id, bodyData._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionUploadTask uploadTaskWithStreamedRequest_(NSURLRequest request) { - final _ret = _lib._objc_msgSend_1050( - _id, _lib._sel_uploadTaskWithStreamedRequest_1, request._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionDownloadTask downloadTaskWithRequest_(NSURLRequest request) { - final _ret = _lib._objc_msgSend_1052( - _id, _lib._sel_downloadTaskWithRequest_1, request._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionDownloadTask downloadTaskWithURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_1053(_id, _lib._sel_downloadTaskWithURL_1, url._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionDownloadTask downloadTaskWithResumeData_(NSData resumeData) { - final _ret = _lib._objc_msgSend_1054( - _id, _lib._sel_downloadTaskWithResumeData_1, resumeData._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionStreamTask streamTaskWithHostName_port_( - NSString hostname, int port) { - final _ret = _lib._objc_msgSend_1057( - _id, _lib._sel_streamTaskWithHostName_port_1, hostname._id, port); - return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionStreamTask streamTaskWithNetService_(NSNetService service) { - final _ret = _lib._objc_msgSend_1065( - _id, _lib._sel_streamTaskWithNetService_1, service._id); - return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionWebSocketTask webSocketTaskWithURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_1072(_id, _lib._sel_webSocketTaskWithURL_1, url._id); - return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionWebSocketTask webSocketTaskWithURL_protocols_( - NSURL url, NSArray protocols) { - final _ret = _lib._objc_msgSend_1073(_id, - _lib._sel_webSocketTaskWithURL_protocols_1, url._id, protocols._id); - return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionWebSocketTask webSocketTaskWithRequest_(NSURLRequest request) { - final _ret = _lib._objc_msgSend_1074( - _id, _lib._sel_webSocketTaskWithRequest_1, request._id); - return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); - } - - @override - NSURLSession init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSession._(_ret, _lib, retain: true, release: true); - } - - static NSURLSession new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLSession1, _lib._sel_new1); - return NSURLSession._(_ret, _lib, retain: false, release: true); - } - - NSURLSessionDataTask dataTaskWithRequest_completionHandler_( - NSURLRequest request, - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_1075( - _id, - _lib._sel_dataTaskWithRequest_completionHandler_1, - request._id, - completionHandler._id); - return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionDataTask dataTaskWithURL_completionHandler_(NSURL url, - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_1076( - _id, - _lib._sel_dataTaskWithURL_completionHandler_1, - url._id, - completionHandler._id); - return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionUploadTask uploadTaskWithRequest_fromFile_completionHandler_( - NSURLRequest request, - NSURL fileURL, - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_1077( - _id, - _lib._sel_uploadTaskWithRequest_fromFile_completionHandler_1, - request._id, - fileURL._id, - completionHandler._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionUploadTask uploadTaskWithRequest_fromData_completionHandler_( - NSURLRequest request, - NSData? bodyData, - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_1078( - _id, - _lib._sel_uploadTaskWithRequest_fromData_completionHandler_1, - request._id, - bodyData?._id ?? ffi.nullptr, - completionHandler._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionDownloadTask downloadTaskWithRequest_completionHandler_( - NSURLRequest request, - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_1079( - _id, - _lib._sel_downloadTaskWithRequest_completionHandler_1, - request._id, - completionHandler._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionDownloadTask downloadTaskWithURL_completionHandler_(NSURL url, - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_1080( - _id, - _lib._sel_downloadTaskWithURL_completionHandler_1, - url._id, - completionHandler._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionDownloadTask downloadTaskWithResumeData_completionHandler_( - NSData resumeData, - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_1081( - _id, - _lib._sel_downloadTaskWithResumeData_completionHandler_1, - resumeData._id, - completionHandler._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } - - static NSURLSession allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSession1, _lib._sel_allocWithZone_1, zone); - return NSURLSession._(_ret, _lib, retain: false, release: true); - } - - static NSURLSession alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLSession1, _lib._sel_alloc1); - return NSURLSession._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLSession1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLSession1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLSession1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLSession1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLSession1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLSession1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLSession1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSURLSession1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSession1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSURLSessionConfiguration extends NSObject { - NSURLSessionConfiguration._( - ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSessionConfiguration] that points to the same underlying object as [other]. - static NSURLSessionConfiguration castFrom(T other) { - return NSURLSessionConfiguration._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLSessionConfiguration] that wraps the given raw object pointer. - static NSURLSessionConfiguration castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionConfiguration._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLSessionConfiguration]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLSessionConfiguration1); - } - - static NSURLSessionConfiguration getDefaultSessionConfiguration( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_1027(_lib._class_NSURLSessionConfiguration1, - _lib._sel_defaultSessionConfiguration1); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionConfiguration getEphemeralSessionConfiguration( - ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_1027(_lib._class_NSURLSessionConfiguration1, - _lib._sel_ephemeralSessionConfiguration1); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionConfiguration - backgroundSessionConfigurationWithIdentifier_( - ThermionDartTexture1 _lib, NSString identifier) { - final _ret = _lib._objc_msgSend_1028( - _lib._class_NSURLSessionConfiguration1, - _lib._sel_backgroundSessionConfigurationWithIdentifier_1, - identifier._id); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } - - NSString? get identifier { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_identifier1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - int get requestCachePolicy { - return _lib._objc_msgSend_854(_id, _lib._sel_requestCachePolicy1); - } - - set requestCachePolicy(int value) { - return _lib._objc_msgSend_1003( - _id, _lib._sel_setRequestCachePolicy_1, value); - } - - double get timeoutIntervalForRequest { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret( - _id, _lib._sel_timeoutIntervalForRequest1) - : _lib._objc_msgSend_164(_id, _lib._sel_timeoutIntervalForRequest1); - } - - set timeoutIntervalForRequest(double value) { - return _lib._objc_msgSend_541( - _id, _lib._sel_setTimeoutIntervalForRequest_1, value); - } - - double get timeoutIntervalForResource { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_164_fpret( - _id, _lib._sel_timeoutIntervalForResource1) - : _lib._objc_msgSend_164(_id, _lib._sel_timeoutIntervalForResource1); - } - - set timeoutIntervalForResource(double value) { - return _lib._objc_msgSend_541( - _id, _lib._sel_setTimeoutIntervalForResource_1, value); - } - - int get networkServiceType { - return _lib._objc_msgSend_855(_id, _lib._sel_networkServiceType1); - } - - set networkServiceType(int value) { - return _lib._objc_msgSend_1004( - _id, _lib._sel_setNetworkServiceType_1, value); - } - - bool get allowsCellularAccess { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); - } - - set allowsCellularAccess(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAllowsCellularAccess_1, value); - } - - bool get allowsExpensiveNetworkAccess { - return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); - } - - set allowsExpensiveNetworkAccess(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAllowsExpensiveNetworkAccess_1, value); - } - - bool get allowsConstrainedNetworkAccess { - return _lib._objc_msgSend_12( - _id, _lib._sel_allowsConstrainedNetworkAccess1); - } - - set allowsConstrainedNetworkAccess(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setAllowsConstrainedNetworkAccess_1, value); - } - - bool get requiresDNSSECValidation { - return _lib._objc_msgSend_12(_id, _lib._sel_requiresDNSSECValidation1); - } - - set requiresDNSSECValidation(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setRequiresDNSSECValidation_1, value); - } - - bool get waitsForConnectivity { - return _lib._objc_msgSend_12(_id, _lib._sel_waitsForConnectivity1); - } - - set waitsForConnectivity(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setWaitsForConnectivity_1, value); - } - - bool get discretionary { - return _lib._objc_msgSend_12(_id, _lib._sel_isDiscretionary1); - } - - set discretionary(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setDiscretionary_1, value); - } - - NSString? get sharedContainerIdentifier { - final _ret = - _lib._objc_msgSend_43(_id, _lib._sel_sharedContainerIdentifier1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set sharedContainerIdentifier(NSString? value) { - return _lib._objc_msgSend_544(_id, _lib._sel_setSharedContainerIdentifier_1, - value?._id ?? ffi.nullptr); - } - - bool get sessionSendsLaunchEvents { - return _lib._objc_msgSend_12(_id, _lib._sel_sessionSendsLaunchEvents1); - } - - set sessionSendsLaunchEvents(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setSessionSendsLaunchEvents_1, value); - } - - NSDictionary? get connectionProxyDictionary { - final _ret = - _lib._objc_msgSend_389(_id, _lib._sel_connectionProxyDictionary1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set connectionProxyDictionary(NSDictionary? value) { - return _lib._objc_msgSend_633(_id, _lib._sel_setConnectionProxyDictionary_1, - value?._id ?? ffi.nullptr); - } - - int get TLSMinimumSupportedProtocol { - return _lib._objc_msgSend_1029(_id, _lib._sel_TLSMinimumSupportedProtocol1); - } - - set TLSMinimumSupportedProtocol(int value) { - return _lib._objc_msgSend_1030( - _id, _lib._sel_setTLSMinimumSupportedProtocol_1, value); - } - - int get TLSMaximumSupportedProtocol { - return _lib._objc_msgSend_1029(_id, _lib._sel_TLSMaximumSupportedProtocol1); - } - - set TLSMaximumSupportedProtocol(int value) { - return _lib._objc_msgSend_1030( - _id, _lib._sel_setTLSMaximumSupportedProtocol_1, value); - } - - int get TLSMinimumSupportedProtocolVersion { - return _lib._objc_msgSend_1031( - _id, _lib._sel_TLSMinimumSupportedProtocolVersion1); - } - - set TLSMinimumSupportedProtocolVersion(int value) { - return _lib._objc_msgSend_1032( - _id, _lib._sel_setTLSMinimumSupportedProtocolVersion_1, value); - } - - int get TLSMaximumSupportedProtocolVersion { - return _lib._objc_msgSend_1031( - _id, _lib._sel_TLSMaximumSupportedProtocolVersion1); - } - - set TLSMaximumSupportedProtocolVersion(int value) { - return _lib._objc_msgSend_1032( - _id, _lib._sel_setTLSMaximumSupportedProtocolVersion_1, value); - } - - bool get HTTPShouldUsePipelining { - return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); - } - - set HTTPShouldUsePipelining(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setHTTPShouldUsePipelining_1, value); - } - - bool get HTTPShouldSetCookies { - return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldSetCookies1); - } - - set HTTPShouldSetCookies(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setHTTPShouldSetCookies_1, value); - } - - int get HTTPCookieAcceptPolicy { - return _lib._objc_msgSend_851(_id, _lib._sel_HTTPCookieAcceptPolicy1); - } - - set HTTPCookieAcceptPolicy(int value) { - return _lib._objc_msgSend_852( - _id, _lib._sel_setHTTPCookieAcceptPolicy_1, value); - } - - NSDictionary? get HTTPAdditionalHeaders { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_HTTPAdditionalHeaders1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set HTTPAdditionalHeaders(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, _lib._sel_setHTTPAdditionalHeaders_1, value?._id ?? ffi.nullptr); - } - - int get HTTPMaximumConnectionsPerHost { - return _lib._objc_msgSend_82(_id, _lib._sel_HTTPMaximumConnectionsPerHost1); - } - - set HTTPMaximumConnectionsPerHost(int value) { - return _lib._objc_msgSend_634( - _id, _lib._sel_setHTTPMaximumConnectionsPerHost_1, value); - } - - NSHTTPCookieStorage? get HTTPCookieStorage { - final _ret = _lib._objc_msgSend_1033(_id, _lib._sel_HTTPCookieStorage1); - return _ret.address == 0 - ? null - : NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); - } - - set HTTPCookieStorage(NSHTTPCookieStorage? value) { - return _lib._objc_msgSend_1034( - _id, _lib._sel_setHTTPCookieStorage_1, value?._id ?? ffi.nullptr); - } - - NSURLCredentialStorage? get URLCredentialStorage { - final _ret = _lib._objc_msgSend_1035(_id, _lib._sel_URLCredentialStorage1); - return _ret.address == 0 - ? null - : NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); - } - - set URLCredentialStorage(NSURLCredentialStorage? value) { - return _lib._objc_msgSend_1036( - _id, _lib._sel_setURLCredentialStorage_1, value?._id ?? ffi.nullptr); - } - - NSURLCache? get URLCache { - final _ret = _lib._objc_msgSend_1037(_id, _lib._sel_URLCache1); - return _ret.address == 0 - ? null - : NSURLCache._(_ret, _lib, retain: true, release: true); - } - - set URLCache(NSURLCache? value) { - return _lib._objc_msgSend_1038( - _id, _lib._sel_setURLCache_1, value?._id ?? ffi.nullptr); - } - - bool get shouldUseExtendedBackgroundIdleMode { - return _lib._objc_msgSend_12( - _id, _lib._sel_shouldUseExtendedBackgroundIdleMode1); - } - - set shouldUseExtendedBackgroundIdleMode(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setShouldUseExtendedBackgroundIdleMode_1, value); - } - - NSArray? get protocolClasses { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_protocolClasses1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - set protocolClasses(NSArray? value) { - return _lib._objc_msgSend_1039( - _id, _lib._sel_setProtocolClasses_1, value?._id ?? ffi.nullptr); - } - - int get multipathServiceType { - return _lib._objc_msgSend_1040(_id, _lib._sel_multipathServiceType1); - } - - set multipathServiceType(int value) { - return _lib._objc_msgSend_1041( - _id, _lib._sel_setMultipathServiceType_1, value); - } - - @override - NSURLSessionConfiguration init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionConfiguration new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionConfiguration1, _lib._sel_new1); - return NSURLSessionConfiguration._(_ret, _lib, - retain: false, release: true); - } - - static NSURLSessionConfiguration backgroundSessionConfiguration_( - ThermionDartTexture1 _lib, NSString identifier) { - final _ret = _lib._objc_msgSend_1028(_lib._class_NSURLSessionConfiguration1, - _lib._sel_backgroundSessionConfiguration_1, identifier._id); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionConfiguration allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3(_lib._class_NSURLSessionConfiguration1, - _lib._sel_allocWithZone_1, zone); - return NSURLSessionConfiguration._(_ret, _lib, - retain: false, release: true); - } - - static NSURLSessionConfiguration alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionConfiguration1, _lib._sel_alloc1); - return NSURLSessionConfiguration._(_ret, _lib, - retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLSessionConfiguration1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLSessionConfiguration1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLSessionConfiguration1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLSessionConfiguration1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLSessionConfiguration1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLSessionConfiguration1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLSessionConfiguration1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLSessionConfiguration1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionConfiguration1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class SSLProtocol { - static const int kSSLProtocolUnknown = 0; - static const int kTLSProtocol1 = 4; - static const int kTLSProtocol11 = 7; - static const int kTLSProtocol12 = 8; - static const int kDTLSProtocol1 = 9; - static const int kTLSProtocol13 = 10; - static const int kDTLSProtocol12 = 11; - static const int kTLSProtocolMaxSupported = 999; - static const int kSSLProtocol2 = 1; - static const int kSSLProtocol3 = 2; - static const int kSSLProtocol3Only = 3; - static const int kTLSProtocol1Only = 5; - static const int kSSLProtocolAll = 6; -} - -abstract class tls_protocol_version_t { - static const int tls_protocol_version_TLSv10 = 769; - static const int tls_protocol_version_TLSv11 = 770; - static const int tls_protocol_version_TLSv12 = 771; - static const int tls_protocol_version_TLSv13 = 772; - static const int tls_protocol_version_DTLSv10 = -257; - static const int tls_protocol_version_DTLSv12 = -259; -} - -abstract class NSURLSessionMultipathServiceType { - static const int NSURLSessionMultipathServiceTypeNone = 0; - static const int NSURLSessionMultipathServiceTypeHandover = 1; - static const int NSURLSessionMultipathServiceTypeInteractive = 2; - static const int NSURLSessionMultipathServiceTypeAggregate = 3; -} - -void _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_registerClosure( - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = ++_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSArray_NSArray_NSArray extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSArray_NSArray_NSArray._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSArray_NSArray_NSArray.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSArray_NSArray_NSArray.fromFunction(ThermionDartTexture1 lib, void Function(NSArray, NSArray, NSArray) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - NSArray._(arg0, lib, retain: true, release: true), - NSArray._(arg1, lib, retain: true, release: true), - NSArray._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSArray_NSArray_NSArray.listener(ThermionDartTexture1 lib, void Function(NSArray, NSArray, NSArray) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - NSArray._(arg0, lib, retain: true, release: true), - NSArray._(arg1, lib, retain: true, release: true), - NSArray._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSArray arg0, NSArray arg1, NSArray arg2) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id, arg2._id); -} - -void _ObjCBlock_ffiVoid_NSArray1_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSArray1_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSArray1_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSArray1_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSArray1_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSArray1_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSArray1_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSArray1_closureRegistry[block.ref.target.address]!( - arg0); - -class ObjCBlock_ffiVoid_NSArray1 extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSArray1._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSArray1.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray1_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSArray1.fromFunction( - ThermionDartTexture1 lib, void Function(NSArray) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray1_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSArray1_registerClosure( - (ffi.Pointer arg0) => - fn(NSArray._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSArray1.listener( - ThermionDartTexture1 lib, void Function(NSArray) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSArray1_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSArray1_registerClosure( - (ffi.Pointer arg0) => - fn(NSArray._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSArray arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0._id); -} - -class NSURLSessionUploadTask extends NSURLSessionDataTask { - NSURLSessionUploadTask._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSessionUploadTask] that points to the same underlying object as [other]. - static NSURLSessionUploadTask castFrom(T other) { - return NSURLSessionUploadTask._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLSessionUploadTask] that wraps the given raw object pointer. - static NSURLSessionUploadTask castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionUploadTask._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLSessionUploadTask]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLSessionUploadTask1); - } - - @override - NSURLSessionUploadTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionUploadTask new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionUploadTask1, _lib._sel_new1); - return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionUploadTask allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionUploadTask1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionUploadTask alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionUploadTask1, _lib._sel_alloc1); - return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLSessionUploadTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLSessionUploadTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLSessionUploadTask1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLSessionUploadTask1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLSessionUploadTask1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLSessionUploadTask1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLSessionUploadTask1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLSessionUploadTask1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionUploadTask1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSURLSessionDownloadTask extends NSURLSessionTask { - NSURLSessionDownloadTask._( - ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSessionDownloadTask] that points to the same underlying object as [other]. - static NSURLSessionDownloadTask castFrom(T other) { - return NSURLSessionDownloadTask._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLSessionDownloadTask] that wraps the given raw object pointer. - static NSURLSessionDownloadTask castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionDownloadTask._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLSessionDownloadTask]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLSessionDownloadTask1); - } - - void cancelByProducingResumeData_( - ObjCBlock_ffiVoid_NSData completionHandler) { - _lib._objc_msgSend_1051( - _id, _lib._sel_cancelByProducingResumeData_1, completionHandler._id); - } - - @override - NSURLSessionDownloadTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionDownloadTask new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionDownloadTask1, _lib._sel_new1); - return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionDownloadTask allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionDownloadTask1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionDownloadTask alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionDownloadTask1, _lib._sel_alloc1); - return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLSessionDownloadTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLSessionDownloadTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLSessionDownloadTask1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLSessionDownloadTask1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLSessionDownloadTask1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLSessionDownloadTask1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLSessionDownloadTask1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLSessionDownloadTask1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionDownloadTask1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSData_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSData_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSData_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSData_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSData_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSData_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSData_closureRegistry[block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_NSData extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSData._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSData.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSData.fromFunction( - ThermionDartTexture1 lib, void Function(NSData?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSData_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSData.listener( - ThermionDartTexture1 lib, void Function(NSData?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSData_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSData? arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0?._id ?? ffi.nullptr); -} - -class NSURLSessionStreamTask extends NSURLSessionTask { - NSURLSessionStreamTask._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSessionStreamTask] that points to the same underlying object as [other]. - static NSURLSessionStreamTask castFrom(T other) { - return NSURLSessionStreamTask._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLSessionStreamTask] that wraps the given raw object pointer. - static NSURLSessionStreamTask castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionStreamTask._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLSessionStreamTask]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLSessionStreamTask1); - } - - void readDataOfMinLength_maxLength_timeout_completionHandler_( - int minBytes, - int maxBytes, - double timeout, - ObjCBlock_ffiVoid_NSData_bool_NSError completionHandler) { - _lib._objc_msgSend_1055( - _id, - _lib._sel_readDataOfMinLength_maxLength_timeout_completionHandler_1, - minBytes, - maxBytes, - timeout, - completionHandler._id); - } - - void writeData_timeout_completionHandler_(NSData data, double timeout, - ObjCBlock_ffiVoid_NSError completionHandler) { - _lib._objc_msgSend_1056( - _id, - _lib._sel_writeData_timeout_completionHandler_1, - data._id, - timeout, - completionHandler._id); - } - - void captureStreams() { - _lib._objc_msgSend_1(_id, _lib._sel_captureStreams1); - } - - void closeWrite() { - _lib._objc_msgSend_1(_id, _lib._sel_closeWrite1); - } - - void closeRead() { - _lib._objc_msgSend_1(_id, _lib._sel_closeRead1); - } - - void startSecureConnection() { - _lib._objc_msgSend_1(_id, _lib._sel_startSecureConnection1); - } - - void stopSecureConnection() { - _lib._objc_msgSend_1(_id, _lib._sel_stopSecureConnection1); - } - - @override - NSURLSessionStreamTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionStreamTask new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionStreamTask1, _lib._sel_new1); - return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionStreamTask allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionStreamTask1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionStreamTask alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionStreamTask1, _lib._sel_alloc1); - return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLSessionStreamTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLSessionStreamTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLSessionStreamTask1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLSessionStreamTask1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLSessionStreamTask1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLSessionStreamTask1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLSessionStreamTask1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLSessionStreamTask1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionStreamTask1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -void _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, bool, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistry = , bool, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSData_bool_NSError_registerClosure( - void Function(ffi.Pointer, bool, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSData_bool_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSData_bool_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSData_bool_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSData_bool_NSError.fromFunction( - ThermionDartTexture1 lib, void Function(NSData, bool, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSData_bool_NSError_registerClosure( - (ffi.Pointer arg0, bool arg1, - ffi.Pointer arg2) => - fn(NSData._(arg0, lib, retain: true, release: true), arg1, arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSData_bool_NSError.listener( - ThermionDartTexture1 lib, void Function(NSData, bool, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSData_bool_NSError_registerClosure( - (ffi.Pointer arg0, bool arg1, - ffi.Pointer arg2) => - fn(NSData._(arg0, lib, retain: true, release: true), arg1, arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Bool, ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSData arg0, bool arg1, NSError? arg2) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Bool arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - bool, ffi.Pointer)>()( - _id, arg0._id, arg1, arg2?._id ?? ffi.nullptr); -} - -class NSNetService extends NSObject { - NSNetService._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSNetService] that points to the same underlying object as [other]. - static NSNetService castFrom(T other) { - return NSNetService._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSNetService] that wraps the given raw object pointer. - static NSNetService castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSNetService._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSNetService]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSNetService1); - } - - NSNetService initWithDomain_type_name_port_( - NSString domain, NSString type, NSString name, int port) { - final _ret = _lib._objc_msgSend_1058( - _id, - _lib._sel_initWithDomain_type_name_port_1, - domain._id, - type._id, - name._id, - port); - return NSNetService._(_ret, _lib, retain: true, release: true); - } - - NSNetService initWithDomain_type_name_( - NSString domain, NSString type, NSString name) { - final _ret = _lib._objc_msgSend_1059(_id, - _lib._sel_initWithDomain_type_name_1, domain._id, type._id, name._id); - return NSNetService._(_ret, _lib, retain: true, release: true); - } - - void scheduleInRunLoop_forMode_(NSRunLoop aRunLoop, NSString mode) { - _lib._objc_msgSend_568( - _id, _lib._sel_scheduleInRunLoop_forMode_1, aRunLoop._id, mode._id); - } - - void removeFromRunLoop_forMode_(NSRunLoop aRunLoop, NSString mode) { - _lib._objc_msgSend_568( - _id, _lib._sel_removeFromRunLoop_forMode_1, aRunLoop._id, mode._id); - } - - NSObject? get delegate { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set delegate(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); - } - - bool get includesPeerToPeer { - return _lib._objc_msgSend_12(_id, _lib._sel_includesPeerToPeer1); - } - - set includesPeerToPeer(bool value) { - return _lib._objc_msgSend_526( - _id, _lib._sel_setIncludesPeerToPeer_1, value); - } - - NSString get name { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_name1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get type { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_type1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get domain { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_domain1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get hostName { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_hostName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray? get addresses { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_addresses1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - int get port { - return _lib._objc_msgSend_82(_id, _lib._sel_port1); - } - - void publish() { - _lib._objc_msgSend_1(_id, _lib._sel_publish1); - } - - void publishWithOptions_(int options) { - _lib._objc_msgSend_1060(_id, _lib._sel_publishWithOptions_1, options); - } - - void resolve() { - _lib._objc_msgSend_1(_id, _lib._sel_resolve1); - } - - void stop() { - _lib._objc_msgSend_1(_id, _lib._sel_stop1); - } - - static NSDictionary dictionaryFromTXTRecordData_( - ThermionDartTexture1 _lib, NSData txtData) { - final _ret = _lib._objc_msgSend_1061(_lib._class_NSNetService1, - _lib._sel_dictionaryFromTXTRecordData_1, txtData._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSData dataFromTXTRecordDictionary_( - ThermionDartTexture1 _lib, NSDictionary txtDictionary) { - final _ret = _lib._objc_msgSend_1062(_lib._class_NSNetService1, - _lib._sel_dataFromTXTRecordDictionary_1, txtDictionary._id); - return NSData._(_ret, _lib, retain: true, release: true); - } - - void resolveWithTimeout_(double timeout) { - _lib._objc_msgSend_540(_id, _lib._sel_resolveWithTimeout_1, timeout); - } - - bool getInputStream_outputStream_( - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - return _lib._objc_msgSend_1063(_id, _lib._sel_getInputStream_outputStream_1, - inputStream, outputStream); - } - - bool setTXTRecordData_(NSData? recordData) { - return _lib._objc_msgSend_1064( - _id, _lib._sel_setTXTRecordData_1, recordData?._id ?? ffi.nullptr); - } - - NSData? TXTRecordData() { - final _ret = _lib._objc_msgSend_285(_id, _lib._sel_TXTRecordData1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - void startMonitoring() { - _lib._objc_msgSend_1(_id, _lib._sel_startMonitoring1); - } - - void stopMonitoring() { - _lib._objc_msgSend_1(_id, _lib._sel_stopMonitoring1); - } - - @override - NSNetService init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSNetService._(_ret, _lib, retain: true, release: true); - } - - static NSNetService new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSNetService1, _lib._sel_new1); - return NSNetService._(_ret, _lib, retain: false, release: true); - } - - static NSNetService allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSNetService1, _lib._sel_allocWithZone_1, zone); - return NSNetService._(_ret, _lib, retain: false, release: true); - } - - static NSNetService alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSNetService1, _lib._sel_alloc1); - return NSNetService._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSNetService1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSNetService1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSNetService1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSNetService1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSNetService1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSNetService1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSNetService1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSNetService1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSNetService1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSNetServiceOptions { - static const int NSNetServiceNoAutoRename = 1; - static const int NSNetServiceListenForConnections = 2; -} - -class NSURLSessionWebSocketTask extends NSURLSessionTask { - NSURLSessionWebSocketTask._( - ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSessionWebSocketTask] that points to the same underlying object as [other]. - static NSURLSessionWebSocketTask castFrom(T other) { - return NSURLSessionWebSocketTask._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLSessionWebSocketTask] that wraps the given raw object pointer. - static NSURLSessionWebSocketTask castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionWebSocketTask._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLSessionWebSocketTask]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLSessionWebSocketTask1); - } - - void sendMessage_completionHandler_(NSURLSessionWebSocketMessage message, - ObjCBlock_ffiVoid_NSError completionHandler) { - _lib._objc_msgSend_1067(_id, _lib._sel_sendMessage_completionHandler_1, - message._id, completionHandler._id); - } - - void receiveMessageWithCompletionHandler_( - ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError - completionHandler) { - _lib._objc_msgSend_1068(_id, - _lib._sel_receiveMessageWithCompletionHandler_1, completionHandler._id); - } - - void sendPingWithPongReceiveHandler_( - ObjCBlock_ffiVoid_NSError pongReceiveHandler) { - _lib._objc_msgSend_1069(_id, _lib._sel_sendPingWithPongReceiveHandler_1, - pongReceiveHandler._id); - } - - void cancelWithCloseCode_reason_(int closeCode, NSData? reason) { - _lib._objc_msgSend_1070(_id, _lib._sel_cancelWithCloseCode_reason_1, - closeCode, reason?._id ?? ffi.nullptr); - } - - int get maximumMessageSize { - return _lib._objc_msgSend_82(_id, _lib._sel_maximumMessageSize1); - } - - set maximumMessageSize(int value) { - return _lib._objc_msgSend_634( - _id, _lib._sel_setMaximumMessageSize_1, value); - } - - int get closeCode { - return _lib._objc_msgSend_1071(_id, _lib._sel_closeCode1); - } - - NSData? get closeReason { - final _ret = _lib._objc_msgSend_285(_id, _lib._sel_closeReason1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - @override - NSURLSessionWebSocketTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionWebSocketTask new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionWebSocketTask1, _lib._sel_new1); - return NSURLSessionWebSocketTask._(_ret, _lib, - retain: false, release: true); - } - - static NSURLSessionWebSocketTask allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3(_lib._class_NSURLSessionWebSocketTask1, - _lib._sel_allocWithZone_1, zone); - return NSURLSessionWebSocketTask._(_ret, _lib, - retain: false, release: true); - } - - static NSURLSessionWebSocketTask alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionWebSocketTask1, _lib._sel_alloc1); - return NSURLSessionWebSocketTask._(_ret, _lib, - retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLSessionWebSocketTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLSessionWebSocketTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketTask1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSURLSessionWebSocketTask1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSURLSessionWebSocketTask1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLSessionWebSocketTask1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLSessionWebSocketTask1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_NSURLSessionWebSocketTask1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionWebSocketTask1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSURLSessionWebSocketMessage extends NSObject { - NSURLSessionWebSocketMessage._( - ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSessionWebSocketMessage] that points to the same underlying object as [other]. - static NSURLSessionWebSocketMessage castFrom( - T other) { - return NSURLSessionWebSocketMessage._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSURLSessionWebSocketMessage] that wraps the given raw object pointer. - static NSURLSessionWebSocketMessage castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionWebSocketMessage._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLSessionWebSocketMessage]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLSessionWebSocketMessage1); - } - - NSURLSessionWebSocketMessage initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_278(_id, _lib._sel_initWithData_1, data._id); - return NSURLSessionWebSocketMessage._(_ret, _lib, - retain: true, release: true); - } - - NSURLSessionWebSocketMessage initWithString_(NSString string) { - final _ret = - _lib._objc_msgSend_31(_id, _lib._sel_initWithString_1, string._id); - return NSURLSessionWebSocketMessage._(_ret, _lib, - retain: true, release: true); - } - - int get type { - return _lib._objc_msgSend_1066(_id, _lib._sel_type1); - } - - NSData? get data { - final _ret = _lib._objc_msgSend_285(_id, _lib._sel_data1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSString? get string { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_string1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - @override - NSURLSessionWebSocketMessage init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionWebSocketMessage._(_ret, _lib, - retain: true, release: true); - } - - static NSURLSessionWebSocketMessage new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionWebSocketMessage1, _lib._sel_new1); - return NSURLSessionWebSocketMessage._(_ret, _lib, - retain: false, release: true); - } - - static NSURLSessionWebSocketMessage allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3(_lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_allocWithZone_1, zone); - return NSURLSessionWebSocketMessage._(_ret, _lib, - retain: false, release: true); - } - - static NSURLSessionWebSocketMessage alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionWebSocketMessage1, _lib._sel_alloc1); - return NSURLSessionWebSocketMessage._(_ret, _lib, - retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62( - _lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, - key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSURLSessionWebSocketMessageType { - static const int NSURLSessionWebSocketMessageTypeData = 0; - static const int NSURLSessionWebSocketMessageTypeString = 1; -} - -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = - ++_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistry[id] = - fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError.fromFunction( - ThermionDartTexture1 lib, - void Function(NSURLSessionWebSocketMessage?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 ? null : NSURLSessionWebSocketMessage._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError.listener( - ThermionDartTexture1 lib, - void Function(NSURLSessionWebSocketMessage?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSURLSessionWebSocketMessage._(arg0, lib, - retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSURLSessionWebSocketMessage? arg0, NSError? arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1?._id ?? ffi.nullptr); -} - -abstract class NSURLSessionWebSocketCloseCode { - static const int NSURLSessionWebSocketCloseCodeInvalid = 0; - static const int NSURLSessionWebSocketCloseCodeNormalClosure = 1000; - static const int NSURLSessionWebSocketCloseCodeGoingAway = 1001; - static const int NSURLSessionWebSocketCloseCodeProtocolError = 1002; - static const int NSURLSessionWebSocketCloseCodeUnsupportedData = 1003; - static const int NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005; - static const int NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006; - static const int NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007; - static const int NSURLSessionWebSocketCloseCodePolicyViolation = 1008; - static const int NSURLSessionWebSocketCloseCodeMessageTooBig = 1009; - static const int NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = - 1010; - static const int NSURLSessionWebSocketCloseCodeInternalServerError = 1011; - static const int NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015; -} - -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError.fromFunction( - ThermionDartTexture1 lib, - void Function(NSData?, NSURLResponse?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSURLResponse._(arg1, lib, retain: true, release: true), - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError.listener( - ThermionDartTexture1 lib, - void Function(NSData?, NSURLResponse?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_registerClosure((ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSURLResponse._(arg1, lib, retain: true, release: true), - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSData? arg0, NSURLResponse? arg1, NSError? arg2) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - _id, - arg0?._id ?? ffi.nullptr, - arg1?._id ?? ffi.nullptr, - arg2?._id ?? ffi.nullptr); -} - -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError.fromFunction( - ThermionDartTexture1 lib, - void Function(NSURL?, NSURLResponse?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSURLResponse._(arg1, lib, retain: true, release: true), - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError.listener( - ThermionDartTexture1 lib, - void Function(NSURL?, NSURLResponse?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_registerClosure((ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSURLResponse._(arg1, lib, retain: true, release: true), - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSURL? arg0, NSURLResponse? arg1, NSError? arg2) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - _id, - arg0?._id ?? ffi.nullptr, - arg1?._id ?? ffi.nullptr, - arg2?._id ?? ffi.nullptr); -} - -class NSProtocolChecker extends NSProxy { - NSProtocolChecker._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSProtocolChecker] that points to the same underlying object as [other]. - static NSProtocolChecker castFrom(T other) { - return NSProtocolChecker._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSProtocolChecker] that wraps the given raw object pointer. - static NSProtocolChecker castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSProtocolChecker._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSProtocolChecker]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSProtocolChecker1); - } - - Protocol get protocol { - final _ret = _lib._objc_msgSend_1082(_id, _lib._sel_protocol1); - return Protocol._(_ret, _lib, retain: true, release: true); - } - - NSObject? get target { - final _ret = _lib._objc_msgSend_900(_id, _lib._sel_target1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSProtocolChecker protocolCheckerWithTarget_protocol_( - ThermionDartTexture1 _lib, NSObject anObject, Protocol aProtocol) { - final _ret = _lib._objc_msgSend_1083( - _lib._class_NSProtocolChecker1, - _lib._sel_protocolCheckerWithTarget_protocol_1, - anObject._id, - aProtocol._id); - return NSProtocolChecker._(_ret, _lib, retain: true, release: true); - } - - NSProtocolChecker initWithTarget_protocol_( - NSObject anObject, Protocol aProtocol) { - final _ret = _lib._objc_msgSend_1083( - _id, _lib._sel_initWithTarget_protocol_1, anObject._id, aProtocol._id); - return NSProtocolChecker._(_ret, _lib, retain: true, release: true); - } - - static NSObject alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSProtocolChecker1, _lib._sel_alloc1); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - static bool respondsToSelector_( - ThermionDartTexture1 _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_4(_lib._class_NSProtocolChecker1, - _lib._sel_respondsToSelector_1, aSelector); - } -} - -class NSTask extends NSObject { - NSTask._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSTask] that points to the same underlying object as [other]. - static NSTask castFrom(T other) { - return NSTask._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSTask] that wraps the given raw object pointer. - static NSTask castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSTask._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSTask]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTask1); - } - - @override - NSTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSTask._(_ret, _lib, retain: true, release: true); - } - - NSURL? get executableURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_executableURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - set executableURL(NSURL? value) { - return _lib._objc_msgSend_670( - _id, _lib._sel_setExecutableURL_1, value?._id ?? ffi.nullptr); - } - - NSArray? get arguments { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_arguments1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - set arguments(NSArray? value) { - return _lib._objc_msgSend_1039( - _id, _lib._sel_setArguments_1, value?._id ?? ffi.nullptr); - } - - NSDictionary? get environment { - final _ret = _lib._objc_msgSend_389(_id, _lib._sel_environment1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - set environment(NSDictionary? value) { - return _lib._objc_msgSend_633( - _id, _lib._sel_setEnvironment_1, value?._id ?? ffi.nullptr); - } - - NSURL? get currentDirectoryURL { - final _ret = _lib._objc_msgSend_44(_id, _lib._sel_currentDirectoryURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - set currentDirectoryURL(NSURL? value) { - return _lib._objc_msgSend_670( - _id, _lib._sel_setCurrentDirectoryURL_1, value?._id ?? ffi.nullptr); - } - - NSObject? get standardInput { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_standardInput1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set standardInput(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setStandardInput_1, value?._id ?? ffi.nullptr); - } - - NSObject? get standardOutput { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_standardOutput1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set standardOutput(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setStandardOutput_1, value?._id ?? ffi.nullptr); - } - - NSObject? get standardError { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_standardError1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set standardError(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setStandardError_1, value?._id ?? ffi.nullptr); - } - - bool launchAndReturnError_(ffi.Pointer> error) { - return _lib._objc_msgSend_242(_id, _lib._sel_launchAndReturnError_1, error); - } - - void interrupt() { - _lib._objc_msgSend_1(_id, _lib._sel_interrupt1); - } - - void terminate() { - _lib._objc_msgSend_1(_id, _lib._sel_terminate1); - } - - bool suspend() { - return _lib._objc_msgSend_12(_id, _lib._sel_suspend1); - } - - bool resume() { - return _lib._objc_msgSend_12(_id, _lib._sel_resume1); - } - - int get processIdentifier { - return _lib._objc_msgSend_236(_id, _lib._sel_processIdentifier1); - } - - bool get running { - return _lib._objc_msgSend_12(_id, _lib._sel_isRunning1); - } - - int get terminationStatus { - return _lib._objc_msgSend_236(_id, _lib._sel_terminationStatus1); - } - - int get terminationReason { - return _lib._objc_msgSend_1084(_id, _lib._sel_terminationReason1); - } - - ObjCBlock_ffiVoid_NSTask? get terminationHandler { - final _ret = _lib._objc_msgSend_1085(_id, _lib._sel_terminationHandler1); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid_NSTask._(_ret, _lib, retain: true, release: true); - } - - set terminationHandler(ObjCBlock_ffiVoid_NSTask? value) { - return _lib._objc_msgSend_1086( - _id, _lib._sel_setTerminationHandler_1, value?._id ?? ffi.nullptr); - } - - int get qualityOfService { - return _lib._objc_msgSend_542(_id, _lib._sel_qualityOfService1); - } - - set qualityOfService(int value) { - return _lib._objc_msgSend_543(_id, _lib._sel_setQualityOfService_1, value); - } - - static NSTask? - launchedTaskWithExecutableURL_arguments_error_terminationHandler_( - ThermionDartTexture1 _lib, - NSURL url, - NSArray arguments, - ffi.Pointer> error, - ObjCBlock_ffiVoid_NSTask? terminationHandler) { - final _ret = _lib._objc_msgSend_1087( - _lib._class_NSTask1, - _lib._sel_launchedTaskWithExecutableURL_arguments_error_terminationHandler_1, - url._id, - arguments._id, - error, - terminationHandler?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSTask._(_ret, _lib, retain: true, release: true); - } - - void waitUntilExit() { - _lib._objc_msgSend_1(_id, _lib._sel_waitUntilExit1); - } - - NSString? get launchPath { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_launchPath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set launchPath(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setLaunchPath_1, value?._id ?? ffi.nullptr); - } - - NSString get currentDirectoryPath { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_currentDirectoryPath1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - set currentDirectoryPath(NSString value) { - return _lib._objc_msgSend_645( - _id, _lib._sel_setCurrentDirectoryPath_1, value._id); - } - - void launch() { - _lib._objc_msgSend_1(_id, _lib._sel_launch1); - } - - static NSTask launchedTaskWithLaunchPath_arguments_( - ThermionDartTexture1 _lib, NSString path, NSArray arguments) { - final _ret = _lib._objc_msgSend_1088( - _lib._class_NSTask1, - _lib._sel_launchedTaskWithLaunchPath_arguments_1, - path._id, - arguments._id); - return NSTask._(_ret, _lib, retain: true, release: true); - } - - static NSTask new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSTask1, _lib._sel_new1); - return NSTask._(_ret, _lib, retain: false, release: true); - } - - static NSTask allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSTask1, _lib._sel_allocWithZone_1, zone); - return NSTask._(_ret, _lib, retain: false, release: true); - } - - static NSTask alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSTask1, _lib._sel_alloc1); - return NSTask._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSTask1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSTask1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSTask1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSTask1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSTask1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSTask1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSTask1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSTask1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSTaskTerminationReason { - static const int NSTaskTerminationReasonExit = 1; - static const int NSTaskTerminationReasonUncaughtSignal = 2; -} - -void _ObjCBlock_ffiVoid_NSTask_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSTask_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSTask_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSTask_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSTask_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSTask_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSTask_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSTask_closureRegistry[block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_NSTask extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSTask._( - ffi.Pointer<_ObjCBlock> id, ThermionDartTexture1 lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSTask.fromFunctionPointer( - ThermionDartTexture1 lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSTask_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - ObjCBlock_ffiVoid_NSTask.fromFunction( - ThermionDartTexture1 lib, void Function(NSTask) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSTask_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSTask_registerClosure( - (ffi.Pointer arg0) => - fn(NSTask._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSTask.listener( - ThermionDartTexture1 lib, void Function(NSTask) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSTask_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSTask_registerClosure( - (ffi.Pointer arg0) => - fn(NSTask._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSTask arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0._id); -} - -class NSXMLElement extends NSXMLNode { - NSXMLElement._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSXMLElement] that points to the same underlying object as [other]. - static NSXMLElement castFrom(T other) { - return NSXMLElement._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSXMLElement] that wraps the given raw object pointer. - static NSXMLElement castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSXMLElement._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSXMLElement]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLElement1); - } - - NSXMLElement initWithName_(NSString name) { - final _ret = _lib._objc_msgSend_31(_id, _lib._sel_initWithName_1, name._id); - return NSXMLElement._(_ret, _lib, retain: true, release: true); - } - - NSXMLElement initWithName_URI_(NSString name, NSString? URI) { - final _ret = _lib._objc_msgSend_1125( - _id, _lib._sel_initWithName_URI_1, name._id, URI?._id ?? ffi.nullptr); - return NSXMLElement._(_ret, _lib, retain: true, release: true); - } - - NSXMLElement initWithName_stringValue_(NSString name, NSString? string) { - final _ret = _lib._objc_msgSend_1125( - _id, - _lib._sel_initWithName_stringValue_1, - name._id, - string?._id ?? ffi.nullptr); - return NSXMLElement._(_ret, _lib, retain: true, release: true); - } - - NSXMLElement? initWithXMLString_error_( - NSString string, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_302( - _id, _lib._sel_initWithXMLString_error_1, string._id, error); - return _ret.address == 0 - ? null - : NSXMLElement._(_ret, _lib, retain: true, release: true); - } - - @override - NSXMLElement initWithKind_options_(int kind, int options) { - final _ret = _lib._objc_msgSend_1090( - _id, _lib._sel_initWithKind_options_1, kind, options); - return NSXMLElement._(_ret, _lib, retain: true, release: true); - } - - NSArray elementsForName_(NSString name) { - final _ret = - _lib._objc_msgSend_357(_id, _lib._sel_elementsForName_1, name._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray elementsForLocalName_URI_(NSString localName, NSString? URI) { - final _ret = _lib._objc_msgSend_1126( - _id, - _lib._sel_elementsForLocalName_URI_1, - localName._id, - URI?._id ?? ffi.nullptr); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - void addAttribute_(NSXMLNode attribute) { - _lib._objc_msgSend_1104(_id, _lib._sel_addAttribute_1, attribute._id); - } - - void removeAttributeForName_(NSString name) { - _lib._objc_msgSend_247(_id, _lib._sel_removeAttributeForName_1, name._id); - } - - NSArray? get attributes { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_attributes1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - set attributes(NSArray? value) { - return _lib._objc_msgSend_1039( - _id, _lib._sel_setAttributes_1, value?._id ?? ffi.nullptr); - } - - void setAttributesWithDictionary_(NSDictionary attributes) { - _lib._objc_msgSend_508( - _id, _lib._sel_setAttributesWithDictionary_1, attributes._id); - } - - NSXMLNode? attributeForName_(NSString name) { - final _ret = - _lib._objc_msgSend_1108(_id, _lib._sel_attributeForName_1, name._id); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLNode? attributeForLocalName_URI_(NSString localName, NSString? URI) { - final _ret = _lib._objc_msgSend_1127( - _id, - _lib._sel_attributeForLocalName_URI_1, - localName._id, - URI?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - void addNamespace_(NSXMLNode aNamespace) { - _lib._objc_msgSend_1104(_id, _lib._sel_addNamespace_1, aNamespace._id); - } - - void removeNamespaceForPrefix_(NSString name) { - _lib._objc_msgSend_247(_id, _lib._sel_removeNamespaceForPrefix_1, name._id); - } - - NSArray? get namespaces { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_namespaces1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - set namespaces(NSArray? value) { - return _lib._objc_msgSend_1039( - _id, _lib._sel_setNamespaces_1, value?._id ?? ffi.nullptr); - } - - NSXMLNode? namespaceForPrefix_(NSString name) { - final _ret = - _lib._objc_msgSend_1108(_id, _lib._sel_namespaceForPrefix_1, name._id); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLNode? resolveNamespaceForName_(NSString name) { - final _ret = _lib._objc_msgSend_1108( - _id, _lib._sel_resolveNamespaceForName_1, name._id); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - NSString? resolvePrefixForNamespaceURI_(NSString namespaceURI) { - final _ret = _lib._objc_msgSend_185( - _id, _lib._sel_resolvePrefixForNamespaceURI_1, namespaceURI._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - void insertChild_atIndex_(NSXMLNode child, int index) { - _lib._objc_msgSend_1102( - _id, _lib._sel_insertChild_atIndex_1, child._id, index); - } - - void insertChildren_atIndex_(NSArray children, int index) { - _lib._objc_msgSend_1103( - _id, _lib._sel_insertChildren_atIndex_1, children._id, index); - } - - void removeChildAtIndex_(int index) { - _lib._objc_msgSend_469(_id, _lib._sel_removeChildAtIndex_1, index); - } - - void setChildren_(NSArray? children) { - _lib._objc_msgSend_838( - _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); - } - - void addChild_(NSXMLNode child) { - _lib._objc_msgSend_1104(_id, _lib._sel_addChild_1, child._id); - } - - void replaceChildAtIndex_withNode_(int index, NSXMLNode node) { - _lib._objc_msgSend_1105( - _id, _lib._sel_replaceChildAtIndex_withNode_1, index, node._id); - } - - void normalizeAdjacentTextNodesPreservingCDATA_(bool preserve) { - _lib._objc_msgSend_866( - _id, _lib._sel_normalizeAdjacentTextNodesPreservingCDATA_1, preserve); - } - - void setAttributesAsDictionary_(NSDictionary attributes) { - _lib._objc_msgSend_508( - _id, _lib._sel_setAttributesAsDictionary_1, attributes._id); - } - - @override - NSXMLElement init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSXMLElement._(_ret, _lib, retain: true, release: true); - } - - @override - NSXMLElement initWithKind_(int kind) { - final _ret = _lib._objc_msgSend_1089(_id, _lib._sel_initWithKind_1, kind); - return NSXMLElement._(_ret, _lib, retain: true, release: true); - } - - static NSObject document(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_document1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject documentWithRootElement_( - ThermionDartTexture1 _lib, NSXMLElement element) { - final _ret = _lib._objc_msgSend_1091(_lib._class_NSXMLElement1, - _lib._sel_documentWithRootElement_1, element._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSXMLElement1, _lib._sel_elementWithName_1, name._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_URI_( - ThermionDartTexture1 _lib, NSString name, NSString URI) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLElement1, - _lib._sel_elementWithName_URI_1, name._id, URI._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString string) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLElement1, - _lib._sel_elementWithName_stringValue_1, name._id, string._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_children_attributes_( - ThermionDartTexture1 _lib, - NSString name, - NSArray? children, - NSArray? attributes) { - final _ret = _lib._objc_msgSend_1093( - _lib._class_NSXMLElement1, - _lib._sel_elementWithName_children_attributes_1, - name._id, - children?._id ?? ffi.nullptr, - attributes?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject attributeWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLElement1, - _lib._sel_attributeWithName_stringValue_1, name._id, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject attributeWithName_URI_stringValue_(ThermionDartTexture1 _lib, - NSString name, NSString URI, NSString stringValue) { - final _ret = _lib._objc_msgSend_1059( - _lib._class_NSXMLElement1, - _lib._sel_attributeWithName_URI_stringValue_1, - name._id, - URI._id, - stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject namespaceWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLElement1, - _lib._sel_namespaceWithName_stringValue_1, name._id, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject processingInstructionWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092( - _lib._class_NSXMLElement1, - _lib._sel_processingInstructionWithName_stringValue_1, - name._id, - stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject commentWithStringValue_( - ThermionDartTexture1 _lib, NSString stringValue) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSXMLElement1, - _lib._sel_commentWithStringValue_1, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject textWithStringValue_( - ThermionDartTexture1 _lib, NSString stringValue) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSXMLElement1, - _lib._sel_textWithStringValue_1, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? DTDNodeWithXMLString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSXMLElement1, - _lib._sel_DTDNodeWithXMLString_1, string._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSString localNameForName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_68( - _lib._class_NSXMLElement1, _lib._sel_localNameForName_1, name._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? prefixForName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_185( - _lib._class_NSXMLElement1, _lib._sel_prefixForName_1, name._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSXMLNode? predefinedNamespaceForPrefix_( - ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_1108(_lib._class_NSXMLElement1, - _lib._sel_predefinedNamespaceForPrefix_1, name._id); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - static NSXMLElement new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_new1); - return NSXMLElement._(_ret, _lib, retain: false, release: true); - } - - static NSXMLElement allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSXMLElement1, _lib._sel_allocWithZone_1, zone); - return NSXMLElement._(_ret, _lib, retain: false, release: true); - } - - static NSXMLElement alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_alloc1); - return NSXMLElement._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSXMLElement1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSXMLElement1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLElement1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLElement1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSXMLElement1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSXMLElement1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSXMLElement1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSXMLElement1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSXMLElement1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSXMLNode extends NSObject { - NSXMLNode._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSXMLNode] that points to the same underlying object as [other]. - static NSXMLNode castFrom(T other) { - return NSXMLNode._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSXMLNode] that wraps the given raw object pointer. - static NSXMLNode castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSXMLNode._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSXMLNode]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLNode1); - } - - @override - NSXMLNode init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLNode initWithKind_(int kind) { - final _ret = _lib._objc_msgSend_1089(_id, _lib._sel_initWithKind_1, kind); - return NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLNode initWithKind_options_(int kind, int options) { - final _ret = _lib._objc_msgSend_1090( - _id, _lib._sel_initWithKind_options_1, kind, options); - return NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - static NSObject document(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_document1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject documentWithRootElement_( - ThermionDartTexture1 _lib, NSXMLElement element) { - final _ret = _lib._objc_msgSend_1091(_lib._class_NSXMLNode1, - _lib._sel_documentWithRootElement_1, element._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSXMLNode1, _lib._sel_elementWithName_1, name._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_URI_( - ThermionDartTexture1 _lib, NSString name, NSString URI) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLNode1, - _lib._sel_elementWithName_URI_1, name._id, URI._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString string) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLNode1, - _lib._sel_elementWithName_stringValue_1, name._id, string._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_children_attributes_( - ThermionDartTexture1 _lib, - NSString name, - NSArray? children, - NSArray? attributes) { - final _ret = _lib._objc_msgSend_1093( - _lib._class_NSXMLNode1, - _lib._sel_elementWithName_children_attributes_1, - name._id, - children?._id ?? ffi.nullptr, - attributes?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject attributeWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLNode1, - _lib._sel_attributeWithName_stringValue_1, name._id, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject attributeWithName_URI_stringValue_(ThermionDartTexture1 _lib, - NSString name, NSString URI, NSString stringValue) { - final _ret = _lib._objc_msgSend_1059( - _lib._class_NSXMLNode1, - _lib._sel_attributeWithName_URI_stringValue_1, - name._id, - URI._id, - stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject namespaceWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLNode1, - _lib._sel_namespaceWithName_stringValue_1, name._id, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject processingInstructionWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092( - _lib._class_NSXMLNode1, - _lib._sel_processingInstructionWithName_stringValue_1, - name._id, - stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject commentWithStringValue_( - ThermionDartTexture1 _lib, NSString stringValue) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSXMLNode1, - _lib._sel_commentWithStringValue_1, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject textWithStringValue_( - ThermionDartTexture1 _lib, NSString stringValue) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSXMLNode1, - _lib._sel_textWithStringValue_1, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? DTDNodeWithXMLString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_38( - _lib._class_NSXMLNode1, _lib._sel_DTDNodeWithXMLString_1, string._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - int get kind { - return _lib._objc_msgSend_1094(_id, _lib._sel_kind1); - } - - NSString? get name { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_name1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set name(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); - } - - NSObject? get objectValue { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_objectValue1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set objectValue(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setObjectValue_1, value?._id ?? ffi.nullptr); - } - - NSString? get stringValue { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_stringValue1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set stringValue(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setStringValue_1, value?._id ?? ffi.nullptr); - } - - void setStringValue_resolvingEntities_(NSString string, bool resolve) { - _lib._objc_msgSend_1095( - _id, _lib._sel_setStringValue_resolvingEntities_1, string._id, resolve); - } - - int get index { - return _lib._objc_msgSend_10(_id, _lib._sel_index1); - } - - int get level { - return _lib._objc_msgSend_10(_id, _lib._sel_level1); - } - - NSXMLDocument? get rootDocument { - final _ret = _lib._objc_msgSend_1119(_id, _lib._sel_rootDocument1); - return _ret.address == 0 - ? null - : NSXMLDocument._(_ret, _lib, retain: true, release: true); - } - - NSXMLNode? get parent { - final _ret = _lib._objc_msgSend_1120(_id, _lib._sel_parent1); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - int get childCount { - return _lib._objc_msgSend_10(_id, _lib._sel_childCount1); - } - - NSArray? get children { - final _ret = _lib._objc_msgSend_83(_id, _lib._sel_children1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSXMLNode? childAtIndex_(int index) { - final _ret = _lib._objc_msgSend_1121(_id, _lib._sel_childAtIndex_1, index); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLNode? get previousSibling { - final _ret = _lib._objc_msgSend_1120(_id, _lib._sel_previousSibling1); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLNode? get nextSibling { - final _ret = _lib._objc_msgSend_1120(_id, _lib._sel_nextSibling1); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLNode? get previousNode { - final _ret = _lib._objc_msgSend_1120(_id, _lib._sel_previousNode1); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLNode? get nextNode { - final _ret = _lib._objc_msgSend_1120(_id, _lib._sel_nextNode1); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - void detach() { - _lib._objc_msgSend_1(_id, _lib._sel_detach1); - } - - NSString? get XPath { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_XPath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get localName { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_localName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get prefix { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_prefix1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get URI { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_URI1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set URI(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setURI_1, value?._id ?? ffi.nullptr); - } - - static NSString localNameForName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_68( - _lib._class_NSXMLNode1, _lib._sel_localNameForName_1, name._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? prefixForName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_185( - _lib._class_NSXMLNode1, _lib._sel_prefixForName_1, name._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSXMLNode? predefinedNamespaceForPrefix_( - ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_1108(_lib._class_NSXMLNode1, - _lib._sel_predefinedNamespaceForPrefix_1, name._id); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - NSString get description { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get XMLString { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_XMLString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString XMLStringWithOptions_(int options) { - final _ret = - _lib._objc_msgSend_1122(_id, _lib._sel_XMLStringWithOptions_1, options); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString canonicalXMLStringPreservingComments_(bool comments) { - final _ret = _lib._objc_msgSend_1123( - _id, _lib._sel_canonicalXMLStringPreservingComments_1, comments); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray? nodesForXPath_error_( - NSString xpath, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_442( - _id, _lib._sel_nodesForXPath_error_1, xpath._id, error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray? objectsForXQuery_constants_error_(NSString xquery, - NSDictionary? constants, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_1124( - _id, - _lib._sel_objectsForXQuery_constants_error_1, - xquery._id, - constants?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray? objectsForXQuery_error_( - NSString xquery, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_442( - _id, _lib._sel_objectsForXQuery_error_1, xquery._id, error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSXMLNode new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_new1); - return NSXMLNode._(_ret, _lib, retain: false, release: true); - } - - static NSXMLNode allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSXMLNode1, _lib._sel_allocWithZone_1, zone); - return NSXMLNode._(_ret, _lib, retain: false, release: true); - } - - static NSXMLNode alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_alloc1); - return NSXMLNode._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSXMLNode1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSXMLNode1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLNode1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLNode1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSXMLNode1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSXMLNode1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSXMLNode1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSXMLNode1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSXMLNode1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSXMLNodeKind { - static const int NSXMLInvalidKind = 0; - static const int NSXMLDocumentKind = 1; - static const int NSXMLElementKind = 2; - static const int NSXMLAttributeKind = 3; - static const int NSXMLNamespaceKind = 4; - static const int NSXMLProcessingInstructionKind = 5; - static const int NSXMLCommentKind = 6; - static const int NSXMLTextKind = 7; - static const int NSXMLDTDKind = 8; - static const int NSXMLEntityDeclarationKind = 9; - static const int NSXMLAttributeDeclarationKind = 10; - static const int NSXMLElementDeclarationKind = 11; - static const int NSXMLNotationDeclarationKind = 12; -} - -abstract class NSXMLNodeOptions { - static const int NSXMLNodeOptionsNone = 0; - static const int NSXMLNodeIsCDATA = 1; - static const int NSXMLNodeExpandEmptyElement = 2; - static const int NSXMLNodeCompactEmptyElement = 4; - static const int NSXMLNodeUseSingleQuotes = 8; - static const int NSXMLNodeUseDoubleQuotes = 16; - static const int NSXMLNodeNeverEscapeContents = 32; - static const int NSXMLDocumentTidyHTML = 512; - static const int NSXMLDocumentTidyXML = 1024; - static const int NSXMLDocumentValidate = 8192; - static const int NSXMLNodeLoadExternalEntitiesAlways = 16384; - static const int NSXMLNodeLoadExternalEntitiesSameOriginOnly = 32768; - static const int NSXMLNodeLoadExternalEntitiesNever = 524288; - static const int NSXMLDocumentXInclude = 65536; - static const int NSXMLNodePrettyPrint = 131072; - static const int NSXMLDocumentIncludeContentTypeDeclaration = 262144; - static const int NSXMLNodePreserveNamespaceOrder = 1048576; - static const int NSXMLNodePreserveAttributeOrder = 2097152; - static const int NSXMLNodePreserveEntities = 4194304; - static const int NSXMLNodePreservePrefixes = 8388608; - static const int NSXMLNodePreserveCDATA = 16777216; - static const int NSXMLNodePreserveWhitespace = 33554432; - static const int NSXMLNodePreserveDTD = 67108864; - static const int NSXMLNodePreserveCharacterReferences = 134217728; - static const int NSXMLNodePromoteSignificantWhitespace = 268435456; - static const int NSXMLNodePreserveEmptyElements = 6; - static const int NSXMLNodePreserveQuotes = 24; - static const int NSXMLNodePreserveAll = 4293918750; -} - -class NSXMLDocument extends NSXMLNode { - NSXMLDocument._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSXMLDocument] that points to the same underlying object as [other]. - static NSXMLDocument castFrom(T other) { - return NSXMLDocument._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSXMLDocument] that wraps the given raw object pointer. - static NSXMLDocument castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSXMLDocument._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSXMLDocument]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDocument1); - } - - @override - NSXMLDocument init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSXMLDocument._(_ret, _lib, retain: true, release: true); - } - - NSXMLDocument? initWithXMLString_options_error_( - NSString string, int mask, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_1096(_id, - _lib._sel_initWithXMLString_options_error_1, string._id, mask, error); - return _ret.address == 0 - ? null - : NSXMLDocument._(_ret, _lib, retain: true, release: true); - } - - NSXMLDocument? initWithContentsOfURL_options_error_( - NSURL url, int mask, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_1097(_id, - _lib._sel_initWithContentsOfURL_options_error_1, url._id, mask, error); - return _ret.address == 0 - ? null - : NSXMLDocument._(_ret, _lib, retain: true, release: true); - } - - NSXMLDocument? initWithData_options_error_( - NSData data, int mask, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_1098( - _id, _lib._sel_initWithData_options_error_1, data._id, mask, error); - return _ret.address == 0 - ? null - : NSXMLDocument._(_ret, _lib, retain: true, release: true); - } - - NSXMLDocument initWithRootElement_(NSXMLElement? element) { - final _ret = _lib._objc_msgSend_1099( - _id, _lib._sel_initWithRootElement_1, element?._id ?? ffi.nullptr); - return NSXMLDocument._(_ret, _lib, retain: true, release: true); - } - - static NSObject replacementClassForClass_( - ThermionDartTexture1 _lib, NSObject cls) { - final _ret = _lib._objc_msgSend_123(_lib._class_NSXMLDocument1, - _lib._sel_replacementClassForClass_1, cls._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSString? get characterEncoding { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_characterEncoding1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set characterEncoding(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setCharacterEncoding_1, value?._id ?? ffi.nullptr); - } - - NSString? get version { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_version1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set version(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setVersion_1, value?._id ?? ffi.nullptr); - } - - bool get standalone { - return _lib._objc_msgSend_12(_id, _lib._sel_isStandalone1); - } - - set standalone(bool value) { - return _lib._objc_msgSend_526(_id, _lib._sel_setStandalone_1, value); - } - - int get documentContentKind { - return _lib._objc_msgSend_1100(_id, _lib._sel_documentContentKind1); - } - - set documentContentKind(int value) { - return _lib._objc_msgSend_1101( - _id, _lib._sel_setDocumentContentKind_1, value); - } - - NSString? get MIMEType { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_MIMEType1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set MIMEType(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setMIMEType_1, value?._id ?? ffi.nullptr); - } - - NSXMLDTD? get DTD { - final _ret = _lib._objc_msgSend_1111(_id, _lib._sel_DTD1); - return _ret.address == 0 - ? null - : NSXMLDTD._(_ret, _lib, retain: true, release: true); - } - - set DTD(NSXMLDTD? value) { - return _lib._objc_msgSend_1112( - _id, _lib._sel_setDTD_1, value?._id ?? ffi.nullptr); - } - - void setRootElement_(NSXMLElement root) { - _lib._objc_msgSend_1113(_id, _lib._sel_setRootElement_1, root._id); - } - - NSXMLElement? rootElement() { - final _ret = _lib._objc_msgSend_1114(_id, _lib._sel_rootElement1); - return _ret.address == 0 - ? null - : NSXMLElement._(_ret, _lib, retain: true, release: true); - } - - void insertChild_atIndex_(NSXMLNode child, int index) { - _lib._objc_msgSend_1102( - _id, _lib._sel_insertChild_atIndex_1, child._id, index); - } - - void insertChildren_atIndex_(NSArray children, int index) { - _lib._objc_msgSend_1103( - _id, _lib._sel_insertChildren_atIndex_1, children._id, index); - } - - void removeChildAtIndex_(int index) { - _lib._objc_msgSend_469(_id, _lib._sel_removeChildAtIndex_1, index); - } - - void setChildren_(NSArray? children) { - _lib._objc_msgSend_838( - _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); - } - - void addChild_(NSXMLNode child) { - _lib._objc_msgSend_1104(_id, _lib._sel_addChild_1, child._id); - } - - void replaceChildAtIndex_withNode_(int index, NSXMLNode node) { - _lib._objc_msgSend_1105( - _id, _lib._sel_replaceChildAtIndex_withNode_1, index, node._id); - } - - NSData get XMLData { - final _ret = _lib._objc_msgSend_42(_id, _lib._sel_XMLData1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSData XMLDataWithOptions_(int options) { - final _ret = - _lib._objc_msgSend_1115(_id, _lib._sel_XMLDataWithOptions_1, options); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSObject? objectByApplyingXSLT_arguments_error_(NSData xslt, - NSDictionary? arguments, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_1116( - _id, - _lib._sel_objectByApplyingXSLT_arguments_error_1, - xslt._id, - arguments?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? objectByApplyingXSLTString_arguments_error_(NSString xslt, - NSDictionary? arguments, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_1117( - _id, - _lib._sel_objectByApplyingXSLTString_arguments_error_1, - xslt._id, - arguments?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? objectByApplyingXSLTAtURL_arguments_error_(NSURL xsltURL, - NSDictionary? argument, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_1118( - _id, - _lib._sel_objectByApplyingXSLTAtURL_arguments_error_1, - xsltURL._id, - argument?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - bool validateAndReturnError_(ffi.Pointer> error) { - return _lib._objc_msgSend_242( - _id, _lib._sel_validateAndReturnError_1, error); - } - - @override - NSXMLDocument initWithKind_(int kind) { - final _ret = _lib._objc_msgSend_1089(_id, _lib._sel_initWithKind_1, kind); - return NSXMLDocument._(_ret, _lib, retain: true, release: true); - } - - @override - NSXMLDocument initWithKind_options_(int kind, int options) { - final _ret = _lib._objc_msgSend_1090( - _id, _lib._sel_initWithKind_options_1, kind, options); - return NSXMLDocument._(_ret, _lib, retain: true, release: true); - } - - static NSObject document(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_document1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject documentWithRootElement_( - ThermionDartTexture1 _lib, NSXMLElement element) { - final _ret = _lib._objc_msgSend_1091(_lib._class_NSXMLDocument1, - _lib._sel_documentWithRootElement_1, element._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSXMLDocument1, _lib._sel_elementWithName_1, name._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_URI_( - ThermionDartTexture1 _lib, NSString name, NSString URI) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDocument1, - _lib._sel_elementWithName_URI_1, name._id, URI._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString string) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDocument1, - _lib._sel_elementWithName_stringValue_1, name._id, string._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_children_attributes_( - ThermionDartTexture1 _lib, - NSString name, - NSArray? children, - NSArray? attributes) { - final _ret = _lib._objc_msgSend_1093( - _lib._class_NSXMLDocument1, - _lib._sel_elementWithName_children_attributes_1, - name._id, - children?._id ?? ffi.nullptr, - attributes?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject attributeWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDocument1, - _lib._sel_attributeWithName_stringValue_1, name._id, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject attributeWithName_URI_stringValue_(ThermionDartTexture1 _lib, - NSString name, NSString URI, NSString stringValue) { - final _ret = _lib._objc_msgSend_1059( - _lib._class_NSXMLDocument1, - _lib._sel_attributeWithName_URI_stringValue_1, - name._id, - URI._id, - stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject namespaceWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDocument1, - _lib._sel_namespaceWithName_stringValue_1, name._id, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject processingInstructionWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092( - _lib._class_NSXMLDocument1, - _lib._sel_processingInstructionWithName_stringValue_1, - name._id, - stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject commentWithStringValue_( - ThermionDartTexture1 _lib, NSString stringValue) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSXMLDocument1, - _lib._sel_commentWithStringValue_1, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject textWithStringValue_( - ThermionDartTexture1 _lib, NSString stringValue) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSXMLDocument1, - _lib._sel_textWithStringValue_1, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? DTDNodeWithXMLString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSXMLDocument1, - _lib._sel_DTDNodeWithXMLString_1, string._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSString localNameForName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_68( - _lib._class_NSXMLDocument1, _lib._sel_localNameForName_1, name._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? prefixForName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_185( - _lib._class_NSXMLDocument1, _lib._sel_prefixForName_1, name._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSXMLNode? predefinedNamespaceForPrefix_( - ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_1108(_lib._class_NSXMLDocument1, - _lib._sel_predefinedNamespaceForPrefix_1, name._id); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - static NSXMLDocument new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_new1); - return NSXMLDocument._(_ret, _lib, retain: false, release: true); - } - - static NSXMLDocument allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSXMLDocument1, _lib._sel_allocWithZone_1, zone); - return NSXMLDocument._(_ret, _lib, retain: false, release: true); - } - - static NSXMLDocument alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_alloc1); - return NSXMLDocument._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSXMLDocument1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSXMLDocument1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLDocument1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLDocument1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSXMLDocument1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSXMLDocument1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSXMLDocument1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSXMLDocument1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSXMLDocument1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSXMLDocumentContentKind { - static const int NSXMLDocumentXMLKind = 0; - static const int NSXMLDocumentXHTMLKind = 1; - static const int NSXMLDocumentHTMLKind = 2; - static const int NSXMLDocumentTextKind = 3; -} - -class NSXMLDTD extends NSXMLNode { - NSXMLDTD._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSXMLDTD] that points to the same underlying object as [other]. - static NSXMLDTD castFrom(T other) { - return NSXMLDTD._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSXMLDTD] that wraps the given raw object pointer. - static NSXMLDTD castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSXMLDTD._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSXMLDTD]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDTD1); - } - - @override - NSXMLDTD init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSXMLDTD._(_ret, _lib, retain: true, release: true); - } - - @override - NSXMLDTD initWithKind_options_(int kind, int options) { - final _ret = _lib._objc_msgSend_1090( - _id, _lib._sel_initWithKind_options_1, kind, options); - return NSXMLDTD._(_ret, _lib, retain: true, release: true); - } - - NSXMLDTD? initWithContentsOfURL_options_error_( - NSURL url, int mask, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_1097(_id, - _lib._sel_initWithContentsOfURL_options_error_1, url._id, mask, error); - return _ret.address == 0 - ? null - : NSXMLDTD._(_ret, _lib, retain: true, release: true); - } - - NSXMLDTD? initWithData_options_error_( - NSData data, int mask, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_1098( - _id, _lib._sel_initWithData_options_error_1, data._id, mask, error); - return _ret.address == 0 - ? null - : NSXMLDTD._(_ret, _lib, retain: true, release: true); - } - - NSString? get publicID { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_publicID1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set publicID(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setPublicID_1, value?._id ?? ffi.nullptr); - } - - NSString? get systemID { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_systemID1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set systemID(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setSystemID_1, value?._id ?? ffi.nullptr); - } - - void insertChild_atIndex_(NSXMLNode child, int index) { - _lib._objc_msgSend_1102( - _id, _lib._sel_insertChild_atIndex_1, child._id, index); - } - - void insertChildren_atIndex_(NSArray children, int index) { - _lib._objc_msgSend_1103( - _id, _lib._sel_insertChildren_atIndex_1, children._id, index); - } - - void removeChildAtIndex_(int index) { - _lib._objc_msgSend_469(_id, _lib._sel_removeChildAtIndex_1, index); - } - - void setChildren_(NSArray? children) { - _lib._objc_msgSend_838( - _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); - } - - void addChild_(NSXMLNode child) { - _lib._objc_msgSend_1104(_id, _lib._sel_addChild_1, child._id); - } - - void replaceChildAtIndex_withNode_(int index, NSXMLNode node) { - _lib._objc_msgSend_1105( - _id, _lib._sel_replaceChildAtIndex_withNode_1, index, node._id); - } - - NSXMLDTDNode? entityDeclarationForName_(NSString name) { - final _ret = _lib._objc_msgSend_1109( - _id, _lib._sel_entityDeclarationForName_1, name._id); - return _ret.address == 0 - ? null - : NSXMLDTDNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLDTDNode? notationDeclarationForName_(NSString name) { - final _ret = _lib._objc_msgSend_1109( - _id, _lib._sel_notationDeclarationForName_1, name._id); - return _ret.address == 0 - ? null - : NSXMLDTDNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLDTDNode? elementDeclarationForName_(NSString name) { - final _ret = _lib._objc_msgSend_1109( - _id, _lib._sel_elementDeclarationForName_1, name._id); - return _ret.address == 0 - ? null - : NSXMLDTDNode._(_ret, _lib, retain: true, release: true); - } - - NSXMLDTDNode? attributeDeclarationForName_elementName_( - NSString name, NSString elementName) { - final _ret = _lib._objc_msgSend_1110( - _id, - _lib._sel_attributeDeclarationForName_elementName_1, - name._id, - elementName._id); - return _ret.address == 0 - ? null - : NSXMLDTDNode._(_ret, _lib, retain: true, release: true); - } - - static NSXMLDTDNode? predefinedEntityDeclarationForName_( - ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_1109(_lib._class_NSXMLDTD1, - _lib._sel_predefinedEntityDeclarationForName_1, name._id); - return _ret.address == 0 - ? null - : NSXMLDTDNode._(_ret, _lib, retain: true, release: true); - } - - @override - NSXMLDTD initWithKind_(int kind) { - final _ret = _lib._objc_msgSend_1089(_id, _lib._sel_initWithKind_1, kind); - return NSXMLDTD._(_ret, _lib, retain: true, release: true); - } - - static NSObject document(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_document1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject documentWithRootElement_( - ThermionDartTexture1 _lib, NSXMLElement element) { - final _ret = _lib._objc_msgSend_1091(_lib._class_NSXMLDTD1, - _lib._sel_documentWithRootElement_1, element._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSXMLDTD1, _lib._sel_elementWithName_1, name._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_URI_( - ThermionDartTexture1 _lib, NSString name, NSString URI) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDTD1, - _lib._sel_elementWithName_URI_1, name._id, URI._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString string) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDTD1, - _lib._sel_elementWithName_stringValue_1, name._id, string._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_children_attributes_( - ThermionDartTexture1 _lib, - NSString name, - NSArray? children, - NSArray? attributes) { - final _ret = _lib._objc_msgSend_1093( - _lib._class_NSXMLDTD1, - _lib._sel_elementWithName_children_attributes_1, - name._id, - children?._id ?? ffi.nullptr, - attributes?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject attributeWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDTD1, - _lib._sel_attributeWithName_stringValue_1, name._id, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject attributeWithName_URI_stringValue_(ThermionDartTexture1 _lib, - NSString name, NSString URI, NSString stringValue) { - final _ret = _lib._objc_msgSend_1059( - _lib._class_NSXMLDTD1, - _lib._sel_attributeWithName_URI_stringValue_1, - name._id, - URI._id, - stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject namespaceWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDTD1, - _lib._sel_namespaceWithName_stringValue_1, name._id, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject processingInstructionWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092( - _lib._class_NSXMLDTD1, - _lib._sel_processingInstructionWithName_stringValue_1, - name._id, - stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject commentWithStringValue_( - ThermionDartTexture1 _lib, NSString stringValue) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSXMLDTD1, - _lib._sel_commentWithStringValue_1, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject textWithStringValue_( - ThermionDartTexture1 _lib, NSString stringValue) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSXMLDTD1, - _lib._sel_textWithStringValue_1, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? DTDNodeWithXMLString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_38( - _lib._class_NSXMLDTD1, _lib._sel_DTDNodeWithXMLString_1, string._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSString localNameForName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_68( - _lib._class_NSXMLDTD1, _lib._sel_localNameForName_1, name._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? prefixForName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_185( - _lib._class_NSXMLDTD1, _lib._sel_prefixForName_1, name._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSXMLNode? predefinedNamespaceForPrefix_( - ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_1108(_lib._class_NSXMLDTD1, - _lib._sel_predefinedNamespaceForPrefix_1, name._id); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - static NSXMLDTD new1(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_new1); - return NSXMLDTD._(_ret, _lib, retain: false, release: true); - } - - static NSXMLDTD allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSXMLDTD1, _lib._sel_allocWithZone_1, zone); - return NSXMLDTD._(_ret, _lib, retain: false, release: true); - } - - static NSXMLDTD alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_alloc1); - return NSXMLDTD._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSXMLDTD1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSXMLDTD1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLDTD1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLDTD1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSXMLDTD1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSXMLDTD1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSXMLDTD1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSXMLDTD1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSXMLDTD1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -class NSXMLDTDNode extends NSXMLNode { - NSXMLDTDNode._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSXMLDTDNode] that points to the same underlying object as [other]. - static NSXMLDTDNode castFrom(T other) { - return NSXMLDTDNode._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSXMLDTDNode] that wraps the given raw object pointer. - static NSXMLDTDNode castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSXMLDTDNode._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSXMLDTDNode]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDTDNode1); - } - - NSXMLDTDNode? initWithXMLString_(NSString string) { - final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_initWithXMLString_1, string._id); - return _ret.address == 0 - ? null - : NSXMLDTDNode._(_ret, _lib, retain: true, release: true); - } - - @override - NSXMLDTDNode initWithKind_options_(int kind, int options) { - final _ret = _lib._objc_msgSend_1090( - _id, _lib._sel_initWithKind_options_1, kind, options); - return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); - } - - @override - NSXMLDTDNode init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); - } - - int get DTDKind { - return _lib._objc_msgSend_1106(_id, _lib._sel_DTDKind1); - } - - set DTDKind(int value) { - return _lib._objc_msgSend_1107(_id, _lib._sel_setDTDKind_1, value); - } - - bool get external1 { - return _lib._objc_msgSend_12(_id, _lib._sel_isExternal1); - } - - NSString? get publicID { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_publicID1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set publicID(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setPublicID_1, value?._id ?? ffi.nullptr); - } - - NSString? get systemID { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_systemID1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set systemID(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setSystemID_1, value?._id ?? ffi.nullptr); - } - - NSString? get notationName { - final _ret = _lib._objc_msgSend_43(_id, _lib._sel_notationName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set notationName(NSString? value) { - return _lib._objc_msgSend_544( - _id, _lib._sel_setNotationName_1, value?._id ?? ffi.nullptr); - } - - @override - NSXMLDTDNode initWithKind_(int kind) { - final _ret = _lib._objc_msgSend_1089(_id, _lib._sel_initWithKind_1, kind); - return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); - } - - static NSObject document(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_document1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject documentWithRootElement_( - ThermionDartTexture1 _lib, NSXMLElement element) { - final _ret = _lib._objc_msgSend_1091(_lib._class_NSXMLDTDNode1, - _lib._sel_documentWithRootElement_1, element._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_31( - _lib._class_NSXMLDTDNode1, _lib._sel_elementWithName_1, name._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_URI_( - ThermionDartTexture1 _lib, NSString name, NSString URI) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDTDNode1, - _lib._sel_elementWithName_URI_1, name._id, URI._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString string) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDTDNode1, - _lib._sel_elementWithName_stringValue_1, name._id, string._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject elementWithName_children_attributes_( - ThermionDartTexture1 _lib, - NSString name, - NSArray? children, - NSArray? attributes) { - final _ret = _lib._objc_msgSend_1093( - _lib._class_NSXMLDTDNode1, - _lib._sel_elementWithName_children_attributes_1, - name._id, - children?._id ?? ffi.nullptr, - attributes?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject attributeWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDTDNode1, - _lib._sel_attributeWithName_stringValue_1, name._id, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject attributeWithName_URI_stringValue_(ThermionDartTexture1 _lib, - NSString name, NSString URI, NSString stringValue) { - final _ret = _lib._objc_msgSend_1059( - _lib._class_NSXMLDTDNode1, - _lib._sel_attributeWithName_URI_stringValue_1, - name._id, - URI._id, - stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject namespaceWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092(_lib._class_NSXMLDTDNode1, - _lib._sel_namespaceWithName_stringValue_1, name._id, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject processingInstructionWithName_stringValue_( - ThermionDartTexture1 _lib, NSString name, NSString stringValue) { - final _ret = _lib._objc_msgSend_1092( - _lib._class_NSXMLDTDNode1, - _lib._sel_processingInstructionWithName_stringValue_1, - name._id, - stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject commentWithStringValue_( - ThermionDartTexture1 _lib, NSString stringValue) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSXMLDTDNode1, - _lib._sel_commentWithStringValue_1, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject textWithStringValue_( - ThermionDartTexture1 _lib, NSString stringValue) { - final _ret = _lib._objc_msgSend_31(_lib._class_NSXMLDTDNode1, - _lib._sel_textWithStringValue_1, stringValue._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? DTDNodeWithXMLString_( - ThermionDartTexture1 _lib, NSString string) { - final _ret = _lib._objc_msgSend_38(_lib._class_NSXMLDTDNode1, - _lib._sel_DTDNodeWithXMLString_1, string._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSString localNameForName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_68( - _lib._class_NSXMLDTDNode1, _lib._sel_localNameForName_1, name._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? prefixForName_(ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_185( - _lib._class_NSXMLDTDNode1, _lib._sel_prefixForName_1, name._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSXMLNode? predefinedNamespaceForPrefix_( - ThermionDartTexture1 _lib, NSString name) { - final _ret = _lib._objc_msgSend_1108(_lib._class_NSXMLDTDNode1, - _lib._sel_predefinedNamespaceForPrefix_1, name._id); - return _ret.address == 0 - ? null - : NSXMLNode._(_ret, _lib, retain: true, release: true); - } - - static NSXMLDTDNode new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_new1); - return NSXMLDTDNode._(_ret, _lib, retain: false, release: true); - } - - static NSXMLDTDNode allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSXMLDTDNode1, _lib._sel_allocWithZone_1, zone); - return NSXMLDTDNode._(_ret, _lib, retain: false, release: true); - } - - static NSXMLDTDNode alloc(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_alloc1); - return NSXMLDTDNode._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_NSXMLDTDNode1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_NSXMLDTDNode1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLDTDNode1, _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSXMLDTDNode1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_NSXMLDTDNode1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_NSXMLDTDNode1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_NSXMLDTDNode1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSXMLDTDNode1, _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSXMLDTDNode1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} - -abstract class NSXMLDTDNodeKind { - static const int NSXMLEntityGeneralKind = 1; - static const int NSXMLEntityParsedKind = 2; - static const int NSXMLEntityUnparsedKind = 3; - static const int NSXMLEntityParameterKind = 4; - static const int NSXMLEntityPredefined = 5; - static const int NSXMLAttributeCDATAKind = 6; - static const int NSXMLAttributeIDKind = 7; - static const int NSXMLAttributeIDRefKind = 8; - static const int NSXMLAttributeIDRefsKind = 9; - static const int NSXMLAttributeEntityKind = 10; - static const int NSXMLAttributeEntitiesKind = 11; - static const int NSXMLAttributeNMTokenKind = 12; - static const int NSXMLAttributeNMTokensKind = 13; - static const int NSXMLAttributeEnumerationKind = 14; - static const int NSXMLAttributeNotationKind = 15; - static const int NSXMLElementDeclarationUndefinedKind = 16; - static const int NSXMLElementDeclarationEmptyKind = 17; - static const int NSXMLElementDeclarationAnyKind = 18; - static const int NSXMLElementDeclarationMixedKind = 19; - static const int NSXMLElementDeclarationElementKind = 20; -} - -class ThermionDartTexture extends NSObject { - ThermionDartTexture._(ffi.Pointer id, ThermionDartTexture1 lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [ThermionDartTexture] that points to the same underlying object as [other]. - static ThermionDartTexture castFrom(T other) { - return ThermionDartTexture._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [ThermionDartTexture] that wraps the given raw object pointer. - static ThermionDartTexture castFromPointer( - ThermionDartTexture1 lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return ThermionDartTexture._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [ThermionDartTexture]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_ThermionDartTexture1); - } - - int get cvMetalTextureCache { - return _lib._objc_msgSend_236(_id, _lib._sel_cvMetalTextureCache1); - } - - set cvMetalTextureCache(int value) { - return _lib._objc_msgSend_1128( - _id, _lib._sel_setCvMetalTextureCache_1, value); - } - - int get cvMetalTexture { - return _lib._objc_msgSend_236(_id, _lib._sel_cvMetalTexture1); - } - - set cvMetalTexture(int value) { - return _lib._objc_msgSend_1128(_id, _lib._sel_setCvMetalTexture_1, value); - } - - NSObject? get metalTexture { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_metalTexture1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set metalTexture(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setMetalTexture_1, value?._id ?? ffi.nullptr); - } - - NSObject? get metalDevice { - final _ret = _lib._objc_msgSend_17(_id, _lib._sel_metalDevice1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - set metalDevice(NSObject? value) { - return _lib._objc_msgSend_415( - _id, _lib._sel_setMetalDevice_1, value?._id ?? ffi.nullptr); - } - - int get metalTextureAddress { - return _lib._objc_msgSend_82(_id, _lib._sel_metalTextureAddress1); - } - - set metalTextureAddress(int value) { - return _lib._objc_msgSend_634( - _id, _lib._sel_setMetalTextureAddress_1, value); - } - - @override - ThermionDartTexture init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return ThermionDartTexture._(_ret, _lib, retain: true, release: true); - } - - ThermionDartTexture initWithWidth_height_(int width, int height) { - final _ret = _lib._objc_msgSend_1129( - _id, _lib._sel_initWithWidth_height_1, width, height); - return ThermionDartTexture._(_ret, _lib, retain: true, release: true); - } - - void destroyTexture() { - _lib._objc_msgSend_1(_id, _lib._sel_destroyTexture1); - } - - static ThermionDartTexture new1(ThermionDartTexture1 _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_ThermionDartTexture1, _lib._sel_new1); - return ThermionDartTexture._(_ret, _lib, retain: false, release: true); - } - - static ThermionDartTexture allocWithZone_( - ThermionDartTexture1 _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_ThermionDartTexture1, _lib._sel_allocWithZone_1, zone); - return ThermionDartTexture._(_ret, _lib, retain: false, release: true); - } - - static ThermionDartTexture alloc(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_ThermionDartTexture1, _lib._sel_alloc1); - return ThermionDartTexture._(_ret, _lib, retain: false, release: true); - } - - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - ThermionDartTexture1 _lib, - NSObject aTarget, - ffi.Pointer aSelector, - NSObject? anArgument) { - _lib._objc_msgSend_14( - _lib._class_ThermionDartTexture1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, - aTarget._id, - aSelector, - anArgument?._id ?? ffi.nullptr); - } - - static void cancelPreviousPerformRequestsWithTarget_( - ThermionDartTexture1 _lib, NSObject aTarget) { - _lib._objc_msgSend_15(_lib._class_ThermionDartTexture1, - _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); - } - - static bool getAccessInstanceVariablesDirectly(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12(_lib._class_ThermionDartTexture1, - _lib._sel_accessInstanceVariablesDirectly1); - } - - static bool useStoredAccessor(ThermionDartTexture1 _lib) { - return _lib._objc_msgSend_12( - _lib._class_ThermionDartTexture1, _lib._sel_useStoredAccessor1); - } - - static NSSet keyPathsForValuesAffectingValueForKey_( - ThermionDartTexture1 _lib, NSString key) { - final _ret = _lib._objc_msgSend_62(_lib._class_ThermionDartTexture1, - _lib._sel_keyPathsForValuesAffectingValueForKey_1, key._id); - return NSSet._(_ret, _lib, retain: true, release: true); - } - - static bool automaticallyNotifiesObserversForKey_( - ThermionDartTexture1 _lib, NSString key) { - return _lib._objc_msgSend_63(_lib._class_ThermionDartTexture1, - _lib._sel_automaticallyNotifiesObserversForKey_1, key._id); - } - - static void setKeys_triggerChangeNotificationsForDependentKey_( - ThermionDartTexture1 _lib, NSArray keys, NSString dependentKey) { - _lib._objc_msgSend_87( - _lib._class_ThermionDartTexture1, - _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, - keys._id, - dependentKey._id); - } - - static NSArray classFallbacksForKeyedArchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_84(_lib._class_ThermionDartTexture1, - _lib._sel_classFallbacksForKeyedArchiver1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSObject classForKeyedUnarchiver(ThermionDartTexture1 _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_ThermionDartTexture1, _lib._sel_classForKeyedUnarchiver1); - return NSObject._(_ret, _lib, retain: true, release: true); - } -} diff --git a/thermion_dart/lib/src/utils/src/axis.dart b/thermion_dart/lib/src/utils/src/axis.dart new file mode 100644 index 00000000..6c9226e4 --- /dev/null +++ b/thermion_dart/lib/src/utils/src/axis.dart @@ -0,0 +1,44 @@ +import 'dart:typed_data'; + +import 'package:vector_math/vector_math_64.dart'; + +import '../../viewer/viewer.dart'; + +class Axis { + final ThermionViewer _viewer; + final ThermionEntity xAxis; + final ThermionEntity yAxis; + final ThermionEntity zAxis; + + Axis._(this.xAxis, this.yAxis, this.zAxis, this._viewer); + + static Future create(ThermionViewer viewer) async { + final xAxis = await viewer!.createGeometry( + Geometry(Float32List.fromList([0, 0, 0, 10, 0, 0]), [0, 1], + primitiveType: PrimitiveType.LINES), + materialInstance: await viewer!.createUnlitMaterialInstance()); + final yAxis = await viewer!.createGeometry( + Geometry(Float32List.fromList([0, 0, 0, 0, 10, 0]), [0, 1], + primitiveType: PrimitiveType.LINES), + materialInstance: await viewer!.createUnlitMaterialInstance()); + final zAxis = await viewer!.createGeometry( + Geometry(Float32List.fromList([0, 0, 0, 0, 0, 10]), [0, 1], + primitiveType: PrimitiveType.LINES), + materialInstance: await viewer!.createUnlitMaterialInstance()); + + await viewer!.setMaterialPropertyFloat4( + xAxis, "baseColorFactor", 0, 1.0, 0.0, 0.0, 1.0); + await viewer!.setMaterialPropertyFloat4( + yAxis, "baseColorFactor", 0, 0.0, 1.0, 0.0, 1.0); + await viewer!.setMaterialPropertyFloat4( + zAxis, "baseColorFactor", 0, 0.0, 0.0, 1.0, 1.0); + return Axis._(xAxis, yAxis, zAxis, viewer); + } + + Future setTransform(Matrix4 transform) async { + await _viewer.setTransform(xAxis, transform); + await _viewer.setTransform(yAxis, transform); + await _viewer.setTransform(zAxis, transform); + + } +} diff --git a/thermion_dart/lib/src/utils/camera_orientation.dart b/thermion_dart/lib/src/utils/src/camera_orientation.dart similarity index 100% rename from thermion_dart/lib/src/utils/camera_orientation.dart rename to thermion_dart/lib/src/utils/src/camera_orientation.dart diff --git a/thermion_dart/lib/src/utils/dart_resources.dart b/thermion_dart/lib/src/utils/src/dart_resources.dart similarity index 93% rename from thermion_dart/lib/src/utils/dart_resources.dart rename to thermion_dart/lib/src/utils/src/dart_resources.dart index 1f3143b8..c4c5278d 100644 --- a/thermion_dart/lib/src/utils/dart_resources.dart +++ b/thermion_dart/lib/src/utils/src/dart_resources.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'package:ffi/ffi.dart'; -import '../viewer/src/ffi/src/thermion_dart.g.dart'; +import '../../viewer/src/ffi/src/thermion_dart.g.dart'; class DartResourceLoader { static final _assets = {}; diff --git a/thermion_dart/lib/src/utils/geometry.dart b/thermion_dart/lib/src/utils/src/geometry.dart similarity index 99% rename from thermion_dart/lib/src/utils/geometry.dart rename to thermion_dart/lib/src/utils/src/geometry.dart index 1da4cafe..2e70ff90 100644 --- a/thermion_dart/lib/src/utils/geometry.dart +++ b/thermion_dart/lib/src/utils/src/geometry.dart @@ -1,7 +1,7 @@ import 'dart:math'; import 'dart:typed_data'; -import '../../thermion_dart.dart'; +import '../../../thermion_dart.dart'; class GeometryHelper { static Geometry sphere({bool normals = true, bool uvs = true}) { diff --git a/thermion_dart/lib/src/entities/gizmo.dart b/thermion_dart/lib/src/utils/src/gizmo.dart similarity index 63% rename from thermion_dart/lib/src/entities/gizmo.dart rename to thermion_dart/lib/src/utils/src/gizmo.dart index aef7fd60..ad023f0c 100644 --- a/thermion_dart/lib/src/entities/gizmo.dart +++ b/thermion_dart/lib/src/utils/src/gizmo.dart @@ -1,19 +1,31 @@ import 'dart:async'; -import 'package:thermion_dart/src/entities/abstract_gizmo.dart'; +import 'package:thermion_dart/src/viewer/viewer.dart'; import 'package:vector_math/vector_math_64.dart'; -import '../viewer/viewer.dart'; -class Gizmo extends AbstractGizmo { +abstract class Gizmo { + bool get isVisible; + bool get isHovered; + + void reset(); + + Future attach(ThermionEntity entity); + Future detach(); + + Stream get boundingBox; + + void checkHover(int x, int y); +} + +abstract class BaseGizmo extends Gizmo { final ThermionEntity x; final ThermionEntity y; final ThermionEntity z; final ThermionEntity center; - final ThermionViewer _viewer; - ThermionEntity? _activeAxis; ThermionEntity? _activeEntity; + ThermionViewer viewer; bool _visible = false; bool get isVisible => _visible; @@ -26,10 +38,9 @@ class Gizmo extends AbstractGizmo { Stream get boundingBox => _boundingBoxController.stream; final _boundingBoxController = StreamController.broadcast(); - Gizmo(this.x, this.y, this.z, this.center, this._viewer, - {this.ignore = const {}}) { - _viewer.gizmoPickResult.listen(_onGizmoPickResult); - _viewer.pickResult.listen(_onPickResult); + BaseGizmo({required this.x, required this.y, required this.z, required this.center, required this.viewer, + this.ignore = const {}}) { + onPick(_onGizmoPickResult); } final _stopwatch = Stopwatch(); @@ -52,12 +63,10 @@ class Gizmo extends AbstractGizmo { final axis = Vector3(_activeAxis == x ? 1.0 : 0.0, _activeAxis == y ? 1.0 : 0.0, _activeAxis == z ? 1.0 : 0.0); - await _viewer.queueRelativePositionUpdateWorldAxis( + await viewer.queueRelativePositionUpdateWorldAxis( _activeEntity!, - _transX * _viewer.pixelRatio, - -_transY * - _viewer - .pixelRatio, // flip the sign because "up" in NDC Y axis is positive, but negative in Flutter + _transX, + -_transY, // flip the sign because "up" in NDC Y axis is positive, but negative in Flutter axis.x, axis.y, axis.z); @@ -70,10 +79,6 @@ class Gizmo extends AbstractGizmo { _activeAxis = null; } - void _onPickResult(FilamentPickResult result) async { - await attach(result.entity); - } - void _onGizmoPickResult(FilamentPickResult result) async { if (result.entity == x || result.entity == y || result.entity == z) { _activeAxis = result.entity; @@ -98,21 +103,25 @@ class Gizmo extends AbstractGizmo { _visible = true; if (_activeEntity != null) { - await _viewer.removeStencilHighlight(_activeEntity!); + await viewer.removeStencilHighlight(_activeEntity!); } _activeEntity = entity; - await _viewer.setGizmoVisibility(true); - await _viewer.setParent(center, entity, preserveScaling: false); - _boundingBoxController.sink.add(await _viewer.getViewportBoundingBox(x)); + await viewer.setParent(center, entity, preserveScaling: false); + _boundingBoxController.sink.add(await viewer.getViewportBoundingBox(x)); } Future detach() async { - await _viewer.setGizmoVisibility(false); + await setVisibility(false); } @override - void checkHover(double x, double y) { - _viewer.pickGizmo(x.toInt(), y.toInt()); + void checkHover(int x, int y) { + pick(x, y); } + + Future pick(int x, int y); + + Future setVisibility(bool visible); + void onPick(void Function(PickResult result) callback); } diff --git a/thermion_dart/lib/src/utils/matrix.dart b/thermion_dart/lib/src/utils/src/matrix.dart similarity index 100% rename from thermion_dart/lib/src/utils/matrix.dart rename to thermion_dart/lib/src/utils/src/matrix.dart diff --git a/thermion_dart/lib/src/utils/utils.dart b/thermion_dart/lib/src/utils/utils.dart new file mode 100644 index 00000000..33016b9c --- /dev/null +++ b/thermion_dart/lib/src/utils/utils.dart @@ -0,0 +1,4 @@ +library; + +export 'src/geometry.dart'; +export 'src/axis.dart'; diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/callbacks.dart b/thermion_dart/lib/src/viewer/src/ffi/src/callbacks.dart index e36a430b..41f65a6a 100644 --- a/thermion_dart/lib/src/viewer/src/ffi/src/callbacks.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/callbacks.dart @@ -26,7 +26,7 @@ Future withVoidCallback( nativeCallable.close(); } -Future withPointerCallback( +Future> withPointerCallback( Function(Pointer)>>) func) async { final completer = Completer>(); @@ -39,7 +39,7 @@ Future withPointerCallback( func.call(nativeCallable.nativeFunction); var ptr = await completer.future; nativeCallable.close(); - return ptr.address; + return ptr; } Future withBoolCallback( diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/camera_ffi.dart b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_camera.dart similarity index 51% rename from thermion_dart/lib/src/viewer/src/ffi/src/camera_ffi.dart rename to thermion_dart/lib/src/viewer/src/ffi/src/ffi_camera.dart index f741aa1e..365fe9fd 100644 --- a/thermion_dart/lib/src/viewer/src/ffi/src/camera_ffi.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_camera.dart @@ -2,34 +2,34 @@ import 'dart:ffi'; import 'package:vector_math/vector_math_64.dart'; -import '../../../../utils/matrix.dart'; +import '../../../../utils/src/matrix.dart'; import '../../thermion_viewer_base.dart'; -import 'thermion_dart.g.dart'; +import 'thermion_dart.g.dart' as g; -class ThermionFFICamera extends Camera { - final Pointer camera; - final Pointer engine; +class FFICamera extends Camera { + final Pointer camera; + final Pointer engine; late ThermionEntity _entity; - ThermionFFICamera(this.camera, this.engine) { - _entity = Camera_getEntity(camera); + FFICamera(this.camera, this.engine) { + _entity = g.Camera_getEntity(camera); } @override Future setProjectionMatrixWithCulling( Matrix4 projectionMatrix, double near, double far) async { - Camera_setCustomProjectionWithCulling( + g.Camera_setCustomProjectionWithCulling( camera, matrix4ToDouble4x4(projectionMatrix), near, far); } Future getModelMatrix() async { - return double4x4ToMatrix4(Camera_getModelMatrix(camera)); + return double4x4ToMatrix4(g.Camera_getModelMatrix(camera)); } @override Future setTransform(Matrix4 transform) async { - var entity = Camera_getEntity(camera); - Engine_setTransform(engine, entity, matrix4ToDouble4x4(transform)); + var entity = g.Camera_getEntity(camera); + g.Engine_setTransform(engine, entity, matrix4ToDouble4x4(transform)); } @override @@ -38,7 +38,7 @@ class ThermionFFICamera extends Camera { double far = kFar, double aspect = 1.0, double focalLength = kFocalLength}) async { - Camera_setLensProjection(camera, near, far, aspect, focalLength); + g.Camera_setLensProjection(camera, near, far, aspect, focalLength); } @override @@ -48,13 +48,13 @@ class ThermionFFICamera extends Camera { @override Future setModelMatrix(Matrix4 matrix) async { - Camera_setModelMatrix(camera, matrix4ToDouble4x4(matrix)); + g.Camera_setModelMatrix(camera, matrix4ToDouble4x4(matrix)); } @override bool operator ==(Object other) => identical(this, other) || - other is ThermionFFICamera && + other is FFICamera && runtimeType == other.runtimeType && camera == other.camera; @@ -63,21 +63,29 @@ class ThermionFFICamera extends Camera { @override Future getCullingFar() async { - return Camera_getCullingFar(camera); + return g.Camera_getCullingFar(camera); } @override Future getNear() async { - return Camera_getNear(camera); + return g.Camera_getNear(camera); } @override Future getFocalLength() async { - return Camera_getFocalLength(camera); + return g.Camera_getFocalLength(camera); } @override Future getViewMatrix() async { - return double4x4ToMatrix4(Camera_getViewMatrix(camera)); + return double4x4ToMatrix4(g.Camera_getViewMatrix(camera)); + } + + @override + Future setProjection(Projection projection, double left, double right, + double bottom, double top, double near, double far) async { + var pType = g.Projection.values[projection.index]; + g.Camera_setProjection(camera, pType, left, + right, bottom, top, near, far); } } diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/ffi_gizmo.dart b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_gizmo.dart new file mode 100644 index 00000000..2113ff1e --- /dev/null +++ b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_gizmo.dart @@ -0,0 +1,50 @@ +import 'dart:async'; +import 'dart:ffi'; + +import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart'; + +import '../../../../utils/src/gizmo.dart'; +import '../../../viewer.dart'; + +class FFIGizmo extends BaseGizmo { + Pointer pointer; + + late NativeCallable _nativeCallback; + FFIGizmo( + this.pointer, ThermionViewer viewer) : super(x: 0, y: 0, z: 0, center: 0, viewer: viewer) { + _nativeCallback = + NativeCallable.listener(_onPickResult); + } + + /// + /// The result(s) of calling [pickGizmo] (see below). + /// + // Stream get onPick => _pickResultController.stream; + // final _pickResultController = StreamController.broadcast(); + + void Function(PickResult)? _callback; + + void onPick(void Function(PickResult) callback) { + _callback = callback; + } + + void _onPickResult(DartEntityId entityId, int x, int y, Pointer view) { + _callback?.call((entity: entityId, x: x, y: y)); + } + + /// + /// Used to test whether a Gizmo is at the given viewport coordinates. + /// Called by `FilamentGestureDetector` on a mouse/finger down event. You probably don't want to call this yourself. + /// This is asynchronous and will require 2-3 frames to complete - subscribe to the [gizmoPickResult] stream to receive the results of this method. + /// [x] and [y] must be in local logical coordinates (i.e. where 0,0 is at top-left of the ThermionWidget). + /// + @override + Future pick(int x, int y) async { + Gizmo_pick(pointer, x.toInt(), y, _nativeCallback.nativeFunction); + } + + @override + Future setVisibility(bool visible) async { + Gizmo_setVisibility(pointer, visible); + } +} diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/ffi_view.dart b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_view.dart new file mode 100644 index 00000000..99850908 --- /dev/null +++ b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_view.dart @@ -0,0 +1,69 @@ +import 'dart:ffi'; +import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart'; +import 'package:thermion_dart/src/viewer/src/shared_types/shared_types.dart'; +import 'ffi_camera.dart'; +import 'thermion_viewer_ffi.dart'; + +class FFIView extends View { + final Pointer view; + final Pointer viewer; + + FFIView(this.view, this.viewer); + + @override + Future updateViewport(int width, int height) async { + View_updateViewport(view, width, height); + } + + @override + Future setRenderTarget(covariant FFIRenderTarget renderTarget) async { + View_setRenderTarget(view, renderTarget.renderTarget); + } + + @override + Future setCamera(FFICamera camera) async { + View_setCamera(view, camera.camera); + } + + @override + Future getViewport() async { + TViewport vp = View_getViewport(view); + return Viewport(vp.left, vp.bottom, vp.width, vp.height); + } + + @override + Camera getCamera() { + final engine = Viewer_getEngine(viewer); + return FFICamera(View_getCamera(view), engine); + } + + @override + Future setAntiAliasing(bool msaa, bool fxaa, bool taa) async { + View_setAntiAliasing(view, msaa, fxaa, taa); + } + + @override + Future setPostProcessing(bool enabled) async { + View_setPostProcessing(view, enabled); + } + + Future setRenderable(bool renderable, FFISwapChain swapChain) async { + Viewer_setViewRenderable(viewer, swapChain.swapChain, view, renderable); + } + + @override + Future setFrustumCullingEnabled(bool enabled) async { + View_setFrustumCullingEnabled(view, enabled); + } + + @override + Future setBloom(double strength) async { + View_setBloom(view, strength); + } + + @override + Future setToneMapper(ToneMapper mapper) async { + final engine = await Viewer_getEngine(viewer); + View_setToneMappingRenderThread(view, engine, mapper.index); + } +} diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/thermion_dart.g.dart b/thermion_dart/lib/src/viewer/src/ffi/src/thermion_dart.g.dart index 18bfd942..19600d8a 100644 --- a/thermion_dart/lib/src/viewer/src/ffi/src/thermion_dart.g.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/thermion_dart.g.dart @@ -27,6 +27,154 @@ external ffi.Pointer Viewer_getSceneManager( ffi.Pointer viewer, ); +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer, ffi.IntPtr, ffi.Uint32, ffi.Uint32)>(isLeaf: true) +external ffi.Pointer Viewer_createRenderTarget( + ffi.Pointer viewer, + int texture, + int width, + int height, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>(isLeaf: true) +external void Viewer_destroyRenderTarget( + ffi.Pointer viewer, + ffi.Pointer tRenderTarget, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(isLeaf: true) +external ffi.Pointer Viewer_createSwapChain( + ffi.Pointer viewer, + ffi.Pointer window, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer, ffi.Uint32, ffi.Uint32)>(isLeaf: true) +external ffi.Pointer Viewer_createHeadlessSwapChain( + ffi.Pointer viewer, + int width, + int height, +); + +@ffi.Native, ffi.Pointer)>( + isLeaf: true) +external void Viewer_destroySwapChain( + ffi.Pointer viewer, + ffi.Pointer swapChain, +); + +@ffi.Native)>(isLeaf: true) +external void Viewer_render( + ffi.Pointer viewer, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(isLeaf: true) +external void Viewer_capture( + ffi.Pointer viewer, + ffi.Pointer view, + ffi.Pointer swapChain, + ffi.Pointer pixelBuffer, + ffi.Pointer> callback, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(isLeaf: true) +external void Viewer_captureRenderTarget( + ffi.Pointer viewer, + ffi.Pointer view, + ffi.Pointer swapChain, + ffi.Pointer renderTarget, + ffi.Pointer pixelBuffer, + ffi.Pointer> callback, +); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true) +external ffi.Pointer Viewer_createView( + ffi.Pointer viewer, +); + +@ffi.Native Function(ffi.Pointer, ffi.Int)>( + isLeaf: true) +external ffi.Pointer Viewer_getViewAt( + ffi.Pointer viewer, + int index, +); + +@ffi.Native, ffi.Pointer)>( + isLeaf: true) +external void Viewer_setMainCamera( + ffi.Pointer tViewer, + ffi.Pointer tView, +); + +@ffi.Native Function(ffi.Pointer, ffi.Int)>( + isLeaf: true) +external ffi.Pointer Viewer_getSwapChainAt( + ffi.Pointer tViewer, + int index, +); + +@ffi.Native< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>(isLeaf: true) +external void Viewer_setViewRenderable( + ffi.Pointer viewer, + ffi.Pointer swapChain, + ffi.Pointer view, + bool renderable, +); + +@ffi.Native< + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Float, + ffi.Pointer>)>(isLeaf: true) +external void Viewer_loadIblRenderThread( + ffi.Pointer viewer, + ffi.Pointer iblPath, + double intensity, + ffi.Pointer> onComplete, +); + + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ffi.Int, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(EntityId entityId, ffi.Int x, ffi.Int y, + ffi.Pointer tView)>>)>(isLeaf: true) +external void Viewer_pick( + ffi.Pointer viewer, + ffi.Pointer tView, + int x, + int y, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(EntityId entityId, ffi.Int x, ffi.Int y, + ffi.Pointer tView)>> + callback, +); + @ffi.Native Function(ffi.Pointer)>(isLeaf: true) external ffi.Pointer Viewer_getEngine( ffi.Pointer viewer, @@ -47,16 +195,6 @@ external void Engine_setTransform( double4x4 transform, ); -@ffi.Native< - ffi.Void Function( - ffi.Pointer, ffi.IntPtr, ffi.Uint32, ffi.Uint32)>(isLeaf: true) -external void create_render_target( - ffi.Pointer viewer, - int texture, - int width, - int height, -); - @ffi.Native)>(isLeaf: true) external void clear_background_image( ffi.Pointer viewer, @@ -92,18 +230,6 @@ external void set_background_color( double a, ); -@ffi.Native, ffi.Int)>(isLeaf: true) -external void set_tone_mapping( - ffi.Pointer viewer, - int toneMapping, -); - -@ffi.Native, ffi.Float)>(isLeaf: true) -external void set_bloom( - ffi.Pointer viewer, - double strength, -); - @ffi.Native, ffi.Pointer)>( isLeaf: true) external void load_skybox( @@ -230,18 +356,6 @@ external int load_glb( bool keepData, ); -@ffi.Native< - EntityId Function(ffi.Pointer, ffi.Pointer, - ffi.Size, ffi.Bool, ffi.Int, ffi.Int)>(isLeaf: true) -external int load_glb_from_buffer( - ffi.Pointer sceneManager, - ffi.Pointer data, - int length, - bool keepData, - int priority, - int layer, -); - @ffi.Native< EntityId Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Bool)>(isLeaf: true) @@ -275,134 +389,17 @@ external void get_instances( ffi.Pointer out, ); -@ffi.Native)>(isLeaf: true) -external void set_main_camera( - ffi.Pointer viewer, -); - @ffi.Native)>(isLeaf: true) external int get_main_camera( ffi.Pointer viewer, ); -@ffi.Native< - ffi.Bool Function( - ffi.Pointer, EntityId, ffi.Pointer)>(isLeaf: true) -external bool set_camera( - ffi.Pointer viewer, - int entity, - ffi.Pointer nodeName, -); - -@ffi.Native, ffi.Bool)>(isLeaf: true) -external void set_view_frustum_culling( - ffi.Pointer viewer, - bool enabled, -); - -@ffi.Native< - ffi.Bool Function( - ffi.Pointer, - ffi.Uint64, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer buf, ffi.Size size, - ffi.Pointer data)>>, - ffi.Pointer)>(isLeaf: true) -external bool render( - ffi.Pointer viewer, - int frameTimeInNanos, - ffi.Pointer pixelBuffer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer buf, ffi.Size size, - ffi.Pointer data)>> - callback, - ffi.Pointer data, -); - -@ffi.Native< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(isLeaf: true) -external void capture( - ffi.Pointer viewer, - ffi.Pointer pixelBuffer, - ffi.Pointer> callback, -); - -@ffi.Native< - ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Uint32, - ffi.Uint32)>(isLeaf: true) -external void create_swap_chain( - ffi.Pointer viewer, - ffi.Pointer window, - int width, - int height, -); - -@ffi.Native)>(isLeaf: true) -external void destroy_swap_chain( - ffi.Pointer viewer, -); - @ffi.Native, ffi.Float)>(isLeaf: true) external void set_frame_interval( ffi.Pointer viewer, double interval, ); -@ffi.Native, ffi.Uint32, ffi.Uint32)>( - isLeaf: true) -external void update_viewport( - ffi.Pointer viewer, - int width, - int height, -); - -@ffi.Native)>(isLeaf: true) -external void scroll_begin( - ffi.Pointer viewer, -); - -@ffi.Native< - ffi.Void Function( - ffi.Pointer, ffi.Float, ffi.Float, ffi.Float)>(isLeaf: true) -external void scroll_update( - ffi.Pointer viewer, - double x, - double y, - double z, -); - -@ffi.Native)>(isLeaf: true) -external void scroll_end( - ffi.Pointer viewer, -); - -@ffi.Native< - ffi.Void Function( - ffi.Pointer, ffi.Float, ffi.Float, ffi.Bool)>(isLeaf: true) -external void grab_begin( - ffi.Pointer viewer, - double x, - double y, - bool pan, -); - -@ffi.Native, ffi.Float, ffi.Float)>( - isLeaf: true) -external void grab_update( - ffi.Pointer viewer, - double x, - double y, -); - -@ffi.Native)>(isLeaf: true) -external void grab_end( - ffi.Pointer viewer, -); - @ffi.Native< ffi.Void Function(ffi.Pointer, EntityId, ffi.Pointer, ffi.Pointer, ffi.Int)>(isLeaf: true) @@ -424,25 +421,6 @@ external bool set_morph_target_weights( int numWeights, ); -@ffi.Native< - ffi.Bool Function( - ffi.Pointer, - EntityId, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Int, - ffi.Float)>(isLeaf: true) -external bool set_morph_animation( - ffi.Pointer sceneManager, - int entity, - ffi.Pointer morphData, - ffi.Pointer morphIndices, - int numMorphTargets, - int numFrames, - double frameLengthInMs, -); - @ffi.Native< ffi.Pointer Function( ffi.Pointer, TMaterialKey)>(isLeaf: true) @@ -660,6 +638,61 @@ external void SceneManager_queueTransformUpdates( int numEntities, ); +@ffi.Native< + ffi.Pointer Function(ffi.Pointer, EntityId, + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer SceneManager_findCameraByName( + ffi.Pointer tSceneManager, + int entity, + ffi.Pointer name, +); + +@ffi.Native, EntityId, ffi.Int)>( + isLeaf: true) +external void SceneManager_setVisibilityLayer( + ffi.Pointer tSceneManager, + int entity, + int layer, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer SceneManager_getScene( + ffi.Pointer tSceneManager, +); + +@ffi.Native< + EntityId Function(ffi.Pointer, ffi.Pointer, + ffi.Size, ffi.Bool, ffi.Int, ffi.Int, ffi.Bool)>(isLeaf: true) +external int SceneManager_loadGlbFromBuffer( + ffi.Pointer sceneManager, + ffi.Pointer arg1, + int length, + bool keepData, + int priority, + int layer, + bool loadResourcesAsync, +); + +@ffi.Native< + ffi.Bool Function( + ffi.Pointer, + EntityId, + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ffi.Int, + ffi.Float)>(isLeaf: true) +external bool SceneManager_setMorphAnimation( + ffi.Pointer sceneManager, + int entity, + ffi.Pointer morphData, + ffi.Pointer morphIndices, + int numMorphTargets, + int numFrames, + double frameLengthInMs, +); + @ffi.Native, EntityId)>( isLeaf: true) external bool update_bone_matrices( @@ -739,10 +772,11 @@ external void queue_relative_position_update_world_axis( ); @ffi.Native< - ffi.Void Function(ffi.Pointer, EntityId, ffi.Float, - ffi.Float)>(isLeaf: true) + ffi.Void Function(ffi.Pointer, ffi.Pointer, EntityId, + ffi.Float, ffi.Float)>(isLeaf: true) external void queue_position_update_from_viewport_coords( ffi.Pointer sceneManager, + ffi.Pointer view, int entity, double viewportX, double viewportY, @@ -780,172 +814,6 @@ external void set_scale( double scale, ); -@ffi.Native< - ffi.Void Function( - ffi.Pointer, ffi.Float, ffi.Float, ffi.Float)>(isLeaf: true) -external void set_camera_exposure( - ffi.Pointer camera, - double aperture, - double shutterSpeed, - double sensitivity, -); - -@ffi.Native, double4x4)>(isLeaf: true) -external void set_camera_model_matrix( - ffi.Pointer camera, - double4x4 matrix, -); - -@ffi.Native Function(ffi.Pointer, EntityId)>( - isLeaf: true) -external ffi.Pointer get_camera( - ffi.Pointer viewer, - int entity, -); - -@ffi.Native)>(isLeaf: true) -external double4x4 get_camera_model_matrix( - ffi.Pointer camera, -); - -@ffi.Native)>(isLeaf: true) -external double4x4 get_camera_view_matrix( - ffi.Pointer camera, -); - -@ffi.Native)>(isLeaf: true) -external double4x4 get_camera_projection_matrix( - ffi.Pointer camera, -); - -@ffi.Native)>(isLeaf: true) -external double4x4 get_camera_culling_projection_matrix( - ffi.Pointer camera, -); - -@ffi.Native Function(ffi.Pointer)>( - isLeaf: true) -external ffi.Pointer get_camera_frustum( - ffi.Pointer camera, -); - -@ffi.Native< - ffi.Void Function( - ffi.Pointer, double4x4, ffi.Double, ffi.Double)>(isLeaf: true) -external void set_camera_projection_matrix( - ffi.Pointer camera, - double4x4 matrix, - double near, - double far, -); - -@ffi.Native< - ffi.Void Function(ffi.Pointer, ffi.Double, ffi.Double, ffi.Double, - ffi.Double, ffi.Bool)>(isLeaf: true) -external void set_camera_projection_from_fov( - ffi.Pointer camera, - double fovInDegrees, - double aspect, - double near, - double far, - bool horizontal, -); - -@ffi.Native)>(isLeaf: true) -external double get_camera_focal_length( - ffi.Pointer camera, -); - -@ffi.Native)>(isLeaf: true) -external double Camera_getFocalLength( - ffi.Pointer camera, -); - -@ffi.Native)>(isLeaf: true) -external double Camera_getNear( - ffi.Pointer camera, -); - -@ffi.Native)>(isLeaf: true) -external double Camera_getCullingFar( - ffi.Pointer camera, -); - -@ffi.Native)>(isLeaf: true) -external double4x4 Camera_getViewMatrix( - ffi.Pointer camera, -); - -@ffi.Native)>(isLeaf: true) -external double4x4 Camera_getModelMatrix( - ffi.Pointer camera, -); - -@ffi.Native)>(isLeaf: true) -external double get_camera_near( - ffi.Pointer camera, -); - -@ffi.Native)>(isLeaf: true) -external double get_camera_culling_far( - ffi.Pointer camera, -); - -@ffi.Native, ffi.Bool)>(isLeaf: true) -external double get_camera_fov( - ffi.Pointer camera, - bool horizontal, -); - -@ffi.Native, ffi.Float)>(isLeaf: true) -external void set_camera_focus_distance( - ffi.Pointer camera, - double focusDistance, -); - -@ffi.Native< - ffi.Void Function(ffi.Pointer, _ManipulatorMode, ffi.Double, - ffi.Double, ffi.Double)>(isLeaf: true) -external void set_camera_manipulator_options( - ffi.Pointer viewer, - int mode, - double orbitSpeedX, - double orbitSpeedY, - double zoomSpeed, -); - -@ffi.Native< - ffi.Void Function( - ffi.Pointer, double4x4, ffi.Double, ffi.Double)>(isLeaf: true) -external void Camera_setCustomProjectionWithCulling( - ffi.Pointer camera, - double4x4 projectionMatrix, - double near, - double far, -); - -@ffi.Native, double4x4)>(isLeaf: true) -external void Camera_setModelMatrix( - ffi.Pointer camera, - double4x4 modelMatrix, -); - -@ffi.Native< - ffi.Void Function(ffi.Pointer, ffi.Double, ffi.Double, ffi.Double, - ffi.Double)>(isLeaf: true) -external void Camera_setLensProjection( - ffi.Pointer camera, - double near, - double far, - double aspect, - double focalLength, -); - -@ffi.Native)>(isLeaf: true) -external int Camera_getEntity( - ffi.Pointer camera, -); - @ffi.Native Function(ffi.Pointer)>( isLeaf: true) external ffi.Pointer Engine_getEntityManager( @@ -966,14 +834,6 @@ external void SceneManager_destroyCamera( ffi.Pointer camera, ); -@ffi.Native< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>(isLeaf: true) -external void SceneManager_setCamera( - ffi.Pointer sceneManager, - ffi.Pointer camera, -); - @ffi.Native)>(isLeaf: true) external int SceneManager_getCameraCount( ffi.Pointer sceneManager, @@ -987,12 +847,6 @@ external ffi.Pointer SceneManager_getCameraAt( int index, ); -@ffi.Native Function(ffi.Pointer)>( - isLeaf: true) -external ffi.Pointer SceneManager_getActiveCamera( - ffi.Pointer sceneManager, -); - @ffi.Native< ffi.Int Function(ffi.Pointer, EntityId, ffi.Pointer)>(isLeaf: true) @@ -1011,61 +865,6 @@ external int reveal_mesh( ffi.Pointer meshName, ); -@ffi.Native, ffi.Bool)>(isLeaf: true) -external void set_post_processing( - ffi.Pointer viewer, - bool enabled, -); - -@ffi.Native, ffi.Bool)>(isLeaf: true) -external void set_shadows_enabled( - ffi.Pointer viewer, - bool enabled, -); - -@ffi.Native, ffi.Int)>(isLeaf: true) -external void set_shadow_type( - ffi.Pointer viewer, - int shadowType, -); - -@ffi.Native, ffi.Float, ffi.Float)>( - isLeaf: true) -external void set_soft_shadow_options( - ffi.Pointer viewer, - double penumbraScale, - double penumbraRatioScale, -); - -@ffi.Native< - ffi.Void Function( - ffi.Pointer, ffi.Bool, ffi.Bool, ffi.Bool)>(isLeaf: true) -external void set_antialiasing( - ffi.Pointer viewer, - bool msaa, - bool fxaa, - bool taa, -); - -@ffi.Native< - ffi.Void Function( - ffi.Pointer, - ffi.Int, - ffi.Int, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - EntityId entityId, ffi.Int x, ffi.Int y)>>)>(isLeaf: true) -external void filament_pick( - ffi.Pointer viewer, - int x, - int y, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(EntityId entityId, ffi.Int x, ffi.Int y)>> - callback, -); - @ffi.Native< ffi.Pointer Function( ffi.Pointer, EntityId)>(isLeaf: true) @@ -1111,19 +910,6 @@ external ffi.Pointer get_entity_name_at( bool renderableOnly, ); -@ffi.Native, ffi.Bool)>(isLeaf: true) -external void set_recording( - ffi.Pointer viewer, - bool recording, -); - -@ffi.Native, ffi.Pointer)>( - isLeaf: true) -external void set_recording_output_directory( - ffi.Pointer viewer, - ffi.Pointer outputDirectory, -); - @ffi.Native(isLeaf: true) external void ios_dummy(); @@ -1240,22 +1026,18 @@ external void set_priority( ); @ffi.Native< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>(isLeaf: true) -external void get_gizmo( - ffi.Pointer sceneManager, - ffi.Pointer out, -); - -@ffi.Native, EntityId)>(isLeaf: true) + Aabb2 Function( + ffi.Pointer, ffi.Pointer, EntityId)>(isLeaf: true) external Aabb2 get_bounding_box( ffi.Pointer sceneManager, + ffi.Pointer view, int entity, ); @ffi.Native< ffi.Void Function( ffi.Pointer, + ffi.Pointer, EntityId, ffi.Pointer, ffi.Pointer, @@ -1263,6 +1045,7 @@ external Aabb2 get_bounding_box( ffi.Pointer)>(isLeaf: true) external void get_bounding_box_to_out( ffi.Pointer sceneManager, + ffi.Pointer view, int entity, ffi.Pointer minX, ffi.Pointer minY, @@ -1270,48 +1053,6 @@ external void get_bounding_box_to_out( ffi.Pointer maxY, ); -@ffi.Native, ffi.Int, ffi.Bool)>( - isLeaf: true) -external void set_layer_visibility( - ffi.Pointer sceneManager, - int layer, - bool visible, -); - -@ffi.Native, EntityId, ffi.Int)>( - isLeaf: true) -external void set_visibility_layer( - ffi.Pointer sceneManager, - int entity, - int layer, -); - -@ffi.Native< - ffi.Void Function( - ffi.Pointer, - ffi.Int, - ffi.Int, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - EntityId entityId, ffi.Int x, ffi.Int y)>>)>(isLeaf: true) -external void pick_gizmo( - ffi.Pointer sceneManager, - int x, - int y, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(EntityId entityId, ffi.Int x, ffi.Int y)>> - callback, -); - -@ffi.Native, ffi.Bool)>( - isLeaf: true) -external void set_gizmo_visibility( - ffi.Pointer sceneManager, - bool visible, -); - @ffi.Native< ffi.Void Function(ffi.Pointer, EntityId, ffi.Float, ffi.Float, ffi.Float)>(isLeaf: true) @@ -1455,6 +1196,119 @@ external void MaterialInstance_setParameterFloat2( double y, ); +@ffi.Native)>(isLeaf: true) +external TViewport View_getViewport( + ffi.Pointer view, +); + +@ffi.Native, ffi.Uint32, ffi.Uint32)>( + isLeaf: true) +external void View_updateViewport( + ffi.Pointer view, + int width, + int height, +); + +@ffi.Native, ffi.Pointer)>( + isLeaf: true) +external void View_setRenderTarget( + ffi.Pointer view, + ffi.Pointer renderTarget, +); + +@ffi.Native, ffi.Bool)>(isLeaf: true) +external void View_setFrustumCullingEnabled( + ffi.Pointer view, + bool enabled, +); + +@ffi.Native, ffi.Bool)>(isLeaf: true) +external void View_setPostProcessing( + ffi.Pointer tView, + bool enabled, +); + +@ffi.Native, ffi.Bool)>(isLeaf: true) +external void View_setShadowsEnabled( + ffi.Pointer tView, + bool enabled, +); + +@ffi.Native, ffi.Int)>(isLeaf: true) +external void View_setShadowType( + ffi.Pointer tView, + int shadowType, +); + +@ffi.Native, ffi.Float, ffi.Float)>( + isLeaf: true) +external void View_setSoftShadowOptions( + ffi.Pointer tView, + double penumbraScale, + double penumbraRatioScale, +); + +@ffi.Native, ffi.Float)>(isLeaf: true) +external void View_setBloom( + ffi.Pointer tView, + double strength, +); + +@ffi.Native< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedInt)>(symbol: "View_setToneMapping", isLeaf: true) +external void _View_setToneMapping( + ffi.Pointer tView, + ffi.Pointer tEngine, + int toneMapping, +); + +void View_setToneMapping( + ffi.Pointer tView, + ffi.Pointer tEngine, + ToneMapping toneMapping, +) => + _View_setToneMapping( + tView, + tEngine, + toneMapping.value, + ); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, ffi.Bool, ffi.Bool, ffi.Bool)>(isLeaf: true) +external void View_setAntiAliasing( + ffi.Pointer tView, + bool msaa, + bool fxaa, + bool taa, +); + +@ffi.Native, ffi.Int, ffi.Bool)>( + isLeaf: true) +external void View_setLayerEnabled( + ffi.Pointer tView, + int layer, + bool visible, +); + +@ffi.Native, ffi.Pointer)>( + isLeaf: true) +external void View_setCamera( + ffi.Pointer tView, + ffi.Pointer tCamera, +); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true) +external ffi.Pointer View_getScene( + ffi.Pointer tView, +); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true) +external ffi.Pointer View_getCamera( + ffi.Pointer tView, +); + @ffi.Native< ffi.Void Function( ffi.Pointer, @@ -1468,7 +1322,7 @@ external void MaterialInstance_setParameterFloat2( ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer viewer)>>)>(isLeaf: true) -external void create_filament_viewer_render_thread( +external void Viewer_createOnRenderThread( ffi.Pointer context, ffi.Pointer platform, ffi.Pointer uberArchivePath, @@ -1484,37 +1338,108 @@ external void create_filament_viewer_render_thread( ); @ffi.Native< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Uint32, - ffi.Pointer>)>(isLeaf: true) -external void create_swap_chain_render_thread( + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi + .NativeFunction)>>)>( + isLeaf: true) +external void Viewer_createSwapChainRenderThread( ffi.Pointer viewer, ffi.Pointer surface, + ffi.Pointer)>> + onComplete, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer< + ffi + .NativeFunction)>>)>( + isLeaf: true) +external void Viewer_createHeadlessSwapChainRenderThread( + ffi.Pointer viewer, int width, int height, + ffi.Pointer)>> + onComplete, +); + +@ffi.Native< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(isLeaf: true) +external void Viewer_destroySwapChainRenderThread( + ffi.Pointer viewer, + ffi.Pointer swapChain, + ffi.Pointer> onComplete, +); + +@ffi.Native< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(isLeaf: true) +external void Viewer_renderRenderThread( + ffi.Pointer viewer, + ffi.Pointer view, + ffi.Pointer swapChain, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(isLeaf: true) +external void Viewer_captureRenderThread( + ffi.Pointer viewer, + ffi.Pointer view, + ffi.Pointer swapChain, + ffi.Pointer out, + ffi.Pointer> onComplete, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(isLeaf: true) +external void Viewer_captureRenderTargetRenderThread( + ffi.Pointer viewer, + ffi.Pointer view, + ffi.Pointer swapChain, + ffi.Pointer renderTarget, + ffi.Pointer out, ffi.Pointer> onComplete, ); @ffi.Native< ffi.Void Function(ffi.Pointer, ffi.Pointer>)>(isLeaf: true) -external void destroy_swap_chain_render_thread( +external void Viewer_requestFrameRenderThread( ffi.Pointer viewer, ffi.Pointer> onComplete, ); @ffi.Native< - ffi.Void Function(ffi.Pointer, ffi.IntPtr, ffi.Uint32, ffi.Uint32, - ffi.Pointer>)>(isLeaf: true) -external void create_render_target_render_thread( - ffi.Pointer viewer, - int nativeTextureId, - int width, - int height, - ffi.Pointer> onComplete, + ffi.Void Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>(isLeaf: true) +external void View_setToneMappingRenderThread( + ffi.Pointer tView, + ffi.Pointer tEngine, + int thermion, +); + +@ffi.Native, ffi.Double)>(isLeaf: true) +external void View_setBloomRenderThread( + ffi.Pointer tView, + double bloom, ); @ffi.Native)>(isLeaf: true) @@ -1522,20 +1447,6 @@ external void destroy_filament_viewer_render_thread( ffi.Pointer viewer, ); -@ffi.Native)>(isLeaf: true) -external void render_render_thread( - ffi.Pointer viewer, -); - -@ffi.Native< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(isLeaf: true) -external void capture_render_thread( - ffi.Pointer viewer, - ffi.Pointer out, - ffi.Pointer> onComplete, -); - @ffi.Native( isLeaf: true) external FilamentRenderCallback make_render_callback_fn_pointer( @@ -1551,14 +1462,6 @@ external void set_rendering_render_thread( ffi.Pointer> onComplete, ); -@ffi.Native< - ffi.Void Function(ffi.Pointer, - ffi.Pointer>)>(isLeaf: true) -external void request_frame_render_thread( - ffi.Pointer viewer, - ffi.Pointer> onComplete, -); - @ffi.Native, ffi.Float)>(isLeaf: true) external void set_frame_interval_render_thread( ffi.Pointer viewer, @@ -1601,18 +1504,6 @@ external void set_background_image_position_render_thread( bool clamp, ); -@ffi.Native, ffi.Int)>(isLeaf: true) -external void set_tone_mapping_render_thread( - ffi.Pointer viewer, - int toneMapping, -); - -@ffi.Native, ffi.Float)>(isLeaf: true) -external void set_bloom_render_thread( - ffi.Pointer viewer, - double strength, -); - @ffi.Native< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>)>(isLeaf: true) @@ -1627,6 +1518,30 @@ external void remove_skybox_render_thread( ffi.Pointer viewer, ); +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ffi.Int, + ffi.Bool, + ffi.Int, + ffi.Int, + ffi.Bool, + ffi.Pointer>)>( + isLeaf: true) +external void SceneManager_loadGlbFromBufferRenderThread( + ffi.Pointer sceneManager, + ffi.Pointer data, + int length, + int numInstances, + bool keepData, + int priority, + int layer, + bool loadResourcesAsync, + ffi.Pointer> callback, +); + @ffi.Native< ffi.Void Function( ffi.Pointer, @@ -1643,28 +1558,6 @@ external void load_glb_render_thread( ffi.Pointer> callback, ); -@ffi.Native< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Int, - ffi.Bool, - ffi.Int, - ffi.Int, - ffi.Pointer>)>( - isLeaf: true) -external void load_glb_from_buffer_render_thread( - ffi.Pointer sceneManager, - ffi.Pointer data, - int length, - int numInstances, - bool keepData, - int priority, - int layer, - ffi.Pointer> callback, -); - @ffi.Native< ffi.Void Function( ffi.Pointer, @@ -1708,17 +1601,6 @@ external void clear_entities_render_thread( ffi.Pointer> callback, ); -@ffi.Native< - ffi.Void Function(ffi.Pointer, EntityId, ffi.Pointer, - ffi.Pointer>)>( - isLeaf: true) -external void set_camera_render_thread( - ffi.Pointer viewer, - int asset, - ffi.Pointer nodeName, - ffi.Pointer> callback, -); - @ffi.Native< ffi.Void Function(ffi.Pointer, EntityId, ffi.Pointer, ffi.Pointer, ffi.Int)>(isLeaf: true) @@ -1915,6 +1797,228 @@ external void unproject_texture_render_thread( ffi.Pointer> callback, ); +@ffi.Native< + ffi.Void Function( + ffi.Pointer, ffi.Float, ffi.Float, ffi.Float)>(isLeaf: true) +external void set_camera_exposure( + ffi.Pointer camera, + double aperture, + double shutterSpeed, + double sensitivity, +); + +@ffi.Native, double4x4)>(isLeaf: true) +external void set_camera_model_matrix( + ffi.Pointer camera, + double4x4 matrix, +); + +@ffi.Native Function(ffi.Pointer, EntityId)>( + isLeaf: true) +external ffi.Pointer get_camera( + ffi.Pointer viewer, + int entity, +); + +@ffi.Native)>(isLeaf: true) +external double4x4 get_camera_model_matrix( + ffi.Pointer camera, +); + +@ffi.Native)>(isLeaf: true) +external double4x4 get_camera_view_matrix( + ffi.Pointer camera, +); + +@ffi.Native)>(isLeaf: true) +external double4x4 get_camera_projection_matrix( + ffi.Pointer camera, +); + +@ffi.Native)>(isLeaf: true) +external double4x4 get_camera_culling_projection_matrix( + ffi.Pointer camera, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer get_camera_frustum( + ffi.Pointer camera, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, double4x4, ffi.Double, ffi.Double)>(isLeaf: true) +external void set_camera_projection_matrix( + ffi.Pointer camera, + double4x4 matrix, + double near, + double far, +); + +@ffi.Native< + ffi.Void Function(ffi.Pointer, ffi.Double, ffi.Double, ffi.Double, + ffi.Double, ffi.Bool)>(isLeaf: true) +external void set_camera_projection_from_fov( + ffi.Pointer camera, + double fovInDegrees, + double aspect, + double near, + double far, + bool horizontal, +); + +@ffi.Native)>(isLeaf: true) +external double get_camera_focal_length( + ffi.Pointer camera, +); + +@ffi.Native)>(isLeaf: true) +external double Camera_getFocalLength( + ffi.Pointer camera, +); + +@ffi.Native)>(isLeaf: true) +external double Camera_getNear( + ffi.Pointer camera, +); + +@ffi.Native)>(isLeaf: true) +external double Camera_getCullingFar( + ffi.Pointer camera, +); + +@ffi.Native)>(isLeaf: true) +external double4x4 Camera_getViewMatrix( + ffi.Pointer camera, +); + +@ffi.Native)>(isLeaf: true) +external double4x4 Camera_getModelMatrix( + ffi.Pointer camera, +); + +@ffi.Native)>(isLeaf: true) +external double get_camera_near( + ffi.Pointer camera, +); + +@ffi.Native)>(isLeaf: true) +external double get_camera_culling_far( + ffi.Pointer camera, +); + +@ffi.Native, ffi.Bool)>(isLeaf: true) +external double get_camera_fov( + ffi.Pointer camera, + bool horizontal, +); + +@ffi.Native, ffi.Float)>(isLeaf: true) +external void set_camera_focus_distance( + ffi.Pointer camera, + double focusDistance, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, double4x4, ffi.Double, ffi.Double)>(isLeaf: true) +external void Camera_setCustomProjectionWithCulling( + ffi.Pointer camera, + double4x4 projectionMatrix, + double near, + double far, +); + +@ffi.Native, double4x4)>(isLeaf: true) +external void Camera_setModelMatrix( + ffi.Pointer camera, + double4x4 modelMatrix, +); + +@ffi.Native< + ffi.Void Function(ffi.Pointer, ffi.Double, ffi.Double, ffi.Double, + ffi.Double)>(isLeaf: true) +external void Camera_setLensProjection( + ffi.Pointer camera, + double near, + double far, + double aspect, + double focalLength, +); + +@ffi.Native)>(isLeaf: true) +external int Camera_getEntity( + ffi.Pointer camera, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.UnsignedInt, + ffi.Double, + ffi.Double, + ffi.Double, + ffi.Double, + ffi.Double, + ffi.Double)>(symbol: "Camera_setProjection", isLeaf: true) +external void _Camera_setProjection( + ffi.Pointer tCamera, + int projection, + double left, + double right, + double bottom, + double top, + double near, + double far, +); + +void Camera_setProjection( + ffi.Pointer tCamera, + Projection projection, + double left, + double right, + double bottom, + double top, + double near, + double far, +) => + _Camera_setProjection( + tCamera, + projection.value, + left, + right, + bottom, + top, + near, + far, + ); + +@ffi.Native< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer Gizmo_new( + ffi.Pointer tEngine, + ffi.Pointer tView, + ffi.Pointer tScene, +); + +@ffi.Native< + ffi.Void Function(ffi.Pointer, ffi.Uint32, ffi.Uint32, + GizmoPickCallback)>(isLeaf: true) +external void Gizmo_pick( + ffi.Pointer tGizmo, + int x, + int y, + GizmoPickCallback callback, +); + +@ffi.Native, ffi.Bool)>(isLeaf: true) +external void Gizmo_setVisibility( + ffi.Pointer tGizmo, + bool visible, +); + final class TCamera extends ffi.Opaque {} final class TMaterialInstance extends ffi.Opaque {} @@ -1927,6 +2031,16 @@ final class TViewer extends ffi.Opaque {} final class TSceneManager extends ffi.Opaque {} +final class TRenderTarget extends ffi.Opaque {} + +final class TSwapChain extends ffi.Opaque {} + +final class TView extends ffi.Opaque {} + +final class TGizmo extends ffi.Opaque {} + +final class TScene extends ffi.Opaque {} + final class TMaterialKey extends ffi.Struct { @ffi.Bool() external bool doubleSided; @@ -2152,8 +2266,37 @@ typedef DartLoadFilamentResourceIntoOutPointerFunction = void Function( /// - setting up a render loop typedef EntityId = ffi.Int32; typedef DartEntityId = int; -typedef _ManipulatorMode = ffi.Int32; -typedef Dart_ManipulatorMode = int; + +final class TViewport extends ffi.Struct { + @ffi.Int32() + external int left; + + @ffi.Int32() + external int bottom; + + @ffi.Uint32() + external int width; + + @ffi.Uint32() + external int height; +} + +enum ToneMapping { + ACES(0), + FILMIC(1), + LINEAR(2); + + final int value; + const ToneMapping(this.value); + + static ToneMapping fromValue(int value) => switch (value) { + 0 => ACES, + 1 => FILMIC, + 2 => LINEAR, + _ => throw ArgumentError("Unknown value for ToneMapping: $value"), + }; +} + typedef FilamentRenderCallback = ffi.Pointer>; typedef FilamentRenderCallbackFunction = ffi.Void Function( @@ -2161,6 +2304,27 @@ typedef FilamentRenderCallbackFunction = ffi.Void Function( typedef DartFilamentRenderCallbackFunction = void Function( ffi.Pointer owner); +enum Projection { + Perspective(0), + Orthographic(1); + + final int value; + const Projection(this.value); + + static Projection fromValue(int value) => switch (value) { + 0 => Perspective, + 1 => Orthographic, + _ => throw ArgumentError("Unknown value for Projection: $value"), + }; +} + +typedef GizmoPickCallback + = ffi.Pointer>; +typedef GizmoPickCallbackFunction = ffi.Void Function( + EntityId entityId, ffi.Uint32 x, ffi.Uint32 y, ffi.Pointer view); +typedef DartGizmoPickCallbackFunction = void Function( + DartEntityId entityId, int x, int y, ffi.Pointer view); + const int __bool_true_false_are_defined = 1; const int true1 = 1; diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart b/thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart index 38021be7..050219d6 100644 --- a/thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart @@ -1,20 +1,20 @@ import 'dart:async'; -import 'dart:ffi'; import 'dart:math'; import 'dart:typed_data'; import 'package:animation_tools_dart/animation_tools_dart.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/src/ffi_gizmo.dart'; import 'package:vector_math/vector_math_64.dart'; import 'package:vector_math/vector_math_64.dart' as v64; -import '../../../../entities/gizmo.dart'; -import '../../../../utils/matrix.dart'; +import '../../../../utils/src/gizmo.dart'; +import '../../../../utils/src/matrix.dart'; import '../../events.dart'; -import '../../shared_types/camera.dart'; +import '../../shared_types/view.dart'; import '../../thermion_viewer_base.dart'; import 'package:logging/logging.dart'; import 'callbacks.dart'; -import 'camera_ffi.dart'; -import 'thermion_dart.g.dart'; +import 'ffi_camera.dart'; +import 'ffi_view.dart'; // ignore: constant_identifier_names const ThermionEntity _FILAMENT_ASSET_ERROR = 0; @@ -24,8 +24,6 @@ typedef RenderCallback = Pointer)>>; class ThermionViewerFFI extends ThermionViewer { final _logger = Logger("ThermionViewerFFI"); - double pixelRatio = 1.0; - Pointer? _sceneManager; Pointer? _viewer; @@ -86,25 +84,47 @@ class ThermionViewerFFI extends ThermionViewer { this._sharedContext = sharedContext ?? nullptr; _onPickResultCallable = - NativeCallable.listener( + NativeCallable view)>.listener( _onPickResult); - _onGizmoPickResultCallable = - NativeCallable.listener( - _onGizmoPickResult); - _initialize(); } - Future createRenderTarget( - double width, double height, int textureHandle) async { - await withVoidCallback((callback) => create_render_target_render_thread( - _viewer!, textureHandle, width.toInt(), height.toInt(), callback)); + /// + /// + /// + Future createRenderTarget( + int width, int height, int textureHandle) async { + final renderTarget = + Viewer_createRenderTarget(_viewer!, textureHandle, width, height); + return FFIRenderTarget(renderTarget, _viewer!); } + /// + /// + /// + Future setRenderTarget(FFIRenderTarget renderTarget) async { + final view = (await getViewAt(0)) as FFIView; + View_setRenderTarget(view.view, renderTarget.renderTarget); + } + + /// + /// + /// + Future createView() async { + var view = Viewer_createView(_viewer!); + if (view == nullptr) { + throw Exception("Failed to create view"); + } + return FFIView(view, _viewer!); + } + + /// + /// + /// Future updateViewportAndCameraProjection(double width, double height) async { - viewportDimensions = (width * pixelRatio, height * pixelRatio); - update_viewport(_viewer!, width.toInt(), height.toInt()); + var mainView = FFIView(Viewer_getViewAt(_viewer!, 0), _viewer!); + mainView.updateViewport(width.toInt(), height.toInt()); final cameraCount = await getCameraCount(); @@ -119,7 +139,7 @@ class ThermionViewerFFI extends ThermionViewer { far = kFar; } - var aspect = viewportDimensions.$1 / viewportDimensions.$2; + var aspect = width / height; var focalLength = await camera.getFocalLength(); if (focalLength.abs() < 0.1) { focalLength = kFocalLength; @@ -129,18 +149,26 @@ class ThermionViewerFFI extends ThermionViewer { } } - Future createSwapChain(double width, double height, - {Pointer? surface}) async { - await withVoidCallback((callback) { - create_swap_chain_render_thread(_viewer!, surface ?? nullptr, - width.toInt(), height.toInt(), callback); + /// + /// + /// + Future createHeadlessSwapChain(int width, int height) async { + var swapChain = await withPointerCallback((callback) { + return Viewer_createHeadlessSwapChainRenderThread( + _viewer!, width, height, callback); }); + return FFISwapChain(swapChain, _viewer!); } - Future destroySwapChain() async { - await withVoidCallback((callback) { - destroy_swap_chain_render_thread(_viewer!, callback); + /// + /// + /// + Future createSwapChain(int surface) async { + var swapChain = await withPointerCallback((callback) { + return Viewer_createSwapChainRenderThread( + _viewer!, Pointer.fromAddress(surface), callback); }); + return FFISwapChain(swapChain, _viewer!); } Gizmo? _gizmo; @@ -150,18 +178,12 @@ class ThermionViewerFFI extends ThermionViewer { final uberarchivePtr = uberArchivePath?.toNativeUtf8(allocator: allocator).cast() ?? nullptr; - var viewer = await withPointerCallback( + _viewer = await withPointerCallback( (Pointer)>> callback) { - create_filament_viewer_render_thread( - _sharedContext, - _driver, - uberarchivePtr, - resourceLoader, - _renderCallback, - _renderCallbackOwner, - callback); + Viewer_createOnRenderThread(_sharedContext, _driver, uberarchivePtr, + resourceLoader, _renderCallback, _renderCallbackOwner, callback); }); - _viewer = Pointer.fromAddress(viewer); + allocator.free(uberarchivePtr); if (_viewer!.address == 0) { throw Exception("Failed to create viewer. Check logs for details"); @@ -169,13 +191,6 @@ class ThermionViewerFFI extends ThermionViewer { _sceneManager = Viewer_getSceneManager(_viewer!); - await setCameraManipulatorOptions(zoomSpeed: 1.0); - - final gizmoEntities = allocator(4); - get_gizmo(_sceneManager!, gizmoEntities); - _gizmo = Gizmo(gizmoEntities[0], gizmoEntities[1], gizmoEntities[2], - gizmoEntities[3], this); - allocator.free(gizmoEntities); this._initialized.complete(true); } @@ -202,25 +217,37 @@ class ThermionViewerFFI extends ThermionViewer { /// /// @override - Future render() async { - render_render_thread(_viewer!); + Future render({FFISwapChain? swapChain}) async { + final view = (await getViewAt(0)) as FFIView; + swapChain ??= FFISwapChain(Viewer_getSwapChainAt(_viewer!, 0), _viewer!); + Viewer_renderRenderThread(_viewer!, view.view, swapChain.swapChain); } /// /// /// @override - Future capture() async { - final length = this.viewportDimensions.$1.toInt() * - this.viewportDimensions.$2.toInt() * - 4; - final out = allocator(length); + Future capture( + {FFIView? view, + FFISwapChain? swapChain, + FFIRenderTarget? renderTarget}) async { + view ??= (await getViewAt(0)) as FFIView; + final vp = await view.getViewport(); + final length = vp.width * vp.height * 4; + final out = Uint8List(length); + + swapChain ??= FFISwapChain(Viewer_getSwapChainAt(_viewer!, 0), _viewer!); + await withVoidCallback((cb) { - capture_render_thread(_viewer!, out, cb); + if (renderTarget != null) { + Viewer_captureRenderTargetRenderThread(_viewer!, view!.view, + swapChain!.swapChain, renderTarget.renderTarget, out.address, cb); + } else { + Viewer_captureRenderThread( + _viewer!, view!.view, swapChain!.swapChain, out.address, cb); + } }); - final data = Uint8List.fromList(out.asTypedList(length)); - allocator.free(out); - return data; + return out; } /// @@ -246,9 +273,7 @@ class ThermionViewerFFI extends ThermionViewer { await setRendering(false); await clearEntities(); await clearLights(); - print("DESTROYING"); destroy_filament_viewer_render_thread(_viewer!); - print("DESTROYED"); _sceneManager = null; _viewer = null; await _pickResultController.close(); @@ -259,7 +284,6 @@ class ThermionViewerFFI extends ThermionViewer { await callback.call(); } _onDispose.clear(); - print("DONE"); } /// @@ -336,7 +360,12 @@ class ThermionViewerFFI extends ThermionViewer { Future loadIbl(String lightingPath, {double intensity = 30000}) async { final pathPtr = lightingPath.toNativeUtf8(allocator: allocator).cast(); - load_ibl(_viewer!, pathPtr, intensity); + + await withVoidCallback((cb) { + Viewer_loadIblRenderThread(_viewer!, pathPtr, intensity, cb); + }); + + } /// @@ -409,24 +438,24 @@ class ThermionViewerFFI extends ThermionViewer { @override Future addDirectLight(DirectLight directLight) async { var entity = add_light( - _viewer!, - directLight.type.index, - directLight.color, - directLight.intensity, - directLight.position.x, - directLight.position.y, - directLight.position.z, - directLight.direction.x, - directLight.direction.y, - directLight.direction.z, - directLight.falloffRadius, - directLight.spotLightConeInner, - directLight.spotLightConeOuter, - directLight.sunAngularRadius, - directLight.sunHaloSize, - directLight.sunHaloFallof, - directLight.castShadows, - ); + _viewer!, + directLight.type.index, + directLight.color, + directLight.intensity, + directLight.position.x, + directLight.position.y, + directLight.position.z, + directLight.direction.x, + directLight.direction.y, + directLight.direction.z, + directLight.falloffRadius, + directLight.spotLightConeInner, + directLight.spotLightConeOuter, + directLight.sunAngularRadius, + directLight.sunHaloSize, + directLight.sunHaloFallof, + directLight.castShadows, + ); if (entity == _FILAMENT_ASSET_ERROR) { throw Exception("Failed to add light to scene"); } @@ -501,6 +530,7 @@ class ThermionViewerFFI extends ThermionViewer { final pathPtr = path.toNativeUtf8(allocator: allocator).cast(); var entity = await withIntCallback((callback) => load_glb_render_thread( _sceneManager!, pathPtr, numInstances, keepData, callback)); + allocator.free(pathPtr); if (entity == _FILAMENT_ASSET_ERROR) { throw Exception("An error occurred loading the asset at $path"); @@ -521,7 +551,7 @@ class ThermionViewerFFI extends ThermionViewer { int numInstances = 1, bool keepData = false, int priority = 4, - int layer = 0}) async { + int layer = 0, bool loadResourcesAsync=false}) async { if (unlit) { throw Exception("Not yet implemented"); } @@ -531,8 +561,8 @@ class ThermionViewerFFI extends ThermionViewer { } var entity = await withIntCallback((callback) => - load_glb_from_buffer_render_thread(_sceneManager!, data.address, - data.length, numInstances, keepData, priority, layer, callback)); + SceneManager_loadGlbFromBufferRenderThread(_sceneManager!, data.address, + data.length, numInstances, keepData, priority, layer, loadResourcesAsync, callback)); if (entity == _FILAMENT_ASSET_ERROR) { throw Exception("An error occurred loading GLB from buffer"); @@ -560,54 +590,6 @@ class ThermionViewerFFI extends ThermionViewer { return entity; } - /// - /// - /// - @override - Future panStart(double x, double y) async { - grab_begin(_viewer!, x * pixelRatio, y * pixelRatio, true); - } - - /// - /// - /// - @override - Future panUpdate(double x, double y) async { - grab_update(_viewer!, x * pixelRatio, y * pixelRatio); - } - - /// - /// - /// - @override - Future panEnd() async { - grab_end(_viewer!); - } - - /// - /// - /// - @override - Future rotateStart(double x, double y) async { - grab_begin(_viewer!, x * pixelRatio, y * pixelRatio, false); - } - - /// - /// - /// - @override - Future rotateUpdate(double x, double y) async { - grab_update(_viewer!, x * pixelRatio, y * pixelRatio); - } - - /// - /// - /// - @override - Future rotateEnd() async { - grab_end(_viewer!); - } - /// /// /// @@ -752,7 +734,7 @@ class ThermionViewerFFI extends ThermionViewer { var meshEntity = meshEntities[i]; if (targetMeshNames?.contains(meshName) == false) { - _logger.info("Skipping $meshName, not contained in target"); + // _logger.info("Skipping $meshName, not contained in target"); continue; } @@ -772,39 +754,24 @@ class ThermionViewerFFI extends ThermionViewer { Child meshes: ${meshNames}"""); } - var indices = - intersection.map((m) => meshMorphTargets.indexOf(m)).toList(); + var indices = Uint32List.fromList( + intersection.map((m) => meshMorphTargets.indexOf(m)).toList()); - var frameData = animation.extract(morphTargets: intersection); + // var frameData = animation.data; + var frameData = animation.subset(intersection); - assert(frameData.length == animation.numFrames * intersection.length); + assert( + frameData.data.length == animation.numFrames * intersection.length); - var dataPtr = allocator(frameData.length); - - // not currently working on WASM :( wasted a lot of time figuring that out as no error is thrown - // dataPtr - // .asTypedList(frameData.length) - // .setRange(0, frameData.length, frameData); - for (int i = 0; i < frameData.length; i++) { - dataPtr[i] = frameData[i]; - } - - final idxPtr = allocator(indices.length); - - for (int i = 0; i < indices.length; i++) { - idxPtr[i] = indices[i]; - } - - var result = set_morph_animation( + var result = SceneManager_setMorphAnimation( _sceneManager!, meshEntity, - dataPtr, - idxPtr, + frameData.data.address, + indices.address, indices.length, animation.numFrames, animation.frameLengthInMs); - allocator.free(dataPtr); - allocator.free(idxPtr); + if (!result) { throw Exception("Failed to set morph animation data for ${meshName}"); } @@ -1063,33 +1030,6 @@ class ThermionViewerFFI extends ThermionViewer { }); } - /// - /// - /// - /// - /// - /// - @override - Future zoomBegin() async { - scroll_begin(_viewer!); - } - - /// - /// - /// - @override - Future zoomUpdate(double x, double y, double z) async { - scroll_update(_viewer!, x, y, z); - } - - /// - /// - /// - @override - Future zoomEnd() async { - scroll_end(_viewer!); - } - /// /// /// @@ -1158,7 +1098,8 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future setMainCamera() async { - set_main_camera(_viewer!); + final view = (await getViewAt(0)) as FFIView; + Viewer_setMainCamera(_viewer!, view.view); } /// @@ -1179,7 +1120,7 @@ class ThermionViewerFFI extends ThermionViewer { Future getCameraComponent(ThermionEntity cameraEntity) async { var engine = Viewer_getEngine(_viewer!); var camera = Engine_getCameraComponent(engine, cameraEntity); - return ThermionFFICamera(camera, engine); + return FFICamera(camera, engine); } /// @@ -1189,11 +1130,14 @@ class ThermionViewerFFI extends ThermionViewer { Future setCamera(ThermionEntity entity, String? name) async { var cameraNamePtr = name?.toNativeUtf8(allocator: allocator).cast() ?? nullptr; - var result = set_camera(_viewer!, entity, cameraNamePtr); - allocator.free(cameraNamePtr); - if (!result) { + final camera = + SceneManager_findCameraByName(_sceneManager!, entity, cameraNamePtr); + if (camera == nullptr) { throw Exception("Failed to set camera"); } + final view = (await getViewAt(0)) as FFIView; + View_setCamera(view.view, camera); + allocator.free(cameraNamePtr); } /// @@ -1201,7 +1145,8 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future setToneMapping(ToneMapper mapper) async { - set_tone_mapping_render_thread(_viewer!, mapper.index); + final view = await getViewAt(0); + view.setToneMapper(mapper); } /// @@ -1209,7 +1154,8 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future setPostProcessing(bool enabled) async { - set_post_processing_render_thread(_viewer!, enabled); + final view = await getViewAt(0) as FFIView; + View_setPostProcessing(view.view, enabled); } /// @@ -1217,14 +1163,16 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future setShadowsEnabled(bool enabled) async { - set_shadows_enabled(_viewer!, enabled); + final view = await getViewAt(0) as FFIView; + View_setShadowsEnabled(view.view, enabled); } /// /// /// Future setShadowType(ShadowType shadowType) async { - set_shadow_type(_viewer!, shadowType.index); + final view = await getViewAt(0) as FFIView; + View_setShadowType(view.view, shadowType.index); } /// @@ -1232,7 +1180,8 @@ class ThermionViewerFFI extends ThermionViewer { /// Future setSoftShadowOptions( double penumbraScale, double penumbraRatioScale) async { - set_soft_shadow_options(_viewer!, penumbraScale, penumbraRatioScale); + final view = await getViewAt(0) as FFIView; + View_setSoftShadowOptions(view.view, penumbraScale, penumbraRatioScale); } /// @@ -1240,7 +1189,8 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future setAntiAliasing(bool msaa, bool fxaa, bool taa) async { - set_antialiasing(_viewer!, msaa, fxaa, taa); + final view = await getViewAt(0) as FFIView; + View_setAntiAliasing(view.view, msaa, fxaa, taa); } /// @@ -1248,7 +1198,8 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future setBloom(double bloom) async { - set_bloom_render_thread(_viewer!, bloom); + final view = await getViewAt(0) as FFIView; + View_setBloom(view.view, bloom); } /// @@ -1263,7 +1214,7 @@ class ThermionViewerFFI extends ThermionViewer { /// /// Future getCameraFov(bool horizontal) async { - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; return get_camera_fov(mainCamera.camera, horizontal); } @@ -1292,7 +1243,7 @@ class ThermionViewerFFI extends ThermionViewer { } Future getCameraNear() async { - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; return get_camera_near(mainCamera.camera); } @@ -1301,7 +1252,7 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future getCameraCullingFar() async { - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; return get_camera_culling_far(mainCamera.camera); } @@ -1310,7 +1261,7 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future setCameraFocusDistance(double focusDistance) async { - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; set_camera_focus_distance(mainCamera.camera, focusDistance); } @@ -1337,7 +1288,8 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future setViewFrustumCulling(bool enabled) async { - set_view_frustum_culling(_viewer!, enabled); + var view = await getViewAt(0); + view.setFrustumCullingEnabled(enabled); } /// @@ -1346,7 +1298,7 @@ class ThermionViewerFFI extends ThermionViewer { @override Future setCameraExposure( double aperture, double shutterSpeed, double sensitivity) async { - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; set_camera_exposure(mainCamera.camera, aperture, shutterSpeed, sensitivity); } @@ -1375,25 +1327,11 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future setCameraModelMatrix4(Matrix4 modelMatrix) async { - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; final out = matrix4ToDouble4x4(modelMatrix); set_camera_model_matrix(mainCamera.camera, out); } - /// - /// - /// - @override - Future setCameraLensProjection( - {double near = kNear, - double far = kFar, - double? aspect, - double focalLength = kFocalLength}) async { - aspect ??= viewportDimensions.$1 / viewportDimensions.$2; - var mainCamera = get_camera(_viewer!, get_main_camera(_viewer!)); - Camera_setLensProjection(mainCamera, near, far, aspect, focalLength); - } - /// /// /// @@ -1480,7 +1418,9 @@ class ThermionViewerFFI extends ThermionViewer { /// Future queuePositionUpdateFromViewportCoords( ThermionEntity entity, double x, double y) async { - queue_position_update_from_viewport_coords(_sceneManager!, entity, x, y); + final view = (await getViewAt(0)) as FFIView; + queue_position_update_from_viewport_coords( + _sceneManager!, view.view, entity, x, y); } /// @@ -1529,46 +1469,28 @@ class ThermionViewerFFI extends ThermionViewer { return result.cast().toDartString(); } - void _onPickResult(ThermionEntity entityId, int x, int y) { - _pickResultController.add(( - entity: entityId, - x: (x / pixelRatio).toDouble(), - y: (viewportDimensions.$2 - y) / pixelRatio - )); + void _onPickResult( + ThermionEntity entityId, int x, int y, Pointer viewPtr) async { + final view = FFIView(viewPtr, _viewer!); + final viewport = await view.getViewport(); + + _pickResultController + .add((entity: entityId, x: x.ceil(), y: (viewport.height - y).ceil())); } - void _onGizmoPickResult(ThermionEntity entityId, int x, int y) { - _gizmoPickResultController.add(( - entity: entityId, - x: (x / pixelRatio).toDouble(), - y: (viewportDimensions.$2 - y) / pixelRatio - )); - } - - late NativeCallable + late NativeCallable view)> _onPickResultCallable; - late NativeCallable - _onGizmoPickResultCallable; /// /// /// @override void pick(int x, int y) async { - x = (x * pixelRatio).ceil(); - y = (viewportDimensions.$2 - (y * pixelRatio)).ceil(); - - filament_pick(_viewer!, x, y, _onPickResultCallable.nativeFunction); - } - - /// - /// - /// - @override - void pickGizmo(int x, int y) async { - x = (x * pixelRatio).ceil(); - y = (viewportDimensions.$2 - (y * pixelRatio)).ceil(); - pick_gizmo(_sceneManager!, x, y, _onGizmoPickResultCallable.nativeFunction); + final view = (await getViewAt(0)) as FFIView; + var viewport = await view.getViewport(); + y = (viewport.height - y).ceil(); + Viewer_pick( + _viewer!, view.view, x, y, _onPickResultCallable.nativeFunction); } /// @@ -1579,7 +1501,7 @@ class ThermionViewerFFI extends ThermionViewer { if (_viewer == null) { throw Exception("No viewer available"); } - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; var matrixStruct = get_camera_view_matrix(mainCamera.camera); return double4x4ToMatrix4(matrixStruct); } @@ -1592,7 +1514,7 @@ class ThermionViewerFFI extends ThermionViewer { if (_viewer == null) { throw Exception("No viewer available"); } - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; var matrixStruct = get_camera_model_matrix(mainCamera.camera); return double4x4ToMatrix4(matrixStruct); } @@ -1605,7 +1527,7 @@ class ThermionViewerFFI extends ThermionViewer { if (_viewer == null) { throw Exception("No viewer available"); } - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; var matrixStruct = get_camera_projection_matrix(mainCamera.camera); return double4x4ToMatrix4(matrixStruct); } @@ -1618,7 +1540,7 @@ class ThermionViewerFFI extends ThermionViewer { if (_viewer == null) { throw Exception("No viewer available"); } - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; var matrixStruct = get_camera_culling_projection_matrix(mainCamera.camera); return double4x4ToMatrix4(matrixStruct); } @@ -1649,27 +1571,6 @@ class ThermionViewerFFI extends ThermionViewer { return rotationMatrix; } - ManipulatorMode _cameraMode = ManipulatorMode.ORBIT; - - /// - /// - /// - @override - Future setCameraManipulatorOptions( - {ManipulatorMode? mode, - double orbitSpeedX = 0.01, - double orbitSpeedY = 0.01, - double zoomSpeed = 0.01}) async { - if (mode != null) { - _cameraMode = mode; - } - if (_cameraMode != ManipulatorMode.ORBIT) { - throw Exception("Manipulator mode $mode not yet implemented"); - } - set_camera_manipulator_options( - _viewer!, _cameraMode.index, orbitSpeedX, orbitSpeedX, zoomSpeed); - } - /// /// /// @@ -1678,7 +1579,7 @@ class ThermionViewerFFI extends ThermionViewer { if (_viewer == null) { throw Exception("No viewer available"); } - var mainCamera = await getMainCamera() as ThermionFFICamera; + var mainCamera = await getMainCamera() as FFICamera; var arrayPtr = get_camera_frustum(mainCamera.camera); var doubleList = arrayPtr.asTypedList(24); @@ -1747,24 +1648,6 @@ class ThermionViewerFFI extends ThermionViewer { return names; } - /// - /// - /// - @override - Future setRecording(bool recording) async { - set_recording(_viewer!, recording); - } - - /// - /// - /// - @override - Future setRecordingOutputDirectory(String outputDir) async { - var pathPtr = outputDir.toNativeUtf8(allocator: allocator); - set_recording_output_directory(_viewer!, pathPtr.cast()); - allocator.free(pathPtr); - } - final _collisions = {}; /// @@ -1917,7 +1800,8 @@ class ThermionViewerFFI extends ThermionViewer { /// @override Future getViewportBoundingBox(ThermionEntity entityId) async { - final result = get_bounding_box(_sceneManager!, entityId); + final view = (await getViewAt(0)) as FFIView; + final result = get_bounding_box(_sceneManager!, view.view, entityId); return v64.Aabb2.minMax(v64.Vector2(result.minX, result.minY), v64.Vector2(result.maxX, result.maxY)); } @@ -1925,24 +1809,16 @@ class ThermionViewerFFI extends ThermionViewer { /// /// /// - Future setLayerVisibility(int layer, bool visible) { - set_layer_visibility(_sceneManager!, layer, visible); - return Future.value(); + Future setLayerVisibility(int layer, bool visible) async { + final view = (await getViewAt(0)) as FFIView; + View_setLayerEnabled(view.view, layer, visible); } /// /// /// - Future setVisibilityLayer(ThermionEntity entity, int layer) { - set_visibility_layer(_sceneManager!, entity, layer); - return Future.value(); - } - - /// - /// - /// - Future setGizmoVisibility(bool visible) async { - set_gizmo_visibility(_sceneManager!, visible); + Future setVisibilityLayer(ThermionEntity entity, int layer) async { + SceneManager_setVisibilityLayer(_sceneManager!, entity, layer); } /// @@ -2160,35 +2036,41 @@ class ThermionViewerFFI extends ThermionViewer { completer.complete(true); }); - request_frame_render_thread(_viewer!, callback.nativeFunction); + Viewer_requestFrameRenderThread(_viewer!, callback.nativeFunction); - await completer.future; + try { + await completer.future.timeout(Duration(seconds: 1)); + } catch (err) { + print("WARNING - render call timed out"); + } } Future createCamera() async { var cameraPtr = SceneManager_createCamera(_sceneManager!); var engine = Viewer_getEngine(_viewer!); - var camera = ThermionFFICamera(cameraPtr, engine); + var camera = FFICamera(cameraPtr, engine); return camera; } - Future destroyCamera(ThermionFFICamera camera) async { + Future destroyCamera(FFICamera camera) async { SceneManager_destroyCamera(_sceneManager!, camera.camera); } /// /// /// - Future setActiveCamera(ThermionFFICamera camera) async { - SceneManager_setCamera(_sceneManager!, camera.camera); + Future setActiveCamera(FFICamera camera) async { + final view = (await getViewAt(0)) as FFIView; + View_setCamera(view.view, camera.camera); } /// /// /// Future getActiveCamera() async { - final ptr = SceneManager_getActiveCamera(_sceneManager!); - return ThermionFFICamera(ptr, Viewer_getEngine(_viewer!)); + final view = (await getViewAt(0)) as FFIView; + final ptr = View_getCamera(view.view); + return FFICamera(ptr, Viewer_getEngine(_viewer!)); } final _hooks = []; @@ -2223,7 +2105,24 @@ class ThermionViewerFFI extends ThermionViewer { if (camera == nullptr) { throw Exception("No camera at index $index"); } - return ThermionFFICamera(camera, Viewer_getEngine(_viewer!)); + return FFICamera(camera, Viewer_getEngine(_viewer!)); + } + + @override + Future getViewAt(int index) async { + var view = Viewer_getViewAt(_viewer!, index); + if (view == nullptr) { + throw Exception("Failed to get view"); + } + return FFIView(view, _viewer!); + } + + @override + Future createGizmo(FFIView view) async { + var view = (await getViewAt(0)) as FFIView; + var scene = View_getScene(view.view); + final gizmo = Gizmo_new(Viewer_getEngine(_viewer!), view.view, scene); + return FFIGizmo(gizmo, this); } } @@ -2254,3 +2153,28 @@ class ThermionFFIMaterialInstance extends MaterialInstance { _pointer, name.toNativeUtf8().cast(), x, y); } } + +class FFIRenderTarget extends RenderTarget { + final Pointer renderTarget; + final Pointer viewer; + + FFIRenderTarget(this.renderTarget, this.viewer); + + @override + Future destroy() async { + Viewer_destroyRenderTarget(viewer, renderTarget); + } +} + +class FFISwapChain extends SwapChain { + final Pointer swapChain; + final Pointer viewer; + + FFISwapChain(this.swapChain, this.viewer); + + Future destroy() async { + await withVoidCallback((callback) { + Viewer_destroySwapChainRenderThread(viewer, swapChain, callback); + }); + } +} diff --git a/thermion_dart/lib/src/viewer/src/ffi/thermion_viewer_ffi.dart b/thermion_dart/lib/src/viewer/src/ffi/thermion_viewer_ffi.dart index 53a9c860..06003446 100644 --- a/thermion_dart/lib/src/viewer/src/ffi/thermion_viewer_ffi.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/thermion_viewer_ffi.dart @@ -1,4 +1,3 @@ library; export 'src/thermion_viewer_ffi.dart' show ThermionViewerFFI; -export 'src/camera_ffi.dart'; diff --git a/thermion_dart/lib/src/viewer/src/shared_types/camera.dart b/thermion_dart/lib/src/viewer/src/shared_types/camera.dart index 6e1f4d6e..27d35bf2 100644 --- a/thermion_dart/lib/src/viewer/src/shared_types/camera.dart +++ b/thermion_dart/lib/src/viewer/src/shared_types/camera.dart @@ -2,7 +2,11 @@ import 'package:vector_math/vector_math_64.dart'; import '../thermion_viewer_base.dart'; +enum Projection { Perspective, Orthographic } + abstract class Camera { + Future setProjection(Projection projection, double left, double right, + double bottom, double top, double near, double far); Future setProjectionMatrixWithCulling( Matrix4 projectionMatrix, double near, double far); diff --git a/thermion_dart/lib/src/viewer/src/shared_types/pick_result.dart b/thermion_dart/lib/src/viewer/src/shared_types/pick_result.dart index 1c935e18..64a01290 100644 --- a/thermion_dart/lib/src/viewer/src/shared_types/pick_result.dart +++ b/thermion_dart/lib/src/viewer/src/shared_types/pick_result.dart @@ -1,5 +1,5 @@ // "picking" means clicking/tapping on the viewport, and unprojecting the X/Y coordinate to determine whether any renderable entities were present at those coordinates. import '../../viewer.dart'; -typedef FilamentPickResult = ({ThermionEntity entity, double x, double y}); -typedef ThermionPickResult = FilamentPickResult; +typedef FilamentPickResult = ({ThermionEntity entity, int x, int y}); +typedef PickResult = FilamentPickResult; diff --git a/thermion_dart/lib/src/viewer/src/shared_types/render_target.dart b/thermion_dart/lib/src/viewer/src/shared_types/render_target.dart new file mode 100644 index 00000000..4b648e6a --- /dev/null +++ b/thermion_dart/lib/src/viewer/src/shared_types/render_target.dart @@ -0,0 +1,3 @@ +abstract class RenderTarget { + Future destroy(); +} diff --git a/thermion_dart/lib/src/viewer/src/shared_types/shared_types.dart b/thermion_dart/lib/src/viewer/src/shared_types/shared_types.dart index 55aee2c1..80480a67 100644 --- a/thermion_dart/lib/src/viewer/src/shared_types/shared_types.dart +++ b/thermion_dart/lib/src/viewer/src/shared_types/shared_types.dart @@ -1,5 +1,8 @@ library shared_types; +export 'swap_chain.dart'; +export 'view.dart'; +export 'render_target.dart'; export 'camera.dart'; export 'material.dart'; export 'texture.dart'; diff --git a/thermion_dart/lib/src/viewer/src/shared_types/swap_chain.dart b/thermion_dart/lib/src/viewer/src/shared_types/swap_chain.dart new file mode 100644 index 00000000..0c89746b --- /dev/null +++ b/thermion_dart/lib/src/viewer/src/shared_types/swap_chain.dart @@ -0,0 +1,3 @@ +abstract class SwapChain { + Future destroy(); +} diff --git a/thermion_dart/lib/src/viewer/src/shared_types/view.dart b/thermion_dart/lib/src/viewer/src/shared_types/view.dart new file mode 100644 index 00000000..c862505a --- /dev/null +++ b/thermion_dart/lib/src/viewer/src/shared_types/view.dart @@ -0,0 +1,30 @@ +import 'package:thermion_dart/thermion_dart.dart'; +import 'swap_chain.dart'; + +/// +/// The viewport currently attached to a [View]. +/// +/// The dimensions here are guaranteed to be in physical pixels. +/// +class Viewport { + final int left; + final int bottom; + final int width; + final int height; + + Viewport(this.left, this.bottom, this.width, this.height); +} + +abstract class View { + Future getViewport(); + Future updateViewport(int width, int height); + Future setRenderTarget(covariant RenderTarget? renderTarget); + Future setCamera(covariant Camera camera); + Camera getCamera(); + Future setPostProcessing(bool enabled); + Future setAntiAliasing(bool msaa, bool fxaa, bool taa); + Future setRenderable(bool renderable, covariant SwapChain swapChain); + Future setFrustumCullingEnabled(bool enabled); + Future setToneMapper(ToneMapper mapper); + Future setBloom(double strength); +} diff --git a/thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart b/thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart index ad7a1aa1..0c8c5760 100644 --- a/thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart +++ b/thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart @@ -1,6 +1,5 @@ import 'package:thermion_dart/src/viewer/src/events.dart'; -import '../../entities/abstract_gizmo.dart'; -import 'shared_types/camera.dart'; +import '../../utils/src/gizmo.dart'; import 'shared_types/shared_types.dart'; export 'shared_types/shared_types.dart'; @@ -10,6 +9,8 @@ import 'package:vector_math/vector_math_64.dart'; import 'dart:async'; import 'package:animation_tools_dart/animation_tools_dart.dart'; +import 'shared_types/view.dart'; + const double kNear = 0.05; const double kFar = 1000.0; const double kFocalLength = 28.0; @@ -20,16 +21,6 @@ abstract class ThermionViewer { /// Future get initialized; - /// - /// The current dimensions of the viewport (in physical pixels). - /// - var viewportDimensions = (0.0, 0.0); - - /// - /// The current ratio of logical to physical pixels. - /// - late double pixelRatio; - /// /// The result(s) of calling [pick] (see below). /// This may be a broadcast stream, so you should ensure you have subscribed to this stream before calling [pick]. @@ -37,11 +28,6 @@ abstract class ThermionViewer { /// Stream get pickResult; - /// - /// The result(s) of calling [pickGizmo] (see below). - /// - Stream get gizmoPickResult; - /// /// A Stream containing entities added/removed to/from to the scene. /// @@ -60,7 +46,7 @@ abstract class ThermionViewer { /// /// Render a single frame immediately. /// - Future render(); + Future render({covariant SwapChain? swapChain}); /// /// Requests a single frame to be rendered. This is only intended to be used internally. @@ -70,7 +56,41 @@ abstract class ThermionViewer { /// /// Render a single frame and copy the pixel buffer to [out]. /// - Future capture(); + Future capture( + {covariant SwapChain? swapChain, + covariant View? view, + covariant RenderTarget? renderTarget}); + + /// + /// + /// + Future createHeadlessSwapChain(int width, int height); + + /// + /// + /// + Future createSwapChain(int handle); + + /// + /// + /// + Future createRenderTarget( + int width, int height, int textureHandle); + + /// + /// + /// + Future setRenderTarget(covariant RenderTarget renderTarget); + + /// + /// + /// + Future createView(); + + /// + /// + /// + Future getViewAt(int index); /// /// Sets the framerate for continuous rendering when [setRendering] is enabled. @@ -196,12 +216,16 @@ abstract class ThermionViewer { /// Specify [numInstances] to create multiple instances (this is more efficient than dynamically instantating at a later time). You can then retrieve the created instances with [getInstances]. /// If you want to be able to call [createInstance] at a later time, you must pass true for [keepData]. /// If [keepData] is false, the source glTF data will be released and [createInstance] will throw an exception. + /// If [loadResourcesAsync] is true, resources (textures, materials, etc) will + /// be loaded asynchronously (so expect some material/texture pop-in); + /// /// Future loadGlbFromBuffer(Uint8List data, {int numInstances = 1, bool keepData = false, int priority = 4, - int layer = 0}); + int layer = 0, + bool loadResourcesAsync}); /// /// Create a new instance of [entity]. @@ -228,36 +252,6 @@ abstract class ThermionViewer { Future loadGltf(String path, String relativeResourcePath, {bool keepData = false}); - /// - /// Called by `FilamentGestureDetector`. You probably don't want to call this yourself. - /// - Future panStart(double x, double y); - - /// - /// Called by `FilamentGestureDetector`. You probably don't want to call this yourself. - /// - Future panUpdate(double x, double y); - - /// - /// Called by `FilamentGestureDetector`. You probably don't want to call this yourself. - /// - Future panEnd(); - - /// - /// Called by `FilamentGestureDetector`. You probably don't want to call this yourself. - /// - Future rotateStart(double x, double y); - - /// - /// Called by `FilamentGestureDetector`. You probably don't want to call this yourself. - /// - Future rotateUpdate(double x, double y); - - /// - /// Called by `FilamentGestureDetector`. You probably don't want to call this yourself. - /// - Future rotateEnd(); - /// /// Set the weights for all morph targets in [entity] to [weights]. /// Note that [weights] must contain values for ALL morph targets, but no exception will be thrown if you don't do so (you'll just get incorrect results). @@ -368,7 +362,8 @@ abstract class ThermionViewer { /// Sets multiple transforms (relative to parent) simultaneously for [entity]. /// Uses mutex to ensure that transform updates aren't split across frames. /// - Future queueTransformUpdates(List entities, List transforms); + Future queueTransformUpdates( + List entities, List transforms); /// /// Updates the bone matrices for [entity] (which must be the ThermionEntity @@ -399,21 +394,6 @@ abstract class ThermionViewer { /// Future clearEntities(); - /// - /// Called by `FilamentGestureDetector`. You probably don't want to call this yourself. - /// - Future zoomBegin(); - - /// - /// Called by `FilamentGestureDetector`. You probably don't want to call this yourself. - /// - Future zoomUpdate(double x, double y, double z); - - /// - /// Called by `FilamentGestureDetector`. You probably don't want to call this yourself. - /// - Future zoomEnd(); - /// /// Schedules the glTF animation at [index] in [entity] to start playing on the next frame. /// @@ -506,15 +486,6 @@ abstract class ThermionViewer { /// Future getCameraCullingFar(); - /// - /// - /// - Future setCameraLensProjection( - {double near = kNear, - double far = kFar, - double? aspect, - double focalLength = kFocalLength}); - /// /// Sets the focus distance for the camera. /// @@ -714,30 +685,11 @@ abstract class ThermionViewer { /// void pick(int x, int y); - /// - /// Used to test whether a Gizmo is at the given viewport coordinates. - /// Called by `FilamentGestureDetector` on a mouse/finger down event. You probably don't want to call this yourself. - /// This is asynchronous and will require 2-3 frames to complete - subscribe to the [gizmoPickResult] stream to receive the results of this method. - /// [x] and [y] must be in local logical coordinates (i.e. where 0,0 is at top-left of the ThermionWidget). - /// - void pickGizmo(int x, int y); - /// /// Retrieves the name assigned to the given ThermionEntity (usually corresponds to the glTF mesh name). /// String? getNameForEntity(ThermionEntity entity); - /// - /// Sets the options for manipulating the camera via the viewport. - /// ManipulatorMode.FREE_FLIGHT and ManipulatorMode.MAP are currently unsupported and will throw an exception. - /// - @Deprecated("Use InputHandler instead") - Future setCameraManipulatorOptions( - {ManipulatorMode mode = ManipulatorMode.ORBIT, - double orbitSpeedX = 0.01, - double orbitSpeedY = 0.01, - double zoomSpeed = 0.01}); - /// /// Returns all child entities under [parent]. /// @@ -757,17 +709,6 @@ abstract class ThermionViewer { Future> getChildEntityNames(ThermionEntity entity, {bool renderableOnly = true}); - /// - /// If [recording] is set to true, each frame the framebuffer/texture will be written to /tmp/output_*.png. - /// This will impact performance; handle with care. - /// - Future setRecording(bool recording); - - /// - /// Sets the output directory where recorded PNGs will be placed. - /// - Future setRecordingOutputDirectory(String outputDirectory); - /// /// An [entity] will only be animatable after an animation component is attached. /// Any calls to [playAnimation]/[setBoneAnimation]/[setMorphAnimation] will have no visual effect until [addAnimationComponent] has been called on the instance. @@ -828,9 +769,9 @@ abstract class ThermionViewer { Future setPriority(ThermionEntity entityId, int priority); /// - /// The gizmo for translating/rotating objects. Only one gizmo is present in the scene. + /// The gizmo for translating/rotating objects. Only one gizmo can be active for a given view. /// - AbstractGizmo? get gizmo; + Future createGizmo(covariant View view); /// /// Register a callback to be invoked when this viewer is disposed. @@ -854,11 +795,6 @@ abstract class ThermionViewer { /// Future setVisibilityLayer(ThermionEntity entity, int layer); - /// - /// Show/hide the translation gizmo. - /// - Future setGizmoVisibility(bool visible); - /// /// Renders an outline around [entity] with the given color. /// @@ -957,7 +893,7 @@ abstract class ThermionViewer { /// /// /// - Future getActiveCamera(); + Future getActiveCamera(); /// /// diff --git a/thermion_dart/lib/src/viewer/src/thermion_viewer_stub.dart b/thermion_dart/lib/src/viewer/src/thermion_viewer_stub.dart index 4f2c9688..d849c5d2 100644 --- a/thermion_dart/lib/src/viewer/src/thermion_viewer_stub.dart +++ b/thermion_dart/lib/src/viewer/src/thermion_viewer_stub.dart @@ -1,12 +1,13 @@ import 'dart:math'; import 'dart:typed_data'; +import 'package:thermion_dart/src/utils/src/gizmo.dart'; +import 'package:thermion_dart/src/viewer/src/shared_types/swap_chain.dart'; +import 'package:thermion_dart/src/viewer/src/shared_types/view.dart'; import 'package:thermion_dart/thermion_dart.dart'; import 'package:vector_math/vector_math_64.dart'; import 'dart:async'; import 'package:animation_tools_dart/animation_tools_dart.dart'; - -import '../../entities/abstract_gizmo.dart'; import 'events.dart'; import 'shared_types/camera.dart'; @@ -240,10 +241,6 @@ class ThermionViewerStub extends ThermionViewer { throw UnimplementedError(); } - @override - // TODO: implement gizmo - AbstractGizmo? get gizmo => throw UnimplementedError(); - @override Future hide(ThermionEntity entity, String? meshName) { // TODO: implement hide @@ -384,12 +381,7 @@ class ThermionViewerStub extends ThermionViewer { throw UnimplementedError(); } - @override - Future render() { - // TODO: implement render - throw UnimplementedError(); - } - + @override // TODO: implement rendering bool get rendering => throw UnimplementedError(); @@ -723,12 +715,6 @@ class ThermionViewerStub extends ThermionViewer { throw UnimplementedError(); } - @override - Future capture() { - // TODO: implement capture - throw UnimplementedError(); - } - @override Future getBoundingBox(ThermionEntity entity) { // TODO: implement getBoundingBox @@ -907,11 +893,7 @@ class ThermionViewerStub extends ThermionViewer { throw UnimplementedError(); } - @override - Future loadGlbFromBuffer(Uint8List data, {int numInstances = 1, bool keepData = false, int priority = 4, int layer = 0}) { - // TODO: implement loadGlbFromBuffer - throw UnimplementedError(); - } + @override Future setMaterialPropertyInt(ThermionEntity entity, String propertyName, int materialIndex, int value) { @@ -1007,18 +989,79 @@ class ThermionViewerStub extends ThermionViewer { // TODO: implement getCameraCount throw UnimplementedError(); } - - @override - Future getActiveCamera() { - // TODO: implement getActiveCamera - throw UnimplementedError(); - } - + @override Future queueTransformUpdates(List entities, List transforms) { // TODO: implement queueTransformUpdates throw UnimplementedError(); } + @override + Future createRenderTarget(int width, int height, int textureHandle) { + // TODO: implement createRenderTarget + throw UnimplementedError(); + } + + @override + Future setRenderTarget(covariant RenderTarget renderTarget) { + // TODO: implement setRenderTarget + throw UnimplementedError(); + } + + @override + Future createView() { + // TODO: implement createView + throw UnimplementedError(); + } + + @override + Future getViewAt(int index) { + // TODO: implement getViewAt + throw UnimplementedError(); + } + + + @override + Future createGizmo(covariant View view) { + // TODO: implement createGizmo + throw UnimplementedError(); + } + + @override + Future createHeadlessSwapChain(int width, int height) { + // TODO: implement createHeadlessSwapChain + throw UnimplementedError(); + } + + @override + Future capture({covariant SwapChain? swapChain, covariant View? view, covariant RenderTarget? renderTarget}) { + // TODO: implement capture + throw UnimplementedError(); + } + + @override + Future createSwapChain(handle) { + // TODO: implement createSwapChain + throw UnimplementedError(); + } + + @override + Future render({covariant SwapChain? swapChain}) { + // TODO: implement render + throw UnimplementedError(); + } + + @override + Future getActiveCamera() { + // TODO: implement getActiveCamera + throw UnimplementedError(); + } + + @override + Future loadGlbFromBuffer(Uint8List data, {int numInstances = 1, bool keepData = false, int priority = 4, int layer = 0, bool loadResourcesAsync= false}) { + // TODO: implement loadGlbFromBuffer + throw UnimplementedError(); + } + } diff --git a/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_dart_bridge.dart b/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_dart_bridge.dart index e428e2a2..656017da 100644 --- a/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_dart_bridge.dart +++ b/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_dart_bridge.dart @@ -1,759 +1,759 @@ -@JS() -library thermion_flutter_js; - -import 'dart:js_interop'; -import 'package:logging/logging.dart'; -import 'package:vector_math/vector_math_64.dart' as v64; -import 'package:animation_tools_dart/animation_tools_dart.dart'; -import 'dart:js_interop_unsafe'; -import 'package:vector_math/vector_math_64.dart'; -import '../../../viewer.dart'; -import 'thermion_viewer_js_shim.dart'; - -/// -/// A (Dart) class that wraps a (Dart) instance of [ThermionViewer], -/// but exported to JS by binding to a global property. -/// This is effectively an implementation of [ThermionViewerJSShim]; -/// allowing users to interact with an instance of [ThermionViewer] -/// (presumably compiled to WASM) from any Javascript context (including -/// the browser console). -/// -@JSExport() -class ThermionViewerJSDartBridge { - final _logger = Logger("ThermionViewerJSDartBridge"); - final ThermionViewer viewer; - - ThermionViewerJSDartBridge(this.viewer); - - void bind({String globalPropertyName = "thermionViewer"}) { - var wrapper = createJSInteropWrapper(this) - as ThermionViewerJSShim; - globalContext.setProperty(globalPropertyName.toJS, wrapper); - } - - JSPromise get initialized { - return viewer.initialized.then((v) => v.toJS).toJS; - } - - @JSExport() - JSBoolean get rendering => viewer.rendering.toJS; - - @JSExport() - JSPromise setRendering(bool render) { - return viewer.setRendering(render).toJS; - } - - @JSExport() - JSPromise render() => viewer.render().toJS; - - @JSExport() - JSPromise capture() { - return viewer.capture().then((captured) => captured.toJS).toJS; - } - - @JSExport() - JSPromise setFrameRate(int framerate) => viewer.setFrameRate(framerate).toJS; - - @JSExport() - JSPromise dispose() => viewer.dispose().toJS; - - @JSExport() - JSPromise setBackgroundImage(String path, {bool fillHeight = false}) => - viewer.setBackgroundImage(path, fillHeight: fillHeight).toJS; - - @JSExport() - JSPromise setBackgroundImagePosition(double x, double y, - {bool clamp = false}) => - viewer.setBackgroundImagePosition(x, y, clamp: clamp).toJS; - - @JSExport() - JSPromise clearBackgroundImage() => viewer.clearBackgroundImage().toJS; - - @JSExport() - JSPromise setBackgroundColor(double r, double g, double b, double alpha) => - viewer.setBackgroundColor(r, g, b, alpha).toJS; - - @JSExport() - JSPromise loadSkybox(String skyboxPath) => viewer.loadSkybox(skyboxPath).toJS; - - @JSExport() - JSPromise removeSkybox() => viewer.removeSkybox().toJS; - - @JSExport() - JSPromise loadIbl(String lightingPath, double intensity) { - _logger.info("Loading IBL from $lightingPath with intensity $intensity"); - return viewer.loadIbl(lightingPath, intensity: intensity).toJS; - } - - @JSExport() - JSPromise rotateIbl(JSArray rotation) { - var matrix = - Matrix3.fromList(rotation.toDart.map((v) => v.toDartDouble).toList()); - return viewer.rotateIbl(matrix).toJS; - } - - @JSExport() - JSPromise removeIbl() => viewer.removeIbl().toJS; - - @JSExport() - JSPromise addLight( - int type, - double colour, - double intensity, - double posX, - double posY, - double posZ, - double dirX, - double dirY, - double dirZ, - double falloffRadius, - double spotLightConeInner, - double spotLightConeOuter, - double sunAngularRadius, - double sunHaloSize, - double sunHaloFallof, - bool castShadows) { - return viewer - .addLight(LightType.values[type], colour, intensity, posX, posY, posZ, - dirX, dirY, dirZ, - falloffRadius: falloffRadius, - spotLightConeInner: spotLightConeInner, - spotLightConeOuter: spotLightConeOuter, - sunAngularRadius: sunAngularRadius, - sunHaloSize: sunHaloSize, - sunHaloFallof: sunHaloFallof, - castShadows: castShadows) - .then((entity) => entity.toJS) - .toJS; - } - - @JSExport() - JSPromise removeLight(ThermionEntity light) => viewer.removeLight(light).toJS; - - @JSExport() - JSPromise clearLights() => viewer.clearLights().toJS; - - @JSExport() - JSPromise loadGlb(String path, {int numInstances = 1}) { - _logger.info("Loading GLB from path $path with numInstances $numInstances"); - return viewer - .loadGlb(path, numInstances: numInstances) - .then((entity) => entity.toJS) - .catchError((err) { - _logger.info("Error: $err"); - }).toJS; - } - - @JSExport() - JSPromise createInstance(ThermionEntity entity) { - return viewer.createInstance(entity).then((instance) => instance.toJS).toJS; - } - - @JSExport() - JSPromise getInstanceCount(ThermionEntity entity) => - viewer.getInstanceCount(entity).then((v) => v.toJS).toJS; - - @JSExport() - JSPromise> getInstances(ThermionEntity entity) { - return viewer - .getInstances(entity) - .then((instances) => - instances.map((instance) => instance.toJS).toList().toJS) - .toJS; - } - - @JSExport() - JSPromise loadGltf(String path, String relativeResourcePath, - {bool keepData = false}) { - return viewer - .loadGltf(path, relativeResourcePath, keepData: keepData) - .then((entity) => entity.toJS) - .toJS; - } - - @JSExport() - JSPromise panStart(double x, double y) => viewer.panStart(x, y).toJS; - - @JSExport() - JSPromise panUpdate(double x, double y) => viewer.panUpdate(x, y).toJS; - - @JSExport() - JSPromise panEnd() => viewer.panEnd().toJS; - - @JSExport() - JSPromise rotateStart(double x, double y) => viewer.rotateStart(x, y).toJS; - - @JSExport() - JSPromise rotateUpdate(double x, double y) => viewer.rotateUpdate(x, y).toJS; - - @JSExport() - JSPromise rotateEnd() => viewer.rotateEnd().toJS; - - @JSExport() - JSPromise setMorphTargetWeights( - ThermionEntity entity, JSArray weights) { - var dartWeights = weights.toDart.map((w) => w.toDartDouble).toList(); - return viewer.setMorphTargetWeights(entity, dartWeights).toJS; - } - - @JSExport() - JSPromise> getMorphTargetNames( - ThermionEntity entity, ThermionEntity childEntity) { - var morphTargetNames = viewer - .getMorphTargetNames(entity, childEntity) - .then((v) => v.map((s) => s.toJS).toList().toJS); - return morphTargetNames.toJS; - } - - @JSExport() - JSPromise> getBoneNames( - ThermionEntity entity, int skinIndex) { - return viewer - .getBoneNames(entity, skinIndex: skinIndex) - .then((v) => v.map((s) => s.toJS).toList().toJS) - .toJS; - } - - @JSExport() - JSPromise> getAnimationNames(ThermionEntity entity) => - viewer - .getAnimationNames(entity) - .then((v) => v.map((s) => s.toJS).toList().toJS) - .toJS; - - @JSExport() - JSPromise getAnimationDuration( - ThermionEntity entity, int animationIndex) => - viewer - .getAnimationDuration(entity, animationIndex) - .then((v) => v.toJS) - .toJS; - - @JSExport() - void clearMorphAnimationData(ThermionEntity entity) { - viewer.clearMorphAnimationData(entity); - } - - @JSExport() - JSPromise setMorphAnimationData( - ThermionEntity entity, - JSArray> animation, - JSArray morphTargets, - JSArray? targetMeshNames, - double frameLengthInMs) { - try { - var morphTargetsDart = morphTargets.toDart.map((m) => m.toDart).toList(); - var animationDataDart = animation.toDart - .map((x) => x.toDart.map((y) => y.toDartDouble).toList()) - .toList(); - - var morphAnimationData = MorphAnimationData( - animationDataDart, morphTargetsDart, - frameLengthInMs: frameLengthInMs); - var targetMeshNamesDart = - targetMeshNames?.toDart.map((x) => x.toDart).toList(); - if (animationDataDart.first.length != morphTargetsDart.length) { - throw Exception( - "Length mismatch between morph targets and animation data"); - } - var result = viewer - .setMorphAnimationData( - entity, - morphAnimationData, - targetMeshNames: targetMeshNamesDart, - ) - .onError((err, st) { - _logger.severe("ERROR SETTING MORPH ANIMATION DATA : $err\n$st"); - return null; - }); - return result.toJS; - } catch (err, st) { - _logger.severe(err); - _logger.severe(st); - rethrow; - } - } - - @JSExport() - JSPromise resetBones(ThermionEntity entity) => viewer.resetBones(entity).toJS; - - @JSExport() - JSPromise addBoneAnimation( - ThermionEntity entity, - JSArray bones, - JSArray>> frameData, - JSNumber frameLengthInMs, - JSNumber spaceEnum, - JSNumber skinIndex, - JSNumber fadeInInSecs, - JSNumber fadeOutInSecs, - JSNumber maxDelta) { - var frameDataDart = frameData.toDart - .map((frame) => frame.toDart - .map((v) { - var values = v.toDart; - var trans = v64.Vector3(values[0].toDartDouble, - values[1].toDartDouble, values[2].toDartDouble); - var rot = v64.Quaternion( - values[3].toDartDouble, - values[4].toDartDouble, - values[5].toDartDouble, - values[6].toDartDouble); - return (rotation: rot, translation: trans); - }) - .cast() - .toList()) - .toList(); - - var data = BoneAnimationData( - bones.toDart.map((n) => n.toDart).toList(), frameDataDart, - frameLengthInMs: frameLengthInMs.toDartDouble, - space: Space.values[spaceEnum.toDartInt]); - - return viewer - .addBoneAnimation(entity, data, - skinIndex: skinIndex.toDartInt, - fadeInInSecs: fadeInInSecs.toDartDouble, - fadeOutInSecs: fadeOutInSecs.toDartDouble) - .toJS; - } - - @JSExport() - JSPromise removeEntity(ThermionEntity entity) => - viewer.removeEntity(entity).toJS; - - @JSExport() - JSPromise clearEntities() { - return viewer.clearEntities().toJS; - } - - @JSExport() - JSPromise zoomBegin() => viewer.zoomBegin().toJS; - - @JSExport() - JSPromise zoomUpdate(double x, double y, double z) => - viewer.zoomUpdate(x, y, z).toJS; - - @JSExport() - JSPromise zoomEnd() => viewer.zoomEnd().toJS; - - @JSExport() - JSPromise playAnimation(ThermionEntity entity, int index, - {bool loop = false, - bool reverse = false, - bool replaceActive = true, - double crossfade = 0.0, - double startOffset = 0.0}) => - viewer - .playAnimation(entity, index, - loop: loop, - reverse: reverse, - replaceActive: replaceActive, - crossfade: crossfade, - startOffset: startOffset) - .toJS; - - @JSExport() - JSPromise playAnimationByName(ThermionEntity entity, String name, - {bool loop = false, - bool reverse = false, - bool replaceActive = true, - double crossfade = 0.0}) => - viewer - .playAnimationByName( - entity, - name, - loop: loop, - reverse: reverse, - replaceActive: replaceActive, - crossfade: crossfade, - ) - .toJS; - - @JSExport() - JSPromise setAnimationFrame( - ThermionEntity entity, int index, int animationFrame) => - viewer - .setAnimationFrame( - entity, - index, - animationFrame, - ) - .toJS; - - @JSExport() - JSPromise stopAnimation(ThermionEntity entity, int animationIndex) => - viewer.stopAnimation(entity, animationIndex).toJS; - - @JSExport() - JSPromise stopAnimationByName(ThermionEntity entity, String name) => - viewer.stopAnimationByName(entity, name).toJS; - - @JSExport() - JSPromise setCamera(ThermionEntity entity, String? name) => - viewer.setCamera(entity, name).toJS; - - @JSExport() - JSPromise setMainCamera() => viewer.setMainCamera().toJS; - - @JSExport() - JSPromise getMainCamera() { - throw UnimplementedError("TODO"); - // return viewer.getMainCamera().then((camera) => camera.toJS).toJS; - } - - @JSExport() - JSPromise setParent( - ThermionEntity child, ThermionEntity parent, bool preserveScaling) { - return viewer - .setParent(child, parent, preserveScaling: preserveScaling) - .toJS; - } - - @JSExport() - JSPromise setCameraFov(double degrees, bool horizontal) => - viewer.setCameraFov(degrees, horizontal: horizontal).toJS; - - @JSExport() - JSPromise setToneMapping(int mapper) => - viewer.setToneMapping(ToneMapper.values[mapper]).toJS; - - @JSExport() - JSPromise setBloom(double bloom) => viewer.setBloom(bloom).toJS; - - @JSExport() - JSPromise setCameraFocalLength(double focalLength) => - viewer.setCameraFocalLength(focalLength).toJS; - - @JSExport() - JSPromise setCameraCulling(double near, double far) => - viewer.setCameraCulling(near, far).toJS; - - @JSExport() - JSPromise getCameraCullingNear() => - viewer.getCameraCullingNear().then((v) => v.toJS).toJS; - - @JSExport() - JSPromise getCameraCullingFar() => - viewer.getCameraCullingFar().then((v) => v.toJS).toJS; - - @JSExport() - JSPromise setCameraFocusDistance(double focusDistance) => - viewer.setCameraFocusDistance(focusDistance).toJS; - - @JSExport() - JSPromise> getCameraPosition() { - throw UnimplementedError(); - // return viewer.getCameraPosition().then((position) => position.toJS).toJS; - } - - @JSExport() - JSPromise> getCameraModelMatrix() { - throw UnimplementedError(); - // return viewer.getCameraModelMatrix().then((matrix) => matrix.toJSArray()).toJS; - } - - @JSExport() - JSPromise> getCameraViewMatrix() { - throw UnimplementedError(); - // return viewer.getCameraViewMatrix().then((matrix) => matrix.toJSArray()).toJS; - } - - @JSExport() - JSPromise> getCameraProjectionMatrix() { - throw UnimplementedError(); - // return viewer.getCameraProjectionMatrix().then((matrix) => matrix.toJSArray()).toJS; - } - - @JSExport() - JSPromise> getCameraCullingProjectionMatrix() { - throw UnimplementedError(); - // return viewer.getCameraCullingProjectionMatrix().then((matrix) => matrix.toJSArray()).toJS; - } - - @JSExport() - JSPromise getCameraFrustum() { - throw UnimplementedError(); - // return viewer.getCameraFrustum().then((frustum) => frustum.toJS).toJS; - } - - @JSExport() - JSPromise setCameraPosition(double x, double y, double z) => - viewer.setCameraPosition(x, y, z).toJS; - @JSExport() - JSPromise> getCameraRotation() { - return viewer - .getCameraRotation() - .then((rotation) => rotation.storage.map((v) => v.toJS).toList().toJS) - .toJS; - } - - @JSExport() - JSPromise moveCameraToAsset(ThermionEntity entity) => - throw UnimplementedError(); -// viewer.moveCameraToAsset(entity)).toJS; - - @JSExport() - JSPromise setViewFrustumCulling(JSBoolean enabled) => - throw UnimplementedError(); -// viewer.setViewFrustumCulling(enabled).toJS; - - @JSExport() - JSPromise setCameraExposure( - double aperture, double shutterSpeed, double sensitivity) => - viewer.setCameraExposure(aperture, shutterSpeed, sensitivity).toJS; - - @JSExport() - JSPromise setCameraRotation(JSArray quaternion) { - var dartVals = quaternion.toDart; - return viewer - .setCameraRotation(v64.Quaternion( - dartVals[0].toDartDouble, - dartVals[1].toDartDouble, - dartVals[2].toDartDouble, - dartVals[3].toDartDouble)) - .toJS; - } - - @JSExport() - JSPromise setCameraModelMatrix(JSArray matrix) { - throw UnimplementedError(); - // viewer.setCameraModelMatrix(matrix).toJS; - } - - @JSExport() - JSPromise setMaterialColor(ThermionEntity entity, String meshName, - int materialIndex, double r, double g, double b, double a) => - throw UnimplementedError(); -// viewer.setMaterialColor( -// entity), -// meshName, -// materialIndex, -// r, -// g, -// b, -// a, -// ).toJS; - - @JSExport() - JSPromise transformToUnitCube(ThermionEntity entity) => - viewer.transformToUnitCube(entity).toJS; - - @JSExport() - JSPromise setPosition(ThermionEntity entity, double x, double y, double z) => - viewer.setPosition(entity, x, y, z).toJS; - @JSExport() - JSPromise setScale(ThermionEntity entity, double scale) => - viewer.setScale(entity, scale).toJS; - @JSExport() - JSPromise setRotation( - ThermionEntity entity, double rads, double x, double y, double z) => - viewer.setRotation(entity, rads, x, y, z).toJS; - @JSExport() - JSPromise queuePositionUpdate( - ThermionEntity entity, double x, double y, double z, bool relative) => - viewer - .queuePositionUpdate( - entity, - x, - y, - z, - relative: relative, - ) - .toJS; - @JSExport() - JSPromise queueRotationUpdate(ThermionEntity entity, double rads, double x, - double y, double z, bool relative) => - viewer - .queueRotationUpdate( - entity, - rads, - x, - y, - z, - relative: relative, - ) - .toJS; - @JSExport() - JSPromise queueRotationUpdateQuat( - ThermionEntity entity, JSArray quat, JSBoolean relative) => - throw UnimplementedError(); -// viewer.queueRotationUpdateQuat( -// entity, -// quat.toDartQuaternion(), -// relative: relative, -// ).toJS; - - @JSExport() - JSPromise setPostProcessing(bool enabled) => - viewer.setPostProcessing(enabled).toJS; - - @JSExport() - JSPromise setAntiAliasing(bool msaa, bool fxaa, bool taa) => - viewer.setAntiAliasing(msaa, fxaa, taa).toJS; - - @JSExport() - JSPromise setRotationQuat( - ThermionEntity entity, JSArray rotation) => - throw UnimplementedError(); - - @JSExport() - JSPromise reveal(ThermionEntity entity, String? meshName) => - viewer.reveal(entity, meshName).toJS; - - @JSExport() - JSPromise hide(ThermionEntity entity, String? meshName) => - viewer.hide(entity, meshName).toJS; - - @JSExport() - void pick(int x, int y) => viewer.pick(x, y); - - @JSExport() - String? getNameForEntity(ThermionEntity entity) => - viewer.getNameForEntity(entity); - - @JSExport() - JSPromise setCameraManipulatorOptions({ - int mode = 0, - double orbitSpeedX = 0.01, - double orbitSpeedY = 0.01, - double zoomSpeed = 0.01, - }) => - viewer - .setCameraManipulatorOptions( - mode: ManipulatorMode.values[mode], - orbitSpeedX: orbitSpeedX, - orbitSpeedY: orbitSpeedY, - zoomSpeed: zoomSpeed, - ) - .toJS; - - @JSExport() - JSPromise> getChildEntities( - ThermionEntity parent, bool renderableOnly) { - return viewer - .getChildEntities( - parent, - renderableOnly, - ) - .then((entities) => entities.map((entity) => entity.toJS).toList().toJS) - .onError((e, st) async { - _logger.severe("Error : $e\n$st"); - return [].toJS; - }).toJS; - } - - @JSExport() - JSPromise getChildEntity(ThermionEntity parent, String childName) { - return viewer - .getChildEntity( - parent, - childName, - ) - .then((entity) => entity.toJS) - .onError((e, st) async { - _logger.severe("Error getChildEntity : $e\n$st"); - return 0.toJS; - }).toJS; - } - - @JSExport() - JSPromise> getChildEntityNames( - ThermionEntity entity, bool renderableOnly) => - viewer - .getChildEntityNames( - entity, - renderableOnly: renderableOnly, - ) - .then((v) => v.map((s) => s.toJS).toList().toJS) - .toJS; - - @JSExport() - JSPromise setRecording(bool recording) => viewer.setRecording(recording).toJS; - - @JSExport() - JSPromise setRecordingOutputDirectory(String outputDirectory) => - viewer.setRecordingOutputDirectory(outputDirectory).toJS; - - @JSExport() - JSPromise addAnimationComponent(ThermionEntity entity) => - viewer.addAnimationComponent(entity).toJS; - - @JSExport() - JSPromise removeAnimationComponent(ThermionEntity entity) => - viewer.removeAnimationComponent(entity).toJS; - - @JSExport() - JSPromise getParent(ThermionEntity entity) => - viewer.removeAnimationComponent(entity).toJS; - - @JSExport() - JSPromise getBone(ThermionEntity entity, int boneIndex, int skinIndex) => - viewer.getBone(entity, boneIndex, skinIndex: skinIndex).toJS; - - @JSExport() - JSPromise> getLocalTransform(ThermionEntity entity) { - return viewer - .getLocalTransform(entity) - .then((t) => t.storage.map((v) => v.toJS).toList().toJS) - .toJS; - } - - @JSExport() - JSPromise> getWorldTransform(ThermionEntity entity) { - return viewer - .getWorldTransform(entity) - .then((t) => t.storage.map((v) => v.toJS).toList().toJS) - .toJS; - } - - @JSExport() - JSPromise setTransform(ThermionEntity entity, JSArray transform) { - return viewer - .setTransform( - entity, - Matrix4.fromList( - transform.toDart.map((v) => v.toDartDouble).toList())) - .toJS; - } - - @JSExport() - JSPromise updateBoneMatrices(ThermionEntity entity) { - return viewer.updateBoneMatrices(entity).toJS; - } - - @JSExport() - JSPromise setBoneTransform(ThermionEntity entity, int boneIndex, - JSArray transform, int skinIndex) { - return viewer - .setBoneTransform( - entity, - boneIndex, - Matrix4.fromList( - transform.toDart.map((v) => v.toDartDouble).toList()), - skinIndex: skinIndex) - .toJS; - } - - @JSExport() - JSPromise addCollisionComponent(ThermionEntity entity, - {JSFunction? callback, bool affectsTransform = false}) { - throw UnimplementedError(); - } - - @JSExport() - JSPromise setShadowsEnabled(bool enabled) { - return viewer.setShadowsEnabled(enabled).toJS; - } - - @JSExport() - JSPromise setShadowType(int shadowType) { - return viewer.setShadowType(ShadowType.values[shadowType]).toJS; - } - - @JSExport() - JSPromise setSoftShadowOptions( - double penumbraScale, double penumbraRatioScale) { - return viewer.setSoftShadowOptions(penumbraScale, penumbraRatioScale).toJS; - } -} +// @JS() +// library thermion_flutter_js; + +// import 'dart:js_interop'; +// import 'package:logging/logging.dart'; +// import 'package:vector_math/vector_math_64.dart' as v64; +// import 'package:animation_tools_dart/animation_tools_dart.dart'; +// import 'dart:js_interop_unsafe'; +// import 'package:vector_math/vector_math_64.dart'; +// import '../../../viewer.dart'; +// import 'thermion_viewer_js_shim.dart'; + +// /// +// /// A (Dart) class that wraps a (Dart) instance of [ThermionViewer], +// /// but exported to JS by binding to a global property. +// /// This is effectively an implementation of [ThermionViewerJSShim]; +// /// allowing users to interact with an instance of [ThermionViewer] +// /// (presumably compiled to WASM) from any Javascript context (including +// /// the browser console). +// /// +// @JSExport() +// class ThermionViewerJSDartBridge { +// final _logger = Logger("ThermionViewerJSDartBridge"); +// final ThermionViewer viewer; + +// ThermionViewerJSDartBridge(this.viewer); + +// void bind({String globalPropertyName = "thermionViewer"}) { +// var wrapper = createJSInteropWrapper(this) +// as ThermionViewerJSShim; +// globalContext.setProperty(globalPropertyName.toJS, wrapper); +// } + +// JSPromise get initialized { +// return viewer.initialized.then((v) => v.toJS).toJS; +// } + +// @JSExport() +// JSBoolean get rendering => viewer.rendering.toJS; + +// @JSExport() +// JSPromise setRendering(bool render) { +// return viewer.setRendering(render).toJS; +// } + +// @JSExport() +// JSPromise render() => viewer.render().toJS; + +// @JSExport() +// JSPromise capture() { +// return viewer.capture().then((captured) => captured.toJS).toJS; +// } + +// @JSExport() +// JSPromise setFrameRate(int framerate) => viewer.setFrameRate(framerate).toJS; + +// @JSExport() +// JSPromise dispose() => viewer.dispose().toJS; + +// @JSExport() +// JSPromise setBackgroundImage(String path, {bool fillHeight = false}) => +// viewer.setBackgroundImage(path, fillHeight: fillHeight).toJS; + +// @JSExport() +// JSPromise setBackgroundImagePosition(double x, double y, +// {bool clamp = false}) => +// viewer.setBackgroundImagePosition(x, y, clamp: clamp).toJS; + +// @JSExport() +// JSPromise clearBackgroundImage() => viewer.clearBackgroundImage().toJS; + +// @JSExport() +// JSPromise setBackgroundColor(double r, double g, double b, double alpha) => +// viewer.setBackgroundColor(r, g, b, alpha).toJS; + +// @JSExport() +// JSPromise loadSkybox(String skyboxPath) => viewer.loadSkybox(skyboxPath).toJS; + +// @JSExport() +// JSPromise removeSkybox() => viewer.removeSkybox().toJS; + +// @JSExport() +// JSPromise loadIbl(String lightingPath, double intensity) { +// _logger.info("Loading IBL from $lightingPath with intensity $intensity"); +// return viewer.loadIbl(lightingPath, intensity: intensity).toJS; +// } + +// @JSExport() +// JSPromise rotateIbl(JSArray rotation) { +// var matrix = +// Matrix3.fromList(rotation.toDart.map((v) => v.toDartDouble).toList()); +// return viewer.rotateIbl(matrix).toJS; +// } + +// @JSExport() +// JSPromise removeIbl() => viewer.removeIbl().toJS; + +// @JSExport() +// JSPromise addLight( +// int type, +// double colour, +// double intensity, +// double posX, +// double posY, +// double posZ, +// double dirX, +// double dirY, +// double dirZ, +// double falloffRadius, +// double spotLightConeInner, +// double spotLightConeOuter, +// double sunAngularRadius, +// double sunHaloSize, +// double sunHaloFallof, +// bool castShadows) { +// return viewer +// .addLight(LightType.values[type], colour, intensity, posX, posY, posZ, +// dirX, dirY, dirZ, +// falloffRadius: falloffRadius, +// spotLightConeInner: spotLightConeInner, +// spotLightConeOuter: spotLightConeOuter, +// sunAngularRadius: sunAngularRadius, +// sunHaloSize: sunHaloSize, +// sunHaloFallof: sunHaloFallof, +// castShadows: castShadows) +// .then((entity) => entity.toJS) +// .toJS; +// } + +// @JSExport() +// JSPromise removeLight(ThermionEntity light) => viewer.removeLight(light).toJS; + +// @JSExport() +// JSPromise clearLights() => viewer.clearLights().toJS; + +// @JSExport() +// JSPromise loadGlb(String path, {int numInstances = 1}) { +// _logger.info("Loading GLB from path $path with numInstances $numInstances"); +// return viewer +// .loadGlb(path, numInstances: numInstances) +// .then((entity) => entity.toJS) +// .catchError((err) { +// _logger.info("Error: $err"); +// }).toJS; +// } + +// @JSExport() +// JSPromise createInstance(ThermionEntity entity) { +// return viewer.createInstance(entity).then((instance) => instance.toJS).toJS; +// } + +// @JSExport() +// JSPromise getInstanceCount(ThermionEntity entity) => +// viewer.getInstanceCount(entity).then((v) => v.toJS).toJS; + +// @JSExport() +// JSPromise> getInstances(ThermionEntity entity) { +// return viewer +// .getInstances(entity) +// .then((instances) => +// instances.map((instance) => instance.toJS).toList().toJS) +// .toJS; +// } + +// @JSExport() +// JSPromise loadGltf(String path, String relativeResourcePath, +// {bool keepData = false}) { +// return viewer +// .loadGltf(path, relativeResourcePath, keepData: keepData) +// .then((entity) => entity.toJS) +// .toJS; +// } + +// @JSExport() +// JSPromise panStart(double x, double y) => viewer.panStart(x, y).toJS; + +// @JSExport() +// JSPromise panUpdate(double x, double y) => viewer.panUpdate(x, y).toJS; + +// @JSExport() +// JSPromise panEnd() => viewer.panEnd().toJS; + +// @JSExport() +// JSPromise rotateStart(double x, double y) => viewer.rotateStart(x, y).toJS; + +// @JSExport() +// JSPromise rotateUpdate(double x, double y) => viewer.rotateUpdate(x, y).toJS; + +// @JSExport() +// JSPromise rotateEnd() => viewer.rotateEnd().toJS; + +// @JSExport() +// JSPromise setMorphTargetWeights( +// ThermionEntity entity, JSArray weights) { +// var dartWeights = weights.toDart.map((w) => w.toDartDouble).toList(); +// return viewer.setMorphTargetWeights(entity, dartWeights).toJS; +// } + +// @JSExport() +// JSPromise> getMorphTargetNames( +// ThermionEntity entity, ThermionEntity childEntity) { +// var morphTargetNames = viewer +// .getMorphTargetNames(entity, childEntity) +// .then((v) => v.map((s) => s.toJS).toList().toJS); +// return morphTargetNames.toJS; +// } + +// @JSExport() +// JSPromise> getBoneNames( +// ThermionEntity entity, int skinIndex) { +// return viewer +// .getBoneNames(entity, skinIndex: skinIndex) +// .then((v) => v.map((s) => s.toJS).toList().toJS) +// .toJS; +// } + +// @JSExport() +// JSPromise> getAnimationNames(ThermionEntity entity) => +// viewer +// .getAnimationNames(entity) +// .then((v) => v.map((s) => s.toJS).toList().toJS) +// .toJS; + +// @JSExport() +// JSPromise getAnimationDuration( +// ThermionEntity entity, int animationIndex) => +// viewer +// .getAnimationDuration(entity, animationIndex) +// .then((v) => v.toJS) +// .toJS; + +// @JSExport() +// void clearMorphAnimationData(ThermionEntity entity) { +// viewer.clearMorphAnimationData(entity); +// } + +// @JSExport() +// JSPromise setMorphAnimationData( +// ThermionEntity entity, +// JSArray> animation, +// JSArray morphTargets, +// JSArray? targetMeshNames, +// double frameLengthInMs) { +// try { +// var morphTargetsDart = morphTargets.toDart.map((m) => m.toDart).toList(); +// var animationDataDart = animation.toDart +// .map((x) => x.toDart.map((y) => y.toDartDouble).toList()) +// .toList(); + +// var morphAnimationData = MorphAnimationData( +// animationDataDart, morphTargetsDart, +// frameLengthInMs: frameLengthInMs); +// var targetMeshNamesDart = +// targetMeshNames?.toDart.map((x) => x.toDart).toList(); +// if (animationDataDart.first.length != morphTargetsDart.length) { +// throw Exception( +// "Length mismatch between morph targets and animation data"); +// } +// var result = viewer +// .setMorphAnimationData( +// entity, +// morphAnimationData, +// targetMeshNames: targetMeshNamesDart, +// ) +// .onError((err, st) { +// _logger.severe("ERROR SETTING MORPH ANIMATION DATA : $err\n$st"); +// return null; +// }); +// return result.toJS; +// } catch (err, st) { +// _logger.severe(err); +// _logger.severe(st); +// rethrow; +// } +// } + +// @JSExport() +// JSPromise resetBones(ThermionEntity entity) => viewer.resetBones(entity).toJS; + +// @JSExport() +// JSPromise addBoneAnimation( +// ThermionEntity entity, +// JSArray bones, +// JSArray>> frameData, +// JSNumber frameLengthInMs, +// JSNumber spaceEnum, +// JSNumber skinIndex, +// JSNumber fadeInInSecs, +// JSNumber fadeOutInSecs, +// JSNumber maxDelta) { +// var frameDataDart = frameData.toDart +// .map((frame) => frame.toDart +// .map((v) { +// var values = v.toDart; +// var trans = v64.Vector3(values[0].toDartDouble, +// values[1].toDartDouble, values[2].toDartDouble); +// var rot = v64.Quaternion( +// values[3].toDartDouble, +// values[4].toDartDouble, +// values[5].toDartDouble, +// values[6].toDartDouble); +// return (rotation: rot, translation: trans); +// }) +// .cast() +// .toList()) +// .toList(); + +// var data = BoneAnimationData( +// bones.toDart.map((n) => n.toDart).toList(), frameDataDart, +// frameLengthInMs: frameLengthInMs.toDartDouble, +// space: Space.values[spaceEnum.toDartInt]); + +// return viewer +// .addBoneAnimation(entity, data, +// skinIndex: skinIndex.toDartInt, +// fadeInInSecs: fadeInInSecs.toDartDouble, +// fadeOutInSecs: fadeOutInSecs.toDartDouble) +// .toJS; +// } + +// @JSExport() +// JSPromise removeEntity(ThermionEntity entity) => +// viewer.removeEntity(entity).toJS; + +// @JSExport() +// JSPromise clearEntities() { +// return viewer.clearEntities().toJS; +// } + +// @JSExport() +// JSPromise zoomBegin() => viewer.zoomBegin().toJS; + +// @JSExport() +// JSPromise zoomUpdate(double x, double y, double z) => +// viewer.zoomUpdate(x, y, z).toJS; + +// @JSExport() +// JSPromise zoomEnd() => viewer.zoomEnd().toJS; + +// @JSExport() +// JSPromise playAnimation(ThermionEntity entity, int index, +// {bool loop = false, +// bool reverse = false, +// bool replaceActive = true, +// double crossfade = 0.0, +// double startOffset = 0.0}) => +// viewer +// .playAnimation(entity, index, +// loop: loop, +// reverse: reverse, +// replaceActive: replaceActive, +// crossfade: crossfade, +// startOffset: startOffset) +// .toJS; + +// @JSExport() +// JSPromise playAnimationByName(ThermionEntity entity, String name, +// {bool loop = false, +// bool reverse = false, +// bool replaceActive = true, +// double crossfade = 0.0}) => +// viewer +// .playAnimationByName( +// entity, +// name, +// loop: loop, +// reverse: reverse, +// replaceActive: replaceActive, +// crossfade: crossfade, +// ) +// .toJS; + +// @JSExport() +// JSPromise setAnimationFrame( +// ThermionEntity entity, int index, int animationFrame) => +// viewer +// .setAnimationFrame( +// entity, +// index, +// animationFrame, +// ) +// .toJS; + +// @JSExport() +// JSPromise stopAnimation(ThermionEntity entity, int animationIndex) => +// viewer.stopAnimation(entity, animationIndex).toJS; + +// @JSExport() +// JSPromise stopAnimationByName(ThermionEntity entity, String name) => +// viewer.stopAnimationByName(entity, name).toJS; + +// @JSExport() +// JSPromise setCamera(ThermionEntity entity, String? name) => +// viewer.setCamera(entity, name).toJS; + +// @JSExport() +// JSPromise setMainCamera() => viewer.setMainCamera().toJS; + +// @JSExport() +// JSPromise getMainCamera() { +// throw UnimplementedError("TODO"); +// // return viewer.getMainCamera().then((camera) => camera.toJS).toJS; +// } + +// @JSExport() +// JSPromise setParent( +// ThermionEntity child, ThermionEntity parent, bool preserveScaling) { +// return viewer +// .setParent(child, parent, preserveScaling: preserveScaling) +// .toJS; +// } + +// @JSExport() +// JSPromise setCameraFov(double degrees, bool horizontal) => +// viewer.setCameraFov(degrees, horizontal: horizontal).toJS; + +// @JSExport() +// JSPromise setToneMapping(int mapper) => +// viewer.setToneMapping(ToneMapper.values[mapper]).toJS; + +// @JSExport() +// JSPromise setBloom(double bloom) => viewer.setBloom(bloom).toJS; + +// @JSExport() +// JSPromise setCameraFocalLength(double focalLength) => +// viewer.setCameraFocalLength(focalLength).toJS; + +// @JSExport() +// JSPromise setCameraCulling(double near, double far) => +// viewer.setCameraCulling(near, far).toJS; + +// @JSExport() +// JSPromise getCameraCullingNear() => +// viewer.getCameraCullingNear().then((v) => v.toJS).toJS; + +// @JSExport() +// JSPromise getCameraCullingFar() => +// viewer.getCameraCullingFar().then((v) => v.toJS).toJS; + +// @JSExport() +// JSPromise setCameraFocusDistance(double focusDistance) => +// viewer.setCameraFocusDistance(focusDistance).toJS; + +// @JSExport() +// JSPromise> getCameraPosition() { +// throw UnimplementedError(); +// // return viewer.getCameraPosition().then((position) => position.toJS).toJS; +// } + +// @JSExport() +// JSPromise> getCameraModelMatrix() { +// throw UnimplementedError(); +// // return viewer.getCameraModelMatrix().then((matrix) => matrix.toJSArray()).toJS; +// } + +// @JSExport() +// JSPromise> getCameraViewMatrix() { +// throw UnimplementedError(); +// // return viewer.getCameraViewMatrix().then((matrix) => matrix.toJSArray()).toJS; +// } + +// @JSExport() +// JSPromise> getCameraProjectionMatrix() { +// throw UnimplementedError(); +// // return viewer.getCameraProjectionMatrix().then((matrix) => matrix.toJSArray()).toJS; +// } + +// @JSExport() +// JSPromise> getCameraCullingProjectionMatrix() { +// throw UnimplementedError(); +// // return viewer.getCameraCullingProjectionMatrix().then((matrix) => matrix.toJSArray()).toJS; +// } + +// @JSExport() +// JSPromise getCameraFrustum() { +// throw UnimplementedError(); +// // return viewer.getCameraFrustum().then((frustum) => frustum.toJS).toJS; +// } + +// @JSExport() +// JSPromise setCameraPosition(double x, double y, double z) => +// viewer.setCameraPosition(x, y, z).toJS; +// @JSExport() +// JSPromise> getCameraRotation() { +// return viewer +// .getCameraRotation() +// .then((rotation) => rotation.storage.map((v) => v.toJS).toList().toJS) +// .toJS; +// } + +// @JSExport() +// JSPromise moveCameraToAsset(ThermionEntity entity) => +// throw UnimplementedError(); +// // viewer.moveCameraToAsset(entity)).toJS; + +// @JSExport() +// JSPromise setViewFrustumCulling(JSBoolean enabled) => +// throw UnimplementedError(); +// // viewer.setViewFrustumCulling(enabled).toJS; + +// @JSExport() +// JSPromise setCameraExposure( +// double aperture, double shutterSpeed, double sensitivity) => +// viewer.setCameraExposure(aperture, shutterSpeed, sensitivity).toJS; + +// @JSExport() +// JSPromise setCameraRotation(JSArray quaternion) { +// var dartVals = quaternion.toDart; +// return viewer +// .setCameraRotation(v64.Quaternion( +// dartVals[0].toDartDouble, +// dartVals[1].toDartDouble, +// dartVals[2].toDartDouble, +// dartVals[3].toDartDouble)) +// .toJS; +// } + +// @JSExport() +// JSPromise setCameraModelMatrix(JSArray matrix) { +// throw UnimplementedError(); +// // viewer.setCameraModelMatrix(matrix).toJS; +// } + +// @JSExport() +// JSPromise setMaterialColor(ThermionEntity entity, String meshName, +// int materialIndex, double r, double g, double b, double a) => +// throw UnimplementedError(); +// // viewer.setMaterialColor( +// // entity), +// // meshName, +// // materialIndex, +// // r, +// // g, +// // b, +// // a, +// // ).toJS; + +// @JSExport() +// JSPromise transformToUnitCube(ThermionEntity entity) => +// viewer.transformToUnitCube(entity).toJS; + +// @JSExport() +// JSPromise setPosition(ThermionEntity entity, double x, double y, double z) => +// viewer.setPosition(entity, x, y, z).toJS; +// @JSExport() +// JSPromise setScale(ThermionEntity entity, double scale) => +// viewer.setScale(entity, scale).toJS; +// @JSExport() +// JSPromise setRotation( +// ThermionEntity entity, double rads, double x, double y, double z) => +// viewer.setRotation(entity, rads, x, y, z).toJS; +// @JSExport() +// JSPromise queuePositionUpdate( +// ThermionEntity entity, double x, double y, double z, bool relative) => +// viewer +// .queuePositionUpdate( +// entity, +// x, +// y, +// z, +// relative: relative, +// ) +// .toJS; +// @JSExport() +// JSPromise queueRotationUpdate(ThermionEntity entity, double rads, double x, +// double y, double z, bool relative) => +// viewer +// .queueRotationUpdate( +// entity, +// rads, +// x, +// y, +// z, +// relative: relative, +// ) +// .toJS; +// @JSExport() +// JSPromise queueRotationUpdateQuat( +// ThermionEntity entity, JSArray quat, JSBoolean relative) => +// throw UnimplementedError(); +// // viewer.queueRotationUpdateQuat( +// // entity, +// // quat.toDartQuaternion(), +// // relative: relative, +// // ).toJS; + +// @JSExport() +// JSPromise setPostProcessing(bool enabled) => +// viewer.setPostProcessing(enabled).toJS; + +// @JSExport() +// JSPromise setAntiAliasing(bool msaa, bool fxaa, bool taa) => +// viewer.setAntiAliasing(msaa, fxaa, taa).toJS; + +// @JSExport() +// JSPromise setRotationQuat( +// ThermionEntity entity, JSArray rotation) => +// throw UnimplementedError(); + +// @JSExport() +// JSPromise reveal(ThermionEntity entity, String? meshName) => +// viewer.reveal(entity, meshName).toJS; + +// @JSExport() +// JSPromise hide(ThermionEntity entity, String? meshName) => +// viewer.hide(entity, meshName).toJS; + +// @JSExport() +// void pick(int x, int y) => viewer.pick(x, y); + +// @JSExport() +// String? getNameForEntity(ThermionEntity entity) => +// viewer.getNameForEntity(entity); + +// @JSExport() +// JSPromise setCameraManipulatorOptions({ +// int mode = 0, +// double orbitSpeedX = 0.01, +// double orbitSpeedY = 0.01, +// double zoomSpeed = 0.01, +// }) => +// viewer +// .setCameraManipulatorOptions( +// mode: ManipulatorMode.values[mode], +// orbitSpeedX: orbitSpeedX, +// orbitSpeedY: orbitSpeedY, +// zoomSpeed: zoomSpeed, +// ) +// .toJS; + +// @JSExport() +// JSPromise> getChildEntities( +// ThermionEntity parent, bool renderableOnly) { +// return viewer +// .getChildEntities( +// parent, +// renderableOnly, +// ) +// .then((entities) => entities.map((entity) => entity.toJS).toList().toJS) +// .onError((e, st) async { +// _logger.severe("Error : $e\n$st"); +// return [].toJS; +// }).toJS; +// } + +// @JSExport() +// JSPromise getChildEntity(ThermionEntity parent, String childName) { +// return viewer +// .getChildEntity( +// parent, +// childName, +// ) +// .then((entity) => entity.toJS) +// .onError((e, st) async { +// _logger.severe("Error getChildEntity : $e\n$st"); +// return 0.toJS; +// }).toJS; +// } + +// @JSExport() +// JSPromise> getChildEntityNames( +// ThermionEntity entity, bool renderableOnly) => +// viewer +// .getChildEntityNames( +// entity, +// renderableOnly: renderableOnly, +// ) +// .then((v) => v.map((s) => s.toJS).toList().toJS) +// .toJS; + +// @JSExport() +// JSPromise setRecording(bool recording) => viewer.setRecording(recording).toJS; + +// @JSExport() +// JSPromise setRecordingOutputDirectory(String outputDirectory) => +// viewer.setRecordingOutputDirectory(outputDirectory).toJS; + +// @JSExport() +// JSPromise addAnimationComponent(ThermionEntity entity) => +// viewer.addAnimationComponent(entity).toJS; + +// @JSExport() +// JSPromise removeAnimationComponent(ThermionEntity entity) => +// viewer.removeAnimationComponent(entity).toJS; + +// @JSExport() +// JSPromise getParent(ThermionEntity entity) => +// viewer.removeAnimationComponent(entity).toJS; + +// @JSExport() +// JSPromise getBone(ThermionEntity entity, int boneIndex, int skinIndex) => +// viewer.getBone(entity, boneIndex, skinIndex: skinIndex).toJS; + +// @JSExport() +// JSPromise> getLocalTransform(ThermionEntity entity) { +// return viewer +// .getLocalTransform(entity) +// .then((t) => t.storage.map((v) => v.toJS).toList().toJS) +// .toJS; +// } + +// @JSExport() +// JSPromise> getWorldTransform(ThermionEntity entity) { +// return viewer +// .getWorldTransform(entity) +// .then((t) => t.storage.map((v) => v.toJS).toList().toJS) +// .toJS; +// } + +// @JSExport() +// JSPromise setTransform(ThermionEntity entity, JSArray transform) { +// return viewer +// .setTransform( +// entity, +// Matrix4.fromList( +// transform.toDart.map((v) => v.toDartDouble).toList())) +// .toJS; +// } + +// @JSExport() +// JSPromise updateBoneMatrices(ThermionEntity entity) { +// return viewer.updateBoneMatrices(entity).toJS; +// } + +// @JSExport() +// JSPromise setBoneTransform(ThermionEntity entity, int boneIndex, +// JSArray transform, int skinIndex) { +// return viewer +// .setBoneTransform( +// entity, +// boneIndex, +// Matrix4.fromList( +// transform.toDart.map((v) => v.toDartDouble).toList()), +// skinIndex: skinIndex) +// .toJS; +// } + +// @JSExport() +// JSPromise addCollisionComponent(ThermionEntity entity, +// {JSFunction? callback, bool affectsTransform = false}) { +// throw UnimplementedError(); +// } + +// @JSExport() +// JSPromise setShadowsEnabled(bool enabled) { +// return viewer.setShadowsEnabled(enabled).toJS; +// } + +// @JSExport() +// JSPromise setShadowType(int shadowType) { +// return viewer.setShadowType(ShadowType.values[shadowType]).toJS; +// } + +// @JSExport() +// JSPromise setSoftShadowOptions( +// double penumbraScale, double penumbraRatioScale) { +// return viewer.setSoftShadowOptions(penumbraScale, penumbraRatioScale).toJS; +// } +// } diff --git a/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_js.dart b/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_js.dart index c066711a..48357131 100644 --- a/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_js.dart +++ b/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_js.dart @@ -1,1107 +1,1107 @@ -import 'dart:js_interop'; -import 'dart:js_interop_unsafe'; -import 'dart:math'; -import 'dart:typed_data'; - -import 'package:animation_tools_dart/animation_tools_dart.dart'; -import 'package:logging/logging.dart'; -import 'package:vector_math/vector_math_64.dart'; -import '../../../../entities/abstract_gizmo.dart'; -import '../../../viewer.dart'; -import '../../events.dart'; -import '../../shared_types/camera.dart'; -import 'thermion_viewer_js_shim.dart'; - -/// -/// An [ThermionViewer] implementation that forwards calls to -/// a corresponding Javascript shim implementation (see [ThermionViewerJSShim]). -/// -class ThermionViewerJS implements ThermionViewer { - final _logger = Logger("ThermionViewerJS"); - late final ThermionViewerJSShim _shim; - - ThermionViewerJS.fromGlobalProperty(String globalPropertyName) { - this._shim = globalContext.getProperty(globalPropertyName.toJS) - as ThermionViewerJSShim; - } - - ThermionViewerJS(this._shim); - - @override - Future get initialized async { - var inited = _shim.initialized; - final JSBoolean result = await inited.toDart; - return result.toDart; - } - - @override - Stream get pickResult { - throw UnimplementedError(); - } - - @override - bool get rendering => _shim.rendering; - - @override - Future setRendering(bool render) async { - await _shim.setRendering(render).toDart; - } - - @override - Future render() async { - await _shim.render().toDart; - } - - @override - Future setFrameRate(int framerate) async { - await _shim.setFrameRate(framerate).toDart; - } - - @override - Future dispose() async { - await _shim.dispose().toDart; - for (final callback in _onDispose) { - callback.call(); - } - } - - @override - Future setBackgroundImage(String path, - {bool fillHeight = false}) async { - await _shim.setBackgroundImage(path, fillHeight).toDart; - } - - @override - Future setBackgroundImagePosition(double x, double y, - {bool clamp = false}) async { - await _shim.setBackgroundImagePosition(x, y, clamp).toDart; - } - - @override - Future clearBackgroundImage() async { - await _shim.clearBackgroundImage().toDart; - } - - @override - Future setBackgroundColor( - double r, double g, double b, double alpha) async { - await _shim.setBackgroundColor(r, g, b, alpha).toDart; - } - - @override - Future loadSkybox(String skyboxPath) async { - await _shim.loadSkybox(skyboxPath).toDart; - } - - @override - Future removeSkybox() async { - await _shim.removeSkybox().toDart; - } - - @override - Future loadIbl(String lightingPath, {double intensity = 30000}) async { - await _shim.loadIbl(lightingPath, intensity).toDart; - } - - @override - Future rotateIbl(Matrix3 rotation) async { - await _shim - .rotateIbl(rotation.storage.map((v) => v.toJS).toList().toJS) - .toDart; - } - - @override - Future removeIbl() async { - await _shim.removeIbl().toDart; - } - - @override - Future addLight( - LightType type, - double colour, - double intensity, - double posX, - double posY, - double posZ, - double dirX, - double dirY, - double dirZ, - {double falloffRadius = 1.0, - double spotLightConeInner = pi / 8, - double spotLightConeOuter = pi / 4, - double sunAngularRadius = 0.545, - double sunHaloSize = 10.0, - double sunHaloFallof = 80.0, - bool castShadows = true}) async { - return (await _shim - .addLight( - type.index, - colour, - intensity, - posX, - posY, - posZ, - dirX, - dirY, - dirZ, - falloffRadius, - spotLightConeInner, - spotLightConeOuter, - sunAngularRadius, - sunHaloSize, - sunHaloFallof, - castShadows) - .toDart) - .toDartInt; - } - - @override - Future removeLight(ThermionEntity light) async { - await _shim.removeLight(light).toDart; - } - - @override - Future clearLights() async { - await _shim.clearLights().toDart; - } - - @override - Future loadGlb(String path, {int numInstances = 1, bool keepData=false}) async { - var entity = (await _shim.loadGlb(path, numInstances).toDart).toDartInt; - return entity; - } - - @override - Future createInstance(ThermionEntity entity) async { - return (await _shim.createInstance(entity).toDart).toDartInt; - } - - @override - Future getInstanceCount(ThermionEntity entity) async { - return (await _shim.getInstanceCount(entity).toDart).toDartInt; - } - - @override - Future> getInstances(ThermionEntity entity) async { - throw UnimplementedError(); - // final List jsInstances = - // await _shim.getInstances(entity).toDart; - // return jsInstances - // .map((js) => ThermionEntity._fromJSObject(js)) - // .toList() - // .toDart; - } - - @override - Future loadGltf(String path, String relativeResourcePath, - {bool keepData = false}) async { - throw UnimplementedError(); - // final ThermionEntity jsEntity = await _shim - // .loadGltf(path, relativeResourcePath, force: force) - // .toDart; - // return ThermionEntity._fromJSObject(jsEntity).toDart; - } - - @override - Future panStart(double x, double y) async { - await _shim.panStart(x, y).toDart; - } - - @override - Future panUpdate(double x, double y) async { - await _shim.panUpdate(x, y).toDart; - } - - @override - Future panEnd() async { - await _shim.panEnd().toDart; - } - - @override - Future rotateStart(double x, double y) async { - await _shim.rotateStart(x, y).toDart; - } - - @override - Future rotateUpdate(double x, double y) async { - await _shim.rotateUpdate(x, y).toDart; - } - - @override - Future rotateEnd() async { - await _shim.rotateEnd().toDart; - } - - @override - Future setMorphTargetWeights( - ThermionEntity entity, List weights) async { - var jsWeights = weights.map((x) => x.toJS).cast().toList().toJS; - var promise = _shim.setMorphTargetWeights(entity, jsWeights); - await promise.toDart; - } - - @override - Future> getMorphTargetNames( - ThermionEntity entity, ThermionEntity childEntity) async { - var result = await _shim.getMorphTargetNames(entity, childEntity).toDart; - return result.toDart.map((r) => r.toDart).toList(); - } - - @override - Future> getAnimationNames(ThermionEntity entity) async { - var names = (await (_shim.getAnimationNames(entity).toDart)) - .toDart - .map((x) => x.toDart) - .toList(); - return names; - } - - @override - Future getAnimationDuration( - ThermionEntity entity, int animationIndex) async { - return (await _shim.getAnimationDuration(entity, animationIndex).toDart) - .toDartDouble; - } - - @override - Future clearMorphAnimationData(ThermionEntity entity) async { - _shim.clearMorphAnimationData(entity); - } - - @override - Future setMorphAnimationData( - ThermionEntity entity, MorphAnimationData animation, - {List? targetMeshNames}) async { - try { - var animationDataJs = animation.data - .map((x) => x.map((y) => y.toJS).toList().toJS) - .toList() - .toJS; - var morphTargetsJs = animation.morphTargets - .map((x) => x.toJS) - .cast() - .toList() - .toJS; - var targetMeshNamesJS = - targetMeshNames?.map((x) => x.toJS).cast().toList().toJS; - await _shim - .setMorphAnimationData(entity, animationDataJs, morphTargetsJs, - targetMeshNamesJS, animation.frameLengthInMs) - .toDart; - } catch (err, st) { - _logger.severe(err); - _logger.severe(st); - rethrow; - } - } - - @override - Future resetBones(ThermionEntity entity) async { - await _shim.resetBones(entity).toDart; - } - - @override - Future addBoneAnimation( - ThermionEntity entity, BoneAnimationData animation, - {int skinIndex = 0, - double fadeInInSecs = 0.0, - double fadeOutInSecs = 0.0, - double maxDelta = 1.0}) async { - var boneNames = animation.bones.map((n) => n.toJS).toList().toJS; - var frameData = animation.frameData - .map((frame) => frame - .map((q) => [ - q.translation[0].toJS, - q.translation[1].toJS, - q.translation[2].toJS, - q.rotation.x.toJS, - q.rotation.y.toJS, - q.rotation.z.toJS, - q.rotation.w.toJS, - ].toJS) - .toList() - .toJS) - .toList() - .toJS; - - await _shim - .addBoneAnimation( - entity, - boneNames, - frameData, - animation.frameLengthInMs.toJS, - animation.space.index.toJS, - skinIndex.toJS, - fadeInInSecs.toJS, - fadeOutInSecs.toJS, - maxDelta.toJS) - .toDart; - } - - @override - Future removeEntity(ThermionEntity entity) async { - await _shim.removeEntity(entity).toDart; - } - - @override - Future clearEntities() async { - await _shim.clearEntities().toDart; - } - - @override - Future zoomBegin() async { - await _shim.zoomBegin().toDart; - } - - @override - Future zoomUpdate(double x, double y, double z) async { - await _shim.zoomUpdate(x, y, z).toDart; - } - - @override - Future zoomEnd() async { - await _shim.zoomEnd().toDart; - } - - @override - Future playAnimation(ThermionEntity entity, int index, - {bool loop = false, - bool reverse = false, - bool replaceActive = true, - double crossfade = 0.0, - double startOffset = 0.0}) async { - await _shim - .playAnimation( - entity, index, loop, reverse, replaceActive, crossfade, startOffset) - .toDart; - } - - @override - Future playAnimationByName(ThermionEntity entity, String name, - {bool loop = false, - bool reverse = false, - bool replaceActive = true, - double crossfade = 0.0}) async { - await _shim - .playAnimationByName( - entity, name, loop, reverse, replaceActive, crossfade) - .toDart; - } - - @override - Future setAnimationFrame( - ThermionEntity entity, int index, int animationFrame) async { - await _shim.setAnimationFrame(entity, index, animationFrame).toDart; - } - - @override - Future stopAnimation(ThermionEntity entity, int animationIndex) async { - await _shim.stopAnimation(entity, animationIndex).toDart; - } - - @override - Future stopAnimationByName(ThermionEntity entity, String name) async { - await _shim.stopAnimationByName(entity, name).toDart; - } - - @override - Future setCamera(ThermionEntity entity, String? name) async { - await _shim.setCamera(entity, name).toDart; - } - - @override - Future setMainCamera() async { - await _shim.setMainCamera().toDart; - } - - @override - Future getMainCamera() async { - throw UnimplementedError(); - // final ThermionEntity jsEntity = await _shim.getMainCamera().toDart; - // return ThermionEntity._fromJSObject(jsEntity).toDart; - } - - @override - Future setCameraFov(double degrees, {bool horizontal = true}) async { - await _shim.setCameraFov(degrees, horizontal).toDart; - } - - @override - Future setToneMapping(ToneMapper mapper) async { - await _shim.setToneMapping(mapper.index).toDart; - } - - @override - Future setBloom(double bloom) async { - await _shim.setBloom(bloom).toDart; - } - - @override - Future setCameraFocalLength(double focalLength) async { - await _shim.setCameraFocalLength(focalLength).toDart; - } - - @override - Future setCameraCulling(double near, double far) async { - await _shim.setCameraCulling(near, far).toDart; - } - - @override - Future getCameraCullingNear() async { - return (await _shim.getCameraCullingNear().toDart).toDartDouble; - } - - @override - Future getCameraCullingFar() async { - return (await _shim.getCameraCullingFar().toDart).toDartDouble; - } - - @override - Future setCameraFocusDistance(double focusDistance) async { - await _shim.setCameraFocusDistance(focusDistance).toDart; - } - - @override - Future getCameraPosition() async { - final jsPosition = (await _shim.getCameraPosition().toDart).toDart; - return Vector3(jsPosition[0].toDartDouble, jsPosition[1].toDartDouble, - jsPosition[2].toDartDouble); - } - - @override - Future getCameraModelMatrix() async { - throw UnimplementedError(); - // final JSMatrix4 jsMatrix = await _shim.getCameraModelMatrix().toDart; - // return Matrix4.fromList(jsMatrix.storage).toDart; - } - - @override - Future getCameraViewMatrix() async { - throw UnimplementedError(); - // final JSMatrix4 jsMatrix = await _shim.getCameraViewMatrix().toDart; - // return Matrix4.fromList(jsMatrix.storage).toDart; - } - - @override - Future getCameraProjectionMatrix() async { - throw UnimplementedError(); - // final JSMatrix4 jsMatrix = - // await _shim.getCameraProjectionMatrix().toDart; - // return Matrix4.fromList(jsMatrix.storage).toDart; - } - - @override - Future getCameraCullingProjectionMatrix() async { - throw UnimplementedError(); - // final JSMatrix4 jsMatrix = - // await _shim.getCameraCullingProjectionMatrix().toDart; - // return Matrix4.fromList(jsMatrix.storage).toDart; - } - - @override - Future getCameraFrustum() async { - throw UnimplementedError(); - // final JSObject jsFrustum = await _shim.getCameraFrustum().toDart; - // // Assuming Frustum is a class that can be constructed from the JSObject - // return Frustum._fromJSObject(jsFrustum).toDart; - } - - @override - Future setCameraPosition(double x, double y, double z) async { - await _shim.setCameraPosition(x, y, z).toDart; - } - - @override - Future getCameraRotation() async { - throw UnimplementedError(); - // final JSMatrix3 jsRotation = await _shim.getCameraRotation().toDart; - // return Matrix3.fromList(jsRotation.storage).toDart; - } - - @override - Future moveCameraToAsset(ThermionEntity entity) async { - await _shim.moveCameraToAsset(entity).toDart; - } - - @override - Future setViewFrustumCulling(bool enabled) async { - throw UnimplementedError(); - // await _shim.setViewFrustumCulling(enabled.toJSBoolean()).toDart; - } - - @override - Future setCameraExposure( - double aperture, double shutterSpeed, double sensitivity) async { - await _shim.setCameraExposure(aperture, shutterSpeed, sensitivity).toDart; - } - - @override - Future setCameraRotation(Quaternion quaternion) async { - final values = [ - quaternion.x.toJS, - quaternion.y.toJS, - quaternion.z.toJS, - quaternion.w.toJS - ]; - await _shim.setCameraRotation(values.toJS).toDart; - } - - @override - Future setCameraModelMatrix(List matrix) async { - throw UnimplementedError(); - - // await _shim.setCameraModelMatrix(matrix.toJSBox).toDart; - } - - @override - Future setMaterialColor(ThermionEntity entity, String meshName, - int materialIndex, double r, double g, double b, double a) async { - await _shim - .setMaterialColor(entity, meshName, materialIndex, r, g, b, a) - .toDart; - } - - @override - Future transformToUnitCube(ThermionEntity entity) async { - await _shim.transformToUnitCube(entity).toDart; - } - - @override - Future setPosition( - ThermionEntity entity, double x, double y, double z) async { - await _shim.setPosition(entity, x, y, z).toDart; - } - - @override - Future setScale(ThermionEntity entity, double scale) async { - await _shim.setScale(entity, scale).toDart; - } - - @override - Future setRotation( - ThermionEntity entity, double rads, double x, double y, double z) async { - await _shim.setRotation(entity, rads, x, y, z).toDart; - } - - @override - Future queuePositionUpdate( - ThermionEntity entity, double x, double y, double z, - {bool relative = false}) async { - await _shim.queuePositionUpdate(entity, x, y, z, relative).toDart; - } - - @override - Future queueRotationUpdate( - ThermionEntity entity, double rads, double x, double y, double z, - {bool relative = false}) async { - await _shim.queueRotationUpdate(entity, rads, x, y, z, relative).toDart; - } - - @override - Future queueRotationUpdateQuat(ThermionEntity entity, Quaternion quat, - {bool relative = false}) async { - throw UnimplementedError(); - - // final JSQuaternion jsQuat = quat.toJSQuaternion().toDart; - // await _shim - // .queueRotationUpdateQuat(entity, jsQuat, relative: relative) - // .toDart; - } - - @override - Future setPostProcessing(bool enabled) async { - await _shim.setPostProcessing(enabled).toDart; - } - - @override - Future setAntiAliasing(bool msaa, bool fxaa, bool taa) async { - await _shim.setAntiAliasing(msaa, fxaa, taa).toDart; - } - - @override - Future setRotationQuat( - ThermionEntity entity, Quaternion rotation) async { - throw UnimplementedError(); - // final JSQuaternion jsRotation = rotation.toJSQuaternion().toDart; - // await _shim.setRotationQuat(entity, jsRotation).toDart; - } - - @override - Future reveal(ThermionEntity entity, String? meshName) async { - throw UnimplementedError(); - // await _shim.reveal(entity, meshName).toDart; - } - - @override - Future hide(ThermionEntity entity, String? meshName) async { - throw UnimplementedError(); - // await _shim.hide(entity, meshName).toDart; - } - - @override - void pick(int x, int y) { - throw UnimplementedError(); - // _shim.pick(x, y).toDart; - } - - @override - String? getNameForEntity(ThermionEntity entity) { - return _shim.getNameForEntity(entity); - } - - @override - Future setCameraManipulatorOptions( - {ManipulatorMode mode = ManipulatorMode.ORBIT, - double orbitSpeedX = 0.01, - double orbitSpeedY = 0.01, - double zoomSpeed = 0.01}) async { - await _shim - .setCameraManipulatorOptions( - mode.index, orbitSpeedX, orbitSpeedY, zoomSpeed) - .toDart; - } - - @override - Future> getChildEntities( - ThermionEntity parent, bool renderableOnly) async { - final children = - await _shim.getChildEntities(parent, renderableOnly).toDart; - return children.toDart - .map((js) => js.toDartInt) - .cast() - .toList(); - } - - @override - Future getChildEntity( - ThermionEntity parent, String childName) async { - return (await _shim.getChildEntity(parent, childName).toDart).toDartInt; - } - - @override - Future> getChildEntityNames(ThermionEntity entity, - {bool renderableOnly = true}) async { - var names = await _shim.getChildEntityNames(entity, renderableOnly).toDart; - return names.toDart.map((x) => x.toDart).toList(); - } - - @override - Future setRecording(bool recording) async { - throw UnimplementedError(); - // await _shim.setRecording(recording.toJSBoolean()).toDart; - } - - @override - Future setRecordingOutputDirectory(String outputDirectory) async { - await _shim.setRecordingOutputDirectory(outputDirectory).toDart; - } - - @override - Future addAnimationComponent(ThermionEntity entity) async { - await _shim.addAnimationComponent(entity).toDart; - } - - @override - Future addCollisionComponent(ThermionEntity entity, - {void Function(int entityId1, int entityId2)? callback, - bool affectsTransform = false}) async { - throw UnimplementedError(); - // final JSFunction? jsCallback = callback != null - // ? allowInterop( - // (int entityId1, int entityId2) => callback(entityId1, entityId2)) - // : null; - // await _shim - // .addCollisionComponent(entity, - // callback: jsCallback, - // affectsTransform: affectsTransform.toJSBoolean()) - // .toDart; - } - - @override - Future removeCollisionComponent(ThermionEntity entity) async { - await _shim.removeCollisionComponent(entity).toDart; - } - - @override - Future createGeometry( - Geometry geometry, - { - bool keepData=false, MaterialInstance? materialInstance, - PrimitiveType primitiveType = PrimitiveType.TRIANGLES}) async { - throw UnimplementedError(); - // final ThermionEntity jsEntity = await _shim - // .createGeometry(vertices, indices, - // materialPath: materialPath, primitiveType: primitiveType.index) - // .toDart; - // return ThermionEntity._fromJSObject(jsEntity).toDart; - } - - @override - Future setParent(ThermionEntity child, ThermionEntity parent, - {bool preserveScaling = false}) async { - await _shim.setParent(child, parent, preserveScaling).toDart; - } - - @override - Future testCollisions(ThermionEntity entity) async { - await _shim.testCollisions(entity).toDart; - } - - @override - Future setPriority(ThermionEntity entityId, int priority) async { - await _shim.setPriority(entityId, priority).toDart; - } - - AbstractGizmo? get gizmo => null; - - @override - Future> getBoneNames(ThermionEntity entity, - {int skinIndex = 0}) async { - var result = await _shim.getBoneNames(entity, skinIndex).toDart; - return result.toDart.map((n) => n.toDart).toList(); - } - - @override - Future getBone(ThermionEntity entity, int boneIndex, - {int skinIndex = 0}) async { - var result = await _shim.getBone(entity, boneIndex, skinIndex).toDart; - return result.toDartInt; - } - - @override - Future getInverseBindMatrix(ThermionEntity parent, int boneIndex, - {int skinIndex = 0}) { - // TODO: implement getInverseBindMatrix - throw UnimplementedError(); - } - - @override - Future getLocalTransform(ThermionEntity entity) async { - var result = await _shim.getLocalTransform(entity).toDart; - return Matrix4.fromList(result.toDart.map((v) => v.toDartDouble).toList()); - } - - @override - Future getParent(ThermionEntity child) async { - var result = await _shim.getParent(child).toDart; - return result.toDartInt; - } - - @override - Future getWorldTransform(ThermionEntity entity) async { - var result = await _shim.getLocalTransform(entity).toDart; - return Matrix4.fromList(result.toDart.map((v) => v.toDartDouble).toList()); - } - - @override - Future removeAnimationComponent(ThermionEntity entity) { - return _shim.removeAnimationComponent(entity).toDart; - } - - @override - Future setBoneTransform( - ThermionEntity entity, int boneIndex, Matrix4 transform, - {int skinIndex = 0}) { - return _shim - .setBoneTransform(entity, boneIndex, - transform.storage.map((v) => v.toJS).toList().toJS, skinIndex) - .toDart; - } - - @override - Future setTransform(ThermionEntity entity, Matrix4 transform) { - return _shim - .setTransform( - entity, transform.storage.map((v) => v.toJS).toList().toJS) - .toDart; - } - - @override - Future updateBoneMatrices(ThermionEntity entity) { - return _shim.updateBoneMatrices(entity).toDart; - } - - final _onDispose = []; - - /// - /// - /// - void onDispose(Future Function() callback) { - _onDispose.add(callback); - } - - @override - Future setShadowType(ShadowType shadowType) { - return _shim.setShadowType(shadowType.index).toDart; - } - - @override - Future setShadowsEnabled(bool enabled) { - return _shim.setShadowsEnabled(enabled).toDart; - } - - @override - Future setSoftShadowOptions(double penumbraScale, double penumbraRatioScale) { - return _shim.setSoftShadowOptions(penumbraScale, penumbraRatioScale).toDart; - } - - @override - Future capture() async { - final captured = await _shim.capture().toDart; - return captured.toDart; - } - - @override - late (double, double) viewportDimensions; - - @override - Future getBoundingBox(ThermionEntity entity) { - // return _shim.getBoundingBox(entity); - throw UnimplementedError(); - } - - @override - Future getCameraFov(bool horizontal) { - // TODO: implement getCameraFov - throw UnimplementedError(); - } - - @override - Future queueRelativePositionUpdateWorldAxis(ThermionEntity entity, - double viewportX, double viewportY, double x, double y, double z) { - // TODO: implement queueRelativePositionUpdateWorldAxis - throw UnimplementedError(); - } +// import 'dart:js_interop'; +// import 'dart:js_interop_unsafe'; +// import 'dart:math'; +// import 'dart:typed_data'; + +// import 'package:animation_tools_dart/animation_tools_dart.dart'; +// import 'package:logging/logging.dart'; +// import 'package:vector_math/vector_math_64.dart'; +// import '../../shared_types/internal/gizmo.dart'; +// import '../../../viewer.dart'; +// import '../../events.dart'; +// import '../../shared_types/camera.dart'; +// import 'thermion_viewer_js_shim.dart'; + +// /// +// /// An [ThermionViewer] implementation that forwards calls to +// /// a corresponding Javascript shim implementation (see [ThermionViewerJSShim]). +// /// +// class ThermionViewerJS implements ThermionViewer { +// final _logger = Logger("ThermionViewerJS"); +// late final ThermionViewerJSShim _shim; + +// ThermionViewerJS.fromGlobalProperty(String globalPropertyName) { +// this._shim = globalContext.getProperty(globalPropertyName.toJS) +// as ThermionViewerJSShim; +// } + +// ThermionViewerJS(this._shim); + +// @override +// Future get initialized async { +// var inited = _shim.initialized; +// final JSBoolean result = await inited.toDart; +// return result.toDart; +// } + +// @override +// Stream get pickResult { +// throw UnimplementedError(); +// } + +// @override +// bool get rendering => _shim.rendering; + +// @override +// Future setRendering(bool render) async { +// await _shim.setRendering(render).toDart; +// } + +// @override +// Future render() async { +// await _shim.render().toDart; +// } + +// @override +// Future setFrameRate(int framerate) async { +// await _shim.setFrameRate(framerate).toDart; +// } + +// @override +// Future dispose() async { +// await _shim.dispose().toDart; +// for (final callback in _onDispose) { +// callback.call(); +// } +// } + +// @override +// Future setBackgroundImage(String path, +// {bool fillHeight = false}) async { +// await _shim.setBackgroundImage(path, fillHeight).toDart; +// } + +// @override +// Future setBackgroundImagePosition(double x, double y, +// {bool clamp = false}) async { +// await _shim.setBackgroundImagePosition(x, y, clamp).toDart; +// } + +// @override +// Future clearBackgroundImage() async { +// await _shim.clearBackgroundImage().toDart; +// } + +// @override +// Future setBackgroundColor( +// double r, double g, double b, double alpha) async { +// await _shim.setBackgroundColor(r, g, b, alpha).toDart; +// } + +// @override +// Future loadSkybox(String skyboxPath) async { +// await _shim.loadSkybox(skyboxPath).toDart; +// } + +// @override +// Future removeSkybox() async { +// await _shim.removeSkybox().toDart; +// } + +// @override +// Future loadIbl(String lightingPath, {double intensity = 30000}) async { +// await _shim.loadIbl(lightingPath, intensity).toDart; +// } + +// @override +// Future rotateIbl(Matrix3 rotation) async { +// await _shim +// .rotateIbl(rotation.storage.map((v) => v.toJS).toList().toJS) +// .toDart; +// } + +// @override +// Future removeIbl() async { +// await _shim.removeIbl().toDart; +// } + +// @override +// Future addLight( +// LightType type, +// double colour, +// double intensity, +// double posX, +// double posY, +// double posZ, +// double dirX, +// double dirY, +// double dirZ, +// {double falloffRadius = 1.0, +// double spotLightConeInner = pi / 8, +// double spotLightConeOuter = pi / 4, +// double sunAngularRadius = 0.545, +// double sunHaloSize = 10.0, +// double sunHaloFallof = 80.0, +// bool castShadows = true}) async { +// return (await _shim +// .addLight( +// type.index, +// colour, +// intensity, +// posX, +// posY, +// posZ, +// dirX, +// dirY, +// dirZ, +// falloffRadius, +// spotLightConeInner, +// spotLightConeOuter, +// sunAngularRadius, +// sunHaloSize, +// sunHaloFallof, +// castShadows) +// .toDart) +// .toDartInt; +// } + +// @override +// Future removeLight(ThermionEntity light) async { +// await _shim.removeLight(light).toDart; +// } + +// @override +// Future clearLights() async { +// await _shim.clearLights().toDart; +// } + +// @override +// Future loadGlb(String path, {int numInstances = 1, bool keepData=false}) async { +// var entity = (await _shim.loadGlb(path, numInstances).toDart).toDartInt; +// return entity; +// } + +// @override +// Future createInstance(ThermionEntity entity) async { +// return (await _shim.createInstance(entity).toDart).toDartInt; +// } + +// @override +// Future getInstanceCount(ThermionEntity entity) async { +// return (await _shim.getInstanceCount(entity).toDart).toDartInt; +// } + +// @override +// Future> getInstances(ThermionEntity entity) async { +// throw UnimplementedError(); +// // final List jsInstances = +// // await _shim.getInstances(entity).toDart; +// // return jsInstances +// // .map((js) => ThermionEntity._fromJSObject(js)) +// // .toList() +// // .toDart; +// } + +// @override +// Future loadGltf(String path, String relativeResourcePath, +// {bool keepData = false}) async { +// throw UnimplementedError(); +// // final ThermionEntity jsEntity = await _shim +// // .loadGltf(path, relativeResourcePath, force: force) +// // .toDart; +// // return ThermionEntity._fromJSObject(jsEntity).toDart; +// } + +// @override +// Future panStart(double x, double y) async { +// await _shim.panStart(x, y).toDart; +// } + +// @override +// Future panUpdate(double x, double y) async { +// await _shim.panUpdate(x, y).toDart; +// } + +// @override +// Future panEnd() async { +// await _shim.panEnd().toDart; +// } + +// @override +// Future rotateStart(double x, double y) async { +// await _shim.rotateStart(x, y).toDart; +// } + +// @override +// Future rotateUpdate(double x, double y) async { +// await _shim.rotateUpdate(x, y).toDart; +// } + +// @override +// Future rotateEnd() async { +// await _shim.rotateEnd().toDart; +// } + +// @override +// Future setMorphTargetWeights( +// ThermionEntity entity, List weights) async { +// var jsWeights = weights.map((x) => x.toJS).cast().toList().toJS; +// var promise = _shim.setMorphTargetWeights(entity, jsWeights); +// await promise.toDart; +// } + +// @override +// Future> getMorphTargetNames( +// ThermionEntity entity, ThermionEntity childEntity) async { +// var result = await _shim.getMorphTargetNames(entity, childEntity).toDart; +// return result.toDart.map((r) => r.toDart).toList(); +// } + +// @override +// Future> getAnimationNames(ThermionEntity entity) async { +// var names = (await (_shim.getAnimationNames(entity).toDart)) +// .toDart +// .map((x) => x.toDart) +// .toList(); +// return names; +// } + +// @override +// Future getAnimationDuration( +// ThermionEntity entity, int animationIndex) async { +// return (await _shim.getAnimationDuration(entity, animationIndex).toDart) +// .toDartDouble; +// } + +// @override +// Future clearMorphAnimationData(ThermionEntity entity) async { +// _shim.clearMorphAnimationData(entity); +// } + +// @override +// Future setMorphAnimationData( +// ThermionEntity entity, MorphAnimationData animation, +// {List? targetMeshNames}) async { +// try { +// var animationDataJs = animation.data +// .map((x) => x.map((y) => y.toJS).toList().toJS) +// .toList() +// .toJS; +// var morphTargetsJs = animation.morphTargets +// .map((x) => x.toJS) +// .cast() +// .toList() +// .toJS; +// var targetMeshNamesJS = +// targetMeshNames?.map((x) => x.toJS).cast().toList().toJS; +// await _shim +// .setMorphAnimationData(entity, animationDataJs, morphTargetsJs, +// targetMeshNamesJS, animation.frameLengthInMs) +// .toDart; +// } catch (err, st) { +// _logger.severe(err); +// _logger.severe(st); +// rethrow; +// } +// } + +// @override +// Future resetBones(ThermionEntity entity) async { +// await _shim.resetBones(entity).toDart; +// } + +// @override +// Future addBoneAnimation( +// ThermionEntity entity, BoneAnimationData animation, +// {int skinIndex = 0, +// double fadeInInSecs = 0.0, +// double fadeOutInSecs = 0.0, +// double maxDelta = 1.0}) async { +// var boneNames = animation.bones.map((n) => n.toJS).toList().toJS; +// var frameData = animation.frameData +// .map((frame) => frame +// .map((q) => [ +// q.translation[0].toJS, +// q.translation[1].toJS, +// q.translation[2].toJS, +// q.rotation.x.toJS, +// q.rotation.y.toJS, +// q.rotation.z.toJS, +// q.rotation.w.toJS, +// ].toJS) +// .toList() +// .toJS) +// .toList() +// .toJS; + +// await _shim +// .addBoneAnimation( +// entity, +// boneNames, +// frameData, +// animation.frameLengthInMs.toJS, +// animation.space.index.toJS, +// skinIndex.toJS, +// fadeInInSecs.toJS, +// fadeOutInSecs.toJS, +// maxDelta.toJS) +// .toDart; +// } + +// @override +// Future removeEntity(ThermionEntity entity) async { +// await _shim.removeEntity(entity).toDart; +// } + +// @override +// Future clearEntities() async { +// await _shim.clearEntities().toDart; +// } + +// @override +// Future zoomBegin() async { +// await _shim.zoomBegin().toDart; +// } + +// @override +// Future zoomUpdate(double x, double y, double z) async { +// await _shim.zoomUpdate(x, y, z).toDart; +// } + +// @override +// Future zoomEnd() async { +// await _shim.zoomEnd().toDart; +// } + +// @override +// Future playAnimation(ThermionEntity entity, int index, +// {bool loop = false, +// bool reverse = false, +// bool replaceActive = true, +// double crossfade = 0.0, +// double startOffset = 0.0}) async { +// await _shim +// .playAnimation( +// entity, index, loop, reverse, replaceActive, crossfade, startOffset) +// .toDart; +// } + +// @override +// Future playAnimationByName(ThermionEntity entity, String name, +// {bool loop = false, +// bool reverse = false, +// bool replaceActive = true, +// double crossfade = 0.0}) async { +// await _shim +// .playAnimationByName( +// entity, name, loop, reverse, replaceActive, crossfade) +// .toDart; +// } + +// @override +// Future setAnimationFrame( +// ThermionEntity entity, int index, int animationFrame) async { +// await _shim.setAnimationFrame(entity, index, animationFrame).toDart; +// } + +// @override +// Future stopAnimation(ThermionEntity entity, int animationIndex) async { +// await _shim.stopAnimation(entity, animationIndex).toDart; +// } + +// @override +// Future stopAnimationByName(ThermionEntity entity, String name) async { +// await _shim.stopAnimationByName(entity, name).toDart; +// } + +// @override +// Future setCamera(ThermionEntity entity, String? name) async { +// await _shim.setCamera(entity, name).toDart; +// } + +// @override +// Future setMainCamera() async { +// await _shim.setMainCamera().toDart; +// } + +// @override +// Future getMainCamera() async { +// throw UnimplementedError(); +// // final ThermionEntity jsEntity = await _shim.getMainCamera().toDart; +// // return ThermionEntity._fromJSObject(jsEntity).toDart; +// } + +// @override +// Future setCameraFov(double degrees, {bool horizontal = true}) async { +// await _shim.setCameraFov(degrees, horizontal).toDart; +// } + +// @override +// Future setToneMapping(ToneMapper mapper) async { +// await _shim.setToneMapping(mapper.index).toDart; +// } + +// @override +// Future setBloom(double bloom) async { +// await _shim.setBloom(bloom).toDart; +// } + +// @override +// Future setCameraFocalLength(double focalLength) async { +// await _shim.setCameraFocalLength(focalLength).toDart; +// } + +// @override +// Future setCameraCulling(double near, double far) async { +// await _shim.setCameraCulling(near, far).toDart; +// } + +// @override +// Future getCameraCullingNear() async { +// return (await _shim.getCameraCullingNear().toDart).toDartDouble; +// } + +// @override +// Future getCameraCullingFar() async { +// return (await _shim.getCameraCullingFar().toDart).toDartDouble; +// } + +// @override +// Future setCameraFocusDistance(double focusDistance) async { +// await _shim.setCameraFocusDistance(focusDistance).toDart; +// } + +// @override +// Future getCameraPosition() async { +// final jsPosition = (await _shim.getCameraPosition().toDart).toDart; +// return Vector3(jsPosition[0].toDartDouble, jsPosition[1].toDartDouble, +// jsPosition[2].toDartDouble); +// } + +// @override +// Future getCameraModelMatrix() async { +// throw UnimplementedError(); +// // final JSMatrix4 jsMatrix = await _shim.getCameraModelMatrix().toDart; +// // return Matrix4.fromList(jsMatrix.storage).toDart; +// } + +// @override +// Future getCameraViewMatrix() async { +// throw UnimplementedError(); +// // final JSMatrix4 jsMatrix = await _shim.getCameraViewMatrix().toDart; +// // return Matrix4.fromList(jsMatrix.storage).toDart; +// } + +// @override +// Future getCameraProjectionMatrix() async { +// throw UnimplementedError(); +// // final JSMatrix4 jsMatrix = +// // await _shim.getCameraProjectionMatrix().toDart; +// // return Matrix4.fromList(jsMatrix.storage).toDart; +// } + +// @override +// Future getCameraCullingProjectionMatrix() async { +// throw UnimplementedError(); +// // final JSMatrix4 jsMatrix = +// // await _shim.getCameraCullingProjectionMatrix().toDart; +// // return Matrix4.fromList(jsMatrix.storage).toDart; +// } + +// @override +// Future getCameraFrustum() async { +// throw UnimplementedError(); +// // final JSObject jsFrustum = await _shim.getCameraFrustum().toDart; +// // // Assuming Frustum is a class that can be constructed from the JSObject +// // return Frustum._fromJSObject(jsFrustum).toDart; +// } + +// @override +// Future setCameraPosition(double x, double y, double z) async { +// await _shim.setCameraPosition(x, y, z).toDart; +// } + +// @override +// Future getCameraRotation() async { +// throw UnimplementedError(); +// // final JSMatrix3 jsRotation = await _shim.getCameraRotation().toDart; +// // return Matrix3.fromList(jsRotation.storage).toDart; +// } + +// @override +// Future moveCameraToAsset(ThermionEntity entity) async { +// await _shim.moveCameraToAsset(entity).toDart; +// } + +// @override +// Future setViewFrustumCulling(bool enabled) async { +// throw UnimplementedError(); +// // await _shim.setViewFrustumCulling(enabled.toJSBoolean()).toDart; +// } + +// @override +// Future setCameraExposure( +// double aperture, double shutterSpeed, double sensitivity) async { +// await _shim.setCameraExposure(aperture, shutterSpeed, sensitivity).toDart; +// } + +// @override +// Future setCameraRotation(Quaternion quaternion) async { +// final values = [ +// quaternion.x.toJS, +// quaternion.y.toJS, +// quaternion.z.toJS, +// quaternion.w.toJS +// ]; +// await _shim.setCameraRotation(values.toJS).toDart; +// } + +// @override +// Future setCameraModelMatrix(List matrix) async { +// throw UnimplementedError(); + +// // await _shim.setCameraModelMatrix(matrix.toJSBox).toDart; +// } + +// @override +// Future setMaterialColor(ThermionEntity entity, String meshName, +// int materialIndex, double r, double g, double b, double a) async { +// await _shim +// .setMaterialColor(entity, meshName, materialIndex, r, g, b, a) +// .toDart; +// } + +// @override +// Future transformToUnitCube(ThermionEntity entity) async { +// await _shim.transformToUnitCube(entity).toDart; +// } + +// @override +// Future setPosition( +// ThermionEntity entity, double x, double y, double z) async { +// await _shim.setPosition(entity, x, y, z).toDart; +// } + +// @override +// Future setScale(ThermionEntity entity, double scale) async { +// await _shim.setScale(entity, scale).toDart; +// } + +// @override +// Future setRotation( +// ThermionEntity entity, double rads, double x, double y, double z) async { +// await _shim.setRotation(entity, rads, x, y, z).toDart; +// } + +// @override +// Future queuePositionUpdate( +// ThermionEntity entity, double x, double y, double z, +// {bool relative = false}) async { +// await _shim.queuePositionUpdate(entity, x, y, z, relative).toDart; +// } + +// @override +// Future queueRotationUpdate( +// ThermionEntity entity, double rads, double x, double y, double z, +// {bool relative = false}) async { +// await _shim.queueRotationUpdate(entity, rads, x, y, z, relative).toDart; +// } + +// @override +// Future queueRotationUpdateQuat(ThermionEntity entity, Quaternion quat, +// {bool relative = false}) async { +// throw UnimplementedError(); + +// // final JSQuaternion jsQuat = quat.toJSQuaternion().toDart; +// // await _shim +// // .queueRotationUpdateQuat(entity, jsQuat, relative: relative) +// // .toDart; +// } + +// @override +// Future setPostProcessing(bool enabled) async { +// await _shim.setPostProcessing(enabled).toDart; +// } + +// @override +// Future setAntiAliasing(bool msaa, bool fxaa, bool taa) async { +// await _shim.setAntiAliasing(msaa, fxaa, taa).toDart; +// } + +// @override +// Future setRotationQuat( +// ThermionEntity entity, Quaternion rotation) async { +// throw UnimplementedError(); +// // final JSQuaternion jsRotation = rotation.toJSQuaternion().toDart; +// // await _shim.setRotationQuat(entity, jsRotation).toDart; +// } + +// @override +// Future reveal(ThermionEntity entity, String? meshName) async { +// throw UnimplementedError(); +// // await _shim.reveal(entity, meshName).toDart; +// } + +// @override +// Future hide(ThermionEntity entity, String? meshName) async { +// throw UnimplementedError(); +// // await _shim.hide(entity, meshName).toDart; +// } + +// @override +// void pick(int x, int y) { +// throw UnimplementedError(); +// // _shim.pick(x, y).toDart; +// } + +// @override +// String? getNameForEntity(ThermionEntity entity) { +// return _shim.getNameForEntity(entity); +// } + +// @override +// Future setCameraManipulatorOptions( +// {ManipulatorMode mode = ManipulatorMode.ORBIT, +// double orbitSpeedX = 0.01, +// double orbitSpeedY = 0.01, +// double zoomSpeed = 0.01}) async { +// await _shim +// .setCameraManipulatorOptions( +// mode.index, orbitSpeedX, orbitSpeedY, zoomSpeed) +// .toDart; +// } + +// @override +// Future> getChildEntities( +// ThermionEntity parent, bool renderableOnly) async { +// final children = +// await _shim.getChildEntities(parent, renderableOnly).toDart; +// return children.toDart +// .map((js) => js.toDartInt) +// .cast() +// .toList(); +// } + +// @override +// Future getChildEntity( +// ThermionEntity parent, String childName) async { +// return (await _shim.getChildEntity(parent, childName).toDart).toDartInt; +// } + +// @override +// Future> getChildEntityNames(ThermionEntity entity, +// {bool renderableOnly = true}) async { +// var names = await _shim.getChildEntityNames(entity, renderableOnly).toDart; +// return names.toDart.map((x) => x.toDart).toList(); +// } + +// @override +// Future setRecording(bool recording) async { +// throw UnimplementedError(); +// // await _shim.setRecording(recording.toJSBoolean()).toDart; +// } + +// @override +// Future setRecordingOutputDirectory(String outputDirectory) async { +// await _shim.setRecordingOutputDirectory(outputDirectory).toDart; +// } + +// @override +// Future addAnimationComponent(ThermionEntity entity) async { +// await _shim.addAnimationComponent(entity).toDart; +// } + +// @override +// Future addCollisionComponent(ThermionEntity entity, +// {void Function(int entityId1, int entityId2)? callback, +// bool affectsTransform = false}) async { +// throw UnimplementedError(); +// // final JSFunction? jsCallback = callback != null +// // ? allowInterop( +// // (int entityId1, int entityId2) => callback(entityId1, entityId2)) +// // : null; +// // await _shim +// // .addCollisionComponent(entity, +// // callback: jsCallback, +// // affectsTransform: affectsTransform.toJSBoolean()) +// // .toDart; +// } + +// @override +// Future removeCollisionComponent(ThermionEntity entity) async { +// await _shim.removeCollisionComponent(entity).toDart; +// } + +// @override +// Future createGeometry( +// Geometry geometry, +// { +// bool keepData=false, MaterialInstance? materialInstance, +// PrimitiveType primitiveType = PrimitiveType.TRIANGLES}) async { +// throw UnimplementedError(); +// // final ThermionEntity jsEntity = await _shim +// // .createGeometry(vertices, indices, +// // materialPath: materialPath, primitiveType: primitiveType.index) +// // .toDart; +// // return ThermionEntity._fromJSObject(jsEntity).toDart; +// } + +// @override +// Future setParent(ThermionEntity child, ThermionEntity parent, +// {bool preserveScaling = false}) async { +// await _shim.setParent(child, parent, preserveScaling).toDart; +// } + +// @override +// Future testCollisions(ThermionEntity entity) async { +// await _shim.testCollisions(entity).toDart; +// } + +// @override +// Future setPriority(ThermionEntity entityId, int priority) async { +// await _shim.setPriority(entityId, priority).toDart; +// } + +// AbstractGizmo? get gizmo => null; + +// @override +// Future> getBoneNames(ThermionEntity entity, +// {int skinIndex = 0}) async { +// var result = await _shim.getBoneNames(entity, skinIndex).toDart; +// return result.toDart.map((n) => n.toDart).toList(); +// } + +// @override +// Future getBone(ThermionEntity entity, int boneIndex, +// {int skinIndex = 0}) async { +// var result = await _shim.getBone(entity, boneIndex, skinIndex).toDart; +// return result.toDartInt; +// } + +// @override +// Future getInverseBindMatrix(ThermionEntity parent, int boneIndex, +// {int skinIndex = 0}) { +// // TODO: implement getInverseBindMatrix +// throw UnimplementedError(); +// } + +// @override +// Future getLocalTransform(ThermionEntity entity) async { +// var result = await _shim.getLocalTransform(entity).toDart; +// return Matrix4.fromList(result.toDart.map((v) => v.toDartDouble).toList()); +// } + +// @override +// Future getParent(ThermionEntity child) async { +// var result = await _shim.getParent(child).toDart; +// return result.toDartInt; +// } + +// @override +// Future getWorldTransform(ThermionEntity entity) async { +// var result = await _shim.getLocalTransform(entity).toDart; +// return Matrix4.fromList(result.toDart.map((v) => v.toDartDouble).toList()); +// } + +// @override +// Future removeAnimationComponent(ThermionEntity entity) { +// return _shim.removeAnimationComponent(entity).toDart; +// } + +// @override +// Future setBoneTransform( +// ThermionEntity entity, int boneIndex, Matrix4 transform, +// {int skinIndex = 0}) { +// return _shim +// .setBoneTransform(entity, boneIndex, +// transform.storage.map((v) => v.toJS).toList().toJS, skinIndex) +// .toDart; +// } + +// @override +// Future setTransform(ThermionEntity entity, Matrix4 transform) { +// return _shim +// .setTransform( +// entity, transform.storage.map((v) => v.toJS).toList().toJS) +// .toDart; +// } + +// @override +// Future updateBoneMatrices(ThermionEntity entity) { +// return _shim.updateBoneMatrices(entity).toDart; +// } + +// final _onDispose = []; + +// /// +// /// +// /// +// void onDispose(Future Function() callback) { +// _onDispose.add(callback); +// } + +// @override +// Future setShadowType(ShadowType shadowType) { +// return _shim.setShadowType(shadowType.index).toDart; +// } + +// @override +// Future setShadowsEnabled(bool enabled) { +// return _shim.setShadowsEnabled(enabled).toDart; +// } + +// @override +// Future setSoftShadowOptions(double penumbraScale, double penumbraRatioScale) { +// return _shim.setSoftShadowOptions(penumbraScale, penumbraRatioScale).toDart; +// } + +// @override +// Future capture() async { +// final captured = await _shim.capture().toDart; +// return captured.toDart; +// } + +// @override +// late (double, double) viewportDimensions; + +// @override +// Future getBoundingBox(ThermionEntity entity) { +// // return _shim.getBoundingBox(entity); +// throw UnimplementedError(); +// } + +// @override +// Future getCameraFov(bool horizontal) { +// // TODO: implement getCameraFov +// throw UnimplementedError(); +// } + +// @override +// Future queueRelativePositionUpdateWorldAxis(ThermionEntity entity, +// double viewportX, double viewportY, double x, double y, double z) { +// // TODO: implement queueRelativePositionUpdateWorldAxis +// throw UnimplementedError(); +// } - @override - double pixelRatio = 0.0; +// @override +// double pixelRatio = 0.0; - @override - Future createIbl(double r, double g, double b, double intensity) { - // TODO: implement createIbl - throw UnimplementedError(); - } +// @override +// Future createIbl(double r, double g, double b, double intensity) { +// // TODO: implement createIbl +// throw UnimplementedError(); +// } - @override - // TODO: implement gizmoPickResult - Stream get gizmoPickResult => throw UnimplementedError(); +// @override +// // TODO: implement gizmoPickResult +// Stream get gizmoPickResult => throw UnimplementedError(); - @override - void pickGizmo(int x, int y) { - // TODO: implement pickGizmo - } +// @override +// void pickGizmo(int x, int y) { +// // TODO: implement pickGizmo +// } - @override - Future setGizmoVisibility(bool visible) { - // TODO: implement setGizmoVisibility - throw UnimplementedError(); - } +// @override +// Future setGizmoVisibility(bool visible) { +// // TODO: implement setGizmoVisibility +// throw UnimplementedError(); +// } - @override - Future setLayerEnabled(int layer, bool enabled) { - // TODO: implement setLayerEnabled - throw UnimplementedError(); - } +// @override +// Future setLayerEnabled(int layer, bool enabled) { +// // TODO: implement setLayerEnabled +// throw UnimplementedError(); +// } - @override - // TODO: implement entitiesAdded - Stream get entitiesAdded => throw UnimplementedError(); +// @override +// // TODO: implement entitiesAdded +// Stream get entitiesAdded => throw UnimplementedError(); - @override - // TODO: implement entitiesRemoved - Stream get entitiesRemoved => throw UnimplementedError(); +// @override +// // TODO: implement entitiesRemoved +// Stream get entitiesRemoved => throw UnimplementedError(); - @override - Future getAncestor(ThermionEntity entity) { - // TODO: implement getAncestor - throw UnimplementedError(); - } +// @override +// Future getAncestor(ThermionEntity entity) { +// // TODO: implement getAncestor +// throw UnimplementedError(); +// } - @override - Future getCameraNear() { - // TODO: implement getCameraNear - throw UnimplementedError(); - } +// @override +// Future getCameraNear() { +// // TODO: implement getCameraNear +// throw UnimplementedError(); +// } - @override - Future getViewportBoundingBox(ThermionEntity entity) { - // TODO: implement getViewportBoundingBox - throw UnimplementedError(); - } +// @override +// Future getViewportBoundingBox(ThermionEntity entity) { +// // TODO: implement getViewportBoundingBox +// throw UnimplementedError(); +// } - @override - // TODO: implement lightsAdded - Stream get lightsAdded => throw UnimplementedError(); +// @override +// // TODO: implement lightsAdded +// Stream get lightsAdded => throw UnimplementedError(); - @override - // TODO: implement lightsRemoved - Stream get lightsRemoved => throw UnimplementedError(); +// @override +// // TODO: implement lightsRemoved +// Stream get lightsRemoved => throw UnimplementedError(); - @override - Future loadGlbFromBuffer(Uint8List data, {int numInstances = 1, bool keepData = false, int layer=4, int priority =4 }) { - // TODO: implement loadGlbFromBuffer - throw UnimplementedError(); - } +// @override +// Future loadGlbFromBuffer(Uint8List data, {int numInstances = 1, bool keepData = false, int layer=4, int priority =4 }) { +// // TODO: implement loadGlbFromBuffer +// throw UnimplementedError(); +// } - @override - Future queuePositionUpdateFromViewportCoords(ThermionEntity entity, double x, double y) { - // TODO: implement queuePositionUpdateFromViewportCoords - throw UnimplementedError(); - } +// @override +// Future queuePositionUpdateFromViewportCoords(ThermionEntity entity, double x, double y) { +// // TODO: implement queuePositionUpdateFromViewportCoords +// throw UnimplementedError(); +// } - @override - Future removeStencilHighlight(ThermionEntity entity) { - // TODO: implement removeStencilHighlight - throw UnimplementedError(); - } +// @override +// Future removeStencilHighlight(ThermionEntity entity) { +// // TODO: implement removeStencilHighlight +// throw UnimplementedError(); +// } - @override - Future setCameraModelMatrix4(Matrix4 matrix) { - // TODO: implement setCameraModelMatrix4 - throw UnimplementedError(); - } +// @override +// Future setCameraModelMatrix4(Matrix4 matrix) { +// // TODO: implement setCameraModelMatrix4 +// throw UnimplementedError(); +// } - @override - Future setLightDirection(ThermionEntity lightEntity, Vector3 direction) { - // TODO: implement setLightDirection - throw UnimplementedError(); - } +// @override +// Future setLightDirection(ThermionEntity lightEntity, Vector3 direction) { +// // TODO: implement setLightDirection +// throw UnimplementedError(); +// } - @override - Future setLightPosition(ThermionEntity lightEntity, double x, double y, double z) { - // TODO: implement setLightPosition - throw UnimplementedError(); - } +// @override +// Future setLightPosition(ThermionEntity lightEntity, double x, double y, double z) { +// // TODO: implement setLightPosition +// throw UnimplementedError(); +// } - @override - Future setMaterialPropertyFloat(ThermionEntity entity, String propertyName, int materialIndex, double value) { - // TODO: implement setMaterialPropertyFloat - throw UnimplementedError(); - } +// @override +// Future setMaterialPropertyFloat(ThermionEntity entity, String propertyName, int materialIndex, double value) { +// // TODO: implement setMaterialPropertyFloat +// throw UnimplementedError(); +// } - @override - Future setMaterialPropertyFloat4(ThermionEntity entity, String propertyName, int materialIndex, double f1, double f2, double f3, double f4) { - // TODO: implement setMaterialPropertyFloat4 - throw UnimplementedError(); - } +// @override +// Future setMaterialPropertyFloat4(ThermionEntity entity, String propertyName, int materialIndex, double f1, double f2, double f3, double f4) { +// // TODO: implement setMaterialPropertyFloat4 +// throw UnimplementedError(); +// } - @override - Future setStencilHighlight(ThermionEntity entity, {double r = 1.0, double g = 0.0, double b = 0.0}) { - // TODO: implement setStencilHighlight - throw UnimplementedError(); - } +// @override +// Future setStencilHighlight(ThermionEntity entity, {double r = 1.0, double g = 0.0, double b = 0.0}) { +// // TODO: implement setStencilHighlight +// throw UnimplementedError(); +// } - @override - Future addDirectLight(DirectLight light) { - // TODO: implement addDirectLight - throw UnimplementedError(); - } +// @override +// Future addDirectLight(DirectLight light) { +// // TODO: implement addDirectLight +// throw UnimplementedError(); +// } - @override - Future applyTexture(covariant ThermionTexture texture, ThermionEntity entity, {int materialIndex = 0, String parameterName = "baseColorMap"}) { - // TODO: implement applyTexture - throw UnimplementedError(); - } +// @override +// Future applyTexture(covariant ThermionTexture texture, ThermionEntity entity, {int materialIndex = 0, String parameterName = "baseColorMap"}) { +// // TODO: implement applyTexture +// throw UnimplementedError(); +// } - @override - Future createTexture(Uint8List data) { - // TODO: implement createTexture - throw UnimplementedError(); - } +// @override +// Future createTexture(Uint8List data) { +// // TODO: implement createTexture +// throw UnimplementedError(); +// } - @override - Future createUbershaderMaterialInstance({bool doubleSided = false, bool unlit = false, bool hasVertexColors = false, bool hasBaseColorTexture = false, bool hasNormalTexture = false, bool hasOcclusionTexture = false, bool hasEmissiveTexture = false, bool useSpecularGlossiness = false, AlphaMode alphaMode = AlphaMode.OPAQUE, bool enableDiagnostics = false, bool hasMetallicRoughnessTexture = false, int metallicRoughnessUV = 0, int baseColorUV = 0, bool hasClearCoatTexture = false, int clearCoatUV = 0, bool hasClearCoatRoughnessTexture = false, int clearCoatRoughnessUV = 0, bool hasClearCoatNormalTexture = false, int clearCoatNormalUV = 0, bool hasClearCoat = false, bool hasTransmission = false, bool hasTextureTransforms = false, int emissiveUV = 0, int aoUV = 0, int normalUV = 0, bool hasTransmissionTexture = false, int transmissionUV = 0, bool hasSheenColorTexture = false, int sheenColorUV = 0, bool hasSheenRoughnessTexture = false, int sheenRoughnessUV = 0, bool hasVolumeThicknessTexture = false, int volumeThicknessUV = 0, bool hasSheen = false, bool hasIOR = false, bool hasVolume = false}) { - // TODO: implement createUbershaderMaterialInstance - throw UnimplementedError(); - } +// @override +// Future createUbershaderMaterialInstance({bool doubleSided = false, bool unlit = false, bool hasVertexColors = false, bool hasBaseColorTexture = false, bool hasNormalTexture = false, bool hasOcclusionTexture = false, bool hasEmissiveTexture = false, bool useSpecularGlossiness = false, AlphaMode alphaMode = AlphaMode.OPAQUE, bool enableDiagnostics = false, bool hasMetallicRoughnessTexture = false, int metallicRoughnessUV = 0, int baseColorUV = 0, bool hasClearCoatTexture = false, int clearCoatUV = 0, bool hasClearCoatRoughnessTexture = false, int clearCoatRoughnessUV = 0, bool hasClearCoatNormalTexture = false, int clearCoatNormalUV = 0, bool hasClearCoat = false, bool hasTransmission = false, bool hasTextureTransforms = false, int emissiveUV = 0, int aoUV = 0, int normalUV = 0, bool hasTransmissionTexture = false, int transmissionUV = 0, bool hasSheenColorTexture = false, int sheenColorUV = 0, bool hasSheenRoughnessTexture = false, int sheenRoughnessUV = 0, bool hasVolumeThicknessTexture = false, int volumeThicknessUV = 0, bool hasSheen = false, bool hasIOR = false, bool hasVolume = false}) { +// // TODO: implement createUbershaderMaterialInstance +// throw UnimplementedError(); +// } - @override - Future createUnlitMaterialInstance() { - // TODO: implement createUnlitMaterialInstance - throw UnimplementedError(); - } +// @override +// Future createUnlitMaterialInstance() { +// // TODO: implement createUnlitMaterialInstance +// throw UnimplementedError(); +// } - @override - Future destroyMaterialInstance(covariant MaterialInstance materialInstance) { - // TODO: implement destroyMaterialInstance - throw UnimplementedError(); - } +// @override +// Future destroyMaterialInstance(covariant MaterialInstance materialInstance) { +// // TODO: implement destroyMaterialInstance +// throw UnimplementedError(); +// } - @override - Future destroyTexture(covariant ThermionTexture texture) { - // TODO: implement destroyTexture - throw UnimplementedError(); - } +// @override +// Future destroyTexture(covariant ThermionTexture texture) { +// // TODO: implement destroyTexture +// throw UnimplementedError(); +// } - @override - Future getMainCameraEntity() { - // TODO: implement getMainCameraEntity - throw UnimplementedError(); - } +// @override +// Future getMainCameraEntity() { +// // TODO: implement getMainCameraEntity +// throw UnimplementedError(); +// } - @override - Future getMaterialInstanceAt(ThermionEntity entity, int index) { - // TODO: implement getMaterialInstanceAt - throw UnimplementedError(); - } +// @override +// Future getMaterialInstanceAt(ThermionEntity entity, int index) { +// // TODO: implement getMaterialInstanceAt +// throw UnimplementedError(); +// } - @override - // TODO: implement sceneUpdated - Stream get sceneUpdated => throw UnimplementedError(); +// @override +// // TODO: implement sceneUpdated +// Stream get sceneUpdated => throw UnimplementedError(); - @override - Future setLayerVisibility(int layer, bool visible) { - // TODO: implement setLayerVisibility - throw UnimplementedError(); - } +// @override +// Future setLayerVisibility(int layer, bool visible) { +// // TODO: implement setLayerVisibility +// throw UnimplementedError(); +// } - @override - Future setMaterialPropertyInt(ThermionEntity entity, String propertyName, int materialIndex, int value) { - // TODO: implement setMaterialPropertyInt - throw UnimplementedError(); - } +// @override +// Future setMaterialPropertyInt(ThermionEntity entity, String propertyName, int materialIndex, int value) { +// // TODO: implement setMaterialPropertyInt +// throw UnimplementedError(); +// } - @override - Future setVisibilityLayer(ThermionEntity entity, int layer) { - // TODO: implement setVisibilityLayer - throw UnimplementedError(); - } +// @override +// Future setVisibilityLayer(ThermionEntity entity, int layer) { +// // TODO: implement setVisibilityLayer +// throw UnimplementedError(); +// } - @override - Future setCameraLensProjection({double near = kNear, double far = kFar, double? aspect, double focalLength = kFocalLength}) { - // TODO: implement setCameraLensProjection - throw UnimplementedError(); - } +// @override +// Future setCameraLensProjection({double near = kNear, double far = kFar, double? aspect, double focalLength = kFocalLength}) { +// // TODO: implement setCameraLensProjection +// throw UnimplementedError(); +// } - @override - Future createCamera() { - // TODO: implement createCamera - throw UnimplementedError(); - } +// @override +// Future createCamera() { +// // TODO: implement createCamera +// throw UnimplementedError(); +// } - @override - Future registerRequestFrameHook(Future Function() hook) { - // TODO: implement registerRequestFrameHook - throw UnimplementedError(); - } +// @override +// Future registerRequestFrameHook(Future Function() hook) { +// // TODO: implement registerRequestFrameHook +// throw UnimplementedError(); +// } - @override - Future requestFrame() { - // TODO: implement requestFrame - throw UnimplementedError(); - } +// @override +// Future requestFrame() { +// // TODO: implement requestFrame +// throw UnimplementedError(); +// } - @override - Future setActiveCamera(covariant Camera camera) { - // TODO: implement setActiveCamera - throw UnimplementedError(); - } +// @override +// Future setActiveCamera(covariant Camera camera) { +// // TODO: implement setActiveCamera +// throw UnimplementedError(); +// } - @override - Future unregisterRequestFrameHook(Future Function() hook) { - // TODO: implement unregisterRequestFrameHook - throw UnimplementedError(); - } -} +// @override +// Future unregisterRequestFrameHook(Future Function() hook) { +// // TODO: implement unregisterRequestFrameHook +// throw UnimplementedError(); +// } +// } diff --git a/thermion_dart/lib/src/viewer/src/web_wasm/src/camera.dart b/thermion_dart/lib/src/viewer/src/web_wasm/src/camera.dart index 4296f7e5..49bf4379 100644 --- a/thermion_dart/lib/src/viewer/src/web_wasm/src/camera.dart +++ b/thermion_dart/lib/src/viewer/src/web_wasm/src/camera.dart @@ -1,6 +1,5 @@ import 'package:vector_math/vector_math_64.dart'; -import '../../shared_types/camera.dart'; import '../../thermion_viewer_base.dart'; class ThermionWasmCamera extends Camera { @@ -45,4 +44,34 @@ class ThermionWasmCamera extends Camera { // TODO: implement setModelMatrix throw UnimplementedError(); } + + @override + Future getCullingFar() { + // TODO: implement getCullingFar + throw UnimplementedError(); + } + + @override + Future getFocalLength() { + // TODO: implement getFocalLength + throw UnimplementedError(); + } + + @override + Future getNear() { + // TODO: implement getNear + throw UnimplementedError(); + } + + @override + Future getViewMatrix() { + // TODO: implement getViewMatrix + throw UnimplementedError(); + } + + @override + Future setProjection(Projection projection, double left, double right, double bottom, double top, double near, double far) { + // TODO: implement setProjection + throw UnimplementedError(); + } } diff --git a/thermion_dart/lib/src/viewer/src/web_wasm/src/thermion_viewer_wasm.dart b/thermion_dart/lib/src/viewer/src/web_wasm/src/thermion_viewer_wasm.dart index a99e3951..0bc3eb8e 100644 --- a/thermion_dart/lib/src/viewer/src/web_wasm/src/thermion_viewer_wasm.dart +++ b/thermion_dart/lib/src/viewer/src/web_wasm/src/thermion_viewer_wasm.dart @@ -1,2510 +1,2490 @@ -import 'dart:async'; -import 'dart:js_interop'; -import 'dart:js_interop_unsafe'; -import 'dart:math'; -import 'dart:typed_data' as td; -import 'dart:typed_data'; -import 'package:logging/logging.dart'; -import 'package:web/web.dart'; -import 'package:animation_tools_dart/animation_tools_dart.dart'; - -import 'package:vector_math/vector_math_64.dart'; -import 'package:http/http.dart' as http; -import 'dart:convert'; -import '../../../../entities/abstract_gizmo.dart'; -import '../../../../entities/gizmo.dart'; -import '../../../viewer.dart'; -import '../../events.dart'; -import '../../shared_types/camera.dart'; -import 'camera.dart'; -import 'material_instance.dart'; - -extension type _EmscriptenModule(JSObject _) implements JSObject { - external JSAny? ccall(String name, String returnType, - JSArray argTypes, JSArray args, JSAny? opts); - - external JSNumber _malloc(int numBytes); - external void _free(JSNumber addr); - external JSNumber stackAlloc(int numBytes); - - external JSAny getValue(JSNumber addr, String llvmType); - external void setValue(JSNumber addr, JSNumber value, String llvmType); - - external JSString intArrayToString(JSAny ptr); - external JSString UTF8ToString(JSAny ptr); - external void stringToUTF8( - JSString str, JSNumber ptr, JSNumber maxBytesToWrite); - external void writeArrayToMemory(JSUint8Array data, JSNumber ptr); - - external JSNumber addFunction(JSFunction f, String signature); - external void removeFunction(JSNumber f); - external JSAny get ALLOC_STACK; - external JSAny get HEAPU32; - external JSAny get HEAP32; -} - -typedef ThermionViewerImpl = ThermionViewerWasm; - -/// -/// A [ThermionViewer] implementation that forwards calls to the -/// (Emscripten-generated) ThermionDart JS module. -/// -class ThermionViewerWasm implements ThermionViewer { - final _logger = Logger("ThermionViewerWasm"); - - _EmscriptenModule? _module; - - bool _initialized = false; - bool _rendering = false; - - String? assetPathPrefix; - - late (double, double) viewportDimensions; - - late double pixelRatio; - - /// - /// Construct an instance of this class by explicitly passing the - /// module instance via the [module] property, or by specifying [moduleName], - /// being the name of the window property where the module has already been - /// loaded. - /// - /// Pass [assetPathPrefix] if you need to prepend a path to all asset paths - /// (e.g. on Flutter where the asset directory /foo is actually shipped under - /// the directory /assets/foo, you would construct this as: - /// - /// final viewer = ThermionViewerWasm(assetPathPrefix:"/assets/") - /// - ThermionViewerWasm({JSObject? module, this.assetPathPrefix}) { - if (module != null) { - _module = module as _EmscriptenModule; - } - } - - void _setAssetPathPrefix(String assetPathPrefix) { - _module!.ccall( - "thermion_dart_web_set_asset_path_prefix", - "void", - ["string".toJS].toJS, - [assetPathPrefix.toJS].toJS, - null); - } - - JSNumber? _viewer; - JSNumber? _sceneManager; - int _width = 0; - int _height = 0; - - Future initialize(double width, double height, double pixelRatio, - {String? uberArchivePath}) async { - if (!_initialized) { - await _initializeModule(); - _initialized = true; - if (assetPathPrefix != null) { - _setAssetPathPrefix(assetPathPrefix!); - } - } - this.pixelRatio = pixelRatio; - - final context = _module!.ccall("thermion_dart_web_create_gl_context", "int", - [].toJS, [].toJS, null); - final loader = _module!.ccall( - "thermion_dart_web_get_resource_loader_wrapper", - "void*", - [].toJS, - [].toJS, - null); - _viewer = _module!.ccall( - "create_filament_viewer", - "void*", - ["void*".toJS, "void*".toJS, "void*".toJS, "string".toJS].toJS, - [context!, loader, null, uberArchivePath?.toJS].toJS, - null) as JSNumber; - await createSwapChain(width.ceil(), height.ceil()); - updateViewportAndCameraProjection(width.ceil(), height.ceil(), 1.0); - _sceneManager = _module!.ccall("get_scene_manager", "void*", - ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber; - - _pickCallbackPtr = _module!.addFunction(_onPickCallback.toJS, "viii"); - _pickGizmoCallbackPtr = - _module!.addFunction(_onPickGizmoCallback.toJS, "viii"); - - var gizmoOut = _module!._malloc(4 * 4); - - _module!.ccall("get_gizmo", "void", ["void*".toJS, "void*".toJS].toJS, - [_sceneManager!, gizmoOut].toJS, null); - - var x = _module!.getValue(gizmoOut, "i32") as JSNumber; - var y = _module!.getValue((gizmoOut.toDartInt + 4).toJS, "i32") as JSNumber; - var z = _module!.getValue((gizmoOut.toDartInt + 8).toJS, "i32") as JSNumber; - var center = - _module!.getValue((gizmoOut.toDartInt + 12).toJS, "i32") as JSNumber; - _gizmo = - Gizmo(x.toDartInt, y.toDartInt, z.toDartInt, center.toDartInt, this); - _module!._free(gizmoOut); - _initialized = true; - } - - Future _initializeModule() async { - var moduleScript = document.createElement("script") as HTMLScriptElement; - - globalContext["exports"] = JSObject(); - var module = JSObject(); - globalContext["module"] = module; - var content = await http.get(Uri.parse("thermion_dart.js")); - moduleScript.innerHTML = content.body.toJS; - document.head!.appendChild(moduleScript); - var instantiate = module.getProperty("exports".toJS) as JSFunction; - var moduleInstance = - instantiate.callAsFunction() as JSPromise<_EmscriptenModule>; - _module = await moduleInstance.toDart; - } - - Future createSwapChain(int width, int height) async { - _module!.ccall( - "create_swap_chain", - "void", - ["void*".toJS, "void*".toJS, "uint32_t".toJS, "uint32_t".toJS].toJS, - [_viewer!, null, width.toJS, height.toJS].toJS, - null); - } - - Future destroySwapChain() async { - if (_viewer == null) { - return; - } - _module!.ccall("destroy_swap_chain", "void", ["void*".toJS].toJS, - [_viewer!].toJS, null); - } - - void updateViewportAndCameraProjection( - int width, int height, double scaleFactor) { - if (width == 0 || height == 0) { - throw Exception("Width/height must be greater than zero"); - } - _width = (width * pixelRatio).ceil(); - _height = (height * pixelRatio).ceil(); - viewportDimensions = (_width.toDouble(), _height.toDouble()); - _module!.ccall( - "update_viewport_and_camera_projection", - "void", - ["void*".toJS, "uint32_t".toJS, "uint32_t".toJS, "float".toJS].toJS, - [_viewer!, _width.toJS, _height.toJS, scaleFactor.toJS].toJS, - null); - } - - @override - Future get initialized async { - return _initialized; - } - - /// - /// - /// - final _pickResultController = - StreamController.broadcast(); - - @override - Stream get pickResult { - return _pickResultController.stream; - } - - @override - Stream get gizmoPickResult => - _gizmoPickResultController.stream; - final _gizmoPickResultController = - StreamController.broadcast(); - - @override - bool get rendering => _rendering; - - @override - Future dispose() async { - if (_viewer == null) { - // we've already cleaned everything up, ignore the call to dispose - return; - } - await setRendering(false); - await clearEntities(); - await clearLights(); - _destroyViewer(); - - _sceneManager = null; - _viewer = null; - - for (final callback in _onDispose) { - await callback.call(); - } - _onDispose.clear(); - _module!.removeFunction(_pickCallbackPtr); - _module!.removeFunction(_pickGizmoCallbackPtr); - } - - void _destroyViewer() { - _module!.ccall("destroy_filament_viewer", "void", ["void*".toJS].toJS, - [_viewer].toJS, null); - } - - @override - Future setBackgroundColor(double r, double g, double b, double alpha) async { - _module!.ccall( - "set_background_color", - "void", - ["void*".toJS, "float".toJS, "float".toJS, "float".toJS, "float".toJS] - .toJS, - [_viewer!, r.toJS, g.toJS, b.toJS, alpha.toJS].toJS, - null); - } - - @override - Future addAnimationComponent(ThermionEntity entity) async { - _module!.ccall( - "add_animation_component", - "bool", - ["void*".toJS, "int32_t".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null); - } - - Matrix4 _matrixFromPtr(JSNumber matPtr) { - final mat = Matrix4.zero(); - for (int i = 0; i < 16; i++) { - mat[i] = (_module!.getValue((matPtr.toDartInt + (i * 4)).toJS, "float") - as JSNumber) - .toDartDouble; - } - return mat; - } - - @override - Future> getRestLocalTransforms(ThermionEntity entity, - {int skinIndex = 0}) async { - var boneCountJS = _module!.ccall( - "get_bone_count", - "int", - ["void*".toJS, "int".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS, skinIndex.toJS].toJS, - null) as JSNumber; - var boneCount = boneCountJS.toDartInt; - var buf = _module!._malloc(boneCount * 16 * 4); - _module!.ccall( - "get_rest_local_transforms", - "void", - ["void*".toJS, "int".toJS, "int".toJS, "float*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS, skinIndex.toJS, buf, boneCount.toJS].toJS, - null); - var transforms = []; - for (int i = 0; i < boneCount; i++) { - var matPtr = (buf.toDartInt + (i * 16 * 4)).toJS; - transforms.add(_matrixFromPtr(matPtr)); - } - _module!._free(buf); - return transforms; - } - - @override - Future getBone(ThermionEntity parent, int boneIndex, - {int skinIndex = 0}) async { - final boneId = _module!.ccall( - "get_bone", - "int", - ["void*".toJS, "int32_t".toJS, "int32_t".toJS, "int32_t".toJS].toJS, - [_sceneManager!, parent.toJS, skinIndex.toJS, boneIndex.toJS].toJS, - null) as JSNumber; - if (boneId.toDartInt == -1) { - throw Exception("Failed to get bone"); - } - return boneId.toDartInt; - } - - Future> getBones(ThermionEntity entity, - {int skinIndex = 0}) async { - final boneNames = await getBoneNames(entity); - final bones = await Future.wait(List.generate( - boneNames.length, (i) => getBone(entity, i, skinIndex: skinIndex))); - return bones; - } - - @override - Future addBoneAnimation(ThermionEntity entity, BoneAnimationData animation, - {int skinIndex = 0, - double fadeInInSecs = 0.0, - double fadeOutInSecs = 0.0, - double maxDelta = 1.0}) async { - final boneNames = await getBoneNames(entity); - final bones = await getBones(entity); - - var numBytes = animation.numFrames * 16 * 4; - var floatPtr = _module!._malloc(numBytes); - - var restLocalTransforms = await getRestLocalTransforms(entity); - - for (int i = 0; i < animation.bones.length; i++) { - final boneName = animation.bones[i]; - final entityBoneIndex = boneNames.indexOf(boneName); - - var boneEntity = bones[entityBoneIndex]; - - var baseTransform = restLocalTransforms[entityBoneIndex]; - - var world = Matrix4.identity(); - - // this odd use of ! is intentional, without it, the WASM optimizer gets in trouble - var parentBoneEntity = (await getParent(boneEntity))!; - while (true) { - if (!bones.contains(parentBoneEntity!)) { - break; - } - world = restLocalTransforms[bones.indexOf(parentBoneEntity!)] * world; - parentBoneEntity = (await getParent(parentBoneEntity))!; - } - - world = Matrix4.identity()..setRotation(world.getRotation()); - var worldInverse = Matrix4.identity()..copyInverse(world); - - for (int frameNum = 0; frameNum < animation.numFrames; frameNum++) { - var rotation = animation.frameData[frameNum][i].rotation; - var translation = animation.frameData[frameNum][i].translation; - var frameTransform = - Matrix4.compose(translation, rotation, Vector3.all(1.0)); - var newLocalTransform = frameTransform.clone(); - if (animation.space == Space.Bone) { - newLocalTransform = baseTransform * frameTransform; - } else if (animation.space == Space.ParentWorldRotation) { - newLocalTransform = - baseTransform * (worldInverse * frameTransform * world); - } - for (int j = 0; j < 16; j++) { - var offset = ((frameNum * 16) + j) * 4; - _module!.setValue((floatPtr.toDartInt + offset).toJS, - newLocalTransform.storage[j].toJS, "float"); - } - } - - _module!.ccall( - "add_bone_animation", - "void", - [ - "void*".toJS, - "int".toJS, - "int".toJS, - "int".toJS, - "float*".toJS, - "int".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS - ].toJS, - [ - _sceneManager!, - entity.toJS, - skinIndex.toJS, - entityBoneIndex.toJS, - floatPtr, - animation.numFrames.toJS, - animation.frameLengthInMs.toJS, - fadeOutInSecs.toJS, - fadeInInSecs.toJS, - maxDelta.toJS - ].toJS, - null); - } - _module!._free(floatPtr); - } - - @override - Future addCollisionComponent(ThermionEntity entity, - {void Function(int entityId1, int entityId2)? callback, - bool affectsTransform = false}) { - // TODO: implement addCollisionComponent - throw UnimplementedError(); - } - - @override - Future addLight( - LightType type, - double colour, - double intensity, - double posX, - double posY, - double posZ, - double dirX, - double dirY, - double dirZ, - {double falloffRadius = 1.0, - double spotLightConeInner = pi / 8, - double spotLightConeOuter = pi / 4, - double sunAngularRadius = 0.545, - double sunHaloSize = 10.0, - double sunHaloFallof = 80.0, - bool castShadows = true}) async { - final entityId = _module!.ccall( - "add_light", - "int", - [ - "void*".toJS, - "uint8_t".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "bool".toJS - ].toJS, - [ - _viewer, - type.index.toJS, - colour.toJS, - intensity.toJS, - posX.toJS, - posY.toJS, - posZ.toJS, - dirX.toJS, - dirY.toJS, - dirZ.toJS, - falloffRadius.toJS, - spotLightConeInner.toJS, - spotLightConeOuter.toJS, - sunAngularRadius.toJS, - sunHaloSize.toJS, - sunHaloFallof.toJS, - castShadows.toJS - ].toJS, - null) as JSNumber; - if (entityId.toDartInt == -1) { - throw Exception("Failed to add light"); - } - return entityId.toDartInt; - } - - @override - Future> getBoneNames(ThermionEntity entity, - {int skinIndex = 0}) async { - var boneCountJS = _module!.ccall( - "get_bone_count", - "int", - ["void*".toJS, "int".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS, skinIndex.toJS].toJS, - null) as JSNumber; - var boneCount = boneCountJS.toDartInt; - var buf = _module!._malloc(boneCount * 4); - - var empty = " ".toJS; - var ptrs = []; - for (int i = 0; i < boneCount; i++) { - var ptr = _module!._malloc(256); - _module!.stringToUTF8(empty, ptr, 255.toJS); - ptrs.add(ptr); - _module!.setValue((buf.toDartInt + (i * 4)).toJS, ptr, "i32"); - } - _module!.ccall( - "get_bone_names", - "void", - ["void*".toJS, "int".toJS, "char**".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS, buf, skinIndex.toJS].toJS, - null); - var names = []; - for (int i = 0; i < boneCount; i++) { - var name = _module!.UTF8ToString(ptrs[i]).toDart; - names.add(name); - } - - return names; - } - - @override - Future> getChildEntities( - ThermionEntity parent, bool renderableOnly) async { - var entityCountJS = _module!.ccall( - "get_entity_count", - "int", - ["void*".toJS, "int".toJS, "bool".toJS].toJS, - [_sceneManager!, parent.toJS, renderableOnly.toJS].toJS, - null) as JSNumber; - var entityCount = entityCountJS.toDartInt; - var entities = []; - var buf = _module!._malloc(entityCount * 4); - - _module!.ccall( - "get_entities", - "void", - ["void*".toJS, "int".toJS, "bool".toJS, "int*".toJS].toJS, - [_sceneManager!, parent.toJS, renderableOnly.toJS, buf].toJS, - null); - for (int i = 0; i < entityCount; i++) { - var entityId = - _module!.getValue((buf.toDartInt + (i * 4)).toJS, "i32") as JSNumber; - entities.add(entityId.toDartInt); - } - _module!._free(buf); - return entities; - } - - @override - Future getChildEntity( - ThermionEntity parent, String childName) async { - final entityId = _module!.ccall( - "find_child_entity_by_name", - "int", - ["void*".toJS, "int".toJS, "string".toJS].toJS, - [_sceneManager!, parent.toJS, childName.toJS].toJS, - null) as JSNumber; - if (entityId.toDartInt == -1) { - throw Exception("Failed to find child entity"); - } - return entityId.toDartInt; - } - - @override - Future> getChildEntityNames(ThermionEntity entity, - {bool renderableOnly = true}) async { - var entityCountJS = _module!.ccall( - "get_entity_count", - "int", - ["void*".toJS, "int".toJS, "bool".toJS].toJS, - [_sceneManager!, entity.toJS, renderableOnly.toJS].toJS, - null) as JSNumber; - var entityCount = entityCountJS.toDartInt; - var names = []; - for (int i = 0; i < entityCount; i++) { - var namePtr = _module!.ccall( - "get_entity_name_at", - "char*", - ["void*".toJS, "int".toJS, "int".toJS, "bool".toJS].toJS, - [_sceneManager!, entity.toJS, i.toJS, renderableOnly.toJS].toJS, - null) as JSNumber; - names.add(_module!.UTF8ToString(namePtr).toDart); - } - return names; - } - - @override - Future getMainCamera() async { - var mainCameraEntity = await getMainCameraEntity(); - return ThermionWasmCamera(mainCameraEntity); - } - - @override - Future> getMorphTargetNames( - ThermionEntity entity, ThermionEntity childEntity) async { - var morphTargetCountJS = _module!.ccall( - "get_morph_target_name_count", - "int", - ["void*".toJS, "int32_t".toJS, "int32_t".toJS].toJS, - [_sceneManager!, entity.toJS, childEntity.toJS].toJS, - null) as JSNumber; - var morphTargetCount = morphTargetCountJS.toDartInt; - var names = []; - for (int i = 0; i < morphTargetCount; i++) { - var buf = _module!._malloc(256); - _module!.ccall( - "get_morph_target_name", - "void", - [ - "void*".toJS, - "int32_t".toJS, - "int32_t".toJS, - "char*".toJS, - "int32_t".toJS - ].toJS, - [_sceneManager!, entity.toJS, childEntity.toJS, buf, i.toJS].toJS, - null); - names.add(_module!.UTF8ToString(buf).toDart); - _module!._free(buf); - } - return names; - } - - @override - String? getNameForEntity(ThermionEntity entity) { - final namePtr = _module!.ccall( - "get_name_for_entity", - "char*", - ["void*".toJS, "int32_t".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null) as JSNumber; - if (namePtr.toDartInt == 0) { - return null; - } - return _module!.UTF8ToString(namePtr).toDart; - } - - @override - Future getParent(ThermionEntity child) async { - final parentId = _module!.ccall( - "get_parent", - "int", - ["void*".toJS, "int32_t".toJS].toJS, - [_sceneManager!, child.toJS].toJS, - null) as JSNumber; - if (parentId.toDartInt == -1) { - return null; - } - return parentId.toDartInt; - } - - @override - Future getWorldTransform(ThermionEntity entity) async { - final matrixPtr = _module!._malloc(16 * 4); - _module!.ccall( - "get_world_transform", - "void", - ["void*".toJS, "int32_t".toJS, "float*".toJS].toJS, - [_sceneManager!, entity.toJS, matrixPtr].toJS, - null); - final matrix = _matrixFromPtr(matrixPtr); - _module!._free(matrixPtr); - return matrix; - } - - @override - AbstractGizmo? get gizmo => _gizmo; - Gizmo? _gizmo; - - @override - Future hide(ThermionEntity entity, String? meshName) async { - if (meshName != null) { - final result = _module!.ccall( - "hide_mesh", - "int", - ["void*".toJS, "int".toJS, "string".toJS].toJS, - [_sceneManager!, entity.toJS, meshName.toJS].toJS, - null) as JSNumber; - if (result.toDartInt == -1) { - throw Exception( - "Failed to hide mesh ${meshName} on entity ${entity.toJS}"); - } - } else { - throw Exception( - "Cannot hide mesh, meshName must be specified when invoking this method"); - } - } - - Future loadGlbFromBuffer(Uint8List data, - {int numInstances = 1, bool keepData= false, int layer=0, int priority=4}) async { - if (numInstances != 1) { - throw Exception("TODO"); - } - final ptr = _module!._malloc(data.length); - _module!.writeArrayToMemory(data.toJS, ptr); - - final result = _module!.ccall( - "load_glb_from_buffer", - "int", - ["void*".toJS, "void*".toJS, "size_t".toJS].toJS, - [_sceneManager!, ptr, data.lengthInBytes.toJS].toJS, - null) as JSNumber; - final entityId = result.toDartInt; - _module!._free(ptr); - if (entityId == -1) { - throw Exception("Failed to load GLB"); - } - return entityId; - } - - @override - Future loadGlb(String path, - {int numInstances = 1, bool keepData = false}) async { - final promise = _module!.ccall( - "load_glb", - "int", - ["void*".toJS, "string".toJS, "int".toJS].toJS, - [_sceneManager!, path.toJS, numInstances.toJS].toJS, - {"async": true}.jsify()) as JSPromise; - final entityId = (await promise.toDart).toDartInt; - if (entityId == -1) { - throw Exception("Failed to load GLB"); - } - return entityId; - } - - @override - Future loadGltf(String path, String relativeResourcePath, - {bool keepData = false}) async { - final promise = _module!.ccall( - "load_gltf", - "int", - ["void*".toJS, "string".toJS, "string".toJS].toJS, - [_sceneManager!, path.toJS, relativeResourcePath.toJS].toJS, - {"async": true}.jsify()) as JSPromise; - final entityId = (await promise.toDart).toDartInt; - if (entityId == -1) { - throw Exception("Failed to load GLTF"); - } - return entityId; - } - - @override - Future loadIbl(String lightingPath, {double intensity = 30000}) async { - var promise = _module!.ccall( - "load_ibl", - "void", - ["void*".toJS, "string".toJS, "float".toJS].toJS, - [_viewer!, lightingPath.toJS, intensity.toJS].toJS, - {"async": true}.jsify()) as JSPromise; - await promise.toDart; - } - - @override - Future loadSkybox(String skyboxPath) async { - var promise = _module!.ccall( - "load_skybox", - "void", - ["void*".toJS, "string".toJS].toJS, - [_viewer!, skyboxPath.toJS].toJS, - {"async": true}.jsify()) as JSPromise; - await promise.toDart; - } - - @override - Future playAnimation(ThermionEntity entity, int index, - {bool loop = false, - bool reverse = false, - bool replaceActive = true, - double crossfade = 0.0, - double startOffset = 0.0}) async { - _module!.ccall( - "play_animation", - "void", - [ - "void*".toJS, - "int32_t".toJS, - "int32_t".toJS, - "bool".toJS, - "bool".toJS, - "bool".toJS, - "float".toJS, - "float".toJS - ].toJS, - [ - _sceneManager!, - entity.toJS, - index.toJS, - loop.toJS, - reverse.toJS, - replaceActive.toJS, - crossfade.toJS - ].toJS, - null); - } - - int _last = 0; - - @override - Future render() async { - _last = DateTime.now().millisecondsSinceEpoch * 1000000; - _module!.ccall( - "render", - "void", - [ - "void*".toJS, - "uint64_t".toJS, - "void*".toJS, - "void*".toJS, - "void*".toJS - ].toJS, - [ - _viewer!, - 0.toJS, - null, // pixelBuffer, - null, // callback - null // data - ].toJS, - null); - } - - Future capture() async { - bool wasRendering = rendering; - await setRendering(false); - final pixelBuffer = _module!._malloc(_width * _height * 4); - final completer = Completer(); - final callback = () { - completer.complete(); - }; - final callbackPtr = _module!.addFunction(callback.toJS, "v"); - - _module!.ccall( - "capture", - "void", - ["void*".toJS, "uint8_t*".toJS, "void*".toJS].toJS, - [_viewer!, pixelBuffer, callbackPtr].toJS, - null); - - int iter = 0; - while (true) { - await Future.delayed(Duration(milliseconds: 5)); - await render(); - if (completer.isCompleted) { - break; - } - iter++; - if (iter > 1000) { - _module!._free(pixelBuffer); - throw Exception("Failed to complete capture"); - } - } - - // Create a Uint8ClampedList to store the pixel data - var data = Uint8List(_width * _height * 4); - for (int i = 0; i < data.length; i++) { - data[i] = (_module!.getValue(((pixelBuffer.toDartInt) + i).toJS, "i8") - as JSNumber) - .toDartInt; - } - _module!._free(pixelBuffer); - await setRendering(wasRendering); - print("Captured to ${data.length} pixel buffer"); - _module!.removeFunction(callbackPtr); - - return data; - } - - @override - Future setAntiAliasing(bool msaa, bool fxaa, bool taa) async { - _module!.ccall( - "set_antialiasing", - "void", - ["void*".toJS, "bool".toJS, "bool".toJS, "bool".toJS].toJS, - [_viewer!, msaa.toJS, fxaa.toJS, taa.toJS].toJS, - null); - } - - @override - Future setCameraPosition(double x, double y, double z) async { - _module!.ccall( - "set_camera_position", - "void", - ["void*".toJS, "float".toJS, "float".toJS, "float".toJS].toJS, - [_viewer!, x.toJS, y.toJS, z.toJS].toJS, - null); - } - - @override - Future setCameraRotation(Quaternion quaternion) async { - _module!.ccall( - "set_camera_rotation", - "void", - ["void*".toJS, "float".toJS, "float".toJS, "float".toJS, "float".toJS] - .toJS, - [ - _viewer!, - quaternion.w.toJS, - quaternion.x.toJS, - quaternion.y.toJS, - quaternion.z.toJS - ].toJS, - null); - } - - @override - Future clearMorphAnimationData(ThermionEntity entity) async { - var meshEntities = await getChildEntities(entity, false); - for (final childEntity in meshEntities) { - _module!.ccall( - "clear_morph_animation", - "void", - [ - "void*".toJS, - "int".toJS, - ].toJS, - [ - _sceneManager!, - childEntity.toJS, - ].toJS, - null); - } - } - - @override - Future setMorphAnimationData( - ThermionEntity entity, MorphAnimationData animation, - {List? targetMeshNames, bool useNextEntity = false}) async { - var meshNames = await getChildEntityNames(entity, renderableOnly: false); - if (targetMeshNames != null) { - for (final targetMeshName in targetMeshNames) { - if (!meshNames.contains(targetMeshName)) { - throw Exception( - "Error: mesh ${targetMeshName} does not exist under the specified entity. Available meshes : ${meshNames}"); - } - } - } - - var meshEntities = await getChildEntities(entity, false); - - // Entities are not guaranteed to have the same morph targets (or share the same order), - // either from each other, or from those specified in [animation]. - // We therefore set morph targets separately for each mesh. - // For each mesh, allocate enough memory to hold FxM 32-bit floats - // (where F is the number of Frames, and M is the number of morph targets in the mesh). - // we call [extract] on [animation] to return frame data only for morph targets that present in both the mesh and the animation - for (int i = 0; i < meshNames.length; i++) { - var meshName = meshNames[i]; - var meshEntity = meshEntities[i]; - - if (targetMeshNames?.contains(meshName) == false) { - // _logger.info("Skipping $meshName, not contained in target"); - continue; - } - - if (useNextEntity) meshEntity += 1; - - var meshMorphTargets = await getMorphTargetNames(entity, meshEntity); - - _logger.info("Got mesh morph targets ${meshMorphTargets}"); - - var intersection = animation.morphTargets - .toSet() - .intersection(meshMorphTargets.toSet()) - .toList(); - - if (intersection.isEmpty) { - throw Exception( - """No morph targets specified in animation are present on mesh $meshName. - If you weren't intending to animate every mesh, specify [targetMeshNames] when invoking this method. - Animation morph targets: ${animation.morphTargets}\n - Mesh morph targets ${meshMorphTargets} - Child meshes: ${meshNames}"""); - } - - var indices = - intersection.map((m) => meshMorphTargets.indexOf(m)).toList(); - - var frameData = animation.extract(morphTargets: intersection); - - assert(frameData.length == animation.numFrames * intersection.length); - - // Allocate memory in WASM for the morph data - var dataPtr = _module!._malloc(frameData.length * 4); - - // Create a Float32List to copy the morph data to - var dataList = td.Float32List.fromList(frameData); - - // Copy the morph data to WASM - _module!.writeArrayToMemory( - dataList.buffer.asUint8List(dataList.offsetInBytes).toJS, dataPtr); - - // Allocate memory in WASM for the morph indices - var idxPtr = _module!._malloc(indices.length * 4); - - // Create an Int32List to copy the morph indices to - var idxList = td.Int32List.fromList(indices); - - // Copy the morph indices to WASM - _module!.writeArrayToMemory( - idxList.buffer.asUint8List(idxList.offsetInBytes).toJS, idxPtr); - bool result = false; - try { - var jsResult = _module!.ccall( - "set_morph_animation", - "bool", - [ - "void*".toJS, - "int".toJS, - "float*".toJS, - "int*".toJS, - "int".toJS, - "int".toJS, - "float".toJS - ].toJS, - [ - _sceneManager!, - meshEntity.toJS, - dataPtr, - idxPtr, - indices.length.toJS, - animation.numFrames.toJS, - animation.frameLengthInMs.toJS - ].toJS, - null); - _logger.info("Got jsResult $jsResult"); - result = (jsResult as JSNumber).toDartInt == 1; - } catch (err, st) { - _logger.severe(err); - _logger.severe(st); - } - - // Free the memory allocated in WASM - _module!._free(dataPtr); - _module!._free(idxPtr); - - if (!result) { - throw Exception("Failed to set morph animation data for ${meshName}"); - } - } - } - - @override - Future setPosition( - ThermionEntity entity, double x, double y, double z) async { - _module!.ccall( - "set_position", - "void", - ["void*".toJS, "int".toJS, "float".toJS, "float".toJS, "float".toJS] - .toJS, - [_sceneManager!, entity.toJS, x.toJS, y.toJS, z.toJS].toJS, - null); - } - - @override - Future setPostProcessing(bool enabled) async { - _module!.ccall("set_post_processing", "void", - ["void*".toJS, "bool".toJS].toJS, [_viewer!, enabled.toJS].toJS, null); - } - - @override - Future setRotation( - ThermionEntity entity, double rads, double x, double y, double z) async { - var quaternion = Quaternion.axisAngle(Vector3(x, y, z), rads); - _module!.ccall( - "set_rotation", - "void", - [ - "void*".toJS, - "int".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS - ].toJS, - [ - _sceneManager!, - entity.toJS, - quaternion.radians.toJS, - quaternion.x.toJS, - quaternion.y.toJS, - quaternion.z.toJS, - quaternion.w.toJS - ].toJS, - null); - } - - @override - Future setRotationQuat(ThermionEntity entity, Quaternion rotation) async { - _module!.ccall( - "set_rotation", - "void", - [ - "void*".toJS, - "int".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS - ].toJS, - [ - _sceneManager!, - entity.toJS, - rotation.radians.toJS, - rotation.x.toJS, - rotation.y.toJS, - rotation.z.toJS, - rotation.w.toJS - ].toJS, - null); - } - - final _onDispose = []; - - /// - /// - /// - void onDispose(Future Function() callback) { - _onDispose.add(callback); - } - - @override - Future clearBackgroundImage() async { - _module!.ccall("clear_background_image", "void", ["void*".toJS].toJS, - [_viewer!].toJS, null); - } - - @override - Future clearEntities() async { - _module!.ccall( - "clear_entities", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); - } - - @override - Future clearLights() async { - _module!.ccall( - "clear_lights", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); - } - - @override - Future createGeometry(Geometry geometry, - {MaterialInstance? materialInstance, - bool keepData = false, - PrimitiveType primitiveType = PrimitiveType.TRIANGLES}) async { - final verticesData = td.Float32List.fromList(geometry.vertices); - final indicesData = Uint16List.fromList(geometry.indices); - final verticesPtr = _module!._malloc(verticesData.lengthInBytes); - final indicesPtr = _module!._malloc(indicesData.lengthInBytes); - _module!.writeArrayToMemory( - verticesData.buffer.asUint8List().toJS, verticesPtr); - _module! - .writeArrayToMemory(indicesData.buffer.asUint8List().toJS, indicesPtr); - - final entityId = _module!.ccall( - "create_geometry", - "int", - [ - "void*".toJS, - "float*".toJS, - "int".toJS, - "uint16_t*".toJS, - "int".toJS, - "int".toJS, - "string".toJS - ].toJS, - [ - _viewer!, - verticesPtr, - verticesData.length.toJS, - indicesPtr, - indicesData.length.toJS, - primitiveType.index.toJS, - (materialInstance as ThermionWasmMaterialInstance?)?.pointer.toJS ?? "".toJS, - ].toJS, - null) as JSNumber; - - _module!._free(verticesPtr); - _module!._free(indicesPtr); - - if (entityId.toDartInt == -1) { - throw Exception("Failed to create geometry"); - } - return entityId.toDartInt; - } - - @override - Future createInstance(ThermionEntity entity) async { - final result = _module!.ccall( - "create_instance", - "int", - ["void*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null) as JSNumber; - if (result.toDartInt == -1) { - throw Exception("Failed to create instance of entity ${entity}"); - } - return result.toDartInt; - } - - @override - Future getAnimationDuration( - ThermionEntity entity, int animationIndex) async { - final result = _module!.ccall( - "get_animation_duration", - "float", - ["void*".toJS, "int".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS, animationIndex.toJS].toJS, - null) as JSNumber; - return result.toDartDouble; - } - - @override - Future getAnimationCount(ThermionEntity entity) async { - final animationCount = _module!.ccall( - "get_animation_count", - "int", - ["void*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null) as JSNumber; - return animationCount.toDartInt; - } - - @override - Future> getAnimationNames(ThermionEntity entity) async { - final animationCount = await getAnimationCount(entity); - final names = []; - for (int i = 0; i < animationCount; i++) { - final namePtr = _module!._malloc(256); - _module!.ccall( - "get_animation_name", - "void", - ["void*".toJS, "int".toJS, "char*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS, namePtr, i.toJS].toJS, - null); - names.add(_module!.UTF8ToString(namePtr).toDart); - _module!._free(namePtr); - } - return names; - } - - @override - Future getCameraCullingFar() async { - final result = _module!.ccall("get_camera_culling_far", "double", - ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber; - return result.toDartDouble; - } - - @override - Future getCameraCullingNear() async { - final result = _module!.ccall("get_camera_culling_near", "double", - ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber; - return result.toDartDouble; - } - - @override - Future getCameraCullingProjectionMatrix() async { - final ptr = _module!._malloc(16 * 8); - _module!.ccall("get_camera_culling_projection_matrix", "void", - ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null); - final matrix = Matrix4.zero(); - for (int i = 0; i < 16; i++) { - matrix[i] = (_module!.getValue((ptr.toDartInt + (i * 8)).toJS, "double") - as JSNumber) - .toDartDouble; - } - _module!._free(ptr); - return matrix; - } - - @override - Future getCameraFrustum() async { - final ptr = _module!._malloc(24 * 8); - _module!.ccall("get_camera_frustum", "void", - ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null); - final planes = List.generate(6, (i) { - final offset = i * 4; - return Plane() - ..setFromComponents( - (_module!.getValue((ptr.toDartInt + (offset * 8)).toJS, "double") - as JSNumber) - .toDartDouble, - (_module!.getValue( - (ptr.toDartInt + ((offset + 1) * 8)).toJS, "double") - as JSNumber) - .toDartDouble, - (_module!.getValue( - (ptr.toDartInt + ((offset + 2) * 8)).toJS, "double") - as JSNumber) - .toDartDouble, - (_module!.getValue( - (ptr.toDartInt + ((offset + 3) * 8)).toJS, "double") - as JSNumber) - .toDartDouble); - }); - _module!._free(ptr); - throw UnimplementedError(); - // return Frustum()..plane0 = planes[0]..plane1 =planes[1]..plane2 =planes[2]..plane3 =planes[3], planes[4], planes[5]); - } - - @override - Future getCameraModelMatrix() async { - final ptr = _module!.ccall("get_camera_model_matrix", "void*", - ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber; - final matrix = _matrixFromPtr(ptr); - _module!.ccall( - "thermion_flutter_free", "void", ["void*".toJS].toJS, [ptr].toJS, null); - - return matrix; - } - - @override - Future getCameraPosition() async { - final ptr = _module!._malloc(3 * 8); - _module!.ccall("get_camera_position", "void", - ["void*".toJS, "void*".toJS].toJS, [_viewer!, ptr].toJS, null); - final pos = Vector3( - (_module!.getValue(ptr.toDartInt.toJS, "double") as JSNumber) - .toDartDouble, - (_module!.getValue((ptr.toDartInt + 8).toJS, "double") as JSNumber) - .toDartDouble, - (_module!.getValue((ptr.toDartInt + 16).toJS, "double") as JSNumber) - .toDartDouble); - _module!._free(ptr); - return pos; - } - - @override - Future getCameraProjectionMatrix() async { - final ptr = _module!._malloc(16 * 8); - _module!.ccall("get_camera_projection_matrix", "void", - ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null); - final matrix = _matrixFromPtr(ptr); - _module!._free(ptr); - return matrix; - } - - @override - Future getCameraRotation() async { - final model = await getCameraModelMatrix(); - final rotation = model.getRotation(); - return rotation; - } - - @override - Future getCameraViewMatrix() async { - final ptr = _module!._malloc(16 * 8); - _module!.ccall("get_camera_view_matrix", "void", - ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null); - final matrix = Matrix4.zero(); - for (int i = 0; i < 16; i++) { - matrix[i] = (_module!.getValue((ptr.toDartInt + (i * 8)).toJS, "double") - as JSNumber) - .toDartDouble; - } - _module!._free(ptr); - return matrix; - } - - @override - Future getInstanceCount(ThermionEntity entity) async { - final result = _module!.ccall( - "get_instance_count", - "int", - ["void*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null) as JSNumber; - return result.toDartInt; - } - - @override - Future> getInstances(ThermionEntity entity) async { - final instanceCount = await getInstanceCount(entity); - final buf = _module!._malloc(instanceCount * 4); - _module!.ccall( - "get_instances", - "void", - ["void*".toJS, "int".toJS, "int*".toJS].toJS, - [_sceneManager!, entity.toJS, buf].toJS, - null); - final instances = []; - for (int i = 0; i < instanceCount; i++) { - final instanceId = - _module!.getValue((buf.toDartInt + (i * 4)).toJS, "i32") as JSNumber; - instances.add(instanceId.toDartInt); - } - _module!._free(buf); - return instances; - } - - @override - Future getInverseBindMatrix(ThermionEntity parent, int boneIndex, - {int skinIndex = 0}) async { - final ptr = _module!._malloc(16 * 4); - _module!.ccall( - "get_inverse_bind_matrix", - "void", - ["void*".toJS, "int".toJS, "int".toJS, "int".toJS, "float*".toJS].toJS, - [_sceneManager!, parent.toJS, skinIndex.toJS, boneIndex.toJS, ptr].toJS, - null); - final matrix = _matrixFromPtr(ptr); - _module!._free(ptr); - return matrix; - } - - @override - Future getLocalTransform(ThermionEntity entity) async { - final ptr = _module!._malloc(16 * 4); - _module!.ccall( - "get_local_transform", - "void", - ["void*".toJS, "int".toJS, "float*".toJS].toJS, - [_sceneManager!, entity.toJS, ptr].toJS, - null); - final matrix = _matrixFromPtr(ptr); - _module!._free(ptr); - return matrix; - } - - @override - Future moveCameraToAsset(ThermionEntity entity) async { - _module!.ccall("move_camera_to_asset", "void", - ["void*".toJS, "int".toJS].toJS, [_viewer!, entity.toJS].toJS, null); - } - - @override - Future panEnd() async { - _module! - .ccall("grab_end", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); - } - - @override - Future panStart(double x, double y) async { - _module!.ccall( - "grab_begin", - "void", - ["void*".toJS, "float".toJS, "float".toJS, "bool".toJS].toJS, - [_viewer!, x.toJS, y.toJS, true.toJS].toJS, - null); - } - - @override - Future panUpdate(double x, double y) async { - _module!.ccall( - "grab_update", - "void", - ["void*".toJS, "float".toJS, "float".toJS].toJS, - [_viewer!, x.toJS, y.toJS].toJS, - null); - } - - late JSNumber _pickCallbackPtr; - - void _onPickCallback(ThermionEntity entity, int x, int y) { - _pickResultController - .add((entity: entity, x: x.toDouble(), y: y.toDouble())); - } - - @override - void pick(int x, int y) async { - x = (x * pixelRatio).ceil(); - y = (viewportDimensions.$2 - (y * pixelRatio)).ceil(); - _module!.ccall( - "filament_pick", - "void", - ["void*".toJS, "int".toJS, "int".toJS, "void*".toJS].toJS, - [_viewer!, x.toJS, y.toJS, _pickCallbackPtr].toJS, - null); - } - - @override - Future playAnimationByName(ThermionEntity entity, String name, - {bool loop = false, - bool reverse = false, - bool replaceActive = true, - double crossfade = 0.0}) async { - final animationNames = await getAnimationNames(entity); - final index = animationNames.indexOf(name); - if (index == -1) { - throw Exception("Animation ${name} not found."); - } - return playAnimation(entity, index, - loop: loop, - reverse: reverse, - replaceActive: replaceActive, - crossfade: crossfade); - } - - @override - Future queuePositionUpdate( - ThermionEntity entity, double x, double y, double z, - {bool relative = false}) async { - _module!.ccall( - "queue_position_update", - "void", - [ - "void*".toJS, - "int".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "bool".toJS - ].toJS, - [_sceneManager!, entity.toJS, x.toJS, y.toJS, z.toJS, relative.toJS] - .toJS, - null); - } - - @override - Future queueRotationUpdate( - ThermionEntity entity, double rads, double x, double y, double z, - {bool relative = false}) async { - _module!.ccall( - "queue_rotation_update", - "void", - [ - "void*".toJS, - "int".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "bool".toJS - ].toJS, - [ - _sceneManager!, - entity.toJS, - rads.toJS, - x.toJS, - y.toJS, - z.toJS, - relative.toJS - ].toJS, - null); - } - - @override - Future queueRotationUpdateQuat(ThermionEntity entity, Quaternion quat, - {bool relative = false}) async { - _module!.ccall( - "queue_rotation_update", - "void", - [ - "void*".toJS, - "int".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "bool".toJS - ].toJS, - [ - _sceneManager!, - entity.toJS, - quat.radians.toJS, - quat.x.toJS, - quat.y.toJS, - quat.z.toJS, - relative.toJS - ].toJS, - null); - } - - @override - Future removeAnimationComponent(ThermionEntity entity) async { - _module!.ccall( - "remove_animation_component", - "void", - ["void*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null); - } - - @override - Future removeCollisionComponent(ThermionEntity entity) async { - _module!.ccall( - "remove_collision_component", - "void", - ["void*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null); - } - - @override - Future removeEntity(ThermionEntity entity) async { - _module!.ccall("remove_entity", "void", ["void*".toJS, "int".toJS].toJS, - [_viewer!, entity.toJS].toJS, null); - } - - @override - Future removeIbl() async { - _module!.ccall( - "remove_ibl", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); - } - - @override - Future removeLight(ThermionEntity light) async { - _module!.ccall("remove_light", "void", ["void*".toJS, "int".toJS].toJS, - [_viewer!, light.toJS].toJS, null); - } - - @override - Future removeSkybox() async { - _module!.ccall( - "remove_skybox", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); - } - - @override - Future resetBones(ThermionEntity entity) async { - _module!.ccall( - "reset_to_rest_pose", - "void", - ["void*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null); - } - - @override - Future reveal(ThermionEntity entity, String? meshName) async { - final result = _module!.ccall( - "reveal_mesh", - "int", - ["void*".toJS, "int".toJS, "string".toJS].toJS, - [_sceneManager!, entity.toJS, meshName?.toJS].toJS, - null) as JSNumber; - if (result.toDartInt == -1) { - throw Exception( - "Failed to reveal mesh ${meshName} on entity ${entity.toJS}"); - } - } - - @override - Future rotateIbl(Matrix3 rotation) async { - final ptr = _module!._malloc(9 * 4); - for (int i = 0; i < 9; i++) { - _module!.setValue( - (ptr.toDartInt + (i * 4)).toJS, rotation.storage[i].toJS, "float"); - } - _module!.ccall("rotate_ibl", "void", ["void*".toJS, "float*".toJS].toJS, - [_viewer!, ptr].toJS, null); - _module!._free(ptr); - } - - @override - Future rotateStart(double x, double y) async { - _module!.ccall( - "grab_begin", - "void", - ["void*".toJS, "float".toJS, "float".toJS, "bool".toJS].toJS, - [_viewer!, x.toJS, y.toJS, false.toJS].toJS, - null); - } - - @override - Future rotateUpdate(double x, double y) async { - _module!.ccall( - "grab_update", - "void", - ["void*".toJS, "float".toJS, "float".toJS].toJS, - [_viewer!, x.toJS, y.toJS].toJS, - null); - } - - @override - Future rotateEnd() async { - _module! - .ccall("grab_end", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); - } - - @override - Future setAnimationFrame( - ThermionEntity entity, int index, int animationFrame) async { - _module!.ccall( - "set_animation_frame", - "void", - ["void*".toJS, "int".toJS, "int".toJS, "int".toJS].toJS, - [ - _sceneManager!, - entity.toJS, - index.toJS, - animationFrame.toJS, - ].toJS, - null); - } - - @override - Future setBackgroundImage(String path, {bool fillHeight = false}) async { - _module!.ccall( - "set_background_image", - "void", - ["void*".toJS, "string".toJS, "bool".toJS].toJS, - [_viewer!, path.toJS, fillHeight.toJS].toJS, - null); - } - - @override - Future setBackgroundImagePosition(double x, double y, - {bool clamp = false}) async { - _module!.ccall( - "set_background_image_position", - "void", - ["void*".toJS, "float".toJS, "float".toJS, "bool".toJS].toJS, - [_viewer!, x.toJS, y.toJS, clamp.toJS].toJS, - null); - } - - @override - Future setBloom(double bloom) async { - _module!.ccall("set_bloom", "void", ["void*".toJS, "float".toJS].toJS, - [_viewer!, bloom.toJS].toJS, null); - } - - @override - Future setBoneTransform( - ThermionEntity entity, int boneIndex, Matrix4 transform, - {int skinIndex = 0}) async { - final ptr = _module!._malloc(16 * 4); - for (int i = 0; i < 16; i++) { - _module!.setValue( - (ptr.toDartInt + (i * 4)).toJS, transform.storage[i].toJS, "float"); - } - final result = _module!.ccall( - "set_bone_transform", - "bool", - ["void*".toJS, "int".toJS, "int".toJS, "int".toJS, "float*".toJS].toJS, - [_sceneManager!, entity.toJS, skinIndex.toJS, boneIndex.toJS, ptr].toJS, - null) as JSBoolean; - _module!._free(ptr); - if (!result.toDart) { - throw Exception("Failed to set bone transform"); - } - } - - @override - Future setCamera(ThermionEntity entity, String? name) async { - final result = _module!.ccall( - "set_camera", - "bool", - ["void*".toJS, "int".toJS, "string".toJS].toJS, - [_viewer!, entity.toJS, (name ?? "").toJS].toJS, - null) as JSBoolean; - if (!result.toDart) { - throw Exception("Failed to set camera to entity ${entity}"); - } - } - - @override - Future setCameraCulling(double near, double far) async { - _module!.ccall( - "set_camera_culling", - "void", - ["void*".toJS, "double".toJS, "double".toJS].toJS, - [_viewer!, near.toJS, far.toJS].toJS, - null); - } - - @override - Future setCameraExposure( - double aperture, double shutterSpeed, double sensitivity) async { - _module!.ccall( - "set_camera_exposure", - "void", - ["void*".toJS, "float".toJS, "float".toJS, "float".toJS].toJS, - [ - _viewer!, - aperture.toJS, - shutterSpeed.toJS, - sensitivity.toJS, - ].toJS, - null); - } - - @override - Future setCameraFocalLength(double focalLength) async { - _module!.ccall( - "set_camera_focal_length", - "void", - ["void*".toJS, "float".toJS].toJS, - [_viewer!, focalLength.toJS].toJS, - null); - } - - @override - Future setCameraFocusDistance(double focusDistance) async { - _module!.ccall( - "set_camera_focus_distance", - "void", - ["void*".toJS, "float".toJS].toJS, - [_viewer!, focusDistance.toJS].toJS, - null); - } - - @override - Future setCameraFov(double degrees, {bool horizontal = true}) async { - _module!.ccall( - "set_camera_fov", - "void", - ["void*".toJS, "float".toJS, "bool".toJS].toJS, - [_viewer!, degrees.toJS, horizontal.toJS].toJS, - null); - } - - @override - Future setCameraManipulatorOptions( - {ManipulatorMode mode = ManipulatorMode.ORBIT, - double orbitSpeedX = 0.01, - double orbitSpeedY = 0.01, - double zoomSpeed = 0.01}) async { - _module!.ccall( - "set_camera_manipulator_options", - "void", - ["void*".toJS, "int".toJS, "double".toJS, "double".toJS, "double".toJS] - .toJS, - [ - _viewer!, - mode.index.toJS, - orbitSpeedX.toJS, - orbitSpeedY.toJS, - zoomSpeed.toJS - ].toJS, - null); - } - - @override - Future setCameraModelMatrix(List matrix) async { - assert(matrix.length == 16, "Matrix must have 16 elements"); - final ptr = _module!._malloc(16 * 8); - for (int i = 0; i < 16; i++) { - _module! - .setValue((ptr.toDartInt + (i * 8)).toJS, matrix[i].toJS, "double"); - } - _module!.ccall("set_camera_model_matrix", "void", - ["void*".toJS, "float*".toJS].toJS, [_viewer!, ptr].toJS, null); - _module!._free(ptr); - } - - @override - Future setFrameRate(int framerate) async { - _module!.ccall( - "set_frame_interval", - "void", - ["void*".toJS, "float".toJS].toJS, - [_viewer!, (1 / framerate).toJS].toJS, - null); - } - - @override - Future setMainCamera() async { - _module!.ccall( - "set_main_camera", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); - } - - @override - Future setMaterialColor(ThermionEntity entity, String meshName, - int materialIndex, double r, double g, double b, double a) async { - final result = _module!.ccall( - "set_material_color", - "bool", - [ - "void*".toJS, - "int".toJS, - "string".toJS, - "int".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS - ].toJS, - [ - _sceneManager!, - entity.toJS, - meshName.toJS, - materialIndex.toJS, - r.toJS, - g.toJS, - b.toJS, - a.toJS - ].toJS, - null) as JSBoolean; - if (!result.toDart) { - throw Exception("Failed to set material color"); - } - } - - @override - Future setMorphTargetWeights( - ThermionEntity entity, List weights) async { - final numWeights = weights.length; - final ptr = _module!._malloc(numWeights * 4); - for (int i = 0; i < numWeights; i++) { - _module! - .setValue((ptr.toDartInt + (i * 4)).toJS, weights[i].toJS, "float"); - } - final result = _module!.ccall( - "set_morph_target_weights", - "bool", - ["void*".toJS, "int".toJS, "float*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS, ptr, numWeights.toJS].toJS, - null) as JSBoolean; - _module!._free(ptr); - if (!result.toDart) { - throw Exception("Failed to set morph target weights"); - } - } - - @override - Future setParent(ThermionEntity child, ThermionEntity parent, - {bool preserveScaling = false}) async { - _module!.ccall( - "set_parent", - "void", - ["void*".toJS, "int".toJS, "int".toJS, "bool".toJS].toJS, - [_sceneManager!, child.toJS, parent.toJS, preserveScaling.toJS].toJS, - null); - } - - @override - Future setPriority(ThermionEntity entityId, int priority) { - // TODO: implement setPriority - throw UnimplementedError(); - } - - @override - Future setRecording(bool recording) async { - _module!.ccall("set_recording", "void", ["void*".toJS, "bool".toJS].toJS, - [_viewer!, recording.toJS].toJS, null); - } - - @override - Future setRecordingOutputDirectory(String outputDirectory) async { - _module!.ccall( - "set_recording_output_directory", - "void", - ["void*".toJS, "string".toJS].toJS, - [_viewer!, outputDirectory.toJS].toJS, - null); - } - - Timer? _renderLoop; - - @override - Future setRendering(bool render) async { - if (render && !_rendering) { - _rendering = true; - _renderLoop = Timer.periodic(Duration(microseconds: 16667), (_) { - this.render(); - }); - } else if (!render && _rendering) { - _rendering = false; - _renderLoop?.cancel(); - _renderLoop = null; - } - } - - @override - Future setScale(ThermionEntity entity, double scale) async { - _module!.ccall( - "set_scale", - "void", - ["void*".toJS, "int".toJS, "float".toJS].toJS, - [_sceneManager!, entity.toJS, scale.toJS].toJS, - null); - } - - @override - Future setToneMapping(ToneMapper mapper) async { - _module!.ccall("set_tone_mapping", "void", ["void*".toJS, "int".toJS].toJS, - [_viewer!, mapper.index.toJS].toJS, null); - } - - @override - Future setTransform(ThermionEntity entity, Matrix4 transform) async { - final ptr = _module!._malloc(16 * 4); - for (int i = 0; i < 16; i++) { - _module!.setValue( - (ptr.toDartInt + (i * 4)).toJS, transform.storage[i].toJS, "float"); - } - final result = _module!.ccall( - "set_transform", - "bool", - ["void*".toJS, "int".toJS, "float*".toJS].toJS, - [_sceneManager!, entity.toJS, ptr].toJS, - null) as JSBoolean; - _module!._free(ptr); - if (!result.toDart) { - throw Exception("Failed to set transform"); - } - } - - @override - Future setViewFrustumCulling(bool enabled) async { - _module!.ccall("set_view_frustum_culling", "void", - ["void*".toJS, "bool".toJS].toJS, [_viewer!, enabled.toJS].toJS, null); - } - - @override - Future stopAnimation(ThermionEntity entity, int animationIndex) async { - _module!.ccall( - "stop_animation", - "void", - ["void*".toJS, "int".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS, animationIndex.toJS].toJS, - null); - } - - @override - Future stopAnimationByName(ThermionEntity entity, String name) async { - final namePtr = _allocateString(name); - _module!.ccall( - "stop_animation_by_name", - "void", - ["void*".toJS, "int".toJS, "char*".toJS].toJS, - [_sceneManager!, entity.toJS, namePtr].toJS, - null); - _module!._free(namePtr); - } - - @override - Future testCollisions(ThermionEntity entity) async { - final result = _module!.ccall( - "test_collisions", - "bool", - ["void*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null) as JSBoolean; - return result.toDart; - } - - @override - Future transformToUnitCube(ThermionEntity entity) async { - _module!.ccall( - "transform_to_unit_cube", - "void", - ["void*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null); - } - - @override - Future updateBoneMatrices(ThermionEntity entity) async { - _module!.ccall( - "update_bone_matrices", - "void", - ["void*".toJS, "int".toJS].toJS, - [_sceneManager!, entity.toJS].toJS, - null); - } - - @override - Future zoomBegin() async { - _module!.ccall( - "scroll_begin", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); - } - - @override - Future zoomEnd() async { - _module!.ccall( - "scroll_end", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); - } - - @override - Future zoomUpdate(double x, double y, double z) async { - _module!.ccall( - "scroll_update", - "void", - ["void*".toJS, "float".toJS, "float".toJS, "float".toJS].toJS, - [_viewer!, x.toJS, y.toJS, z.toJS].toJS, - null); - } - -// Helper method to allocate a string in the WASM memory - JSNumber _allocateString(String str) { - final bytes = utf8.encode(str); - final ptr = _module!._malloc(bytes.length + 1); - for (var i = 0; i < bytes.length; i++) { - _module!.setValue((ptr.toDartInt + i).toJS, bytes[i].toJS, "i8"); - } - _module!.setValue( - (ptr.toDartInt + bytes.length).toJS, 0.toJS, "i8"); // Null terminator - return ptr; - } - - @override - Future setShadowType(ShadowType shadowType) async { - _module!.ccall("set_shadow_type", "void", ["void*".toJS, "int".toJS].toJS, - [_viewer!, shadowType.index.toJS].toJS, null); - } - - @override - Future setShadowsEnabled(bool enabled) async { - _module!.ccall("set_shadows_enabled", "void", - ["void*".toJS, "bool".toJS].toJS, [_viewer!, enabled.toJS].toJS, null); - } - - @override - Future setSoftShadowOptions( - double penumbraScale, double penumbraRatioScale) async { - _module!.ccall( - "set_soft_shadow_options", - "void", - ["void*".toJS, "float".toJS, "float".toJS].toJS, - [_viewer!, penumbraScale.toJS, penumbraRatioScale.toJS].toJS, - null); - } - - @override - Future getBoundingBox(ThermionEntity entity) { - var minX = _module!._malloc(4); - var minY = _module!._malloc(4); - var maxX = _module!._malloc(4); - var maxY = _module!._malloc(4); - _module!.ccall( - "get_bounding_box_to_out", - "void", - [ - "void*".toJS, - "int".toJS, - "float*".toJS, - "float*".toJS, - "float*".toJS, - "float*".toJS - ].toJS, - [_sceneManager!, entity.toJS, minX, minY, maxX, maxY].toJS, - null); - - final min = Vector2( - (_module!.getValue(minX, "float") as JSNumber).toDartDouble, - (_module!.getValue(minY, "float") as JSNumber).toDartDouble); - final max = Vector2( - (_module!.getValue(maxX, "float") as JSNumber).toDartDouble, - (_module!.getValue(maxY, "float") as JSNumber).toDartDouble); - - final box = Aabb2.minMax(min, max); - _module!._free(minX); - _module!._free(minY); - _module!._free(maxX); - _module!._free(maxY); - - return Future.value(box); - } - - @override - Future getCameraFov(bool horizontal) async { - var fov = _module!.ccall( - "get_camera_fov", - "float", - ["void*".toJS, "bool".toJS].toJS, - [_viewer!, horizontal.toJS].toJS, - null); - return (fov as JSNumber).toDartDouble; - } - - @override - Future queueRelativePositionUpdateWorldAxis(ThermionEntity entity, - double viewportX, double viewportY, double x, double y, double z) async { - _module!.ccall( - "queue_relative_position_update_world_axis", - "void", - [ - "void*".toJS, - "int".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS, - "float".toJS - ].toJS, - [ - _sceneManager!, - entity.toJS, - viewportX.toJS, - viewportY.toJS, - x.toJS, - y.toJS, - z.toJS - ].toJS, - null); - } - - @override - Future setLayerEnabled(int layer, bool enabled) async { - _module!.ccall( - "set_layer_visibility", - "void", - [ - "void*".toJS, - "int".toJS, - "bool".toJS, - ].toJS, - [ - _sceneManager!, - layer.toJS, - enabled.toJS, - ].toJS, - null); - } - - @override - Future createIbl(double r, double g, double b, double intensity) async { - _module!.ccall( - "create_ibl", - "void", - [ - "void*".toJS, - "double".toJS, - "double".toJS, - "double".toJS, - "double".toJS, - ].toJS, - [_sceneManager!, r.toJS, g.toJS, b.toJS, intensity.toJS].toJS, - null); - } - - late JSNumber _pickGizmoCallbackPtr; - - void _onPickGizmoCallback(ThermionEntity entity, int x, int y) { - _gizmoPickResultController - .add((entity: entity, x: x.toDouble(), y: y.toDouble())); - } - - @override - void pickGizmo(int x, int y) { - x = (x * pixelRatio).ceil(); - y = (viewportDimensions.$2 - (y * pixelRatio)).ceil(); - - _module!.ccall( - "pick_gizmo", - "void", - [ - "void*".toJS, - "int".toJS, - "int".toJS, - "void*".toJS, - ].toJS, - [_sceneManager!, x.toJS, y.toJS, _pickGizmoCallbackPtr].toJS, - null); - } - - @override - Future setGizmoVisibility(bool visible) async { - _module!.ccall( - "set_gizmo_visibility", - "void", - [ - "void*".toJS, - "bool".toJS, - ].toJS, - [_sceneManager!, visible.toJS].toJS, - null); - } - - @override - Future setLightDirection( - ThermionEntity lightEntity, Vector3 direction) async { - direction.normalize(); - _module!.ccall( - "set_light_direction", - "void", - ["void*".toJS, "double".toJS, "double".toJS, "double".toJS].toJS, - [_viewer!, direction.x.toJS, direction.y.toJS, direction.z.toJS].toJS, - null); - } - - @override - Future setLightPosition( - ThermionEntity lightEntity, double x, double y, double z) async { - _module!.ccall( - "set_light_position", - "void", - ["void*".toJS, "double".toJS, "double".toJS, "double".toJS].toJS, - [_viewer!, x.toJS, y.toJS, z.toJS].toJS, - null); - } - - @override - Future getAncestor(ThermionEntity entity) { - // TODO: implement getAncestor - throw UnimplementedError(); - } - - @override - Future queuePositionUpdateFromViewportCoords( - ThermionEntity entity, double x, double y) { - // TODO: implement queuePositionUpdateFromViewportCoords - throw UnimplementedError(); - } - - @override - Future removeStencilHighlight(ThermionEntity entity) { - // TODO: implement removeStencilHighlight - throw UnimplementedError(); - } - - @override - Future setStencilHighlight(ThermionEntity entity, - {double r = 1.0, double g = 0.0, double b = 0.0}) { - // TODO: implement setStencilHighlight - throw UnimplementedError(); - } - - @override - // TODO: implement entitiesAdded - Stream get entitiesAdded => throw UnimplementedError(); - - @override - // TODO: implement entitiesRemoved - Stream get entitiesRemoved => throw UnimplementedError(); - - @override - Future getCameraNear() { - // TODO: implement getCameraNear - throw UnimplementedError(); - } - - @override - Future getViewportBoundingBox(ThermionEntity entity) { - // TODO: implement getViewportBoundingBox - throw UnimplementedError(); - } - - @override - // TODO: implement lightsAdded - Stream get lightsAdded => throw UnimplementedError(); - - @override - // TODO: implement lightsRemoved - Stream get lightsRemoved => throw UnimplementedError(); - - @override - Future setCameraModelMatrix4(Matrix4 matrix) { - // TODO: implement setCameraModelMatrix4 - throw UnimplementedError(); - } - - @override - Future setMaterialPropertyFloat(ThermionEntity entity, String propertyName, - int materialIndex, double value) { - // TODO: implement setMaterialPropertyFloat - throw UnimplementedError(); - } - - @override - Future setMaterialPropertyFloat4(ThermionEntity entity, String propertyName, - int materialIndex, double f1, double f2, double f3, double f4) { - // TODO: implement setMaterialPropertyFloat4 - throw UnimplementedError(); - } - - @override - Future addDirectLight(DirectLight light) { - // TODO: implement addDirectLight - throw UnimplementedError(); - } - - @override - Future applyTexture(covariant ThermionTexture texture, ThermionEntity entity, - {int materialIndex = 0, String parameterName = "baseColorMap"}) { - // TODO: implement applyTexture - throw UnimplementedError(); - } - - @override - Future createTexture(td.Uint8List data) { - // TODO: implement createTexture - throw UnimplementedError(); - } - - @override - Future createUbershaderMaterialInstance( - {bool doubleSided = false, - bool unlit = false, - bool hasVertexColors = false, - bool hasBaseColorTexture = false, - bool hasNormalTexture = false, - bool hasOcclusionTexture = false, - bool hasEmissiveTexture = false, - bool useSpecularGlossiness = false, - AlphaMode alphaMode = AlphaMode.OPAQUE, - bool enableDiagnostics = false, - bool hasMetallicRoughnessTexture = false, - int metallicRoughnessUV = 0, - int baseColorUV = 0, - bool hasClearCoatTexture = false, - int clearCoatUV = 0, - bool hasClearCoatRoughnessTexture = false, - int clearCoatRoughnessUV = 0, - bool hasClearCoatNormalTexture = false, - int clearCoatNormalUV = 0, - bool hasClearCoat = false, - bool hasTransmission = false, - bool hasTextureTransforms = false, - int emissiveUV = 0, - int aoUV = 0, - int normalUV = 0, - bool hasTransmissionTexture = false, - int transmissionUV = 0, - bool hasSheenColorTexture = false, - int sheenColorUV = 0, - bool hasSheenRoughnessTexture = false, - int sheenRoughnessUV = 0, - bool hasVolumeThicknessTexture = false, - int volumeThicknessUV = 0, - bool hasSheen = false, - bool hasIOR = false, - bool hasVolume = false}) { - // TODO: implement createUbershaderMaterialInstance - throw UnimplementedError(); - } - - @override - Future createUnlitMaterialInstance() { - // TODO: implement createUnlitMaterialInstance - throw UnimplementedError(); - } - - @override - Future destroyMaterialInstance(covariant MaterialInstance materialInstance) { - // TODO: implement destroyMaterialInstance - throw UnimplementedError(); - } - - @override - Future destroyTexture(covariant ThermionTexture texture) { - // TODO: implement destroyTexture - throw UnimplementedError(); - } - - @override - Future getMainCameraEntity() async { - final entityId = _module!.ccall( - "get_main_camera", "int", ["void*".toJS].toJS, [_viewer].toJS, null) - as JSNumber; - if (entityId.toDartInt == -1) { - throw Exception("Failed to get main camera"); - } - return entityId.toDartInt; - } - - @override - Future getMaterialInstanceAt( - ThermionEntity entity, int index) { - // TODO: implement getMaterialInstanceAt - throw UnimplementedError(); - } - - @override - Future requestFrame() async { - // TODO: implement requestFrame - } - - @override - // TODO: implement sceneUpdated - Stream get sceneUpdated => throw UnimplementedError(); - - @override - Future setLayerVisibility(int layer, bool visible) { - // TODO: implement setLayerVisibility - throw UnimplementedError(); - } - - @override - Future setMaterialPropertyInt(ThermionEntity entity, String propertyName, - int materialIndex, int value) { - // TODO: implement setMaterialPropertyInt - throw UnimplementedError(); - } - - @override - Future setVisibilityLayer(ThermionEntity entity, int layer) { - // TODO: implement setVisibilityLayer - throw UnimplementedError(); - } +// import 'dart:async'; +// import 'dart:js_interop'; +// import 'dart:js_interop_unsafe'; +// import 'dart:math'; +// import 'dart:typed_data' as td; +// import 'dart:typed_data'; +// import 'package:logging/logging.dart'; +// import 'package:web/web.dart'; +// import 'package:animation_tools_dart/animation_tools_dart.dart'; + +// import 'package:vector_math/vector_math_64.dart'; +// import 'package:http/http.dart' as http; +// import 'dart:convert'; +// import '../../shared_types/internal/gizmo.dart'; +// import '../../shared_types/internal/gizmo.dart'; +// import '../../../viewer.dart'; +// import '../../events.dart'; +// import '../../shared_types/camera.dart'; +// import 'camera.dart'; +// import 'material_instance.dart'; + +// extension type _EmscriptenModule(JSObject _) implements JSObject { +// external JSAny? ccall(String name, String returnType, +// JSArray argTypes, JSArray args, JSAny? opts); + +// external JSNumber _malloc(int numBytes); +// external void _free(JSNumber addr); +// external JSNumber stackAlloc(int numBytes); + +// external JSAny getValue(JSNumber addr, String llvmType); +// external void setValue(JSNumber addr, JSNumber value, String llvmType); + +// external JSString intArrayToString(JSAny ptr); +// external JSString UTF8ToString(JSAny ptr); +// external void stringToUTF8( +// JSString str, JSNumber ptr, JSNumber maxBytesToWrite); +// external void writeArrayToMemory(JSUint8Array data, JSNumber ptr); + +// external JSNumber addFunction(JSFunction f, String signature); +// external void removeFunction(JSNumber f); +// external JSAny get ALLOC_STACK; +// external JSAny get HEAPU32; +// external JSAny get HEAP32; +// } + +// typedef ThermionViewerImpl = ThermionViewerWasm; + +// /// +// /// A [ThermionViewer] implementation that forwards calls to the +// /// (Emscripten-generated) ThermionDart JS module. +// /// +// class ThermionViewerWasm implements ThermionViewer { +// final _logger = Logger("ThermionViewerWasm"); + +// _EmscriptenModule? _module; + +// bool _initialized = false; +// bool _rendering = false; + +// String? assetPathPrefix; + +// late (double, double) viewportDimensions; + +// late double pixelRatio; + +// /// +// /// Construct an instance of this class by explicitly passing the +// /// module instance via the [module] property, or by specifying [moduleName], +// /// being the name of the window property where the module has already been +// /// loaded. +// /// +// /// Pass [assetPathPrefix] if you need to prepend a path to all asset paths +// /// (e.g. on Flutter where the asset directory /foo is actually shipped under +// /// the directory /assets/foo, you would construct this as: +// /// +// /// final viewer = ThermionViewerWasm(assetPathPrefix:"/assets/") +// /// +// ThermionViewerWasm({JSObject? module, this.assetPathPrefix}) { +// if (module != null) { +// _module = module as _EmscriptenModule; +// } +// } + +// void _setAssetPathPrefix(String assetPathPrefix) { +// _module!.ccall( +// "thermion_dart_web_set_asset_path_prefix", +// "void", +// ["string".toJS].toJS, +// [assetPathPrefix.toJS].toJS, +// null); +// } + +// JSNumber? _viewer; +// JSNumber? _sceneManager; +// int _width = 0; +// int _height = 0; + +// Future initialize(double width, double height, double pixelRatio, +// {String? uberArchivePath}) async { +// if (!_initialized) { +// await _initializeModule(); +// _initialized = true; +// if (assetPathPrefix != null) { +// _setAssetPathPrefix(assetPathPrefix!); +// } +// } +// this.pixelRatio = pixelRatio; + +// final context = _module!.ccall("thermion_dart_web_create_gl_context", "int", +// [].toJS, [].toJS, null); +// final loader = _module!.ccall( +// "thermion_dart_web_get_resource_loader_wrapper", +// "void*", +// [].toJS, +// [].toJS, +// null); +// _viewer = _module!.ccall( +// "create_filament_viewer", +// "void*", +// ["void*".toJS, "void*".toJS, "void*".toJS, "string".toJS].toJS, +// [context!, loader, null, uberArchivePath?.toJS].toJS, +// null) as JSNumber; +// await createSwapChain(width.ceil(), height.ceil()); +// updateViewportAndCameraProjection(width.ceil(), height.ceil(), 1.0); +// _sceneManager = _module!.ccall("get_scene_manager", "void*", +// ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber; + +// _pickCallbackPtr = _module!.addFunction(_onPickCallback.toJS, "viii"); +// _pickGizmoCallbackPtr = +// _module!.addFunction(_onPickGizmoCallback.toJS, "viii"); + +// var gizmoOut = _module!._malloc(4 * 4); + +// _module!.ccall("get_gizmo", "void", ["void*".toJS, "void*".toJS].toJS, +// [_sceneManager!, gizmoOut].toJS, null); + +// var x = _module!.getValue(gizmoOut, "i32") as JSNumber; +// var y = _module!.getValue((gizmoOut.toDartInt + 4).toJS, "i32") as JSNumber; +// var z = _module!.getValue((gizmoOut.toDartInt + 8).toJS, "i32") as JSNumber; +// var center = +// _module!.getValue((gizmoOut.toDartInt + 12).toJS, "i32") as JSNumber; +// _gizmo = +// Gizmo(x.toDartInt, y.toDartInt, z.toDartInt, center.toDartInt, this); +// _module!._free(gizmoOut); +// _initialized = true; +// } + +// Future _initializeModule() async { +// var moduleScript = document.createElement("script") as HTMLScriptElement; + +// globalContext["exports"] = JSObject(); +// var module = JSObject(); +// globalContext["module"] = module; +// var content = await http.get(Uri.parse("thermion_dart.js")); +// moduleScript.innerHTML = content.body.toJS; +// document.head!.appendChild(moduleScript); +// var instantiate = module.getProperty("exports".toJS) as JSFunction; +// var moduleInstance = +// instantiate.callAsFunction() as JSPromise<_EmscriptenModule>; +// _module = await moduleInstance.toDart; +// } + +// Future createSwapChain(int width, int height) async { +// _module!.ccall( +// "create_swap_chain", +// "void", +// ["void*".toJS, "void*".toJS, "uint32_t".toJS, "uint32_t".toJS].toJS, +// [_viewer!, null, width.toJS, height.toJS].toJS, +// null); +// } + +// Future destroySwapChain() async { +// if (_viewer == null) { +// return; +// } +// _module!.ccall("destroy_swap_chain", "void", ["void*".toJS].toJS, +// [_viewer!].toJS, null); +// } + +// void updateViewportAndCameraProjection( +// int width, int height, double scaleFactor) { +// if (width == 0 || height == 0) { +// throw Exception("Width/height must be greater than zero"); +// } +// _width = (width * pixelRatio).ceil(); +// _height = (height * pixelRatio).ceil(); +// viewportDimensions = (_width.toDouble(), _height.toDouble()); +// _module!.ccall( +// "update_viewport_and_camera_projection", +// "void", +// ["void*".toJS, "uint32_t".toJS, "uint32_t".toJS, "float".toJS].toJS, +// [_viewer!, _width.toJS, _height.toJS, scaleFactor.toJS].toJS, +// null); +// } + +// @override +// Future get initialized async { +// return _initialized; +// } + +// /// +// /// +// /// +// final _pickResultController = +// StreamController.broadcast(); + +// @override +// Stream get pickResult { +// return _pickResultController.stream; +// } + +// @override +// Stream get gizmoPickResult => +// _gizmoPickResultController.stream; +// final _gizmoPickResultController = +// StreamController.broadcast(); + +// @override +// bool get rendering => _rendering; + +// @override +// Future dispose() async { +// if (_viewer == null) { +// // we've already cleaned everything up, ignore the call to dispose +// return; +// } +// await setRendering(false); +// await clearEntities(); +// await clearLights(); +// _destroyViewer(); + +// _sceneManager = null; +// _viewer = null; + +// for (final callback in _onDispose) { +// await callback.call(); +// } +// _onDispose.clear(); +// _module!.removeFunction(_pickCallbackPtr); +// _module!.removeFunction(_pickGizmoCallbackPtr); +// } + +// void _destroyViewer() { +// _module!.ccall("destroy_filament_viewer", "void", ["void*".toJS].toJS, +// [_viewer].toJS, null); +// } + +// @override +// Future setBackgroundColor(double r, double g, double b, double alpha) async { +// _module!.ccall( +// "set_background_color", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS, "float".toJS, "float".toJS] +// .toJS, +// [_viewer!, r.toJS, g.toJS, b.toJS, alpha.toJS].toJS, +// null); +// } + +// @override +// Future addAnimationComponent(ThermionEntity entity) async { +// _module!.ccall( +// "add_animation_component", +// "bool", +// ["void*".toJS, "int32_t".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null); +// } + +// Matrix4 _matrixFromPtr(JSNumber matPtr) { +// final mat = Matrix4.zero(); +// for (int i = 0; i < 16; i++) { +// mat[i] = (_module!.getValue((matPtr.toDartInt + (i * 4)).toJS, "float") +// as JSNumber) +// .toDartDouble; +// } +// return mat; +// } + +// @override +// Future> getRestLocalTransforms(ThermionEntity entity, +// {int skinIndex = 0}) async { +// var boneCountJS = _module!.ccall( +// "get_bone_count", +// "int", +// ["void*".toJS, "int".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS, skinIndex.toJS].toJS, +// null) as JSNumber; +// var boneCount = boneCountJS.toDartInt; +// var buf = _module!._malloc(boneCount * 16 * 4); +// _module!.ccall( +// "get_rest_local_transforms", +// "void", +// ["void*".toJS, "int".toJS, "int".toJS, "float*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS, skinIndex.toJS, buf, boneCount.toJS].toJS, +// null); +// var transforms = []; +// for (int i = 0; i < boneCount; i++) { +// var matPtr = (buf.toDartInt + (i * 16 * 4)).toJS; +// transforms.add(_matrixFromPtr(matPtr)); +// } +// _module!._free(buf); +// return transforms; +// } + +// @override +// Future getBone(ThermionEntity parent, int boneIndex, +// {int skinIndex = 0}) async { +// final boneId = _module!.ccall( +// "get_bone", +// "int", +// ["void*".toJS, "int32_t".toJS, "int32_t".toJS, "int32_t".toJS].toJS, +// [_sceneManager!, parent.toJS, skinIndex.toJS, boneIndex.toJS].toJS, +// null) as JSNumber; +// if (boneId.toDartInt == -1) { +// throw Exception("Failed to get bone"); +// } +// return boneId.toDartInt; +// } + +// Future> getBones(ThermionEntity entity, +// {int skinIndex = 0}) async { +// final boneNames = await getBoneNames(entity); +// final bones = await Future.wait(List.generate( +// boneNames.length, (i) => getBone(entity, i, skinIndex: skinIndex))); +// return bones; +// } + +// @override +// Future addBoneAnimation(ThermionEntity entity, BoneAnimationData animation, +// {int skinIndex = 0, +// double fadeInInSecs = 0.0, +// double fadeOutInSecs = 0.0, +// double maxDelta = 1.0}) async { +// final boneNames = await getBoneNames(entity); +// final bones = await getBones(entity); + +// var numBytes = animation.numFrames * 16 * 4; +// var floatPtr = _module!._malloc(numBytes); + +// var restLocalTransforms = await getRestLocalTransforms(entity); + +// for (int i = 0; i < animation.bones.length; i++) { +// final boneName = animation.bones[i]; +// final entityBoneIndex = boneNames.indexOf(boneName); + +// var boneEntity = bones[entityBoneIndex]; + +// var baseTransform = restLocalTransforms[entityBoneIndex]; + +// var world = Matrix4.identity(); + +// // this odd use of ! is intentional, without it, the WASM optimizer gets in trouble +// var parentBoneEntity = (await getParent(boneEntity))!; +// while (true) { +// if (!bones.contains(parentBoneEntity!)) { +// break; +// } +// world = restLocalTransforms[bones.indexOf(parentBoneEntity!)] * world; +// parentBoneEntity = (await getParent(parentBoneEntity))!; +// } + +// world = Matrix4.identity()..setRotation(world.getRotation()); +// var worldInverse = Matrix4.identity()..copyInverse(world); + +// for (int frameNum = 0; frameNum < animation.numFrames; frameNum++) { +// var rotation = animation.frameData[frameNum][i].rotation; +// var translation = animation.frameData[frameNum][i].translation; +// var frameTransform = +// Matrix4.compose(translation, rotation, Vector3.all(1.0)); +// var newLocalTransform = frameTransform.clone(); +// if (animation.space == Space.Bone) { +// newLocalTransform = baseTransform * frameTransform; +// } else if (animation.space == Space.ParentWorldRotation) { +// newLocalTransform = +// baseTransform * (worldInverse * frameTransform * world); +// } +// for (int j = 0; j < 16; j++) { +// var offset = ((frameNum * 16) + j) * 4; +// _module!.setValue((floatPtr.toDartInt + offset).toJS, +// newLocalTransform.storage[j].toJS, "float"); +// } +// } + +// _module!.ccall( +// "add_bone_animation", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// "int".toJS, +// "int".toJS, +// "float*".toJS, +// "int".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS +// ].toJS, +// [ +// _sceneManager!, +// entity.toJS, +// skinIndex.toJS, +// entityBoneIndex.toJS, +// floatPtr, +// animation.numFrames.toJS, +// animation.frameLengthInMs.toJS, +// fadeOutInSecs.toJS, +// fadeInInSecs.toJS, +// maxDelta.toJS +// ].toJS, +// null); +// } +// _module!._free(floatPtr); +// } + +// @override +// Future addCollisionComponent(ThermionEntity entity, +// {void Function(int entityId1, int entityId2)? callback, +// bool affectsTransform = false}) { +// // TODO: implement addCollisionComponent +// throw UnimplementedError(); +// } + +// @override +// Future addLight( +// LightType type, +// double colour, +// double intensity, +// double posX, +// double posY, +// double posZ, +// double dirX, +// double dirY, +// double dirZ, +// {double falloffRadius = 1.0, +// double spotLightConeInner = pi / 8, +// double spotLightConeOuter = pi / 4, +// double sunAngularRadius = 0.545, +// double sunHaloSize = 10.0, +// double sunHaloFallof = 80.0, +// bool castShadows = true}) async { +// final entityId = _module!.ccall( +// "add_light", +// "int", +// [ +// "void*".toJS, +// "uint8_t".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "bool".toJS +// ].toJS, +// [ +// _viewer, +// type.index.toJS, +// colour.toJS, +// intensity.toJS, +// posX.toJS, +// posY.toJS, +// posZ.toJS, +// dirX.toJS, +// dirY.toJS, +// dirZ.toJS, +// falloffRadius.toJS, +// spotLightConeInner.toJS, +// spotLightConeOuter.toJS, +// sunAngularRadius.toJS, +// sunHaloSize.toJS, +// sunHaloFallof.toJS, +// castShadows.toJS +// ].toJS, +// null) as JSNumber; +// if (entityId.toDartInt == -1) { +// throw Exception("Failed to add light"); +// } +// return entityId.toDartInt; +// } + +// @override +// Future> getBoneNames(ThermionEntity entity, +// {int skinIndex = 0}) async { +// var boneCountJS = _module!.ccall( +// "get_bone_count", +// "int", +// ["void*".toJS, "int".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS, skinIndex.toJS].toJS, +// null) as JSNumber; +// var boneCount = boneCountJS.toDartInt; +// var buf = _module!._malloc(boneCount * 4); + +// var empty = " ".toJS; +// var ptrs = []; +// for (int i = 0; i < boneCount; i++) { +// var ptr = _module!._malloc(256); +// _module!.stringToUTF8(empty, ptr, 255.toJS); +// ptrs.add(ptr); +// _module!.setValue((buf.toDartInt + (i * 4)).toJS, ptr, "i32"); +// } +// _module!.ccall( +// "get_bone_names", +// "void", +// ["void*".toJS, "int".toJS, "char**".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS, buf, skinIndex.toJS].toJS, +// null); +// var names = []; +// for (int i = 0; i < boneCount; i++) { +// var name = _module!.UTF8ToString(ptrs[i]).toDart; +// names.add(name); +// } + +// return names; +// } + +// @override +// Future> getChildEntities( +// ThermionEntity parent, bool renderableOnly) async { +// var entityCountJS = _module!.ccall( +// "get_entity_count", +// "int", +// ["void*".toJS, "int".toJS, "bool".toJS].toJS, +// [_sceneManager!, parent.toJS, renderableOnly.toJS].toJS, +// null) as JSNumber; +// var entityCount = entityCountJS.toDartInt; +// var entities = []; +// var buf = _module!._malloc(entityCount * 4); + +// _module!.ccall( +// "get_entities", +// "void", +// ["void*".toJS, "int".toJS, "bool".toJS, "int*".toJS].toJS, +// [_sceneManager!, parent.toJS, renderableOnly.toJS, buf].toJS, +// null); +// for (int i = 0; i < entityCount; i++) { +// var entityId = +// _module!.getValue((buf.toDartInt + (i * 4)).toJS, "i32") as JSNumber; +// entities.add(entityId.toDartInt); +// } +// _module!._free(buf); +// return entities; +// } + +// @override +// Future getChildEntity( +// ThermionEntity parent, String childName) async { +// final entityId = _module!.ccall( +// "find_child_entity_by_name", +// "int", +// ["void*".toJS, "int".toJS, "string".toJS].toJS, +// [_sceneManager!, parent.toJS, childName.toJS].toJS, +// null) as JSNumber; +// if (entityId.toDartInt == -1) { +// throw Exception("Failed to find child entity"); +// } +// return entityId.toDartInt; +// } + +// @override +// Future> getChildEntityNames(ThermionEntity entity, +// {bool renderableOnly = true}) async { +// var entityCountJS = _module!.ccall( +// "get_entity_count", +// "int", +// ["void*".toJS, "int".toJS, "bool".toJS].toJS, +// [_sceneManager!, entity.toJS, renderableOnly.toJS].toJS, +// null) as JSNumber; +// var entityCount = entityCountJS.toDartInt; +// var names = []; +// for (int i = 0; i < entityCount; i++) { +// var namePtr = _module!.ccall( +// "get_entity_name_at", +// "char*", +// ["void*".toJS, "int".toJS, "int".toJS, "bool".toJS].toJS, +// [_sceneManager!, entity.toJS, i.toJS, renderableOnly.toJS].toJS, +// null) as JSNumber; +// names.add(_module!.UTF8ToString(namePtr).toDart); +// } +// return names; +// } + +// @override +// Future getMainCamera() async { +// var mainCameraEntity = await getMainCameraEntity(); +// return ThermionWasmCamera(mainCameraEntity); +// } + +// @override +// Future> getMorphTargetNames( +// ThermionEntity entity, ThermionEntity childEntity) async { +// var morphTargetCountJS = _module!.ccall( +// "get_morph_target_name_count", +// "int", +// ["void*".toJS, "int32_t".toJS, "int32_t".toJS].toJS, +// [_sceneManager!, entity.toJS, childEntity.toJS].toJS, +// null) as JSNumber; +// var morphTargetCount = morphTargetCountJS.toDartInt; +// var names = []; +// for (int i = 0; i < morphTargetCount; i++) { +// var buf = _module!._malloc(256); +// _module!.ccall( +// "get_morph_target_name", +// "void", +// [ +// "void*".toJS, +// "int32_t".toJS, +// "int32_t".toJS, +// "char*".toJS, +// "int32_t".toJS +// ].toJS, +// [_sceneManager!, entity.toJS, childEntity.toJS, buf, i.toJS].toJS, +// null); +// names.add(_module!.UTF8ToString(buf).toDart); +// _module!._free(buf); +// } +// return names; +// } + +// @override +// String? getNameForEntity(ThermionEntity entity) { +// final namePtr = _module!.ccall( +// "get_name_for_entity", +// "char*", +// ["void*".toJS, "int32_t".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null) as JSNumber; +// if (namePtr.toDartInt == 0) { +// return null; +// } +// return _module!.UTF8ToString(namePtr).toDart; +// } + +// @override +// Future getParent(ThermionEntity child) async { +// final parentId = _module!.ccall( +// "get_parent", +// "int", +// ["void*".toJS, "int32_t".toJS].toJS, +// [_sceneManager!, child.toJS].toJS, +// null) as JSNumber; +// if (parentId.toDartInt == -1) { +// return null; +// } +// return parentId.toDartInt; +// } + +// @override +// Future getWorldTransform(ThermionEntity entity) async { +// final matrixPtr = _module!._malloc(16 * 4); +// _module!.ccall( +// "get_world_transform", +// "void", +// ["void*".toJS, "int32_t".toJS, "float*".toJS].toJS, +// [_sceneManager!, entity.toJS, matrixPtr].toJS, +// null); +// final matrix = _matrixFromPtr(matrixPtr); +// _module!._free(matrixPtr); +// return matrix; +// } + +// @override +// AbstractGizmo? get gizmo => _gizmo; +// Gizmo? _gizmo; + +// @override +// Future hide(ThermionEntity entity, String? meshName) async { +// if (meshName != null) { +// final result = _module!.ccall( +// "hide_mesh", +// "int", +// ["void*".toJS, "int".toJS, "string".toJS].toJS, +// [_sceneManager!, entity.toJS, meshName.toJS].toJS, +// null) as JSNumber; +// if (result.toDartInt == -1) { +// throw Exception( +// "Failed to hide mesh ${meshName} on entity ${entity.toJS}"); +// } +// } else { +// throw Exception( +// "Cannot hide mesh, meshName must be specified when invoking this method"); +// } +// } + +// Future loadGlbFromBuffer(Uint8List data, +// {int numInstances = 1, bool keepData= false, int layer=0, int priority=4}) async { +// if (numInstances != 1) { +// throw Exception("TODO"); +// } +// final ptr = _module!._malloc(data.length); +// _module!.writeArrayToMemory(data.toJS, ptr); + +// final result = _module!.ccall( +// "load_glb_from_buffer", +// "int", +// ["void*".toJS, "void*".toJS, "size_t".toJS].toJS, +// [_sceneManager!, ptr, data.lengthInBytes.toJS].toJS, +// null) as JSNumber; +// final entityId = result.toDartInt; +// _module!._free(ptr); +// if (entityId == -1) { +// throw Exception("Failed to load GLB"); +// } +// return entityId; +// } + +// @override +// Future loadGlb(String path, +// {int numInstances = 1, bool keepData = false}) async { +// final promise = _module!.ccall( +// "load_glb", +// "int", +// ["void*".toJS, "string".toJS, "int".toJS].toJS, +// [_sceneManager!, path.toJS, numInstances.toJS].toJS, +// {"async": true}.jsify()) as JSPromise; +// final entityId = (await promise.toDart).toDartInt; +// if (entityId == -1) { +// throw Exception("Failed to load GLB"); +// } +// return entityId; +// } + +// @override +// Future loadGltf(String path, String relativeResourcePath, +// {bool keepData = false}) async { +// final promise = _module!.ccall( +// "load_gltf", +// "int", +// ["void*".toJS, "string".toJS, "string".toJS].toJS, +// [_sceneManager!, path.toJS, relativeResourcePath.toJS].toJS, +// {"async": true}.jsify()) as JSPromise; +// final entityId = (await promise.toDart).toDartInt; +// if (entityId == -1) { +// throw Exception("Failed to load GLTF"); +// } +// return entityId; +// } + +// @override +// Future loadIbl(String lightingPath, {double intensity = 30000}) async { +// var promise = _module!.ccall( +// "load_ibl", +// "void", +// ["void*".toJS, "string".toJS, "float".toJS].toJS, +// [_viewer!, lightingPath.toJS, intensity.toJS].toJS, +// {"async": true}.jsify()) as JSPromise; +// await promise.toDart; +// } + +// @override +// Future loadSkybox(String skyboxPath) async { +// var promise = _module!.ccall( +// "load_skybox", +// "void", +// ["void*".toJS, "string".toJS].toJS, +// [_viewer!, skyboxPath.toJS].toJS, +// {"async": true}.jsify()) as JSPromise; +// await promise.toDart; +// } + +// @override +// Future playAnimation(ThermionEntity entity, int index, +// {bool loop = false, +// bool reverse = false, +// bool replaceActive = true, +// double crossfade = 0.0, +// double startOffset = 0.0}) async { +// _module!.ccall( +// "play_animation", +// "void", +// [ +// "void*".toJS, +// "int32_t".toJS, +// "int32_t".toJS, +// "bool".toJS, +// "bool".toJS, +// "bool".toJS, +// "float".toJS, +// "float".toJS +// ].toJS, +// [ +// _sceneManager!, +// entity.toJS, +// index.toJS, +// loop.toJS, +// reverse.toJS, +// replaceActive.toJS, +// crossfade.toJS +// ].toJS, +// null); +// } + +// int _last = 0; + +// @override +// Future render() async { +// _last = DateTime.now().millisecondsSinceEpoch * 1000000; +// _module!.ccall( +// "render", +// "void", +// [ +// "void*".toJS, +// "uint64_t".toJS, +// "void*".toJS, +// "void*".toJS, +// "void*".toJS +// ].toJS, +// [ +// _viewer!, +// 0.toJS, +// null, // pixelBuffer, +// null, // callback +// null // data +// ].toJS, +// null); +// } + +// Future capture() async { +// bool wasRendering = rendering; +// await setRendering(false); +// final pixelBuffer = _module!._malloc(_width * _height * 4); +// final completer = Completer(); +// final callback = () { +// completer.complete(); +// }; +// final callbackPtr = _module!.addFunction(callback.toJS, "v"); + +// _module!.ccall( +// "capture", +// "void", +// ["void*".toJS, "uint8_t*".toJS, "void*".toJS].toJS, +// [_viewer!, pixelBuffer, callbackPtr].toJS, +// null); + +// int iter = 0; +// while (true) { +// await Future.delayed(Duration(milliseconds: 5)); +// await render(); +// if (completer.isCompleted) { +// break; +// } +// iter++; +// if (iter > 1000) { +// _module!._free(pixelBuffer); +// throw Exception("Failed to complete capture"); +// } +// } + +// // Create a Uint8ClampedList to store the pixel data +// var data = Uint8List(_width * _height * 4); +// for (int i = 0; i < data.length; i++) { +// data[i] = (_module!.getValue(((pixelBuffer.toDartInt) + i).toJS, "i8") +// as JSNumber) +// .toDartInt; +// } +// _module!._free(pixelBuffer); +// await setRendering(wasRendering); +// print("Captured to ${data.length} pixel buffer"); +// _module!.removeFunction(callbackPtr); + +// return data; +// } + +// @override +// Future setAntiAliasing(bool msaa, bool fxaa, bool taa) async { +// _module!.ccall( +// "set_antialiasing", +// "void", +// ["void*".toJS, "bool".toJS, "bool".toJS, "bool".toJS].toJS, +// [_viewer!, msaa.toJS, fxaa.toJS, taa.toJS].toJS, +// null); +// } + +// @override +// Future setCameraPosition(double x, double y, double z) async { +// _module!.ccall( +// "set_camera_position", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS, "float".toJS].toJS, +// [_viewer!, x.toJS, y.toJS, z.toJS].toJS, +// null); +// } + +// @override +// Future setCameraRotation(Quaternion quaternion) async { +// _module!.ccall( +// "set_camera_rotation", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS, "float".toJS, "float".toJS] +// .toJS, +// [ +// _viewer!, +// quaternion.w.toJS, +// quaternion.x.toJS, +// quaternion.y.toJS, +// quaternion.z.toJS +// ].toJS, +// null); +// } + +// @override +// Future clearMorphAnimationData(ThermionEntity entity) async { +// var meshEntities = await getChildEntities(entity, false); +// for (final childEntity in meshEntities) { +// _module!.ccall( +// "clear_morph_animation", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// ].toJS, +// [ +// _sceneManager!, +// childEntity.toJS, +// ].toJS, +// null); +// } +// } + +// @override +// Future setMorphAnimationData( +// ThermionEntity entity, MorphAnimationData animation, +// {List? targetMeshNames, bool useNextEntity = false}) async { +// var meshNames = await getChildEntityNames(entity, renderableOnly: false); +// if (targetMeshNames != null) { +// for (final targetMeshName in targetMeshNames) { +// if (!meshNames.contains(targetMeshName)) { +// throw Exception( +// "Error: mesh ${targetMeshName} does not exist under the specified entity. Available meshes : ${meshNames}"); +// } +// } +// } + +// var meshEntities = await getChildEntities(entity, false); + +// // Entities are not guaranteed to have the same morph targets (or share the same order), +// // either from each other, or from those specified in [animation]. +// // We therefore set morph targets separately for each mesh. +// // For each mesh, allocate enough memory to hold FxM 32-bit floats +// // (where F is the number of Frames, and M is the number of morph targets in the mesh). +// // we call [extract] on [animation] to return frame data only for morph targets that present in both the mesh and the animation +// for (int i = 0; i < meshNames.length; i++) { +// var meshName = meshNames[i]; +// var meshEntity = meshEntities[i]; + +// if (targetMeshNames?.contains(meshName) == false) { +// // _logger.info("Skipping $meshName, not contained in target"); +// continue; +// } + +// if (useNextEntity) meshEntity += 1; + +// var meshMorphTargets = await getMorphTargetNames(entity, meshEntity); + +// _logger.info("Got mesh morph targets ${meshMorphTargets}"); + +// var intersection = animation.morphTargets +// .toSet() +// .intersection(meshMorphTargets.toSet()) +// .toList(); + +// if (intersection.isEmpty) { +// throw Exception( +// """No morph targets specified in animation are present on mesh $meshName. +// If you weren't intending to animate every mesh, specify [targetMeshNames] when invoking this method. +// Animation morph targets: ${animation.morphTargets}\n +// Mesh morph targets ${meshMorphTargets} +// Child meshes: ${meshNames}"""); +// } + +// var indices = +// intersection.map((m) => meshMorphTargets.indexOf(m)).toList(); + +// var frameData = animation.extract(morphTargets: intersection); + +// assert(frameData.length == animation.numFrames * intersection.length); + +// // Allocate memory in WASM for the morph data +// var dataPtr = _module!._malloc(frameData.length * 4); + +// // Create a Float32List to copy the morph data to +// var dataList = td.Float32List.fromList(frameData); + +// // Copy the morph data to WASM +// _module!.writeArrayToMemory( +// dataList.buffer.asUint8List(dataList.offsetInBytes).toJS, dataPtr); + +// // Allocate memory in WASM for the morph indices +// var idxPtr = _module!._malloc(indices.length * 4); + +// // Create an Int32List to copy the morph indices to +// var idxList = td.Int32List.fromList(indices); + +// // Copy the morph indices to WASM +// _module!.writeArrayToMemory( +// idxList.buffer.asUint8List(idxList.offsetInBytes).toJS, idxPtr); +// bool result = false; +// try { +// var jsResult = _module!.ccall( +// "set_morph_animation", +// "bool", +// [ +// "void*".toJS, +// "int".toJS, +// "float*".toJS, +// "int*".toJS, +// "int".toJS, +// "int".toJS, +// "float".toJS +// ].toJS, +// [ +// _sceneManager!, +// meshEntity.toJS, +// dataPtr, +// idxPtr, +// indices.length.toJS, +// animation.numFrames.toJS, +// animation.frameLengthInMs.toJS +// ].toJS, +// null); +// _logger.info("Got jsResult $jsResult"); +// result = (jsResult as JSNumber).toDartInt == 1; +// } catch (err, st) { +// _logger.severe(err); +// _logger.severe(st); +// } + +// // Free the memory allocated in WASM +// _module!._free(dataPtr); +// _module!._free(idxPtr); + +// if (!result) { +// throw Exception("Failed to set morph animation data for ${meshName}"); +// } +// } +// } + +// @override +// Future setPosition( +// ThermionEntity entity, double x, double y, double z) async { +// _module!.ccall( +// "set_position", +// "void", +// ["void*".toJS, "int".toJS, "float".toJS, "float".toJS, "float".toJS] +// .toJS, +// [_sceneManager!, entity.toJS, x.toJS, y.toJS, z.toJS].toJS, +// null); +// } + +// @override +// Future setPostProcessing(bool enabled) async { +// _module!.ccall("set_post_processing", "void", +// ["void*".toJS, "bool".toJS].toJS, [_viewer!, enabled.toJS].toJS, null); +// } + +// @override +// Future setRotation( +// ThermionEntity entity, double rads, double x, double y, double z) async { +// var quaternion = Quaternion.axisAngle(Vector3(x, y, z), rads); +// _module!.ccall( +// "set_rotation", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS +// ].toJS, +// [ +// _sceneManager!, +// entity.toJS, +// quaternion.radians.toJS, +// quaternion.x.toJS, +// quaternion.y.toJS, +// quaternion.z.toJS, +// quaternion.w.toJS +// ].toJS, +// null); +// } + +// @override +// Future setRotationQuat(ThermionEntity entity, Quaternion rotation) async { +// _module!.ccall( +// "set_rotation", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS +// ].toJS, +// [ +// _sceneManager!, +// entity.toJS, +// rotation.radians.toJS, +// rotation.x.toJS, +// rotation.y.toJS, +// rotation.z.toJS, +// rotation.w.toJS +// ].toJS, +// null); +// } + +// final _onDispose = []; + +// /// +// /// +// /// +// void onDispose(Future Function() callback) { +// _onDispose.add(callback); +// } + +// @override +// Future clearBackgroundImage() async { +// _module!.ccall("clear_background_image", "void", ["void*".toJS].toJS, +// [_viewer!].toJS, null); +// } + +// @override +// Future clearEntities() async { +// _module!.ccall( +// "clear_entities", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); +// } + +// @override +// Future clearLights() async { +// _module!.ccall( +// "clear_lights", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); +// } + +// @override +// Future createGeometry(Geometry geometry, +// {MaterialInstance? materialInstance, +// bool keepData = false, +// PrimitiveType primitiveType = PrimitiveType.TRIANGLES}) async { +// final verticesData = td.Float32List.fromList(geometry.vertices); +// final indicesData = Uint16List.fromList(geometry.indices); +// final verticesPtr = _module!._malloc(verticesData.lengthInBytes); +// final indicesPtr = _module!._malloc(indicesData.lengthInBytes); +// _module!.writeArrayToMemory( +// verticesData.buffer.asUint8List().toJS, verticesPtr); +// _module! +// .writeArrayToMemory(indicesData.buffer.asUint8List().toJS, indicesPtr); + +// final entityId = _module!.ccall( +// "create_geometry", +// "int", +// [ +// "void*".toJS, +// "float*".toJS, +// "int".toJS, +// "uint16_t*".toJS, +// "int".toJS, +// "int".toJS, +// "string".toJS +// ].toJS, +// [ +// _viewer!, +// verticesPtr, +// verticesData.length.toJS, +// indicesPtr, +// indicesData.length.toJS, +// primitiveType.index.toJS, +// (materialInstance as ThermionWasmMaterialInstance?)?.pointer.toJS ?? "".toJS, +// ].toJS, +// null) as JSNumber; + +// _module!._free(verticesPtr); +// _module!._free(indicesPtr); + +// if (entityId.toDartInt == -1) { +// throw Exception("Failed to create geometry"); +// } +// return entityId.toDartInt; +// } + +// @override +// Future createInstance(ThermionEntity entity) async { +// final result = _module!.ccall( +// "create_instance", +// "int", +// ["void*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null) as JSNumber; +// if (result.toDartInt == -1) { +// throw Exception("Failed to create instance of entity ${entity}"); +// } +// return result.toDartInt; +// } + +// @override +// Future getAnimationDuration( +// ThermionEntity entity, int animationIndex) async { +// final result = _module!.ccall( +// "get_animation_duration", +// "float", +// ["void*".toJS, "int".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS, animationIndex.toJS].toJS, +// null) as JSNumber; +// return result.toDartDouble; +// } + +// @override +// Future getAnimationCount(ThermionEntity entity) async { +// final animationCount = _module!.ccall( +// "get_animation_count", +// "int", +// ["void*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null) as JSNumber; +// return animationCount.toDartInt; +// } + +// @override +// Future> getAnimationNames(ThermionEntity entity) async { +// final animationCount = await getAnimationCount(entity); +// final names = []; +// for (int i = 0; i < animationCount; i++) { +// final namePtr = _module!._malloc(256); +// _module!.ccall( +// "get_animation_name", +// "void", +// ["void*".toJS, "int".toJS, "char*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS, namePtr, i.toJS].toJS, +// null); +// names.add(_module!.UTF8ToString(namePtr).toDart); +// _module!._free(namePtr); +// } +// return names; +// } + +// @override +// Future getCameraCullingFar() async { +// final result = _module!.ccall("get_camera_culling_far", "double", +// ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber; +// return result.toDartDouble; +// } + +// @override +// Future getCameraCullingNear() async { +// final result = _module!.ccall("get_camera_culling_near", "double", +// ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber; +// return result.toDartDouble; +// } + +// @override +// Future getCameraCullingProjectionMatrix() async { +// final ptr = _module!._malloc(16 * 8); +// _module!.ccall("get_camera_culling_projection_matrix", "void", +// ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null); +// final matrix = Matrix4.zero(); +// for (int i = 0; i < 16; i++) { +// matrix[i] = (_module!.getValue((ptr.toDartInt + (i * 8)).toJS, "double") +// as JSNumber) +// .toDartDouble; +// } +// _module!._free(ptr); +// return matrix; +// } + +// @override +// Future getCameraFrustum() async { +// final ptr = _module!._malloc(24 * 8); +// _module!.ccall("get_camera_frustum", "void", +// ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null); +// final planes = List.generate(6, (i) { +// final offset = i * 4; +// return Plane() +// ..setFromComponents( +// (_module!.getValue((ptr.toDartInt + (offset * 8)).toJS, "double") +// as JSNumber) +// .toDartDouble, +// (_module!.getValue( +// (ptr.toDartInt + ((offset + 1) * 8)).toJS, "double") +// as JSNumber) +// .toDartDouble, +// (_module!.getValue( +// (ptr.toDartInt + ((offset + 2) * 8)).toJS, "double") +// as JSNumber) +// .toDartDouble, +// (_module!.getValue( +// (ptr.toDartInt + ((offset + 3) * 8)).toJS, "double") +// as JSNumber) +// .toDartDouble); +// }); +// _module!._free(ptr); +// throw UnimplementedError(); +// // return Frustum()..plane0 = planes[0]..plane1 =planes[1]..plane2 =planes[2]..plane3 =planes[3], planes[4], planes[5]); +// } + +// @override +// Future getCameraModelMatrix() async { +// final ptr = _module!.ccall("get_camera_model_matrix", "void*", +// ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber; +// final matrix = _matrixFromPtr(ptr); +// _module!.ccall( +// "thermion_flutter_free", "void", ["void*".toJS].toJS, [ptr].toJS, null); + +// return matrix; +// } + +// @override +// Future getCameraPosition() async { +// final ptr = _module!._malloc(3 * 8); +// _module!.ccall("get_camera_position", "void", +// ["void*".toJS, "void*".toJS].toJS, [_viewer!, ptr].toJS, null); +// final pos = Vector3( +// (_module!.getValue(ptr.toDartInt.toJS, "double") as JSNumber) +// .toDartDouble, +// (_module!.getValue((ptr.toDartInt + 8).toJS, "double") as JSNumber) +// .toDartDouble, +// (_module!.getValue((ptr.toDartInt + 16).toJS, "double") as JSNumber) +// .toDartDouble); +// _module!._free(ptr); +// return pos; +// } + +// @override +// Future getCameraProjectionMatrix() async { +// final ptr = _module!._malloc(16 * 8); +// _module!.ccall("get_camera_projection_matrix", "void", +// ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null); +// final matrix = _matrixFromPtr(ptr); +// _module!._free(ptr); +// return matrix; +// } + +// @override +// Future getCameraRotation() async { +// final model = await getCameraModelMatrix(); +// final rotation = model.getRotation(); +// return rotation; +// } + +// @override +// Future getCameraViewMatrix() async { +// final ptr = _module!._malloc(16 * 8); +// _module!.ccall("get_camera_view_matrix", "void", +// ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null); +// final matrix = Matrix4.zero(); +// for (int i = 0; i < 16; i++) { +// matrix[i] = (_module!.getValue((ptr.toDartInt + (i * 8)).toJS, "double") +// as JSNumber) +// .toDartDouble; +// } +// _module!._free(ptr); +// return matrix; +// } + +// @override +// Future getInstanceCount(ThermionEntity entity) async { +// final result = _module!.ccall( +// "get_instance_count", +// "int", +// ["void*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null) as JSNumber; +// return result.toDartInt; +// } + +// @override +// Future> getInstances(ThermionEntity entity) async { +// final instanceCount = await getInstanceCount(entity); +// final buf = _module!._malloc(instanceCount * 4); +// _module!.ccall( +// "get_instances", +// "void", +// ["void*".toJS, "int".toJS, "int*".toJS].toJS, +// [_sceneManager!, entity.toJS, buf].toJS, +// null); +// final instances = []; +// for (int i = 0; i < instanceCount; i++) { +// final instanceId = +// _module!.getValue((buf.toDartInt + (i * 4)).toJS, "i32") as JSNumber; +// instances.add(instanceId.toDartInt); +// } +// _module!._free(buf); +// return instances; +// } + +// @override +// Future getInverseBindMatrix(ThermionEntity parent, int boneIndex, +// {int skinIndex = 0}) async { +// final ptr = _module!._malloc(16 * 4); +// _module!.ccall( +// "get_inverse_bind_matrix", +// "void", +// ["void*".toJS, "int".toJS, "int".toJS, "int".toJS, "float*".toJS].toJS, +// [_sceneManager!, parent.toJS, skinIndex.toJS, boneIndex.toJS, ptr].toJS, +// null); +// final matrix = _matrixFromPtr(ptr); +// _module!._free(ptr); +// return matrix; +// } + +// @override +// Future getLocalTransform(ThermionEntity entity) async { +// final ptr = _module!._malloc(16 * 4); +// _module!.ccall( +// "get_local_transform", +// "void", +// ["void*".toJS, "int".toJS, "float*".toJS].toJS, +// [_sceneManager!, entity.toJS, ptr].toJS, +// null); +// final matrix = _matrixFromPtr(ptr); +// _module!._free(ptr); +// return matrix; +// } + +// @override +// Future moveCameraToAsset(ThermionEntity entity) async { +// _module!.ccall("move_camera_to_asset", "void", +// ["void*".toJS, "int".toJS].toJS, [_viewer!, entity.toJS].toJS, null); +// } + +// @override +// Future panEnd() async { +// _module! +// .ccall("grab_end", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); +// } + +// @override +// Future panStart(double x, double y) async { +// _module!.ccall( +// "grab_begin", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS, "bool".toJS].toJS, +// [_viewer!, x.toJS, y.toJS, true.toJS].toJS, +// null); +// } + +// @override +// Future panUpdate(double x, double y) async { +// _module!.ccall( +// "grab_update", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS].toJS, +// [_viewer!, x.toJS, y.toJS].toJS, +// null); +// } + +// late JSNumber _pickCallbackPtr; + +// void _onPickCallback(ThermionEntity entity, int x, int y) { +// _pickResultController +// .add((entity: entity, x: x.toDouble(), y: y.toDouble())); +// } + +// @override +// void pick(int x, int y) async { +// x = (x * pixelRatio).ceil(); +// y = (viewportDimensions.$2 - (y * pixelRatio)).ceil(); +// _module!.ccall( +// "filament_pick", +// "void", +// ["void*".toJS, "int".toJS, "int".toJS, "void*".toJS].toJS, +// [_viewer!, x.toJS, y.toJS, _pickCallbackPtr].toJS, +// null); +// } + +// @override +// Future playAnimationByName(ThermionEntity entity, String name, +// {bool loop = false, +// bool reverse = false, +// bool replaceActive = true, +// double crossfade = 0.0}) async { +// final animationNames = await getAnimationNames(entity); +// final index = animationNames.indexOf(name); +// if (index == -1) { +// throw Exception("Animation ${name} not found."); +// } +// return playAnimation(entity, index, +// loop: loop, +// reverse: reverse, +// replaceActive: replaceActive, +// crossfade: crossfade); +// } + +// @override +// Future queuePositionUpdate( +// ThermionEntity entity, double x, double y, double z, +// {bool relative = false}) async { +// _module!.ccall( +// "queue_position_update", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "bool".toJS +// ].toJS, +// [_sceneManager!, entity.toJS, x.toJS, y.toJS, z.toJS, relative.toJS] +// .toJS, +// null); +// } + +// @override +// Future queueRotationUpdate( +// ThermionEntity entity, double rads, double x, double y, double z, +// {bool relative = false}) async { +// _module!.ccall( +// "queue_rotation_update", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "bool".toJS +// ].toJS, +// [ +// _sceneManager!, +// entity.toJS, +// rads.toJS, +// x.toJS, +// y.toJS, +// z.toJS, +// relative.toJS +// ].toJS, +// null); +// } + +// @override +// Future queueRotationUpdateQuat(ThermionEntity entity, Quaternion quat, +// {bool relative = false}) async { +// _module!.ccall( +// "queue_rotation_update", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "bool".toJS +// ].toJS, +// [ +// _sceneManager!, +// entity.toJS, +// quat.radians.toJS, +// quat.x.toJS, +// quat.y.toJS, +// quat.z.toJS, +// relative.toJS +// ].toJS, +// null); +// } + +// @override +// Future removeAnimationComponent(ThermionEntity entity) async { +// _module!.ccall( +// "remove_animation_component", +// "void", +// ["void*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null); +// } + +// @override +// Future removeCollisionComponent(ThermionEntity entity) async { +// _module!.ccall( +// "remove_collision_component", +// "void", +// ["void*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null); +// } + +// @override +// Future removeEntity(ThermionEntity entity) async { +// _module!.ccall("remove_entity", "void", ["void*".toJS, "int".toJS].toJS, +// [_viewer!, entity.toJS].toJS, null); +// } + +// @override +// Future removeIbl() async { +// _module!.ccall( +// "remove_ibl", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); +// } + +// @override +// Future removeLight(ThermionEntity light) async { +// _module!.ccall("remove_light", "void", ["void*".toJS, "int".toJS].toJS, +// [_viewer!, light.toJS].toJS, null); +// } + +// @override +// Future removeSkybox() async { +// _module!.ccall( +// "remove_skybox", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); +// } + +// @override +// Future resetBones(ThermionEntity entity) async { +// _module!.ccall( +// "reset_to_rest_pose", +// "void", +// ["void*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null); +// } + +// @override +// Future reveal(ThermionEntity entity, String? meshName) async { +// final result = _module!.ccall( +// "reveal_mesh", +// "int", +// ["void*".toJS, "int".toJS, "string".toJS].toJS, +// [_sceneManager!, entity.toJS, meshName?.toJS].toJS, +// null) as JSNumber; +// if (result.toDartInt == -1) { +// throw Exception( +// "Failed to reveal mesh ${meshName} on entity ${entity.toJS}"); +// } +// } + +// @override +// Future rotateIbl(Matrix3 rotation) async { +// final ptr = _module!._malloc(9 * 4); +// for (int i = 0; i < 9; i++) { +// _module!.setValue( +// (ptr.toDartInt + (i * 4)).toJS, rotation.storage[i].toJS, "float"); +// } +// _module!.ccall("rotate_ibl", "void", ["void*".toJS, "float*".toJS].toJS, +// [_viewer!, ptr].toJS, null); +// _module!._free(ptr); +// } + +// @override +// Future rotateStart(double x, double y) async { +// _module!.ccall( +// "grab_begin", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS, "bool".toJS].toJS, +// [_viewer!, x.toJS, y.toJS, false.toJS].toJS, +// null); +// } + +// @override +// Future rotateUpdate(double x, double y) async { +// _module!.ccall( +// "grab_update", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS].toJS, +// [_viewer!, x.toJS, y.toJS].toJS, +// null); +// } + +// @override +// Future rotateEnd() async { +// _module! +// .ccall("grab_end", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); +// } + +// @override +// Future setAnimationFrame( +// ThermionEntity entity, int index, int animationFrame) async { +// _module!.ccall( +// "set_animation_frame", +// "void", +// ["void*".toJS, "int".toJS, "int".toJS, "int".toJS].toJS, +// [ +// _sceneManager!, +// entity.toJS, +// index.toJS, +// animationFrame.toJS, +// ].toJS, +// null); +// } + +// @override +// Future setBackgroundImage(String path, {bool fillHeight = false}) async { +// _module!.ccall( +// "set_background_image", +// "void", +// ["void*".toJS, "string".toJS, "bool".toJS].toJS, +// [_viewer!, path.toJS, fillHeight.toJS].toJS, +// null); +// } + +// @override +// Future setBackgroundImagePosition(double x, double y, +// {bool clamp = false}) async { +// _module!.ccall( +// "set_background_image_position", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS, "bool".toJS].toJS, +// [_viewer!, x.toJS, y.toJS, clamp.toJS].toJS, +// null); +// } + +// @override +// Future setBloom(double bloom) async { +// _module!.ccall("set_bloom", "void", ["void*".toJS, "float".toJS].toJS, +// [_viewer!, bloom.toJS].toJS, null); +// } + +// @override +// Future setBoneTransform( +// ThermionEntity entity, int boneIndex, Matrix4 transform, +// {int skinIndex = 0}) async { +// final ptr = _module!._malloc(16 * 4); +// for (int i = 0; i < 16; i++) { +// _module!.setValue( +// (ptr.toDartInt + (i * 4)).toJS, transform.storage[i].toJS, "float"); +// } +// final result = _module!.ccall( +// "set_bone_transform", +// "bool", +// ["void*".toJS, "int".toJS, "int".toJS, "int".toJS, "float*".toJS].toJS, +// [_sceneManager!, entity.toJS, skinIndex.toJS, boneIndex.toJS, ptr].toJS, +// null) as JSBoolean; +// _module!._free(ptr); +// if (!result.toDart) { +// throw Exception("Failed to set bone transform"); +// } +// } + +// @override +// Future setCamera(ThermionEntity entity, String? name) async { +// final result = _module!.ccall( +// "set_camera", +// "bool", +// ["void*".toJS, "int".toJS, "string".toJS].toJS, +// [_viewer!, entity.toJS, (name ?? "").toJS].toJS, +// null) as JSBoolean; +// if (!result.toDart) { +// throw Exception("Failed to set camera to entity ${entity}"); +// } +// } + +// @override +// Future setCameraCulling(double near, double far) async { +// _module!.ccall( +// "set_camera_culling", +// "void", +// ["void*".toJS, "double".toJS, "double".toJS].toJS, +// [_viewer!, near.toJS, far.toJS].toJS, +// null); +// } + +// @override +// Future setCameraExposure( +// double aperture, double shutterSpeed, double sensitivity) async { +// _module!.ccall( +// "set_camera_exposure", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS, "float".toJS].toJS, +// [ +// _viewer!, +// aperture.toJS, +// shutterSpeed.toJS, +// sensitivity.toJS, +// ].toJS, +// null); +// } + +// @override +// Future setCameraFocalLength(double focalLength) async { +// _module!.ccall( +// "set_camera_focal_length", +// "void", +// ["void*".toJS, "float".toJS].toJS, +// [_viewer!, focalLength.toJS].toJS, +// null); +// } + +// @override +// Future setCameraFocusDistance(double focusDistance) async { +// _module!.ccall( +// "set_camera_focus_distance", +// "void", +// ["void*".toJS, "float".toJS].toJS, +// [_viewer!, focusDistance.toJS].toJS, +// null); +// } + +// @override +// Future setCameraFov(double degrees, {bool horizontal = true}) async { +// _module!.ccall( +// "set_camera_fov", +// "void", +// ["void*".toJS, "float".toJS, "bool".toJS].toJS, +// [_viewer!, degrees.toJS, horizontal.toJS].toJS, +// null); +// } + + +// @override +// Future setCameraModelMatrix(List matrix) async { +// assert(matrix.length == 16, "Matrix must have 16 elements"); +// final ptr = _module!._malloc(16 * 8); +// for (int i = 0; i < 16; i++) { +// _module! +// .setValue((ptr.toDartInt + (i * 8)).toJS, matrix[i].toJS, "double"); +// } +// _module!.ccall("set_camera_model_matrix", "void", +// ["void*".toJS, "float*".toJS].toJS, [_viewer!, ptr].toJS, null); +// _module!._free(ptr); +// } + +// @override +// Future setFrameRate(int framerate) async { +// _module!.ccall( +// "set_frame_interval", +// "void", +// ["void*".toJS, "float".toJS].toJS, +// [_viewer!, (1 / framerate).toJS].toJS, +// null); +// } + +// @override +// Future setMainCamera() async { +// _module!.ccall( +// "set_main_camera", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); +// } + +// @override +// Future setMaterialColor(ThermionEntity entity, String meshName, +// int materialIndex, double r, double g, double b, double a) async { +// final result = _module!.ccall( +// "set_material_color", +// "bool", +// [ +// "void*".toJS, +// "int".toJS, +// "string".toJS, +// "int".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS +// ].toJS, +// [ +// _sceneManager!, +// entity.toJS, +// meshName.toJS, +// materialIndex.toJS, +// r.toJS, +// g.toJS, +// b.toJS, +// a.toJS +// ].toJS, +// null) as JSBoolean; +// if (!result.toDart) { +// throw Exception("Failed to set material color"); +// } +// } + +// @override +// Future setMorphTargetWeights( +// ThermionEntity entity, List weights) async { +// final numWeights = weights.length; +// final ptr = _module!._malloc(numWeights * 4); +// for (int i = 0; i < numWeights; i++) { +// _module! +// .setValue((ptr.toDartInt + (i * 4)).toJS, weights[i].toJS, "float"); +// } +// final result = _module!.ccall( +// "set_morph_target_weights", +// "bool", +// ["void*".toJS, "int".toJS, "float*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS, ptr, numWeights.toJS].toJS, +// null) as JSBoolean; +// _module!._free(ptr); +// if (!result.toDart) { +// throw Exception("Failed to set morph target weights"); +// } +// } + +// @override +// Future setParent(ThermionEntity child, ThermionEntity parent, +// {bool preserveScaling = false}) async { +// _module!.ccall( +// "set_parent", +// "void", +// ["void*".toJS, "int".toJS, "int".toJS, "bool".toJS].toJS, +// [_sceneManager!, child.toJS, parent.toJS, preserveScaling.toJS].toJS, +// null); +// } + +// @override +// Future setPriority(ThermionEntity entityId, int priority) { +// // TODO: implement setPriority +// throw UnimplementedError(); +// } + +// @override +// Future setRecording(bool recording) async { +// _module!.ccall("set_recording", "void", ["void*".toJS, "bool".toJS].toJS, +// [_viewer!, recording.toJS].toJS, null); +// } + +// @override +// Future setRecordingOutputDirectory(String outputDirectory) async { +// _module!.ccall( +// "set_recording_output_directory", +// "void", +// ["void*".toJS, "string".toJS].toJS, +// [_viewer!, outputDirectory.toJS].toJS, +// null); +// } + +// Timer? _renderLoop; + +// @override +// Future setRendering(bool render) async { +// if (render && !_rendering) { +// _rendering = true; +// _renderLoop = Timer.periodic(Duration(microseconds: 16667), (_) { +// this.render(); +// }); +// } else if (!render && _rendering) { +// _rendering = false; +// _renderLoop?.cancel(); +// _renderLoop = null; +// } +// } + +// @override +// Future setScale(ThermionEntity entity, double scale) async { +// _module!.ccall( +// "set_scale", +// "void", +// ["void*".toJS, "int".toJS, "float".toJS].toJS, +// [_sceneManager!, entity.toJS, scale.toJS].toJS, +// null); +// } + +// @override +// Future setToneMapping(ToneMapper mapper) async { +// _module!.ccall("set_tone_mapping", "void", ["void*".toJS, "int".toJS].toJS, +// [_viewer!, mapper.index.toJS].toJS, null); +// } + +// @override +// Future setTransform(ThermionEntity entity, Matrix4 transform) async { +// final ptr = _module!._malloc(16 * 4); +// for (int i = 0; i < 16; i++) { +// _module!.setValue( +// (ptr.toDartInt + (i * 4)).toJS, transform.storage[i].toJS, "float"); +// } +// final result = _module!.ccall( +// "set_transform", +// "bool", +// ["void*".toJS, "int".toJS, "float*".toJS].toJS, +// [_sceneManager!, entity.toJS, ptr].toJS, +// null) as JSBoolean; +// _module!._free(ptr); +// if (!result.toDart) { +// throw Exception("Failed to set transform"); +// } +// } + +// @override +// Future setViewFrustumCulling(bool enabled) async { +// _module!.ccall("set_view_frustum_culling", "void", +// ["void*".toJS, "bool".toJS].toJS, [_viewer!, enabled.toJS].toJS, null); +// } + +// @override +// Future stopAnimation(ThermionEntity entity, int animationIndex) async { +// _module!.ccall( +// "stop_animation", +// "void", +// ["void*".toJS, "int".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS, animationIndex.toJS].toJS, +// null); +// } + +// @override +// Future stopAnimationByName(ThermionEntity entity, String name) async { +// final namePtr = _allocateString(name); +// _module!.ccall( +// "stop_animation_by_name", +// "void", +// ["void*".toJS, "int".toJS, "char*".toJS].toJS, +// [_sceneManager!, entity.toJS, namePtr].toJS, +// null); +// _module!._free(namePtr); +// } + +// @override +// Future testCollisions(ThermionEntity entity) async { +// final result = _module!.ccall( +// "test_collisions", +// "bool", +// ["void*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null) as JSBoolean; +// return result.toDart; +// } + +// @override +// Future transformToUnitCube(ThermionEntity entity) async { +// _module!.ccall( +// "transform_to_unit_cube", +// "void", +// ["void*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null); +// } + +// @override +// Future updateBoneMatrices(ThermionEntity entity) async { +// _module!.ccall( +// "update_bone_matrices", +// "void", +// ["void*".toJS, "int".toJS].toJS, +// [_sceneManager!, entity.toJS].toJS, +// null); +// } + +// @override +// Future zoomBegin() async { +// _module!.ccall( +// "scroll_begin", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); +// } + +// @override +// Future zoomEnd() async { +// _module!.ccall( +// "scroll_end", "void", ["void*".toJS].toJS, [_viewer!].toJS, null); +// } + +// @override +// Future zoomUpdate(double x, double y, double z) async { +// _module!.ccall( +// "scroll_update", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS, "float".toJS].toJS, +// [_viewer!, x.toJS, y.toJS, z.toJS].toJS, +// null); +// } + +// // Helper method to allocate a string in the WASM memory +// JSNumber _allocateString(String str) { +// final bytes = utf8.encode(str); +// final ptr = _module!._malloc(bytes.length + 1); +// for (var i = 0; i < bytes.length; i++) { +// _module!.setValue((ptr.toDartInt + i).toJS, bytes[i].toJS, "i8"); +// } +// _module!.setValue( +// (ptr.toDartInt + bytes.length).toJS, 0.toJS, "i8"); // Null terminator +// return ptr; +// } + +// @override +// Future setShadowType(ShadowType shadowType) async { +// _module!.ccall("set_shadow_type", "void", ["void*".toJS, "int".toJS].toJS, +// [_viewer!, shadowType.index.toJS].toJS, null); +// } + +// @override +// Future setShadowsEnabled(bool enabled) async { +// _module!.ccall("set_shadows_enabled", "void", +// ["void*".toJS, "bool".toJS].toJS, [_viewer!, enabled.toJS].toJS, null); +// } + +// @override +// Future setSoftShadowOptions( +// double penumbraScale, double penumbraRatioScale) async { +// _module!.ccall( +// "set_soft_shadow_options", +// "void", +// ["void*".toJS, "float".toJS, "float".toJS].toJS, +// [_viewer!, penumbraScale.toJS, penumbraRatioScale.toJS].toJS, +// null); +// } + +// @override +// Future getBoundingBox(ThermionEntity entity) { +// var minX = _module!._malloc(4); +// var minY = _module!._malloc(4); +// var maxX = _module!._malloc(4); +// var maxY = _module!._malloc(4); +// _module!.ccall( +// "get_bounding_box_to_out", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// "float*".toJS, +// "float*".toJS, +// "float*".toJS, +// "float*".toJS +// ].toJS, +// [_sceneManager!, entity.toJS, minX, minY, maxX, maxY].toJS, +// null); + +// final min = Vector2( +// (_module!.getValue(minX, "float") as JSNumber).toDartDouble, +// (_module!.getValue(minY, "float") as JSNumber).toDartDouble); +// final max = Vector2( +// (_module!.getValue(maxX, "float") as JSNumber).toDartDouble, +// (_module!.getValue(maxY, "float") as JSNumber).toDartDouble); + +// final box = Aabb2.minMax(min, max); +// _module!._free(minX); +// _module!._free(minY); +// _module!._free(maxX); +// _module!._free(maxY); + +// return Future.value(box); +// } + +// @override +// Future getCameraFov(bool horizontal) async { +// var fov = _module!.ccall( +// "get_camera_fov", +// "float", +// ["void*".toJS, "bool".toJS].toJS, +// [_viewer!, horizontal.toJS].toJS, +// null); +// return (fov as JSNumber).toDartDouble; +// } + +// @override +// Future queueRelativePositionUpdateWorldAxis(ThermionEntity entity, +// double viewportX, double viewportY, double x, double y, double z) async { +// _module!.ccall( +// "queue_relative_position_update_world_axis", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS, +// "float".toJS +// ].toJS, +// [ +// _sceneManager!, +// entity.toJS, +// viewportX.toJS, +// viewportY.toJS, +// x.toJS, +// y.toJS, +// z.toJS +// ].toJS, +// null); +// } + +// @override +// Future setLayerEnabled(int layer, bool enabled) async { +// _module!.ccall( +// "set_layer_visibility", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// "bool".toJS, +// ].toJS, +// [ +// _sceneManager!, +// layer.toJS, +// enabled.toJS, +// ].toJS, +// null); +// } + +// @override +// Future createIbl(double r, double g, double b, double intensity) async { +// _module!.ccall( +// "create_ibl", +// "void", +// [ +// "void*".toJS, +// "double".toJS, +// "double".toJS, +// "double".toJS, +// "double".toJS, +// ].toJS, +// [_sceneManager!, r.toJS, g.toJS, b.toJS, intensity.toJS].toJS, +// null); +// } + +// late JSNumber _pickGizmoCallbackPtr; + +// void _onPickGizmoCallback(ThermionEntity entity, int x, int y) { +// _gizmoPickResultController +// .add((entity: entity, x: x.toDouble(), y: y.toDouble())); +// } + +// @override +// void pickGizmo(int x, int y) { +// x = (x * pixelRatio).ceil(); +// y = (viewportDimensions.$2 - (y * pixelRatio)).ceil(); + +// _module!.ccall( +// "pick_gizmo", +// "void", +// [ +// "void*".toJS, +// "int".toJS, +// "int".toJS, +// "void*".toJS, +// ].toJS, +// [_sceneManager!, x.toJS, y.toJS, _pickGizmoCallbackPtr].toJS, +// null); +// } + +// @override +// Future setGizmoVisibility(bool visible) async { +// _module!.ccall( +// "set_gizmo_visibility", +// "void", +// [ +// "void*".toJS, +// "bool".toJS, +// ].toJS, +// [_sceneManager!, visible.toJS].toJS, +// null); +// } + +// @override +// Future setLightDirection( +// ThermionEntity lightEntity, Vector3 direction) async { +// direction.normalize(); +// _module!.ccall( +// "set_light_direction", +// "void", +// ["void*".toJS, "double".toJS, "double".toJS, "double".toJS].toJS, +// [_viewer!, direction.x.toJS, direction.y.toJS, direction.z.toJS].toJS, +// null); +// } + +// @override +// Future setLightPosition( +// ThermionEntity lightEntity, double x, double y, double z) async { +// _module!.ccall( +// "set_light_position", +// "void", +// ["void*".toJS, "double".toJS, "double".toJS, "double".toJS].toJS, +// [_viewer!, x.toJS, y.toJS, z.toJS].toJS, +// null); +// } + +// @override +// Future getAncestor(ThermionEntity entity) { +// // TODO: implement getAncestor +// throw UnimplementedError(); +// } + +// @override +// Future queuePositionUpdateFromViewportCoords( +// ThermionEntity entity, double x, double y) { +// // TODO: implement queuePositionUpdateFromViewportCoords +// throw UnimplementedError(); +// } + +// @override +// Future removeStencilHighlight(ThermionEntity entity) { +// // TODO: implement removeStencilHighlight +// throw UnimplementedError(); +// } + +// @override +// Future setStencilHighlight(ThermionEntity entity, +// {double r = 1.0, double g = 0.0, double b = 0.0}) { +// // TODO: implement setStencilHighlight +// throw UnimplementedError(); +// } + +// @override +// // TODO: implement entitiesAdded +// Stream get entitiesAdded => throw UnimplementedError(); + +// @override +// // TODO: implement entitiesRemoved +// Stream get entitiesRemoved => throw UnimplementedError(); + +// @override +// Future getCameraNear() { +// // TODO: implement getCameraNear +// throw UnimplementedError(); +// } + +// @override +// Future getViewportBoundingBox(ThermionEntity entity) { +// // TODO: implement getViewportBoundingBox +// throw UnimplementedError(); +// } + +// @override +// // TODO: implement lightsAdded +// Stream get lightsAdded => throw UnimplementedError(); + +// @override +// // TODO: implement lightsRemoved +// Stream get lightsRemoved => throw UnimplementedError(); + +// @override +// Future setCameraModelMatrix4(Matrix4 matrix) { +// // TODO: implement setCameraModelMatrix4 +// throw UnimplementedError(); +// } + +// @override +// Future setMaterialPropertyFloat(ThermionEntity entity, String propertyName, +// int materialIndex, double value) { +// // TODO: implement setMaterialPropertyFloat +// throw UnimplementedError(); +// } + +// @override +// Future setMaterialPropertyFloat4(ThermionEntity entity, String propertyName, +// int materialIndex, double f1, double f2, double f3, double f4) { +// // TODO: implement setMaterialPropertyFloat4 +// throw UnimplementedError(); +// } + +// @override +// Future addDirectLight(DirectLight light) { +// // TODO: implement addDirectLight +// throw UnimplementedError(); +// } + +// @override +// Future applyTexture(covariant ThermionTexture texture, ThermionEntity entity, +// {int materialIndex = 0, String parameterName = "baseColorMap"}) { +// // TODO: implement applyTexture +// throw UnimplementedError(); +// } + +// @override +// Future createTexture(td.Uint8List data) { +// // TODO: implement createTexture +// throw UnimplementedError(); +// } + +// @override +// Future createUbershaderMaterialInstance( +// {bool doubleSided = false, +// bool unlit = false, +// bool hasVertexColors = false, +// bool hasBaseColorTexture = false, +// bool hasNormalTexture = false, +// bool hasOcclusionTexture = false, +// bool hasEmissiveTexture = false, +// bool useSpecularGlossiness = false, +// AlphaMode alphaMode = AlphaMode.OPAQUE, +// bool enableDiagnostics = false, +// bool hasMetallicRoughnessTexture = false, +// int metallicRoughnessUV = 0, +// int baseColorUV = 0, +// bool hasClearCoatTexture = false, +// int clearCoatUV = 0, +// bool hasClearCoatRoughnessTexture = false, +// int clearCoatRoughnessUV = 0, +// bool hasClearCoatNormalTexture = false, +// int clearCoatNormalUV = 0, +// bool hasClearCoat = false, +// bool hasTransmission = false, +// bool hasTextureTransforms = false, +// int emissiveUV = 0, +// int aoUV = 0, +// int normalUV = 0, +// bool hasTransmissionTexture = false, +// int transmissionUV = 0, +// bool hasSheenColorTexture = false, +// int sheenColorUV = 0, +// bool hasSheenRoughnessTexture = false, +// int sheenRoughnessUV = 0, +// bool hasVolumeThicknessTexture = false, +// int volumeThicknessUV = 0, +// bool hasSheen = false, +// bool hasIOR = false, +// bool hasVolume = false}) { +// // TODO: implement createUbershaderMaterialInstance +// throw UnimplementedError(); +// } + +// @override +// Future createUnlitMaterialInstance() { +// // TODO: implement createUnlitMaterialInstance +// throw UnimplementedError(); +// } + +// @override +// Future destroyMaterialInstance(covariant MaterialInstance materialInstance) { +// // TODO: implement destroyMaterialInstance +// throw UnimplementedError(); +// } + +// @override +// Future destroyTexture(covariant ThermionTexture texture) { +// // TODO: implement destroyTexture +// throw UnimplementedError(); +// } + +// @override +// Future getMainCameraEntity() async { +// final entityId = _module!.ccall( +// "get_main_camera", "int", ["void*".toJS].toJS, [_viewer].toJS, null) +// as JSNumber; +// if (entityId.toDartInt == -1) { +// throw Exception("Failed to get main camera"); +// } +// return entityId.toDartInt; +// } + +// @override +// Future getMaterialInstanceAt( +// ThermionEntity entity, int index) { +// // TODO: implement getMaterialInstanceAt +// throw UnimplementedError(); +// } + +// @override +// Future requestFrame() async { +// // TODO: implement requestFrame +// } + +// @override +// // TODO: implement sceneUpdated +// Stream get sceneUpdated => throw UnimplementedError(); + +// @override +// Future setLayerVisibility(int layer, bool visible) { +// // TODO: implement setLayerVisibility +// throw UnimplementedError(); +// } + +// @override +// Future setMaterialPropertyInt(ThermionEntity entity, String propertyName, +// int materialIndex, int value) { +// // TODO: implement setMaterialPropertyInt +// throw UnimplementedError(); +// } + +// @override +// Future setVisibilityLayer(ThermionEntity entity, int layer) { +// // TODO: implement setVisibilityLayer +// throw UnimplementedError(); +// } - @override - Future setCameraLensProjection({double near = kNear, double far = kFar, double? aspect, double focalLength = kFocalLength}) { - // TODO: implement setCameraLensProjection - throw UnimplementedError(); - } +// @override +// Future setCameraLensProjection({double near = kNear, double far = kFar, double? aspect, double focalLength = kFocalLength}) { +// // TODO: implement setCameraLensProjection +// throw UnimplementedError(); +// } - @override - Future createCamera() { - // TODO: implement createCamera - throw UnimplementedError(); - } +// @override +// Future createCamera() { +// // TODO: implement createCamera +// throw UnimplementedError(); +// } - @override - Future setActiveCamera(covariant Camera camera) { - // TODO: implement setActiveCamera - throw UnimplementedError(); - } +// @override +// Future setActiveCamera(covariant Camera camera) { +// // TODO: implement setActiveCamera +// throw UnimplementedError(); +// } - final _hooks = []; +// final _hooks = []; - @override - Future registerRequestFrameHook(Future Function() hook) async { - if (!_hooks.contains(hook)) { - _hooks.add(hook); - } - } +// @override +// Future registerRequestFrameHook(Future Function() hook) async { +// if (!_hooks.contains(hook)) { +// _hooks.add(hook); +// } +// } - @override - Future unregisterRequestFrameHook(Future Function() hook) async { - if (_hooks.contains(hook)) { - _hooks.remove(hook); - } - } -} +// @override +// Future unregisterRequestFrameHook(Future Function() hook) async { +// if (_hooks.contains(hook)) { +// _hooks.remove(hook); +// } +// } +// } diff --git a/thermion_dart/lib/thermion_dart.dart b/thermion_dart/lib/thermion_dart.dart index 9985304a..c43d29c7 100644 --- a/thermion_dart/lib/thermion_dart.dart +++ b/thermion_dart/lib/thermion_dart.dart @@ -2,4 +2,4 @@ library filament_dart; export 'src/viewer/viewer.dart'; export 'src/input/input.dart'; -export 'src/utils/geometry.dart'; +export 'src/utils/utils.dart'; diff --git a/thermion_dart/native/include/APIBoundaryTypes.h b/thermion_dart/native/include/APIBoundaryTypes.h index 1a8b2195..cf022b63 100644 --- a/thermion_dart/native/include/APIBoundaryTypes.h +++ b/thermion_dart/native/include/APIBoundaryTypes.h @@ -8,23 +8,27 @@ extern "C" #include typedef int32_t EntityId; - typedef int32_t _ManipulatorMode; typedef struct TCamera TCamera; typedef struct TMaterialInstance TMaterialInstance; typedef struct TEngine TEngine; typedef struct TEntityManager TEntityManager; typedef struct TViewer TViewer; typedef struct TSceneManager TSceneManager; - + typedef struct TRenderTarget TRenderTarget; + typedef struct TSwapChain TSwapChain; + typedef struct TView TView; + typedef struct TGizmo TGizmo; + typedef struct TScene TScene; + struct TMaterialKey { - bool doubleSided = 1; - bool unlit = 1; - bool hasVertexColors = 1; - bool hasBaseColorTexture = 1; - bool hasNormalTexture = 1; - bool hasOcclusionTexture = 1; - bool hasEmissiveTexture = 1; - bool useSpecularGlossiness = 1; + bool doubleSided = true; + bool unlit = true; + bool hasVertexColors = true; + bool hasBaseColorTexture = true; + bool hasNormalTexture = true; + bool hasOcclusionTexture = true; + bool hasEmissiveTexture = true; + bool useSpecularGlossiness = true; int alphaMode = 4; bool enableDiagnostics = 4; union { @@ -39,42 +43,42 @@ extern "C" }; #else struct { - bool hasMetallicRoughnessTexture = 1; + bool hasMetallicRoughnessTexture = true; uint8_t metallicRoughnessUV = 7; }; struct { - bool hasSpecularGlossinessTexture = 1; + bool hasSpecularGlossinessTexture = true; uint8_t specularGlossinessUV = 7; }; #endif }; uint8_t baseColorUV; // -- 32 bit boundary -- - bool hasClearCoatTexture = 1; + bool hasClearCoatTexture = true; uint8_t clearCoatUV = 7; - bool hasClearCoatRoughnessTexture = 1; + bool hasClearCoatRoughnessTexture = true; uint8_t clearCoatRoughnessUV = 7; - bool hasClearCoatNormalTexture = 1; + bool hasClearCoatNormalTexture = true; uint8_t clearCoatNormalUV = 7; - bool hasClearCoat = 1; - bool hasTransmission = 1; + bool hasClearCoat = true; + bool hasTransmission = true; bool hasTextureTransforms = 6; // -- 32 bit boundary -- uint8_t emissiveUV; uint8_t aoUV; uint8_t normalUV; - bool hasTransmissionTexture = 1; + bool hasTransmissionTexture = true; uint8_t transmissionUV = 7; // -- 32 bit boundary -- - bool hasSheenColorTexture = 1; + bool hasSheenColorTexture = true; uint8_t sheenColorUV = 7; - bool hasSheenRoughnessTexture = 1; + bool hasSheenRoughnessTexture = true; uint8_t sheenRoughnessUV = 7; - bool hasVolumeThicknessTexture = 1; + bool hasVolumeThicknessTexture = true; uint8_t volumeThicknessUV = 7; - bool hasSheen = 1; - bool hasIOR = 1; - bool hasVolume = 1; + bool hasSheen = true; + bool hasIOR = true; + bool hasVolume = true; } ; typedef struct TMaterialKey TMaterialKey; diff --git a/thermion_dart/native/include/CustomGeometry.hpp b/thermion_dart/native/include/CustomGeometry.hpp index 5ecc568d..a3348b43 100644 --- a/thermion_dart/native/include/CustomGeometry.hpp +++ b/thermion_dart/native/include/CustomGeometry.hpp @@ -11,7 +11,7 @@ #include #include -namespace thermion_filament +namespace thermion { using namespace filament; diff --git a/thermion_dart/native/include/FilamentViewer.hpp b/thermion_dart/native/include/FilamentViewer.hpp index d8ee5058..3fb4f33f 100644 --- a/thermion_dart/native/include/FilamentViewer.hpp +++ b/thermion_dart/native/include/FilamentViewer.hpp @@ -36,7 +36,7 @@ #include "SceneManager.hpp" #include "ThreadPool.hpp" -namespace thermion_filament +namespace thermion { typedef std::chrono::time_point time_point_t; @@ -45,13 +45,6 @@ namespace thermion_filament using namespace gltfio; using namespace camutils; - enum ToneMapping - { - ACES, - FILMIC, - LINEAR - }; - class FilamentViewer { @@ -61,8 +54,9 @@ namespace thermion_filament FilamentViewer(const void *context, const ResourceLoaderWrapperImpl *const resourceLoaderWrapper, void *const platform = nullptr, const char *uberArchivePath = nullptr); ~FilamentViewer(); - void setToneMapping(ToneMapping toneMapping); - void setBloom(float strength); + View* createView(); + View* getViewAt(int index); + void loadSkybox(const char *const skyboxUri); void removeSkybox(); @@ -74,44 +68,37 @@ namespace thermion_filament void removeEntity(EntityId asset); void clearEntities(); - void updateViewport(uint32_t width, uint32_t height); - bool render( - uint64_t frameTimeInNanos, - void *pixelBuffer, - void (*callback)(void *buf, size_t size, void *data), - void *data); + void render( + uint64_t frameTimeInNanos + ); void setFrameInterval(float interval); - bool setCamera(EntityId asset, const char *nodeName); - void setMainCamera(); + void setMainCamera(View *view); EntityId getMainCamera(); Camera* getCamera(EntityId entity); float getCameraFov(bool horizontal); void setCameraFov(double fovDegrees, bool horizontal); - void createSwapChain(const void *surface, uint32_t width, uint32_t height); - void destroySwapChain(); + SwapChain* createSwapChain(const void *surface); + SwapChain* createSwapChain(uint32_t width, uint32_t height); + void destroySwapChain(SwapChain* swapChain); - void createRenderTarget(intptr_t textureId, uint32_t width, uint32_t height); + RenderTarget* createRenderTarget(intptr_t textureId, uint32_t width, uint32_t height); + void destroyRenderTarget(RenderTarget* renderTarget); Renderer *getRenderer(); + std::map> _renderable; + + void setRenderable(View* view, SwapChain* swapChain, bool renderable); + void setBackgroundColor(const float r, const float g, const float b, const float a); - void setBackgroundImage(const char *resourcePath, bool fillHeight); + void setBackgroundImage(const char *resourcePath, bool fillHeight, uint32_t width, uint32_t height); void clearBackgroundImage(); - void setBackgroundImagePosition(float x, float y, bool clamp); - - void setViewFrustumCulling(bool enabled); - - void setCameraManipulatorOptions(filament::camutils::Mode mode, double orbitSpeedX, double orbitSpeedY, double zoomSpeed); - void grabBegin(float x, float y, bool pan); - void grabUpdate(float x, float y); - void grabEnd(); - void scrollBegin(); - void scrollUpdate(float x, float y, float delta); - void scrollEnd(); - void pick(uint32_t x, uint32_t y, void (*callback)(EntityId entityId, int x, int y)); + void setBackgroundImagePosition(float x, float y, bool clamp, uint32_t width, uint32_t height); + + void pick(View *view, uint32_t x, uint32_t y, void (*callback)(EntityId entityId, int x, int y, View *view)); Engine* getEngine() { return _engine; } @@ -137,44 +124,38 @@ namespace thermion_filament void setLightDirection(EntityId entityId, float x, float y, float z); void removeLight(EntityId entityId); void clearLights(); - void setPostProcessing(bool enabled); - void setRecording(bool recording); - void setRecordingOutputDirectory(const char *path); - void capture(uint8_t *out, bool useFence, void (*onComplete)()); - - void setAntiAliasing(bool msaaEnabled, bool fxaaEnabled, bool taaEnabled); - void setDepthOfField(); - void setShadowsEnabled(bool enabled); - void setShadowType(ShadowType shadowType); - void setSoftShadowOptions( float penumbraScale, float penumbraRatioScale); + void capture(View* view, uint8_t *out, bool useFence, SwapChain* swapChain, void (*onComplete)()); + void capture(View* view, uint8_t *out, bool useFence, SwapChain* swapChain, RenderTarget* renderTarget, void (*onComplete)()); SceneManager *const getSceneManager() { return (SceneManager *const)_sceneManager; } + SwapChain* getSwapChainAt(int index) { + if(index < _swapChains.size()) { + return _swapChains[index]; + } + Log("Error: index %d is greater than available swapchains", index); + return nullptr; + } + void unprojectTexture(EntityId entity, uint8_t* input, uint32_t inputWidth, uint32_t inputHeight, uint8_t* out, uint32_t outWidth, uint32_t outHeight); private: const ResourceLoaderWrapperImpl *const _resourceLoaderWrapper; void* _context = nullptr; Scene *_scene = nullptr; - - View *_view = nullptr; - Engine *_engine = nullptr; - thermion_filament::ThreadPool *_tp = nullptr; + thermion::ThreadPool *_tp = nullptr; Renderer *_renderer = nullptr; - RenderTarget *_rt = nullptr; - Texture *_rtColor = nullptr; - Texture *_rtDepth = nullptr; - - SwapChain *_swapChain = nullptr; - SceneManager *_sceneManager = nullptr; + std::vector _renderTargets; + std::vector _swapChains; + std::vector _views; - std::mutex mtx; // mutex to ensure thread safety when removing assets + std::mutex _renderMutex; // mutex to ensure thread safety when removing assets std::vector _lights; Texture *_skyboxTexture = nullptr; @@ -187,16 +168,6 @@ namespace thermion_filament // Camera properties Camera *_mainCamera = nullptr; // the default camera added to every scene. If you want the *active* camera, access via View. - Manipulator *_manipulator = nullptr; - filament::camutils::Mode _manipulatorMode = filament::camutils::Mode::ORBIT; - double _orbitSpeedX = 0.01; - double _orbitSpeedY = 0.01; - double _zoomSpeed = 0.01; - - void _createManipulator(); - - ColorGrading *colorGrading = nullptr; - // background image properties uint32_t _imageHeight = 0; uint32_t _imageWidth = 0; @@ -215,12 +186,10 @@ namespace thermion_filament void savePng(void *data, size_t size, int frameNumber); void createBackgroundImage(); - time_point_t _recordingStartTime = std::chrono::high_resolution_clock::now(); + time_point_t _fpsCounterStartTime = std::chrono::high_resolution_clock::now(); - bool _recording = false; - std::string _recordingOutputDirectory = std::string("/tmp"); - std::mutex _recordingMutex; + std::mutex _imageMutex; double _cumulativeAnimationUpdateTime = 0; int _frameCount = 0; diff --git a/thermion_dart/native/include/Gizmo.hpp b/thermion_dart/native/include/Gizmo.hpp index 1358106b..cc8e0dde 100644 --- a/thermion_dart/native/include/Gizmo.hpp +++ b/thermion_dart/native/include/Gizmo.hpp @@ -21,7 +21,7 @@ #include "ThermionDartApi.h" -namespace thermion_filament { +namespace thermion { using namespace filament; using namespace utils; @@ -29,38 +29,13 @@ using namespace utils; class Gizmo { enum Axis { X, Y, Z}; - - class PickCallbackHandler { - public: - PickCallbackHandler(Gizmo* gizmo, void (*callback)(EntityId entityId, int x, int y)) : _gizmo(gizmo), _callback(callback) {}; - void handle(filament::View::PickingQueryResult const &result) { - auto x = static_cast(result.fragCoords.x); - auto y= static_cast(result.fragCoords.y); - for(int i = 0; i < 7; i++) { - if(_gizmo->_entities[i] == result.renderable) { - if(i < 4) { - return; - } - _gizmo->highlight(_gizmo->_entities[i - 4]); - _callback(Entity::smuggle(_gizmo->_entities[i - 4]), x, y); - return; - } - } - _gizmo->unhighlight(); - _callback(0, x, y); - delete(this); - } - - private: - Gizmo* _gizmo; - void (*_callback)(EntityId entityId, int x, int y); - - }; - + public: - Gizmo(Engine& engine, View *view, Scene *scene); + Gizmo(Engine *engine, View *view, Scene *scene); ~Gizmo(); + typedef void (*PickCallback)(EntityId entityId, uint32_t x, uint32_t y, View *view); + Entity x() { return _entities[0]; }; @@ -73,26 +48,49 @@ class Gizmo { Entity center() { return _entities[3]; }; - View* view() { - return _view; - } bool isActive() { return _isActive; } - void pick(uint32_t x, uint32_t y, void (*callback)(EntityId entityId, int x, int y)); + void pick(uint32_t x, uint32_t y, PickCallback callback); bool isGizmoEntity(Entity entity); void setVisibility(bool visible); private: + + class PickCallbackHandler { + public: + PickCallbackHandler(Gizmo* gizmo, PickCallback callback) : _gizmo(gizmo), _callback(callback) {}; + void handle(filament::View::PickingQueryResult const &result) { + auto x = static_cast(result.fragCoords.x); + auto y= static_cast(result.fragCoords.y); + for(int i = 0; i < 7; i++) { + if(_gizmo->_entities[i] == result.renderable) { + if(i < 4) { + return; + } + _gizmo->highlight(_gizmo->_entities[i - 4]); + _callback(Entity::smuggle(_gizmo->_entities[i - 4]), x, y, _gizmo->_view); + return; + } + } + _gizmo->unhighlight(); + _callback(0, x, y, _gizmo->_view); + delete(this); + } + + private: + Gizmo* _gizmo; + PickCallback _callback; + + }; void createTransparentRectangles(); void highlight(Entity entity); void unhighlight(); - Engine &_engine; - View *_view; + Engine *_engine; Scene *_scene; - filament::Camera *_camera; + View *_view; utils::Entity _entities[7] = { utils::Entity(), utils::Entity(), utils::Entity(), utils::Entity(), utils::Entity(), utils::Entity(), utils::Entity() }; Material* _material; MaterialInstance* _materialInstances[7]; diff --git a/thermion_dart/native/include/GridOverlay.hpp b/thermion_dart/native/include/GridOverlay.hpp index f4009bcd..09832200 100644 --- a/thermion_dart/native/include/GridOverlay.hpp +++ b/thermion_dart/native/include/GridOverlay.hpp @@ -22,7 +22,7 @@ #include "material/gizmo.h" -namespace thermion_filament { +namespace thermion { using namespace filament; using namespace utils; diff --git a/thermion_dart/native/include/ResourceBuffer.hpp b/thermion_dart/native/include/ResourceBuffer.hpp index 94f64c05..0a1d9c57 100644 --- a/thermion_dart/native/include/ResourceBuffer.hpp +++ b/thermion_dart/native/include/ResourceBuffer.hpp @@ -8,7 +8,7 @@ using namespace std::chrono_literals; #endif -namespace thermion_filament +namespace thermion { struct ResourceLoaderWrapperImpl : public ResourceLoaderWrapper diff --git a/thermion_dart/native/include/SceneManager.hpp b/thermion_dart/native/include/SceneManager.hpp index d955d17a..ef89e8c6 100644 --- a/thermion_dart/native/include/SceneManager.hpp +++ b/thermion_dart/native/include/SceneManager.hpp @@ -19,10 +19,8 @@ #include #include -#include "material/gizmo.h" - #include "CustomGeometry.hpp" -#include "Gizmo.hpp" + #include "APIBoundaryTypes.h" #include "GridOverlay.hpp" #include "ResourceBuffer.hpp" @@ -32,7 +30,7 @@ #include "tsl/robin_map.h" -namespace thermion_filament +namespace thermion { typedef int32_t EntityId; @@ -46,7 +44,7 @@ namespace thermion_filament class SceneManager { public: - SceneManager(View* view, + SceneManager( const ResourceLoaderWrapperImpl *const loader, Engine *engine, Scene *scene, @@ -94,7 +92,7 @@ namespace thermion_filament /// @return an Entity representing the FilamentAsset associated with the loaded FilamentAsset. /// EntityId loadGlb(const char *uri, int numInstances, bool keepData); - EntityId loadGlbFromBuffer(const uint8_t *data, size_t length, int numInstances = 1, bool keepData = false, int priority = 4, int layer = 0); + EntityId loadGlbFromBuffer(const uint8_t *data, size_t length, int numInstances = 1, bool keepData = false, int priority = 4, int layer = 0, bool loadResourcesAsync = false); EntityId createInstance(EntityId entityId); void remove(EntityId entity); @@ -111,9 +109,9 @@ namespace thermion_filament void setRotation(EntityId e, float rads, float x, float y, float z, float w); void queueTransformUpdates(EntityId* entities, math::mat4* transforms, int numEntities); - void queueRelativePositionUpdateWorldAxis(EntityId entity, float viewportCoordX, float viewportCoordY, float x, float y, float z); - void queueRelativePositionUpdateFromViewportVector(EntityId entityId, float viewportCoordX, float viewportCoordY); + void queueRelativePositionUpdateFromViewportVector(View* view, EntityId entityId, float viewportCoordX, float viewportCoordY); + const utils::Entity *getCameraEntities(EntityId e); size_t getCameraEntityCount(EntityId e); const utils::Entity *getLightEntities(EntityId e) noexcept; @@ -127,7 +125,7 @@ namespace thermion_filament bool setMorphAnimationBuffer( EntityId entityId, const float *const morphData, - const int *const morphIndices, + const uint32_t *const morphIndices, int numMorphTargets, int numFrames, float frameLengthInMs); @@ -231,12 +229,7 @@ namespace thermion_filament /// @param out a pointer large enough to store four floats (the min/max coordinates of the bounding box) /// @return /// - Aabb2 getBoundingBox(EntityId entity); - - /// - /// Toggles the visibility of the given layer. - /// - void setLayerVisibility(SceneManager::LAYERS layer, bool enabled); + Aabb2 getBoundingBox(View* view, EntityId entity); /// /// Creates an entity with the specified geometry/material/normals and adds to the scene. @@ -258,8 +251,6 @@ namespace thermion_filament friend class FilamentViewer; - Gizmo* gizmo = nullptr; - gltfio::MaterialProvider * const unlitMaterialProvider() { return _unlitMaterialProvider; } @@ -272,10 +263,6 @@ namespace thermion_filament return _geometry[entityId].get(); } - Scene* const getScene() { - return _scene; - } - bool isGltfAsset(EntityId entity) { return getAssetByEntityId(entity) != nullptr; } @@ -308,20 +295,21 @@ namespace thermion_filament void destroyCamera(Camera* camera); - void setCamera(Camera* camera); - size_t getCameraCount(); Camera* getCameraAt(size_t index); - Camera* getActiveCamera(); + bool isGizmoEntity(utils::Entity entity); + + Scene* getScene() { + return _scene; + } private: gltfio::AssetLoader *_assetLoader = nullptr; const ResourceLoaderWrapperImpl *const _resourceLoaderWrapper; Engine *_engine = nullptr; Scene *_scene = nullptr; - View* _view = nullptr; Camera* _mainCamera; gltfio::MaterialProvider *_ubershaderProvider = nullptr; @@ -331,6 +319,7 @@ namespace thermion_filament gltfio::TextureProvider *_ktxDecoder = nullptr; std::mutex _mutex; std::mutex _stencilMutex; + std::vector _materialInstances; utils::NameComponentManager *_ncm; diff --git a/thermion_dart/native/include/StreamBufferAdapter.hpp b/thermion_dart/native/include/StreamBufferAdapter.hpp index e76a9fda..abf8e3e0 100644 --- a/thermion_dart/native/include/StreamBufferAdapter.hpp +++ b/thermion_dart/native/include/StreamBufferAdapter.hpp @@ -5,7 +5,7 @@ #include #include -namespace thermion_filament { +namespace thermion { // diff --git a/thermion_dart/native/include/TCamera.h b/thermion_dart/native/include/TCamera.h new file mode 100644 index 00000000..a0ca7e17 --- /dev/null +++ b/thermion_dart/native/include/TCamera.h @@ -0,0 +1,50 @@ +#pragma once + +#ifdef __cplusplus +namespace thermion { +extern "C" +{ +#endif + +#include "ThermionDartApi.h" + +enum Projection { + Perspective, + Orthographic +}; + +// Camera methods +EMSCRIPTEN_KEEPALIVE void set_camera_exposure(TCamera *camera, float aperture, float shutterSpeed, float sensitivity); +EMSCRIPTEN_KEEPALIVE void set_camera_model_matrix(TCamera *camera, double4x4 matrix); +EMSCRIPTEN_KEEPALIVE TCamera *get_camera(TViewer *viewer, EntityId entity); +EMSCRIPTEN_KEEPALIVE double4x4 get_camera_model_matrix(TCamera *const camera); +EMSCRIPTEN_KEEPALIVE double4x4 get_camera_view_matrix(TCamera *const camera); +EMSCRIPTEN_KEEPALIVE double4x4 get_camera_projection_matrix(TCamera *const camera); +EMSCRIPTEN_KEEPALIVE double4x4 get_camera_culling_projection_matrix(TCamera *const camera); +EMSCRIPTEN_KEEPALIVE const double *const get_camera_frustum(TCamera *const camera); +EMSCRIPTEN_KEEPALIVE void set_camera_projection_matrix(TCamera *camera, double4x4 matrix, double near, double far); +EMSCRIPTEN_KEEPALIVE void set_camera_projection_from_fov(TCamera *camera, double fovInDegrees, double aspect, double near, double far, bool horizontal); +EMSCRIPTEN_KEEPALIVE double get_camera_focal_length(TCamera *const camera); +EMSCRIPTEN_KEEPALIVE double Camera_getFocalLength(TCamera *const camera); +EMSCRIPTEN_KEEPALIVE double Camera_getNear(TCamera *const camera); +EMSCRIPTEN_KEEPALIVE double Camera_getCullingFar(TCamera *const camera); +EMSCRIPTEN_KEEPALIVE double4x4 Camera_getViewMatrix(TCamera *const camera); +EMSCRIPTEN_KEEPALIVE double4x4 Camera_getModelMatrix(TCamera* camera); + +EMSCRIPTEN_KEEPALIVE double get_camera_near(TCamera *camera); +EMSCRIPTEN_KEEPALIVE double get_camera_culling_far(TCamera *camera); +EMSCRIPTEN_KEEPALIVE float get_camera_fov(TCamera *camera, bool horizontal); +EMSCRIPTEN_KEEPALIVE void set_camera_focus_distance(TCamera *camera, float focusDistance); + +EMSCRIPTEN_KEEPALIVE void Camera_setCustomProjectionWithCulling(TCamera* camera, double4x4 projectionMatrix, double near, double far); +EMSCRIPTEN_KEEPALIVE void Camera_setModelMatrix(TCamera* camera, double4x4 modelMatrix); +EMSCRIPTEN_KEEPALIVE void Camera_setLensProjection(TCamera *camera, double near, double far, double aspect, double focalLength); +EMSCRIPTEN_KEEPALIVE EntityId Camera_getEntity(TCamera* camera); +EMSCRIPTEN_KEEPALIVE void Camera_setProjection(TCamera *const tCamera, Projection projection, double left, double right, + double bottom, double top, + double near, double far); + +#ifdef __cplusplus +} +} +#endif diff --git a/thermion_dart/native/include/TGizmo.h b/thermion_dart/native/include/TGizmo.h new file mode 100644 index 00000000..df42119d --- /dev/null +++ b/thermion_dart/native/include/TGizmo.h @@ -0,0 +1,19 @@ +#pragma once + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "ThermionDartApi.h" +#include "TGizmo.h" + +typedef void (*GizmoPickCallback)(EntityId entityId, uint32_t x, uint32_t y, TView* view); + +EMSCRIPTEN_KEEPALIVE TGizmo* Gizmo_new(TEngine *tEngine, TView *tView, TScene *tScene); +EMSCRIPTEN_KEEPALIVE void Gizmo_pick(TGizmo *tGizmo, uint32_t x, uint32_t y, GizmoPickCallback callback); +EMSCRIPTEN_KEEPALIVE void Gizmo_setVisibility(TGizmo *tGizmo, bool visible); + +#ifdef __cplusplus +} +#endif diff --git a/thermion_dart/native/include/TView.h b/thermion_dart/native/include/TView.h new file mode 100644 index 00000000..563d6fce --- /dev/null +++ b/thermion_dart/native/include/TView.h @@ -0,0 +1,49 @@ +#pragma once + +#ifdef __cplusplus +namespace thermion { +extern "C" +{ +#endif + +#include "ThermionDartApi.h" + +struct TViewport { + int32_t left; + int32_t bottom; + uint32_t width; + uint32_t height; +}; +typedef struct TViewport TViewport; + +enum ToneMapping +{ + ACES, + FILMIC, + LINEAR +}; + +// View +EMSCRIPTEN_KEEPALIVE TViewport View_getViewport(TView *view); +EMSCRIPTEN_KEEPALIVE void View_updateViewport(TView *view, uint32_t width, uint32_t height); +EMSCRIPTEN_KEEPALIVE void View_setRenderTarget(TView *view, TRenderTarget *renderTarget); +EMSCRIPTEN_KEEPALIVE void View_setFrustumCullingEnabled(TView *view, bool enabled); +EMSCRIPTEN_KEEPALIVE void View_updateViewport(TView* tView, uint32_t width, uint32_t height); +EMSCRIPTEN_KEEPALIVE void View_setRenderTarget(TView* tView, TRenderTarget* tRenderTarget); +EMSCRIPTEN_KEEPALIVE void View_setFrustumCullingEnabled(TView* tView, bool enabled); +EMSCRIPTEN_KEEPALIVE void View_setPostProcessing(TView* tView, bool enabled); +EMSCRIPTEN_KEEPALIVE void View_setShadowsEnabled(TView* tView, bool enabled); +EMSCRIPTEN_KEEPALIVE void View_setShadowType(TView* tView, int shadowType); +EMSCRIPTEN_KEEPALIVE void View_setSoftShadowOptions(TView* tView, float penumbraScale, float penumbraRatioScale); +EMSCRIPTEN_KEEPALIVE void View_setBloom(TView* tView, float strength); +EMSCRIPTEN_KEEPALIVE void View_setToneMapping(TView* tView, TEngine* tEngine, ToneMapping toneMapping); +EMSCRIPTEN_KEEPALIVE void View_setAntiAliasing(TView *tView, bool msaa, bool fxaa, bool taa); +EMSCRIPTEN_KEEPALIVE void View_setLayerEnabled(TView *tView, int layer, bool visible); +EMSCRIPTEN_KEEPALIVE void View_setCamera(TView *tView, TCamera *tCamera); +EMSCRIPTEN_KEEPALIVE TScene* View_getScene(TView *tView); +EMSCRIPTEN_KEEPALIVE TCamera* View_getCamera(TView *tView); + +#ifdef __cplusplus +} +} +#endif diff --git a/thermion_dart/native/include/ThermionDartAPIUtils.h b/thermion_dart/native/include/ThermionDartAPIUtils.h new file mode 100644 index 00000000..9e8e7858 --- /dev/null +++ b/thermion_dart/native/include/ThermionDartAPIUtils.h @@ -0,0 +1,27 @@ +#pragma once +#include +#include "APIBoundaryTypes.h" + +namespace thermion { + +// Helper function to convert filament::math::mat4 to double4x4 +static double4x4 convert_mat4_to_double4x4(const filament::math::mat4 &mat) +{ + return double4x4{ + {mat[0][0], mat[0][1], mat[0][2], mat[0][3]}, + {mat[1][0], mat[1][1], mat[1][2], mat[1][3]}, + {mat[2][0], mat[2][1], mat[2][2], mat[2][3]}, + {mat[3][0], mat[3][1], mat[3][2], mat[3][3]}, + }; +} + +// Helper function to convert double4x4 to filament::math::mat4 +static filament::math::mat4 convert_double4x4_to_mat4(const double4x4 &d_mat) +{ + return filament::math::mat4{ + filament::math::float4{float(d_mat.col1[0]), float(d_mat.col1[1]), float(d_mat.col1[2]), float(d_mat.col1[3])}, + filament::math::float4{float(d_mat.col2[0]), float(d_mat.col2[1]), float(d_mat.col2[2]), float(d_mat.col2[3])}, + filament::math::float4{float(d_mat.col3[0]), float(d_mat.col3[1]), float(d_mat.col3[2]), float(d_mat.col3[3])}, + filament::math::float4{float(d_mat.col4[0]), float(d_mat.col4[1]), float(d_mat.col4[2]), float(d_mat.col4[3])}}; +} +} \ No newline at end of file diff --git a/thermion_dart/native/include/ThermionDartApi.h b/thermion_dart/native/include/ThermionDartApi.h index 33218f60..18a534e8 100644 --- a/thermion_dart/native/include/ThermionDartApi.h +++ b/thermion_dart/native/include/ThermionDartApi.h @@ -48,30 +48,58 @@ #include "APIBoundaryTypes.h" #include "ResourceBuffer.hpp" +#include "ThermionDartAPIUtils.h" #ifdef __cplusplus extern "C" { #endif - EMSCRIPTEN_KEEPALIVE TViewer *create_filament_viewer(const void *const context, const void *const loader, void *const platform, const char *uberArchivePath); + + + EMSCRIPTEN_KEEPALIVE TViewer *Viewer_create(const void *const context, const void *const loader, void *const platform, const char *uberArchivePath); EMSCRIPTEN_KEEPALIVE void destroy_filament_viewer(TViewer *viewer); EMSCRIPTEN_KEEPALIVE TSceneManager *Viewer_getSceneManager(TViewer *viewer); + EMSCRIPTEN_KEEPALIVE TRenderTarget* Viewer_createRenderTarget(TViewer *viewer, intptr_t texture, uint32_t width, uint32_t height); + EMSCRIPTEN_KEEPALIVE void Viewer_destroyRenderTarget(TViewer *viewer, TRenderTarget* tRenderTarget); + EMSCRIPTEN_KEEPALIVE TSwapChain *Viewer_createSwapChain(TViewer *viewer, const void *const window); + EMSCRIPTEN_KEEPALIVE TSwapChain *Viewer_createHeadlessSwapChain(TViewer *viewer, uint32_t width, uint32_t height); + EMSCRIPTEN_KEEPALIVE void Viewer_destroySwapChain(TViewer *viewer, TSwapChain* swapChain); + EMSCRIPTEN_KEEPALIVE void Viewer_render( + TViewer *viewer); + EMSCRIPTEN_KEEPALIVE void Viewer_capture( + TViewer *viewer, + TView *view, + TSwapChain *swapChain, + uint8_t *pixelBuffer, + void (*callback)(void)); + EMSCRIPTEN_KEEPALIVE void Viewer_captureRenderTarget( + TViewer *viewer, + TView *view, + TSwapChain *swapChain, + TRenderTarget *renderTarget, + uint8_t *pixelBuffer, + void (*callback)(void)); + EMSCRIPTEN_KEEPALIVE TView* Viewer_createView(TViewer *viewer); + EMSCRIPTEN_KEEPALIVE TView* Viewer_getViewAt(TViewer *viewer, int index); + EMSCRIPTEN_KEEPALIVE void Viewer_setMainCamera(TViewer *tViewer, TView *tView); + EMSCRIPTEN_KEEPALIVE TSwapChain* Viewer_getSwapChainAt(TViewer *tViewer, int index); + EMSCRIPTEN_KEEPALIVE void Viewer_setViewRenderable(TViewer *viewer, TSwapChain *swapChain, TView* view, bool renderable); + EMSCRIPTEN_KEEPALIVE void Viewer_pick(TViewer *viewer, TView* tView, int x, int y, void (*callback)(EntityId entityId, int x, int y, TView *tView)); // Engine EMSCRIPTEN_KEEPALIVE TEngine *Viewer_getEngine(TViewer* viewer); EMSCRIPTEN_KEEPALIVE TCamera *Engine_getCameraComponent(TEngine* tEngine, EntityId entityId); EMSCRIPTEN_KEEPALIVE void Engine_setTransform(TEngine* tEngine, EntityId entity, double4x4 transform); - - EMSCRIPTEN_KEEPALIVE void create_render_target(TViewer *viewer, intptr_t texture, uint32_t width, uint32_t height); + EMSCRIPTEN_KEEPALIVE void clear_background_image(TViewer *viewer); EMSCRIPTEN_KEEPALIVE void set_background_image(TViewer *viewer, const char *path, bool fillHeight); EMSCRIPTEN_KEEPALIVE void set_background_image_position(TViewer *viewer, float x, float y, bool clamp); EMSCRIPTEN_KEEPALIVE void set_background_color(TViewer *viewer, const float r, const float g, const float b, const float a); - EMSCRIPTEN_KEEPALIVE void set_tone_mapping(TViewer *viewer, int toneMapping); - EMSCRIPTEN_KEEPALIVE void set_bloom(TViewer *viewer, float strength); + + EMSCRIPTEN_KEEPALIVE void load_skybox(TViewer *viewer, const char *skyboxPath); - EMSCRIPTEN_KEEPALIVE void load_ibl(TViewer *viewer, const char *iblPath, float intensity); + EMSCRIPTEN_KEEPALIVE void Viewer_loadIbl(TViewer *viewer, const char *iblPath, float intensity); EMSCRIPTEN_KEEPALIVE void create_ibl(TViewer *viewer, float r, float g, float b, float intensity); EMSCRIPTEN_KEEPALIVE void rotate_ibl(TViewer *viewer, float *rotationMatrix); EMSCRIPTEN_KEEPALIVE void remove_skybox(TViewer *viewer); @@ -99,35 +127,15 @@ extern "C" EMSCRIPTEN_KEEPALIVE void set_light_position(TViewer *viewer, EntityId light, float x, float y, float z); EMSCRIPTEN_KEEPALIVE void set_light_direction(TViewer *viewer, EntityId light, float x, float y, float z); EMSCRIPTEN_KEEPALIVE EntityId load_glb(TSceneManager *sceneManager, const char *assetPath, int numInstances, bool keepData); - EMSCRIPTEN_KEEPALIVE EntityId load_glb_from_buffer(TSceneManager *sceneManager, const void *const data, size_t length, bool keepData, int priority, int layer); EMSCRIPTEN_KEEPALIVE EntityId load_gltf(TSceneManager *sceneManager, const char *assetPath, const char *relativePath, bool keepData); EMSCRIPTEN_KEEPALIVE EntityId create_instance(TSceneManager *sceneManager, EntityId id); EMSCRIPTEN_KEEPALIVE int get_instance_count(TSceneManager *sceneManager, EntityId entityId); EMSCRIPTEN_KEEPALIVE void get_instances(TSceneManager *sceneManager, EntityId entityId, EntityId *out); - EMSCRIPTEN_KEEPALIVE void set_main_camera(TViewer *viewer); + EMSCRIPTEN_KEEPALIVE EntityId get_main_camera(TViewer *viewer); - EMSCRIPTEN_KEEPALIVE bool set_camera(TViewer *viewer, EntityId entity, const char *nodeName); - EMSCRIPTEN_KEEPALIVE void set_view_frustum_culling(TViewer *viewer, bool enabled); - EMSCRIPTEN_KEEPALIVE bool render( - TViewer *viewer, - uint64_t frameTimeInNanos, - void *pixelBuffer, - void (*callback)(void *buf, size_t size, void *data), - void *data); - EMSCRIPTEN_KEEPALIVE void capture( - TViewer *viewer, - uint8_t *pixelBuffer, - void (*callback)(void)); - EMSCRIPTEN_KEEPALIVE void create_swap_chain(TViewer *viewer, const void *const window, uint32_t width, uint32_t height); - EMSCRIPTEN_KEEPALIVE void destroy_swap_chain(TViewer *viewer); + EMSCRIPTEN_KEEPALIVE void set_frame_interval(TViewer *viewer, float interval); - EMSCRIPTEN_KEEPALIVE void update_viewport(TViewer *viewer, uint32_t width, uint32_t height); - EMSCRIPTEN_KEEPALIVE void scroll_begin(TViewer *viewer); - EMSCRIPTEN_KEEPALIVE void scroll_update(TViewer *viewer, float x, float y, float z); - EMSCRIPTEN_KEEPALIVE void scroll_end(TViewer *viewer); - EMSCRIPTEN_KEEPALIVE void grab_begin(TViewer *viewer, float x, float y, bool pan); - EMSCRIPTEN_KEEPALIVE void grab_update(TViewer *viewer, float x, float y); - EMSCRIPTEN_KEEPALIVE void grab_end(TViewer *viewer); + EMSCRIPTEN_KEEPALIVE void apply_weights( TSceneManager *sceneManager, EntityId entity, @@ -139,14 +147,6 @@ extern "C" EntityId entity, const float *const morphData, int numWeights); - EMSCRIPTEN_KEEPALIVE bool set_morph_animation( - TSceneManager *sceneManager, - EntityId entity, - const float *const morphData, - const int *const morphIndices, - int numMorphTargets, - int numFrames, - float frameLengthInMs); EMSCRIPTEN_KEEPALIVE TMaterialInstance *create_material_instance(TSceneManager *sceneManager, TMaterialKey materialConfig); EMSCRIPTEN_KEEPALIVE TMaterialInstance *create_unlit_material_instance(TSceneManager *sceneManager); @@ -199,6 +199,19 @@ extern "C" EMSCRIPTEN_KEEPALIVE bool SceneManager_setTransform(TSceneManager *sceneManager, EntityId entityId, const double *const transform); EMSCRIPTEN_KEEPALIVE void SceneManager_queueTransformUpdates(TSceneManager *sceneManager, EntityId* entities, const double* const transforms, int numEntities); + EMSCRIPTEN_KEEPALIVE TCamera* SceneManager_findCameraByName(TSceneManager* tSceneManager, EntityId entity, const char* name); + EMSCRIPTEN_KEEPALIVE void SceneManager_setVisibilityLayer(TSceneManager *tSceneManager, EntityId entity, int layer); + EMSCRIPTEN_KEEPALIVE TScene* SceneManager_getScene(TSceneManager *tSceneManager); + EMSCRIPTEN_KEEPALIVE EntityId SceneManager_loadGlbFromBuffer(TSceneManager *sceneManager, const uint8_t *const, size_t length, bool keepData, int priority, int layer, bool loadResourcesAsync); + EMSCRIPTEN_KEEPALIVE bool SceneManager_setMorphAnimation( + TSceneManager *sceneManager, + EntityId entity, + const float *const morphData, + const uint32_t *const morphIndices, + int numMorphTargets, + int numFrames, + float frameLengthInMs); + EMSCRIPTEN_KEEPALIVE bool update_bone_matrices(TSceneManager *sceneManager, EntityId entityId); EMSCRIPTEN_KEEPALIVE void get_morph_target_name(TSceneManager *sceneManager, EntityId assetEntity, EntityId childEntity, char *const outPtr, int index); @@ -209,70 +222,31 @@ extern "C" EMSCRIPTEN_KEEPALIVE void transform_to_unit_cube(TSceneManager *sceneManager, EntityId asset); EMSCRIPTEN_KEEPALIVE void queue_relative_position_update_world_axis(TSceneManager *sceneManager, EntityId entity, float viewportX, float viewportY, float x, float y, float z); - EMSCRIPTEN_KEEPALIVE void queue_position_update_from_viewport_coords(TSceneManager *sceneManager, EntityId entity, float viewportX, float viewportY); + EMSCRIPTEN_KEEPALIVE void queue_position_update_from_viewport_coords(TSceneManager *sceneManager, TView *view, EntityId entity, float viewportX, float viewportY); EMSCRIPTEN_KEEPALIVE void set_position(TSceneManager *sceneManager, EntityId entity, float x, float y, float z); EMSCRIPTEN_KEEPALIVE void set_rotation(TSceneManager *sceneManager, EntityId entity, float rads, float x, float y, float z, float w); EMSCRIPTEN_KEEPALIVE void set_scale(TSceneManager *sceneManager, EntityId entity, float scale); - // Camera methods - EMSCRIPTEN_KEEPALIVE void set_view_frustum_culling(TViewer *viewer, bool enabled); - EMSCRIPTEN_KEEPALIVE void set_camera_exposure(TCamera *camera, float aperture, float shutterSpeed, float sensitivity); - EMSCRIPTEN_KEEPALIVE void set_camera_model_matrix(TCamera *camera, double4x4 matrix); - EMSCRIPTEN_KEEPALIVE TCamera *get_camera(TViewer *viewer, EntityId entity); - EMSCRIPTEN_KEEPALIVE double4x4 get_camera_model_matrix(TCamera *const camera); - EMSCRIPTEN_KEEPALIVE double4x4 get_camera_view_matrix(TCamera *const camera); - EMSCRIPTEN_KEEPALIVE double4x4 get_camera_projection_matrix(TCamera *const camera); - EMSCRIPTEN_KEEPALIVE double4x4 get_camera_culling_projection_matrix(TCamera *const camera); - EMSCRIPTEN_KEEPALIVE const double *const get_camera_frustum(TCamera *const camera); - EMSCRIPTEN_KEEPALIVE void set_camera_projection_matrix(TCamera *camera, double4x4 matrix, double near, double far); - EMSCRIPTEN_KEEPALIVE void set_camera_projection_from_fov(TCamera *camera, double fovInDegrees, double aspect, double near, double far, bool horizontal); - EMSCRIPTEN_KEEPALIVE double get_camera_focal_length(TCamera *const camera); - EMSCRIPTEN_KEEPALIVE double Camera_getFocalLength(TCamera *const camera); - EMSCRIPTEN_KEEPALIVE double Camera_getNear(TCamera *const camera); - EMSCRIPTEN_KEEPALIVE double Camera_getCullingFar(TCamera *const camera); - EMSCRIPTEN_KEEPALIVE double4x4 Camera_getViewMatrix(TCamera *const camera); - EMSCRIPTEN_KEEPALIVE double4x4 Camera_getModelMatrix(TCamera* camera); - - EMSCRIPTEN_KEEPALIVE double get_camera_near(TCamera *camera); - EMSCRIPTEN_KEEPALIVE double get_camera_culling_far(TCamera *camera); - EMSCRIPTEN_KEEPALIVE float get_camera_fov(TCamera *camera, bool horizontal); - EMSCRIPTEN_KEEPALIVE void set_camera_focus_distance(TCamera *camera, float focusDistance); - EMSCRIPTEN_KEEPALIVE void set_camera_manipulator_options(TViewer *viewer, _ManipulatorMode mode, double orbitSpeedX, double orbitSpeedY, double zoomSpeed); - - EMSCRIPTEN_KEEPALIVE void Camera_setCustomProjectionWithCulling(TCamera* camera, double4x4 projectionMatrix, double near, double far); - EMSCRIPTEN_KEEPALIVE void Camera_setModelMatrix(TCamera* camera, double4x4 modelMatrix); - EMSCRIPTEN_KEEPALIVE void Camera_setLensProjection(TCamera *camera, double near, double far, double aspect, double focalLength); - - EMSCRIPTEN_KEEPALIVE EntityId Camera_getEntity(TCamera* camera); EMSCRIPTEN_KEEPALIVE TCamera *Engine_getCameraComponent(TEngine *engine, EntityId entity); - EMSCRIPTEN_KEEPALIVE TEntityManager *Engine_getEntityManager(TEngine *engine); // SceneManager - EMSCRIPTEN_KEEPALIVE TCamera* SceneManager_createCamera(TSceneManager *sceneManager); EMSCRIPTEN_KEEPALIVE void SceneManager_destroyCamera(TSceneManager *sceneManager, TCamera* camera); - EMSCRIPTEN_KEEPALIVE void SceneManager_setCamera(TSceneManager *sceneManager, TCamera* camera); EMSCRIPTEN_KEEPALIVE size_t SceneManager_getCameraCount(TSceneManager *sceneManager); EMSCRIPTEN_KEEPALIVE TCamera* SceneManager_getCameraAt(TSceneManager *sceneManager, size_t index); - EMSCRIPTEN_KEEPALIVE TCamera* SceneManager_getActiveCamera(TSceneManager *sceneManager); EMSCRIPTEN_KEEPALIVE int hide_mesh(TSceneManager *sceneManager, EntityId entity, const char *meshName); EMSCRIPTEN_KEEPALIVE int reveal_mesh(TSceneManager *sceneManager, EntityId entity, const char *meshName); - EMSCRIPTEN_KEEPALIVE void set_post_processing(TViewer *viewer, bool enabled); - EMSCRIPTEN_KEEPALIVE void set_shadows_enabled(TViewer *viewer, bool enabled); - EMSCRIPTEN_KEEPALIVE void set_shadow_type(TViewer *viewer, int shadowType); - EMSCRIPTEN_KEEPALIVE void set_soft_shadow_options(TViewer *viewer, float penumbraScale, float penumbraRatioScale); - EMSCRIPTEN_KEEPALIVE void set_antialiasing(TViewer *viewer, bool msaa, bool fxaa, bool taa); - EMSCRIPTEN_KEEPALIVE void filament_pick(TViewer *viewer, int x, int y, void (*callback)(EntityId entityId, int x, int y)); + + EMSCRIPTEN_KEEPALIVE const char *get_name_for_entity(TSceneManager *sceneManager, const EntityId entityId); EMSCRIPTEN_KEEPALIVE EntityId find_child_entity_by_name(TSceneManager *sceneManager, const EntityId parent, const char *name); EMSCRIPTEN_KEEPALIVE int get_entity_count(TSceneManager *sceneManager, const EntityId target, bool renderableOnly); EMSCRIPTEN_KEEPALIVE void get_entities(TSceneManager *sceneManager, const EntityId target, bool renderableOnly, EntityId *out); EMSCRIPTEN_KEEPALIVE const char *get_entity_name_at(TSceneManager *sceneManager, const EntityId target, int index, bool renderableOnly); - EMSCRIPTEN_KEEPALIVE void set_recording(TViewer *viewer, bool recording); - EMSCRIPTEN_KEEPALIVE void set_recording_output_directory(TViewer *viewer, const char *outputDirectory); + EMSCRIPTEN_KEEPALIVE void ios_dummy(); EMSCRIPTEN_KEEPALIVE void thermion_flutter_free(void *ptr); EMSCRIPTEN_KEEPALIVE void add_collision_component(TSceneManager *sceneManager, EntityId entityId, void (*callback)(const EntityId entityId1, const EntityId entityId2), bool affectsCollidingTransform); @@ -298,13 +272,11 @@ extern "C" EMSCRIPTEN_KEEPALIVE void set_parent(TSceneManager *sceneManager, EntityId child, EntityId parent, bool preserveScaling); EMSCRIPTEN_KEEPALIVE void test_collisions(TSceneManager *sceneManager, EntityId entity); EMSCRIPTEN_KEEPALIVE void set_priority(TSceneManager *sceneManager, EntityId entityId, int priority); - EMSCRIPTEN_KEEPALIVE void get_gizmo(TSceneManager *sceneManager, EntityId *out); - EMSCRIPTEN_KEEPALIVE Aabb2 get_bounding_box(TSceneManager *sceneManager, EntityId entity); - EMSCRIPTEN_KEEPALIVE void get_bounding_box_to_out(TSceneManager *sceneManager, EntityId entity, float *minX, float *minY, float *maxX, float *maxY); - EMSCRIPTEN_KEEPALIVE void set_layer_visibility(TSceneManager *sceneManager, int layer, bool visible); - EMSCRIPTEN_KEEPALIVE void set_visibility_layer(TSceneManager *sceneManager, EntityId entity, int layer); - EMSCRIPTEN_KEEPALIVE void pick_gizmo(TSceneManager *sceneManager, int x, int y, void (*callback)(EntityId entityId, int x, int y)); - EMSCRIPTEN_KEEPALIVE void set_gizmo_visibility(TSceneManager *sceneManager, bool visible); + + EMSCRIPTEN_KEEPALIVE Aabb2 get_bounding_box(TSceneManager *sceneManager, TView *view, EntityId entity); + EMSCRIPTEN_KEEPALIVE void get_bounding_box_to_out(TSceneManager *sceneManager, TView *view, EntityId entity, float *minX, float *minY, float *maxX, float *maxY); + + EMSCRIPTEN_KEEPALIVE void set_stencil_highlight(TSceneManager *sceneManager, EntityId entity, float r, float g, float b); EMSCRIPTEN_KEEPALIVE void remove_stencil_highlight(TSceneManager *sceneManager, EntityId entity); EMSCRIPTEN_KEEPALIVE void set_material_property_float(TSceneManager *sceneManager, EntityId entity, int materialIndex, const char *property, float value); diff --git a/thermion_dart/native/include/ThermionDartRenderThreadApi.h b/thermion_dart/native/include/ThermionDartRenderThreadApi.h index cccafd34..4b7979b3 100644 --- a/thermion_dart/native/include/ThermionDartRenderThreadApi.h +++ b/thermion_dart/native/include/ThermionDartRenderThreadApi.h @@ -2,8 +2,10 @@ #define _DART_FILAMENT_FFI_API_H #include "ThermionDartApi.h" +#include "TView.h" #ifdef __cplusplus +namespace thermion { extern "C" { #endif @@ -17,7 +19,7 @@ extern "C" typedef int32_t EntityId; typedef void (*FilamentRenderCallback)(void *const owner); - EMSCRIPTEN_KEEPALIVE void create_filament_viewer_render_thread( + EMSCRIPTEN_KEEPALIVE void Viewer_createOnRenderThread( void *const context, void *const platform, const char *uberArchivePath, @@ -25,32 +27,38 @@ extern "C" void (*renderCallback)(void *const renderCallbackOwner), void *const renderCallbackOwner, void (*callback)(TViewer *viewer)); - EMSCRIPTEN_KEEPALIVE void create_swap_chain_render_thread(TViewer *viewer, void *const surface, uint32_t width, uint32_t height, void (*onComplete)()); - EMSCRIPTEN_KEEPALIVE void destroy_swap_chain_render_thread(TViewer *viewer, void (*onComplete)()); - EMSCRIPTEN_KEEPALIVE void create_render_target_render_thread(TViewer *viewer, intptr_t nativeTextureId, uint32_t width, uint32_t height, void (*onComplete)()); + EMSCRIPTEN_KEEPALIVE void Viewer_createSwapChainRenderThread(TViewer *viewer, void *const surface, void (*onComplete)(TSwapChain*)); + EMSCRIPTEN_KEEPALIVE void Viewer_createHeadlessSwapChainRenderThread(TViewer *viewer, uint32_t width, uint32_t height, void (*onComplete)(TSwapChain*)); + EMSCRIPTEN_KEEPALIVE void Viewer_destroySwapChainRenderThread(TViewer *viewer, TSwapChain* swapChain, void (*onComplete)()); + EMSCRIPTEN_KEEPALIVE void Viewer_renderRenderThread(TViewer *viewer, TView* view, TSwapChain* swapChain); + EMSCRIPTEN_KEEPALIVE void Viewer_captureRenderThread(TViewer *viewer, TView* view, TSwapChain* swapChain, uint8_t* out, void (*onComplete)()); + EMSCRIPTEN_KEEPALIVE void Viewer_captureRenderTargetRenderThread(TViewer *viewer, TView* view, TSwapChain* swapChain, TRenderTarget* renderTarget, uint8_t* out, void (*onComplete)()); + EMSCRIPTEN_KEEPALIVE void Viewer_requestFrameRenderThread(TViewer *viewer, void(*onComplete)()); + EMSCRIPTEN_KEEPALIVE void Viewer_loadIblRenderThread(TViewer *viewer, const char *iblPath, float intensity, void(*onComplete)()); + EMSCRIPTEN_KEEPALIVE void View_setToneMappingRenderThread(TView *tView, TEngine *tEngine, thermion::ToneMapping toneMapping); + EMSCRIPTEN_KEEPALIVE void View_setBloomRenderThread(TView *tView, double bloom); + + EMSCRIPTEN_KEEPALIVE void destroy_filament_viewer_render_thread(TViewer *viewer); - EMSCRIPTEN_KEEPALIVE void render_render_thread(TViewer *viewer); - EMSCRIPTEN_KEEPALIVE void capture_render_thread(TViewer *viewer, uint8_t* out, void (*onComplete)()); - EMSCRIPTEN_KEEPALIVE FilamentRenderCallback make_render_callback_fn_pointer(FilamentRenderCallback); + + FilamentRenderCallback make_render_callback_fn_pointer(FilamentRenderCallback); EMSCRIPTEN_KEEPALIVE void set_rendering_render_thread(TViewer *viewer, bool rendering, void(*onComplete)()); - EMSCRIPTEN_KEEPALIVE void request_frame_render_thread(TViewer *viewer, void(*onComplete)()); + EMSCRIPTEN_KEEPALIVE void set_frame_interval_render_thread(TViewer *viewer, float frameInterval); EMSCRIPTEN_KEEPALIVE void set_background_color_render_thread(TViewer *viewer, const float r, const float g, const float b, const float a); EMSCRIPTEN_KEEPALIVE void clear_background_image_render_thread(TViewer *viewer); EMSCRIPTEN_KEEPALIVE void set_background_image_render_thread(TViewer *viewer, const char *path, bool fillHeight, void (*onComplete)()); EMSCRIPTEN_KEEPALIVE void set_background_image_position_render_thread(TViewer *viewer, float x, float y, bool clamp); - EMSCRIPTEN_KEEPALIVE void set_tone_mapping_render_thread(TViewer *viewer, int toneMapping); - EMSCRIPTEN_KEEPALIVE void set_bloom_render_thread(TViewer *viewer, float strength); EMSCRIPTEN_KEEPALIVE void load_skybox_render_thread(TViewer *viewer, const char *skyboxPath, void (*onComplete)()); EMSCRIPTEN_KEEPALIVE void remove_skybox_render_thread(TViewer *viewer); + EMSCRIPTEN_KEEPALIVE void SceneManager_loadGlbFromBufferRenderThread(TSceneManager *sceneManager, const uint8_t *const data, size_t length, int numInstances, bool keepData, int priority, int layer, bool loadResourcesAsync, void (*callback)(EntityId)); EMSCRIPTEN_KEEPALIVE void load_glb_render_thread(TSceneManager *sceneManager, const char *assetPath, int numInstances, bool keepData, void (*callback)(EntityId)); - EMSCRIPTEN_KEEPALIVE void load_glb_from_buffer_render_thread(TSceneManager *sceneManager, const uint8_t *const data, size_t length, int numInstances, bool keepData, int priority, int layer, void (*callback)(EntityId)); EMSCRIPTEN_KEEPALIVE void load_gltf_render_thread(TSceneManager *sceneManager, const char *assetPath, const char *relativePath, bool keepData, void (*callback)(EntityId)); EMSCRIPTEN_KEEPALIVE void create_instance_render_thread(TSceneManager *sceneManager, EntityId entityId, void (*callback)(EntityId)); EMSCRIPTEN_KEEPALIVE void remove_entity_render_thread(TViewer *viewer, EntityId asset, void (*callback)()); EMSCRIPTEN_KEEPALIVE void clear_entities_render_thread(TViewer *viewer, void (*callback)()); - EMSCRIPTEN_KEEPALIVE void set_camera_render_thread(TViewer *viewer, EntityId asset, const char *nodeName, void (*callback)(bool)); + EMSCRIPTEN_KEEPALIVE void apply_weights_render_thread( TSceneManager *sceneManager, EntityId asset, @@ -99,6 +107,7 @@ extern "C" #ifdef __cplusplus } +} #endif #endif // _DART_FILAMENT_FFI_API_H diff --git a/thermion_dart/native/include/ThreadPool.hpp b/thermion_dart/native/include/ThreadPool.hpp index 1f1e27fb..eb4bc07b 100644 --- a/thermion_dart/native/include/ThreadPool.hpp +++ b/thermion_dart/native/include/ThreadPool.hpp @@ -15,7 +15,7 @@ #ifndef _THREADPOOL_HPP #define _THREADPOOL_HPP -namespace thermion_filament { +namespace thermion { class ThreadPool { std::vector pool; diff --git a/thermion_dart/native/include/UnprojectTexture.hpp b/thermion_dart/native/include/UnprojectTexture.hpp index 0f04dba0..86bcecdf 100644 --- a/thermion_dart/native/include/UnprojectTexture.hpp +++ b/thermion_dart/native/include/UnprojectTexture.hpp @@ -17,7 +17,7 @@ #include "CustomGeometry.hpp" -namespace thermion_filament { +namespace thermion { class UnprojectTexture { public: diff --git a/thermion_dart/native/include/components/AnimationComponentManager.hpp b/thermion_dart/native/include/components/AnimationComponentManager.hpp index 40b18219..7153c6ae 100644 --- a/thermion_dart/native/include/components/AnimationComponentManager.hpp +++ b/thermion_dart/native/include/components/AnimationComponentManager.hpp @@ -24,7 +24,7 @@ #include template class std::vector; -namespace thermion_filament +namespace thermion { using namespace filament; using namespace filament::gltfio; diff --git a/thermion_dart/native/include/components/CollisionComponentManager.hpp b/thermion_dart/native/include/components/CollisionComponentManager.hpp index b7e62ab1..279f6207 100644 --- a/thermion_dart/native/include/components/CollisionComponentManager.hpp +++ b/thermion_dart/native/include/components/CollisionComponentManager.hpp @@ -8,7 +8,7 @@ #include "gltfio/FilamentInstance.h" #include "Log.hpp" -namespace thermion_filament +namespace thermion { typedef void(*CollisionCallback)(int32_t entityId1, int32_t entityId2) ; diff --git a/thermion_dart/native/include/generated/ThermionTextureSwiftObjCAPI.h b/thermion_dart/native/include/generated/ThermionTextureSwiftObjCAPI.h new file mode 100644 index 00000000..d42397bb --- /dev/null +++ b/thermion_dart/native/include/generated/ThermionTextureSwiftObjCAPI.h @@ -0,0 +1,325 @@ +// Generated by Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4) +#ifndef SWIFT_MODULE_SWIFT_H +#define SWIFT_MODULE_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#include +#include +#include +#include +#else +#include +#include +#include +#include +#endif +#if defined(__cplusplus) +#if defined(__arm64e__) && __has_include() +# include +#else +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-macro-identifier" +# ifndef __ptrauth_swift_value_witness_function_pointer +# define __ptrauth_swift_value_witness_function_pointer(x) +# endif +# ifndef __ptrauth_swift_class_method_pointer +# define __ptrauth_swift_class_method_pointer(x) +# endif +#pragma clang diagnostic pop +#endif +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif +#if !defined(SWIFT_RUNTIME_NAME) +# if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# else +# define SWIFT_RUNTIME_NAME(X) +# endif +#endif +#if !defined(SWIFT_COMPILE_NAME) +# if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# else +# define SWIFT_COMPILE_NAME(X) +# endif +#endif +#if !defined(SWIFT_METHOD_FAMILY) +# if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# else +# define SWIFT_METHOD_FAMILY(X) +# endif +#endif +#if !defined(SWIFT_NOESCAPE) +# if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +# else +# define SWIFT_NOESCAPE +# endif +#endif +#if !defined(SWIFT_RELEASES_ARGUMENT) +# if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# else +# define SWIFT_RELEASES_ARGUMENT +# endif +#endif +#if !defined(SWIFT_WARN_UNUSED_RESULT) +# if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# else +# define SWIFT_WARN_UNUSED_RESULT +# endif +#endif +#if !defined(SWIFT_NORETURN) +# if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +# else +# define SWIFT_NORETURN +# endif +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if !defined(SWIFT_DEPRECATED_OBJC) +# if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +# else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# endif +#endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if !defined(SWIFT_INDIRECT_RESULT) +# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) +#endif +#if !defined(SWIFT_CONTEXT) +# define SWIFT_CONTEXT __attribute__((swift_context)) +#endif +#if !defined(SWIFT_ERROR_RESULT) +# define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) +#endif +#if defined(__cplusplus) +# define SWIFT_NOEXCEPT noexcept +#else +# define SWIFT_NOEXCEPT +#endif +#if !defined(SWIFT_C_INLINE_THUNK) +# if __has_attribute(always_inline) +# if __has_attribute(nodebug) +# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug)) +# else +# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) +# endif +# else +# define SWIFT_C_INLINE_THUNK inline +# endif +#endif +#if defined(_WIN32) +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) +#endif +#else +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +# define SWIFT_IMPORT_STDLIB_SYMBOL +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(objc_modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import CoreVideo; +@import ObjectiveC; +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="swift_module",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +@protocol MTLDevice; +@protocol MTLTexture; +@class NSData; + +SWIFT_CLASS("_TtC12swift_module20ThermionTextureSwift") +@interface ThermionTextureSwift : NSObject +@property (nonatomic) CVMetalTextureCacheRef _Nullable cvMetalTextureCache; +@property (nonatomic, strong) id _Nullable metalDevice; +@property (nonatomic) CVMetalTextureRef _Nullable cvMetalTexture; +@property (nonatomic, strong) id _Nullable metalTexture; +@property (nonatomic) NSInteger metalTextureAddress; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithWidth:(int64_t)width height:(int64_t)height OBJC_DESIGNATED_INITIALIZER; +- (void)destroyTexture; +- (void)fillColor; +- (NSData * _Nullable)getTextureBytes SWIFT_WARN_UNUSED_RESULT; +@end + +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#if defined(__cplusplus) +#endif +#pragma clang diagnostic pop +#endif diff --git a/thermion_dart/native/include/material/FileMaterialProvider.hpp b/thermion_dart/native/include/material/FileMaterialProvider.hpp index 00b76859..519c5fc9 100644 --- a/thermion_dart/native/include/material/FileMaterialProvider.hpp +++ b/thermion_dart/native/include/material/FileMaterialProvider.hpp @@ -11,7 +11,7 @@ #include #include "Log.hpp" -namespace thermion_filament { +namespace thermion { class FileMaterialProvider : public filament::gltfio::MaterialProvider { diff --git a/thermion_dart/native/include/material/UnlitMaterialProvider.hpp b/thermion_dart/native/include/material/UnlitMaterialProvider.hpp index 524d2841..81f86dd1 100644 --- a/thermion_dart/native/include/material/UnlitMaterialProvider.hpp +++ b/thermion_dart/native/include/material/UnlitMaterialProvider.hpp @@ -10,7 +10,7 @@ #include #include -namespace thermion_filament { +namespace thermion { class UnlitMaterialProvider : public filament::gltfio::MaterialProvider { private: @@ -63,6 +63,6 @@ public: } }; -} // namespace thermion_filament +} // namespace thermion #endif // UNLIT_MATERIAL_PROVIDER_HPP \ No newline at end of file diff --git a/thermion_dart/native/include/material/gizmo.c b/thermion_dart/native/include/material/gizmo_material.c similarity index 100% rename from thermion_dart/native/include/material/gizmo.c rename to thermion_dart/native/include/material/gizmo_material.c diff --git a/thermion_dart/native/lib/macos/swift/ThermionDartTexture.h b/thermion_dart/native/lib/macos/swift/ThermionDartTexture.h deleted file mode 100644 index 76c30f5d..00000000 --- a/thermion_dart/native/lib/macos/swift/ThermionDartTexture.h +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:02859acdfdc2227784553f616bf55cd34e5931413b21c6fea7aaf79d2aa56af3 -size 10694 diff --git a/thermion_dart/native/lib/macos/swift/build.sh b/thermion_dart/native/lib/macos/swift/build.sh deleted file mode 100644 index be102442..00000000 --- a/thermion_dart/native/lib/macos/swift/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1d0fb1cf7f63c52b5a82a25d2038a1b2d6b9bc9f54491d73345900f58b0b8087 -size 224 diff --git a/thermion_dart/native/lib/macos/swift/libthermion_swift.dylib b/thermion_dart/native/lib/macos/swift/libthermion_swift.dylib deleted file mode 100644 index 8623f52b..00000000 Binary files a/thermion_dart/native/lib/macos/swift/libthermion_swift.dylib and /dev/null differ diff --git a/thermion_dart/native/src/CustomGeometry.cpp b/thermion_dart/native/src/CustomGeometry.cpp index 0736bdaf..5689508f 100644 --- a/thermion_dart/native/src/CustomGeometry.cpp +++ b/thermion_dart/native/src/CustomGeometry.cpp @@ -11,7 +11,7 @@ #include "Log.hpp" #include "CustomGeometry.hpp" -namespace thermion_filament { +namespace thermion { using namespace filament; diff --git a/thermion_dart/native/src/FilamentViewer.cpp b/thermion_dart/native/src/FilamentViewer.cpp index 3e8a423a..93d934a5 100644 --- a/thermion_dart/native/src/FilamentViewer.cpp +++ b/thermion_dart/native/src/FilamentViewer.cpp @@ -105,7 +105,7 @@ namespace filament class LightManager; } // namespace filament -namespace thermion_filament +namespace thermion { using namespace filament; @@ -127,7 +127,9 @@ namespace thermion_filament FilamentViewer::FilamentViewer(const void *sharedContext, const ResourceLoaderWrapperImpl *const resourceLoader, void *const platform, const char *uberArchivePath) : _resourceLoaderWrapper(resourceLoader) { - _context = (void *)sharedContext; + + _context = (void *)sharedContext; + ASSERT_POSTCONDITION(_resourceLoaderWrapper != nullptr, "Resource loader must be non-null"); #if TARGET_OS_IPHONE @@ -164,31 +166,7 @@ namespace thermion_filament _mainCamera = _engine->createCamera(camera); - _view = _engine->createView(); - _view->setBlendMode(filament::View::BlendMode::TRANSLUCENT); - _view->setStencilBufferEnabled(true); - - setToneMapping(ToneMapping::ACES); - - // there's a glitch on certain iGPUs where nothing will render when postprocessing is enabled and bloom is disabled - // set bloom to a small value here - setBloom(0.01); - - _view->setAmbientOcclusionOptions({.enabled = false}); - _view->setDynamicResolutionOptions({.enabled = false}); - -#if defined(_WIN32) - _view->setStereoscopicOptions({.enabled = true}); -#endif - - _view->setDithering(filament::Dithering::NONE); - setAntiAliasing(false, false, false); - _view->setShadowingEnabled(false); - _view->setScreenSpaceRefractionEnabled(false); - setPostProcessing(false); - - _view->setScene(_scene); - _view->setCamera(_mainCamera); + createView(); const float aperture = _mainCamera->getAperture(); const float shutterSpeed = _mainCamera->getShutterSpeed(); @@ -197,7 +175,6 @@ namespace thermion_filament EntityManager &em = EntityManager::get(); _sceneManager = new SceneManager( - _view, _resourceLoaderWrapper, _engine, _scene, @@ -205,80 +182,6 @@ namespace thermion_filament _mainCamera); } - void FilamentViewer::setAntiAliasing(bool msaa, bool fxaa, bool taa) - { - View::MultiSampleAntiAliasingOptions multiSampleAntiAliasingOptions; - multiSampleAntiAliasingOptions.enabled = msaa; - - _view->setMultiSampleAntiAliasingOptions(multiSampleAntiAliasingOptions); - TemporalAntiAliasingOptions taaOpts; - taaOpts.enabled = taa; - _view->setTemporalAntiAliasingOptions(taaOpts); - _view->setAntiAliasing(fxaa ? AntiAliasing::FXAA : AntiAliasing::NONE); - } - - void FilamentViewer::setPostProcessing(bool enabled) - { - _view->setPostProcessingEnabled(enabled); - } - - void FilamentViewer::setShadowsEnabled(bool enabled) - { - _view->setShadowingEnabled(enabled); - } - - void FilamentViewer::setShadowType(ShadowType shadowType) - { - _view->setShadowType(shadowType); - } - - void FilamentViewer::setSoftShadowOptions(float penumbraScale, float penumbraRatioScale) - { - SoftShadowOptions opts; - opts.penumbraRatioScale = penumbraRatioScale; - opts.penumbraScale = penumbraScale; - _view->setSoftShadowOptions(opts); - } - - void FilamentViewer::setBloom(float strength) - { -#ifndef __EMSCRIPTEN__ - decltype(_view->getBloomOptions()) opts; - opts.enabled = true; - opts.strength = strength; - _view->setBloomOptions(opts); -#endif - } - - void FilamentViewer::setToneMapping(ToneMapping toneMapping) - { - - ToneMapper *tm; - switch (toneMapping) - { - case ToneMapping::ACES: - Log("Setting tone mapping to ACES"); - tm = new ACESToneMapper(); - break; - case ToneMapping::LINEAR: - Log("Setting tone mapping to Linear"); - tm = new LinearToneMapper(); - break; - case ToneMapping::FILMIC: - Log("Setting tone mapping to Filmic"); - tm = new FilmicToneMapper(); - break; - default: - Log("ERROR: Unsupported tone mapping"); - return; - } - - auto newColorGrading = ColorGrading::Builder().toneMapper(tm).build(*_engine); - _view->setColorGrading(newColorGrading); - _engine->destroy(colorGrading); - delete tm; - } - void FilamentViewer::setFrameInterval(float frameInterval) { _frameInterval = frameInterval; @@ -307,7 +210,7 @@ namespace thermion_filament bool shadows) { auto light = EntityManager::get().create(); - + auto result = LightManager::Builder(t) .color(Color::cct(colour)) .intensity(intensity) @@ -333,36 +236,38 @@ namespace thermion_filament return Entity::smuggle(light); } - void FilamentViewer::setLightPosition(EntityId entityId, float x, float y, float z) { + void FilamentViewer::setLightPosition(EntityId entityId, float x, float y, float z) + { auto light = Entity::import(entityId); - if(light.isNull()) { + if (light.isNull()) + { Log("Light not found for entity %d", entityId); return; } - auto& lm = _engine->getLightManager(); + auto &lm = _engine->getLightManager(); auto instance = lm.getInstance(light); - lm.setPosition(instance, filament::math::float3 { x, y, z }); - + lm.setPosition(instance, filament::math::float3{x, y, z}); } - void FilamentViewer::setLightDirection(EntityId entityId, float x, float y, float z) { + void FilamentViewer::setLightDirection(EntityId entityId, float x, float y, float z) + { auto light = Entity::import(entityId); - if(light.isNull()) { + if (light.isNull()) + { Log("Light not found for entity %d", entityId); return; } - auto& lm = _engine->getLightManager(); + auto &lm = _engine->getLightManager(); auto instance = lm.getInstance(light); - lm.setDirection(instance, filament::math::float3 { x, y, z }); - + lm.setDirection(instance, filament::math::float3{x, y, z}); } void FilamentViewer::removeLight(EntityId entityId) @@ -446,7 +351,7 @@ namespace thermion_filament void FilamentViewer::loadPngTexture(string path, ResourceBuffer rb) { - thermion_filament::StreamBufferAdapter sb((char *)rb.data, (char *)rb.data + rb.size); + thermion::StreamBufferAdapter sb((char *)rb.data, (char *)rb.data + rb.size); std::istream inputStream(&sb); @@ -608,7 +513,7 @@ namespace thermion_filament } } - void FilamentViewer::setBackgroundImage(const char *resourcePath, bool fillHeight) + void FilamentViewer::setBackgroundImage(const char *resourcePath, bool fillHeight, uint32_t width, uint32_t height) { std::lock_guard lock(_imageMutex); @@ -624,9 +529,7 @@ namespace thermion_filament // This currently just anchors the image at the bottom left of the viewport at its original size // TODO - implement stretch/etc - const Viewport &vp = _view->getViewport(); - - float xScale = float(vp.width) / float(_imageWidth); + float xScale = float(width) / float(_imageWidth); float yScale; if (fillHeight) @@ -635,7 +538,7 @@ namespace thermion_filament } else { - yScale = float(vp.height) / float(_imageHeight); + yScale = float(height) / float(_imageHeight); } _imageScale = mat4f{xScale, 0.0f, 0.0f, 0.0f, 0.0f, yScale, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; @@ -643,7 +546,6 @@ namespace thermion_filament _imageMaterial->setDefaultParameter("transform", _imageScale); _imageMaterial->setDefaultParameter("image", _imageTexture, _imageSampler); _imageMaterial->setDefaultParameter("showImage", 1); - } /// @@ -652,7 +554,7 @@ namespace thermion_filament /// are positioned at a max/min of -1/1 respectively /// (i.e. you cannot set a position where the left/top or right/bottom sides would be "inside" the screen coordinate space). /// - void FilamentViewer::setBackgroundImagePosition(float x, float y, bool clamp = false) + void FilamentViewer::setBackgroundImagePosition(float x, float y, bool clamp = false, uint32_t width = 0, uint32_t height = 0) { std::lock_guard lock(_imageMutex); @@ -678,8 +580,8 @@ namespace thermion_filament { Log("Clamping background image translation"); // first, clamp x/y - auto xScale = float(_imageWidth) / _view->getViewport().width; - auto yScale = float(_imageHeight) / _view->getViewport().height; + auto xScale = float(_imageWidth) / width; + auto yScale = float(_imageHeight) / height; float xMin = 0; float xMax = 0; @@ -720,26 +622,30 @@ namespace thermion_filament // i.e. translating the image right by 0.5 units means translating the UV coordinates left by 0.5 units. x = -x; y = -y; - Log("x %f y %f", x, y); - - Log("imageScale %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f ", _imageScale[0][0], _imageScale[0][1], _imageScale[0][2], _imageScale[0][3], - _imageScale[1][0], _imageScale[1][1], _imageScale[1][2], _imageScale[1][3], - _imageScale[2][0], _imageScale[2][1], _imageScale[2][2], _imageScale[2][3], - _imageScale[3][0], _imageScale[3][1], _imageScale[3][2], _imageScale[3][3]); auto transform = math::mat4f::translation(filament::math::float3(x, y, 0.0f)) * _imageScale; - Log("transform %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f ", transform[0][0], transform[0][1], transform[0][2], transform[0][3], - transform[1][0], transform[1][1], transform[1][2], transform[1][3], - transform[2][0], transform[2][1], transform[2][2], transform[2][3], - transform[3][0], transform[3][1], transform[3][2], transform[3][3]); _imageMaterial->setDefaultParameter("transform", transform); } FilamentViewer::~FilamentViewer() { clearLights(); - destroySwapChain(); + + for (auto view : _views) + { + _engine->destroy(view); + } + + _views.clear(); + + for (auto swapChain : _swapChains) + { + _engine->destroy(swapChain); + } + + _swapChains.clear(); + if (!_imageEntity.isNull()) { _engine->destroy(_imageEntity); @@ -751,7 +657,6 @@ namespace thermion_filament delete _sceneManager; _engine->destroyCameraComponent(_mainCamera->getEntity()); _mainCamera = nullptr; - _engine->destroy(_view); _engine->destroy(_scene); _engine->destroy(_renderer); Engine::destroy(&_engine); @@ -760,70 +665,81 @@ namespace thermion_filament Renderer *FilamentViewer::getRenderer() { return _renderer; } - void FilamentViewer::createSwapChain(const void *window, uint32_t width, uint32_t height) + SwapChain *FilamentViewer::createSwapChain(const void *window) { -#if TARGET_OS_IPHONE - _swapChain = _engine->createSwapChain((void *)window, filament::backend::SWAP_CHAIN_CONFIG_TRANSPARENT | filament::backend::SWAP_CHAIN_CONFIG_APPLE_CVPIXELBUFFER); -#else - if (window) - { - _swapChain = _engine->createSwapChain((void *)window, filament::backend::SWAP_CHAIN_CONFIG_TRANSPARENT | filament::backend::SWAP_CHAIN_CONFIG_READABLE); - Log("Created window swapchain."); - } - else - { - Log("Created headless swapchain."); - _swapChain = _engine->createSwapChain(width, height, filament::backend::SWAP_CHAIN_CONFIG_TRANSPARENT | filament::backend::SWAP_CHAIN_CONFIG_READABLE | filament::SwapChain::CONFIG_HAS_STENCIL_BUFFER); - } -#endif + std::lock_guard lock(_renderMutex); + SwapChain *swapChain = _engine->createSwapChain((void *)window, filament::backend::SWAP_CHAIN_CONFIG_TRANSPARENT | filament::backend::SWAP_CHAIN_CONFIG_READABLE | filament::SwapChain::CONFIG_HAS_STENCIL_BUFFER); + _swapChains.push_back(swapChain); + return swapChain; } - void FilamentViewer::createRenderTarget(intptr_t texture, uint32_t width, uint32_t height) + SwapChain *FilamentViewer::createSwapChain(uint32_t width, uint32_t height) { + std::lock_guard lock(_renderMutex); + SwapChain *swapChain; + swapChain = _engine->createSwapChain(width, height, filament::backend::SWAP_CHAIN_CONFIG_TRANSPARENT | filament::backend::SWAP_CHAIN_CONFIG_READABLE | filament::SwapChain::CONFIG_HAS_STENCIL_BUFFER); + _swapChains.push_back(swapChain); + return swapChain; + } + + RenderTarget *FilamentViewer::createRenderTarget(intptr_t texture, uint32_t width, uint32_t height) + { + Log("Creating render target with size %d x %d", width, height); // Create filament textures and render targets (note the color buffer has the import call) - _rtColor = filament::Texture::Builder() - .width(width) - .height(height) - .levels(1) - .usage(filament::Texture::Usage::COLOR_ATTACHMENT | filament::Texture::Usage::SAMPLEABLE) - .format(filament::Texture::InternalFormat::RGBA8) - .import(texture) - .build(*_engine); - _rtDepth = filament::Texture::Builder() - .width(width) - .height(height) - .levels(1) - .usage(filament::Texture::Usage::DEPTH_ATTACHMENT | filament::Texture::Usage::SAMPLEABLE) - .format(filament::Texture::InternalFormat::DEPTH32F) - .build(*_engine); - _rt = filament::RenderTarget::Builder() - .texture(RenderTarget::AttachmentPoint::COLOR, _rtColor) - .texture(RenderTarget::AttachmentPoint::DEPTH, _rtDepth) - .build(*_engine); - - _view->setRenderTarget(_rt); - - Log("Created render target for texture id %ld (%u x %u)", (long)texture, width, height); + auto rtColor = filament::Texture::Builder() + .width(width) + .height(height) + .levels(1) + .usage(filament::Texture::Usage::COLOR_ATTACHMENT | filament::Texture::Usage::SAMPLEABLE) + .format(filament::Texture::InternalFormat::RGBA8) + .import(texture) + .build(*_engine); + auto rtDepth = filament::Texture::Builder() + .width(width) + .height(height) + .levels(1) + .usage(filament::Texture::Usage::DEPTH_ATTACHMENT | filament::Texture::Usage::SAMPLEABLE) + .format(filament::Texture::InternalFormat::DEPTH32F) + .build(*_engine); + auto rt = filament::RenderTarget::Builder() + .texture(RenderTarget::AttachmentPoint::COLOR, rtColor) + .texture(RenderTarget::AttachmentPoint::DEPTH, rtDepth) + .build(*_engine); + _renderTargets.push_back(rt); + return rt; } - void FilamentViewer::destroySwapChain() + void FilamentViewer::destroyRenderTarget(RenderTarget *renderTarget) { - if (_rt) + std::lock_guard lock(_renderMutex); + auto rtDepth = renderTarget->getTexture(RenderTarget::AttachmentPoint::DEPTH); + if (rtDepth) { - _view->setRenderTarget(nullptr); - _engine->destroy(_rtDepth); - _engine->destroy(_rtColor); - _engine->destroy(_rt); - _rt = nullptr; - _rtDepth = nullptr; - _rtColor = nullptr; + _engine->destroy(rtDepth); } - if (_swapChain) + auto rtColor = renderTarget->getTexture(RenderTarget::AttachmentPoint::COLOR); + if (rtColor) { - _engine->destroy(_swapChain); - _swapChain = nullptr; - Log("Swapchain destroyed."); + _engine->destroy(rtColor); } + _engine->destroy(renderTarget); + auto it = std::find(_renderTargets.begin(), _renderTargets.end(), renderTarget); + if (it != _renderTargets.end()) + { + _renderTargets.erase(it); + } + } + + void FilamentViewer::destroySwapChain(SwapChain *swapChain) + { + std::lock_guard lock(_renderMutex); + _renderable[swapChain].clear(); + auto it = std::find(_swapChains.begin(), _swapChains.end(), swapChain); + if (it != _swapChains.end()) + { + _swapChains.erase(it); + } + _engine->destroy(swapChain); #ifdef __EMSCRIPTEN__ _engine->execute(); #else @@ -831,26 +747,74 @@ namespace thermion_filament #endif } + /// + /// + /// + View *FilamentViewer::createView() + { + auto *view = _engine->createView(); + view->setLayerEnabled(SceneManager::LAYERS::DEFAULT_ASSETS, true); + view->setLayerEnabled(SceneManager::LAYERS::BACKGROUND, true); // skybox + image + view->setLayerEnabled(SceneManager::LAYERS::OVERLAY, false); // world grid + gizmo + view->setBlendMode(filament::View::BlendMode::TRANSLUCENT); + view->setStencilBufferEnabled(true); + view->setAmbientOcclusionOptions({.enabled = false}); + view->setDynamicResolutionOptions({.enabled = false}); +#if defined(_WIN32) + view->setStereoscopicOptions({.enabled = true}); +#endif + + // bloom can be a bit glitchy (some Intel iGPUs won't render when postprocessing is enabled and bloom is disabled, + // and render targets on MacOS flicker when bloom is disabled. + // Here, we enable bloom, but set to 0 strength + view->setBloomOptions({.strength = 0, .enabled=true }); + view->setShadowingEnabled(false); + view->setScreenSpaceRefractionEnabled(false); + view->setPostProcessingEnabled(false); + view->setScene(_scene); + view->setCamera(_mainCamera); + + _views.push_back(view); + return view; + } + + /// + /// + /// + View *FilamentViewer::getViewAt(int32_t index) + { + if (index < _views.size()) + { + return _views[index]; + } + return nullptr; + } + + /// @brief + /// + /// void FilamentViewer::clearEntities() { - _view->setCamera(_mainCamera); _sceneManager->destroyAll(); } + /// @brief + /// @param asset + /// void FilamentViewer::removeEntity(EntityId asset) { - mtx.lock(); + _renderMutex.lock(); // todo - what if we are using a camera from this asset? _sceneManager->remove(asset); - mtx.unlock(); + _renderMutex.unlock(); } /// /// /// - void FilamentViewer::setMainCamera() + void FilamentViewer::setMainCamera(View *view) { - _view->setCamera(_mainCamera); + view->setCamera(_mainCamera); } /// @@ -861,73 +825,6 @@ namespace thermion_filament return Entity::smuggle(_mainCamera->getEntity()); } - /// - /// Sets the active camera to the GLTF camera node specified by [name] (or if null, the first camera found under that node). - /// N.B. Blender will generally export a three-node hierarchy - - /// Camera1->Camera_Orientation->Camera2. The correct name will be the Camera_Orientation. - /// - bool FilamentViewer::setCamera(EntityId entityId, const char *cameraName) - { - - auto asset = _sceneManager->getAssetByEntityId(entityId); - if (!asset) - { - Log("Failed to find asset under entity id %d.", entityId); - return false; - } - size_t count = asset->getCameraEntityCount(); - if (count == 0) - { - Log("No cameras found attached to specified entity."); - return false; - } - - const utils::Entity *cameras = asset->getCameraEntities(); - - utils::Entity target; - - if (!cameraName) - { - target = cameras[0]; - const char *name = asset->getName(target); - Log("No camera specified, using first camera node found (%s)", name); - } - else - { - for (int j = 0; j < count; j++) - { - const char *name = asset->getName(cameras[j]); - if (strcmp(name, cameraName) == 0) - { - target = cameras[j]; - break; - } - } - } - if (target.isNull()) - { - Log("Unable to locate camera under name %s ", cameraName); - return false; - } - - Camera *camera = _engine->getCameraComponent(target); - if (!camera) - { - Log("Failed to retrieve camera component for target"); - return false; - } - _view->setCamera(camera); - - const Viewport &vp = _view->getViewport(); - const double aspect = (double)vp.width / vp.height; - - camera->setScaling({1.0 / aspect, 1.0}); - - Log("Successfully set view camera to target"); - - return true; - } - void FilamentViewer::loadSkybox(const char *const skyboxPath) { @@ -971,8 +868,8 @@ namespace thermion_filament callbackData); _skybox = filament::Skybox::Builder() - .environment(_skyboxTexture) - .build(*_engine); + .environment(_skyboxTexture) + .build(*_engine); _skybox->setLayerMask(0xFF, 1u << SceneManager::LAYERS::BACKGROUND); @@ -981,7 +878,6 @@ namespace thermion_filament void FilamentViewer::removeSkybox() { - Log("Removing skybox"); _scene->setSkybox(nullptr); if (_skybox) { @@ -1028,13 +924,25 @@ namespace thermion_filament .build(*_engine); // Create a copy of the cubemap data - float *pixelData = new float[18] { - r, g, b, - r, g, b, - r, g, b, - r, g, b, - r, g, b, - r, g, b, + float *pixelData = new float[18]{ + r, + g, + b, + r, + g, + b, + r, + g, + b, + r, + g, + b, + r, + g, + b, + r, + g, + b, }; Texture::PixelBufferDescriptor::Callback freeCallback = [](void *buf, size_t, void *data) @@ -1106,104 +1014,69 @@ namespace thermion_filament } } - bool FilamentViewer::render( - uint64_t frameTimeInNanos, - void *pixelBuffer, - void (*callback)(void *buf, size_t size, void *data), - void *data) + void FilamentViewer::setRenderable(View* view, SwapChain* swapChain, bool renderable) { + + std::lock_guard lock(_renderMutex); + + auto views = _renderable[swapChain]; + + auto it = std::find(views.begin(), views.end(), view); + + if(renderable) { + if(it == views.end()) { + views.push_back(view); + } + } else { + if(it != views.end()) { + views.erase(it); + } + } + _renderable[swapChain] = views; + } + + + void FilamentViewer::render( + uint64_t frameTimeInNanos) { - if (!_view || !_swapChain) - { - return false; - } - - auto now = std::chrono::high_resolution_clock::now(); - auto secsSinceLastFpsCheck = float(std::chrono::duration_cast(now - _fpsCounterStartTime).count()); - - if (secsSinceLastFpsCheck >= 1) - { - auto fps = _frameCount / secsSinceLastFpsCheck; - _frameCount = 0; - _skippedFrames = 0; - _fpsCounterStartTime = now; - } - - Timer tmr; - _sceneManager->updateTransforms(); _sceneManager->updateAnimations(); - _cumulativeAnimationUpdateTime += tmr.elapsed(); - - // if a manipulator is active, update the active camera orientation - if (_manipulator) - { - math::double3 eye, target, upward; - Camera &cam = _view->getCamera(); - _manipulator->getLookAt(&eye, &target, &upward); - cam.lookAt(eye, target, upward); - } - - // Render the scene, unless the renderer wants to skip the frame. - bool beginFrame = _renderer->beginFrame(_swapChain, frameTimeInNanos); - if (!beginFrame) - { - _skippedFrames++; - } - - if (beginFrame) - { - - _renderer->render(_view); - - _frameCount++; - - if (_recording) - { - Viewport const &vp = _view->getViewport(); - size_t pixelBufferSize = vp.width * vp.height * 4; - auto *pixelBuffer = new uint8_t[pixelBufferSize]; - auto callback = [](void *buf, size_t size, void *data) - { - auto frameCallbackData = (FrameCallbackData *)data; - auto viewer = (FilamentViewer *)frameCallbackData->viewer; - viewer->savePng(buf, size, frameCallbackData->frameNumber); - delete frameCallbackData; - }; - - auto now = std::chrono::high_resolution_clock::now(); - auto elapsed = float(std::chrono::duration_cast(now - _recordingStartTime).count()); - - auto frameNumber = uint32_t(floor(elapsed / _frameInterval)); - - auto userData = new FrameCallbackData{this, frameNumber}; - - auto pbd = Texture::PixelBufferDescriptor( - pixelBuffer, pixelBufferSize, - Texture::Format::RGBA, - Texture::Type::UBYTE, nullptr, callback, userData); - - _renderer->readPixels(_rt, 0, 0, vp.width, vp.height, std::move(pbd)); + for(auto swapChain : _swapChains) { + auto views = _renderable[swapChain]; + if(views.size() > 0) { + bool beginFrame = _renderer->beginFrame(swapChain, frameTimeInNanos); + if (beginFrame) { + for(auto view : views) { + _renderer->render(view); + } + } + _renderer->endFrame(); } - _renderer->endFrame(); } #ifdef __EMSCRIPTEN__ _engine->execute(); #endif - return beginFrame; } - class CaptureCallbackHandler : public filament::backend::CallbackHandler { - void post(void* user, Callback callback) { - callback(user); - } + class CaptureCallbackHandler : public filament::backend::CallbackHandler + { + void post(void *user, Callback callback) + { + callback(user); + } }; - void FilamentViewer::capture(uint8_t *out, bool useFence, void (*onComplete)()) + void FilamentViewer::capture(View *view, uint8_t *out, bool useFence, SwapChain *swapChain, void (*onComplete)()) { - Viewport const &vp = _view->getViewport(); + if (!swapChain) + { + Log("NO SWAPCHAIN"); + return; + } + + Viewport const &vp = view->getViewport(); size_t pixelBufferSize = vp.width * vp.height * 4; auto *pixelBuffer = new uint8_t[pixelBufferSize]; auto callback = [](void *buf, size_t size, void *data) @@ -1214,15 +1087,17 @@ namespace thermion_filament memcpy(out, buf, size); delete frameCallbackData; - if(callbackPtr) { + if (callbackPtr) + { void (*callback)(void) = (void (*)(void))callbackPtr; callback(); } }; // Create a fence - Fence* fence = nullptr; - if(useFence) { + Fence *fence = nullptr; + if (useFence) + { fence = _engine->createFence(); } @@ -1234,228 +1109,100 @@ namespace thermion_filament pixelBuffer, pixelBufferSize, Texture::Format::RGBA, Texture::Type::UBYTE, dispatcher, callback, userData); - _renderer->beginFrame(_swapChain, 0); - - _renderer->render(_view); - - if (_rt) - { - _renderer->readPixels(_rt, 0, 0, vp.width, vp.height, std::move(pbd)); - } - else - { - _renderer->readPixels(0, 0, vp.width, vp.height, std::move(pbd)); - } + _renderer->beginFrame(swapChain, 0); + _renderer->render(view); + _renderer->readPixels(0, 0, vp.width, vp.height, std::move(pbd)); _renderer->endFrame(); #ifdef __EMSCRIPTEN__ _engine->execute(); emscripten_webgl_commit_frame(); #endif - if(fence) { - Fence::waitAndDestroy(fence); - } - } - - void FilamentViewer::savePng(void *buf, size_t size, int frameNumber) - { - // std::lock_guard lock(_recordingMutex); - // if (!_recording) - // { - // delete[] static_cast(buf); - // return; - // } - - Viewport const &vp = _view->getViewport(); - - std::packaged_task lambda([=]() mutable - { - int digits = 6; - std::ostringstream stringStream; - stringStream << _recordingOutputDirectory << "/output_"; - stringStream << std::setfill('0') << std::setw(digits); - stringStream << std::to_string(frameNumber); - stringStream << ".png"; - - std::string filename = stringStream.str(); - - std::ofstream wf(filename, std::ios::out | std::ios::binary); - - LinearImage image(toLinearWithAlpha(vp.width, vp.height, vp.width * 4, - static_cast(buf))); - - auto result = image::ImageEncoder::encode( - wf, image::ImageEncoder::Format::PNG, image, std::string(""), std::string("")); - - delete[] static_cast(buf); - - if (!result) - { - Log("Failed to encode"); - } - - wf.close(); - if (!wf.good()) - { - Log("Write failed!"); - } }); - _tp->add_task(lambda); - } - - void FilamentViewer::setRecordingOutputDirectory(const char *path) - { - _recordingOutputDirectory = std::string(path); - auto outputDirAsPath = std::filesystem::path(path); - if (!std::filesystem::is_directory(outputDirAsPath)) + if (fence) { - std::filesystem::create_directories(outputDirAsPath); + Fence::waitAndDestroy(fence); } } - void FilamentViewer::setRecording(bool recording) + void FilamentViewer::capture(View *view, uint8_t *out, bool useFence, SwapChain *swapChain, RenderTarget *renderTarget, void (*onComplete)()) { - // std::lock_guard lock(_recordingMutex); - if (recording) - { - _tp = new thermion_filament::ThreadPool(16); - _recordingStartTime = std::chrono::high_resolution_clock::now(); + + if (!(renderTarget || swapChain)) { + Log("NO RENDER TARGET OR SWAPCHAIN"); + return; } - else - { - delete _tp; + + if(swapChain && !_engine->isValid(swapChain)) { + Log("SWAPCHAIN PROVIDED BUT NOT VALID"); + return; + } + + int i =0 ; + for(auto sc : _swapChains) { + if(sc == swapChain) { + Log("Using swapchain at index %d", i); + } + i++; + } + + Viewport const &vp = view->getViewport(); + size_t pixelBufferSize = vp.width * vp.height * 4; + auto *pixelBuffer = new uint8_t[pixelBufferSize]; + auto callback = [](void *buf, size_t size, void *data) + { + auto frameCallbackData = (std::vector *)data; + uint8_t *out = (uint8_t *)(frameCallbackData->at(0)); + void *callbackPtr = frameCallbackData->at(1); + + memcpy(out, buf, size); + delete frameCallbackData; + if (callbackPtr) + { + void (*callback)(void) = (void (*)(void))callbackPtr; + callback(); + } + }; + + // Create a fence + Fence *fence = nullptr; + if (useFence) + { + fence = _engine->createFence(); + } + + auto userData = new std::vector{out, (void *)onComplete}; + + auto dispatcher = new CaptureCallbackHandler(); + + auto pbd = Texture::PixelBufferDescriptor( + pixelBuffer, pixelBufferSize, + Texture::Format::RGBA, + Texture::Type::UBYTE, dispatcher, callback, userData); + _renderer->beginFrame(swapChain, 0); + _renderer->render(view); + _renderer->readPixels(renderTarget, 0, 0, vp.width, vp.height, std::move(pbd)); + _renderer->endFrame(); + +#ifdef __EMSCRIPTEN__ + _engine->execute(); + emscripten_webgl_commit_frame(); +#endif + if (fence) + { + Fence::waitAndDestroy(fence); } - this->_recording = recording; } - Camera* FilamentViewer::getCamera(EntityId entity) { + Camera *FilamentViewer::getCamera(EntityId entity) + { return _engine->getCameraComponent(Entity::import(entity)); } - void FilamentViewer::updateViewport( - uint32_t width, uint32_t height) + void FilamentViewer::pick(View *view, uint32_t x, uint32_t y, void (*callback)(EntityId entityId, int x, int y, View *view)) { - _view->setViewport({0, 0, width, height}); - } + view->pick(x, y, [=](filament::View::PickingQueryResult const &result) { - void FilamentViewer::setViewFrustumCulling(bool enabled) - { - _view->setFrustumCullingEnabled(enabled); - } - - void FilamentViewer::_createManipulator() - { - Camera &cam = _view->getCamera(); - - math::double3 home = cam.getPosition(); - math::double3 up = cam.getUpVector(); - auto fv = cam.getForwardVector(); - math::double3 target = home + fv; - Viewport const &vp = _view->getViewport(); - - _manipulator = Manipulator::Builder() - .viewport(vp.width, vp.height) - .upVector(up.x, up.y, up.z) - .zoomSpeed(_zoomSpeed) - .targetPosition(target[0], target[1], target[2]) - // only applicable to Mode::ORBIT - .orbitHomePosition(home[0], home[1], home[2]) - .orbitSpeed(_orbitSpeedX, _orbitSpeedY) - // only applicable to Mode::FREE_FLIGHT - .flightStartPosition(home[0], home[1], home[2]) - .build(_manipulatorMode); - } - - void FilamentViewer::setCameraManipulatorOptions(filament::camutils::Mode mode, double orbitSpeedX, double orbitSpeedY, double zoomSpeed) - { - _manipulatorMode = mode; - _orbitSpeedX = orbitSpeedX; - _orbitSpeedY = orbitSpeedY; - _zoomSpeed = zoomSpeed; - } - - void FilamentViewer::grabBegin(float x, float y, bool pan) - { - if (!_view || !_mainCamera || !_swapChain) - { - Log("View not ready, ignoring grab"); - return; - } - if (!_manipulator) - { - _createManipulator(); - } - _manipulator->grabBegin(x, y, pan); - } - - void FilamentViewer::grabUpdate(float x, float y) - { - if (!_view || !_swapChain) - { - Log("View not ready, ignoring grab"); - return; - } - - if (_manipulator) - { - _manipulator->grabUpdate(x, y); - } - else - { - Log("Error - trying to use a manipulator when one is not available. Ensure you call grabBegin before grabUpdate/grabEnd"); - } - } - - void FilamentViewer::grabEnd() - { - if (!_view || !_mainCamera || !_swapChain) - { - Log("View not ready, ignoring grab"); - return; - } - if (_manipulator) - { - _manipulator->grabEnd(); - } - else - { - Log("Error - trying to use a manipulator when one is not available. Ensure you call grabBegin before grabUpdate/grabEnd"); - } - delete _manipulator; - _manipulator = nullptr; - } - - void FilamentViewer::scrollBegin() - { - if (!_manipulator) - { - _createManipulator(); - } - } - - void FilamentViewer::scrollUpdate(float x, float y, float delta) - { - if (_manipulator) - { - _manipulator->scroll(int(x), int(y), delta); - } - else - { - Log("Error - trying to use a manipulator when one is not available. Ensure you call grabBegin before grabUpdate/grabEnd"); - } - } - - void FilamentViewer::scrollEnd() - { - delete _manipulator; - _manipulator = nullptr; - } - - void FilamentViewer::pick(uint32_t x, uint32_t y, void (*callback)(EntityId entityId, int x, int y)) - { - - _view->pick(x, y, [=](filament::View::PickingQueryResult const &result) { - - if(_sceneManager->gizmo->isGizmoEntity(result.renderable)) { + if(_sceneManager->isGizmoEntity(result.renderable)) { Log("Gizmo entity, ignoring"); return; } @@ -1466,25 +1213,24 @@ namespace thermion_filament }; if (nonPickableEntities.find(result.renderable) == nonPickableEntities.end()) { - callback(Entity::smuggle(result.renderable), x, y); - } - }); + callback(Entity::smuggle(result.renderable), x, y, view); + } }); } - void FilamentViewer::unprojectTexture(EntityId entityId, uint8_t* input, uint32_t inputWidth, uint32_t inputHeight, uint8_t* out, uint32_t outWidth, uint32_t outHeight) { - const auto * geometry = _sceneManager->getGeometry(entityId); - if(!geometry->uvs) { - Log("No UVS"); - return; + void FilamentViewer::unprojectTexture(EntityId entityId, uint8_t *input, uint32_t inputWidth, uint32_t inputHeight, uint8_t *out, uint32_t outWidth, uint32_t outHeight) + { + const auto *geometry = _sceneManager->getGeometry(entityId); + if (!geometry->uvs) + { + Log("No UVS"); + return; } - - UnprojectTexture unproject(geometry, _view->getCamera(), _engine); + + // UnprojectTexture unproject(geometry, _view->getCamera(), _engine); // TODO - check that input dimensions match viewport? - - unproject.unproject(utils::Entity::import(entityId), input, out, inputWidth, inputHeight, outWidth, outHeight); + + // unproject.unproject(utils::Entity::import(entityId), input, out, inputWidth, inputHeight, outWidth, outHeight); } - - -} // namespace thermion_filament +} // namespace thermion diff --git a/thermion_dart/native/src/Gizmo.cpp b/thermion_dart/native/src/Gizmo.cpp index 7041c629..df92c332 100644 --- a/thermion_dart/native/src/Gizmo.cpp +++ b/thermion_dart/native/src/Gizmo.cpp @@ -10,25 +10,21 @@ #include "material/gizmo.h" #include "Log.hpp" -namespace thermion_filament { +namespace thermion { using namespace filament::gltfio; -Gizmo::Gizmo(Engine &engine, View* view, Scene* scene) : _engine(engine) +Gizmo::Gizmo(Engine *engine, View *view, Scene* scene) : _engine(engine), _view(view), _scene(scene) { - - _scene = scene; - _view = view; - _camera = &(_view->getCamera()); - + auto &entityManager = EntityManager::get(); - auto &transformManager = engine.getTransformManager(); + auto &transformManager = _engine->getTransformManager(); _material = Material::Builder() .package(GIZMO_GIZMO_DATA, GIZMO_GIZMO_SIZE) - .build(engine); + .build(*_engine); // First, create the black cube at the center // The axes widgets will be parented to this entity @@ -62,13 +58,13 @@ Gizmo::Gizmo(Engine &engine, View* view, Scene* scene) : _engine(engine) .vertexCount(8) .bufferCount(1) .attribute(VertexAttribute::POSITION, 0, VertexBuffer::AttributeType::FLOAT3) - .build(engine); + .build(*engine); - centerCubeVb->setBufferAt(engine, 0, VertexBuffer::BufferDescriptor(centerCubeVertices, 8 * sizeof(filament::math::float3), [](void *buffer, size_t size, void *) + centerCubeVb->setBufferAt(*engine, 0, VertexBuffer::BufferDescriptor(centerCubeVertices, 8 * sizeof(filament::math::float3), [](void *buffer, size_t size, void *) { delete[] static_cast(buffer); })); - auto centerCubeIb = IndexBuffer::Builder().indexCount(36).bufferType(IndexBuffer::IndexType::USHORT).build(engine); - centerCubeIb->setBuffer(engine, IndexBuffer::BufferDescriptor( + auto centerCubeIb = IndexBuffer::Builder().indexCount(36).bufferType(IndexBuffer::IndexType::USHORT).build(*engine); + centerCubeIb->setBuffer(*engine, IndexBuffer::BufferDescriptor( centerCubeIndices, 36 * sizeof(uint16_t), [](void *buffer, size_t size, void *) { delete[] static_cast(buffer); })); @@ -81,7 +77,7 @@ Gizmo::Gizmo(Engine &engine, View* view, Scene* scene) : _engine(engine) .priority(7) .geometry(0, RenderableManager::PrimitiveType::TRIANGLES, centerCubeVb, centerCubeIb, 0, 36) .culling(false) - .build(engine, _entities[3]); + .build(*engine, _entities[3]); auto cubeTransformInstance = transformManager.getInstance(_entities[3]); math::mat4f cubeTransform; @@ -128,13 +124,13 @@ Gizmo::Gizmo(Engine &engine, View* view, Scene* scene) : _engine(engine) .vertexCount(13) .bufferCount(1) .attribute(VertexAttribute::POSITION, 0, VertexBuffer::AttributeType::FLOAT3) - .build(engine); + .build(*engine); - vb->setBufferAt(engine, 0, VertexBuffer::BufferDescriptor(vertices, 13 * sizeof(filament::math::float3), [](void *buffer, size_t size, void *) + vb->setBufferAt(*engine, 0, VertexBuffer::BufferDescriptor(vertices, 13 * sizeof(filament::math::float3), [](void *buffer, size_t size, void *) { delete[] static_cast(buffer); })); - auto ib = IndexBuffer::Builder().indexCount(54).bufferType(IndexBuffer::IndexType::USHORT).build(engine); - ib->setBuffer(engine, IndexBuffer::BufferDescriptor( + auto ib = IndexBuffer::Builder().indexCount(54).bufferType(IndexBuffer::IndexType::USHORT).build(*engine); + ib->setBuffer(*engine, IndexBuffer::BufferDescriptor( indices, 54 * sizeof(uint16_t), [](void *buffer, size_t size, void *) { delete[] static_cast(buffer); })); @@ -176,7 +172,7 @@ Gizmo::Gizmo(Engine &engine, View* view, Scene* scene) : _engine(engine) .culling(false) .receiveShadows(false) .castShadows(false) - .build(engine, _entities[i]); + .build(*engine, _entities[i]); auto instance = transformManager.getInstance(_entities[i]); @@ -194,21 +190,21 @@ Gizmo::~Gizmo() { _scene->removeEntities(_entities, 7); for(int i = 0; i < 7; i++) { - _engine.destroy(_entities[i]); + _engine->destroy(_entities[i]); } for(int i = 0; i < 7; i++) { - _engine.destroy(_materialInstances[i]); + _engine->destroy(_materialInstances[i]); } - _engine.destroy(_material); + _engine->destroy(_material); } void Gizmo::createTransparentRectangles() { auto &entityManager = EntityManager::get(); - auto &transformManager = _engine.getTransformManager(); + auto &transformManager = _engine->getTransformManager(); float volumeWidth = 0.2f; float volumeLength = 1.2f; @@ -238,9 +234,9 @@ void Gizmo::createTransparentRectangles() .vertexCount(8) .bufferCount(1) .attribute(VertexAttribute::POSITION, 0, VertexBuffer::AttributeType::FLOAT3) - .build(_engine); + .build(*_engine); - volumeVb->setBufferAt(_engine, 0, VertexBuffer::BufferDescriptor( + volumeVb->setBufferAt(*_engine, 0, VertexBuffer::BufferDescriptor( volumeVertices, 8 * sizeof(filament::math::float3), [](void *buffer, size_t size, void *) { delete[] static_cast(buffer); } )); @@ -248,9 +244,9 @@ void Gizmo::createTransparentRectangles() auto volumeIb = IndexBuffer::Builder() .indexCount(36) .bufferType(IndexBuffer::IndexType::USHORT) - .build(_engine); + .build(*_engine); - volumeIb->setBuffer(_engine, IndexBuffer::BufferDescriptor( + volumeIb->setBuffer(*_engine, IndexBuffer::BufferDescriptor( volumeIndices, 36 * sizeof(uint16_t), [](void *buffer, size_t size, void *) { delete[] static_cast(buffer); } )); @@ -284,7 +280,7 @@ void Gizmo::createTransparentRectangles() .culling(false) .receiveShadows(false) .castShadows(false) - .build(_engine, _entities[i]); + .build(*_engine, _entities[i]); auto instance = transformManager.getInstance(_entities[i]); transformManager.setTransform(instance, transform); @@ -295,7 +291,7 @@ void Gizmo::createTransparentRectangles() } void Gizmo::highlight(Entity entity) { - auto &rm = _engine.getRenderableManager(); + auto &rm = _engine->getRenderableManager(); auto renderableInstance = rm.getInstance(entity); auto materialInstance = rm.getMaterialInstanceAt(renderableInstance, 0); @@ -315,7 +311,7 @@ void Gizmo::highlight(Entity entity) { } void Gizmo::unhighlight() { - auto &rm = _engine.getRenderableManager(); + auto &rm = _engine->getRenderableManager(); for(int i = 0; i < 3; i++) { auto renderableInstance = rm.getInstance(_entities[i]); @@ -326,7 +322,7 @@ void Gizmo::unhighlight() { } } -void Gizmo::pick(uint32_t x, uint32_t y, void (*callback)(EntityId entityId, int x, int y)) +void Gizmo::pick(uint32_t x, uint32_t y, PickCallback callback) { auto handler = new Gizmo::PickCallbackHandler(this, callback); _view->pick(x, y, [=](filament::View::PickingQueryResult const &result) { diff --git a/thermion_dart/native/src/GridOverlay.cpp b/thermion_dart/native/src/GridOverlay.cpp index 6d3a59a6..7b967a3f 100644 --- a/thermion_dart/native/src/GridOverlay.cpp +++ b/thermion_dart/native/src/GridOverlay.cpp @@ -1,3 +1,8 @@ +#ifdef _WIN32 +#define _USE_MATH_DEFINES +#include +#endif + #include "GridOverlay.hpp" #include @@ -11,7 +16,7 @@ #include "SceneManager.hpp" #include "Log.hpp" -namespace thermion_filament { +namespace thermion { using namespace filament::gltfio; @@ -194,4 +199,4 @@ void GridOverlay::destroy() _engine.destroy(_gridEntity); } -} // namespace thermion_filament \ No newline at end of file +} // namespace thermion \ No newline at end of file diff --git a/thermion_dart/native/src/HighlightOverlay.cpp b/thermion_dart/native/src/HighlightOverlay.cpp index 0b0f0f0d..95c6498f 100644 --- a/thermion_dart/native/src/HighlightOverlay.cpp +++ b/thermion_dart/native/src/HighlightOverlay.cpp @@ -4,7 +4,7 @@ #include "SceneManager.hpp" -namespace thermion_filament +namespace thermion { SceneManager::HighlightOverlay::HighlightOverlay( diff --git a/thermion_dart/native/src/SceneManager.cpp b/thermion_dart/native/src/SceneManager.cpp index 261a5655..e87eb2bb 100644 --- a/thermion_dart/native/src/SceneManager.cpp +++ b/thermion_dart/native/src/SceneManager.cpp @@ -38,7 +38,7 @@ extern "C" #include "material/image.h" } -namespace thermion_filament +namespace thermion { using namespace std::chrono; @@ -48,13 +48,12 @@ namespace thermion_filament using namespace filament::gltfio; using std::unique_ptr; - SceneManager::SceneManager(View *view, - const ResourceLoaderWrapperImpl *const resourceLoaderWrapper, + SceneManager::SceneManager(const ResourceLoaderWrapperImpl *const resourceLoaderWrapper, Engine *engine, Scene *scene, const char *uberArchivePath, Camera *mainCamera) - : _view(view), + : _resourceLoaderWrapper(resourceLoaderWrapper), _engine(engine), _scene(scene), @@ -99,28 +98,22 @@ namespace thermion_filament _collisionComponentManager = new CollisionComponentManager(tm); _animationComponentManager = new AnimationComponentManager(tm, _engine->getRenderableManager()); - gizmo = new Gizmo(*_engine, _view, _scene); _gridOverlay = new GridOverlay(*_engine); _scene->addEntity(_gridOverlay->sphere()); _scene->addEntity(_gridOverlay->grid()); - _view->setLayerEnabled(SceneManager::LAYERS::DEFAULT_ASSETS, true); - _view->setLayerEnabled(SceneManager::LAYERS::BACKGROUND, true); // skybox + image - _view->setLayerEnabled(SceneManager::LAYERS::OVERLAY, false); // world grid + gizmo } SceneManager::~SceneManager() { - _view->setScene(nullptr); - _view->setCamera(nullptr); for(auto camera : _cameras) { auto entity = camera->getEntity(); _engine->destroyCameraComponent(entity); _engine->getEntityManager().destroy(entity); } _cameras.clear(); - delete gizmo; + _gridOverlay->destroy(); destroyAll(); @@ -138,6 +131,10 @@ namespace thermion_filament AssetLoader::destroy(&_assetLoader); } + bool SceneManager::isGizmoEntity(Entity entity) { + return false; // TODO + } + int SceneManager::getInstanceCount(EntityId entityId) { auto *asset = getAssetByEntityId(entityId); @@ -260,7 +257,7 @@ namespace thermion_filament } - EntityId SceneManager::loadGlbFromBuffer(const uint8_t *data, size_t length, int numInstances, bool keepData, int priority, int layer) + EntityId SceneManager::loadGlbFromBuffer(const uint8_t *data, size_t length, int numInstances, bool keepData, int priority, int layer, bool loadResourcesAsync) { FilamentAsset *asset = nullptr; @@ -307,10 +304,18 @@ namespace thermion_filament _gltfResourceLoader->asyncUpdateLoad(); } #else - if (!_gltfResourceLoader->loadResources(asset)) - { - Log("Unknown error loading glb asset"); - return 0; + if(loadResourcesAsync) { + if (!_gltfResourceLoader->asyncBeginLoad(asset)) + { + Log("Unknown error loading glb asset"); + return 0; + } + } else { + if (!_gltfResourceLoader->loadResources(asset)) + { + Log("Unknown error loading glb asset"); + return 0; + } } #endif @@ -534,13 +539,18 @@ namespace thermion_filament asset.second->getLightEntityCount()); _assetLoader->destroyAsset(asset.second); } - for(auto* texture : _textures) { + for(auto *texture : _textures) { _engine->destroy(texture); } + for(auto *materialInstance : _materialInstances) { + _engine->destroy(materialInstance); + } + // TODO - free geometry? _textures.clear(); _assets.clear(); + _materialInstances.clear(); } FilamentInstance *SceneManager::getInstanceByEntityId(EntityId entityId) @@ -804,7 +814,7 @@ namespace thermion_filament bool SceneManager::setMorphAnimationBuffer( EntityId entityId, const float *const morphData, - const int *const morphIndices, + const uint32_t *const morphIndices, int numMorphTargets, int numFrames, float frameLengthInMs) @@ -1894,11 +1904,11 @@ namespace thermion_filament tm.setTransform(transformInstance, newTransform); } - void SceneManager::queueRelativePositionUpdateFromViewportVector(EntityId entityId, float viewportCoordX, float viewportCoordY) + void SceneManager::queueRelativePositionUpdateFromViewportVector(View* view, EntityId entityId, float viewportCoordX, float viewportCoordY) { // Get the camera and viewport - const auto &camera = _view->getCamera(); - const auto &vp = _view->getViewport(); + const auto &camera = view->getCamera(); + const auto &vp = view->getViewport(); // Convert viewport coordinates to NDC space float ndcX = (2.0f * viewportCoordX) / vp.width - 1.0f; @@ -2170,10 +2180,10 @@ namespace thermion_filament rm.setPriority(renderableInstance, priority); } - Aabb2 SceneManager::getBoundingBox(EntityId entityId) + Aabb2 SceneManager::getBoundingBox(View *view, EntityId entityId) { - const auto &camera = _view->getCamera(); - const auto &viewport = _view->getViewport(); + const auto &camera = view->getCamera(); + const auto &viewport = view->getViewport(); auto &tcm = _engine->getTransformManager(); auto &rcm = _engine->getRenderableManager(); @@ -2242,11 +2252,6 @@ namespace thermion_filament return Aabb2{minX, minY, maxX, maxY}; } - void SceneManager::setLayerVisibility(LAYERS layer, bool enabled) - { - _view->setLayerEnabled(layer, enabled); - } - void SceneManager::removeStencilHighlight(EntityId entityId) { std::lock_guard lock(_stencilMutex); @@ -2464,6 +2469,7 @@ EntityId SceneManager::createGeometry( } materialInstance->setParameter("baseColorFactor", RgbaType::sRGB, filament::math::float4{1.0f, 0.0f, 1.0f, 1.0f}); materialInstance->setParameter("baseColorIndex", 0); + _materialInstances.push_back(materialInstance); return materialInstance; } @@ -2471,6 +2477,7 @@ EntityId SceneManager::createGeometry( UvMap uvmap; auto instance = _unlitMaterialProvider->createMaterialInstance(nullptr, &uvmap); instance->setParameter("uvScale", filament::math::float2 { 1.0f, 1.0f }); + _materialInstances.push_back(instance); return instance; } @@ -2491,10 +2498,6 @@ EntityId SceneManager::createGeometry( } } - void SceneManager::setCamera(Camera* camera) { - _view->setCamera(camera); - } - size_t SceneManager::getCameraCount() { return _cameras.size() + 1; } @@ -2508,11 +2511,6 @@ EntityId SceneManager::createGeometry( } return _cameras[index-1]; } - - Camera* SceneManager::getActiveCamera() { - auto& camera = _view->getCamera(); - return &camera; - } -} // namespace thermion_filament +} // namespace thermion diff --git a/thermion_dart/native/src/StreamBufferAdapter.cpp b/thermion_dart/native/src/StreamBufferAdapter.cpp index 8d51faaa..c3d54b9c 100644 --- a/thermion_dart/native/src/StreamBufferAdapter.cpp +++ b/thermion_dart/native/src/StreamBufferAdapter.cpp @@ -3,7 +3,7 @@ #include #include -namespace thermion_filament { +namespace thermion { class StreamBufferAdapter : public std::streambuf { diff --git a/thermion_dart/native/src/TCamera.cpp b/thermion_dart/native/src/TCamera.cpp new file mode 100644 index 00000000..716c0bf2 --- /dev/null +++ b/thermion_dart/native/src/TCamera.cpp @@ -0,0 +1,84 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "ThermionDartApi.h" +#include "TCamera.h" +#include "ThermionDartAPIUtils.h" + +#include "Log.hpp" + +#ifdef __cplusplus +namespace thermion +{ + extern "C" + { + using namespace filament; + +#endif + + EMSCRIPTEN_KEEPALIVE void Camera_setCustomProjectionWithCulling(TCamera *tCamera, double4x4 projectionMatrix, double near, double far) + { + auto *camera = reinterpret_cast(tCamera); + camera->setCustomProjection(convert_double4x4_to_mat4(projectionMatrix), near, far); + } + + EMSCRIPTEN_KEEPALIVE double4x4 Camera_getModelMatrix(TCamera *tCamera) + { + auto *camera = reinterpret_cast(tCamera); + return convert_mat4_to_double4x4(camera->getModelMatrix()); + } + + EMSCRIPTEN_KEEPALIVE double4x4 Camera_getViewMatrix(TCamera *const tCamera) + { + auto *camera = reinterpret_cast(tCamera); + return convert_mat4_to_double4x4(camera->getViewMatrix()); + } + + EMSCRIPTEN_KEEPALIVE EntityId Camera_getEntity(TCamera *tCamera) + { + auto *camera = reinterpret_cast(tCamera); + return utils::Entity::smuggle(camera->getEntity()); + } + + EMSCRIPTEN_KEEPALIVE double Camera_getFocalLength(TCamera *const tCamera) + { + auto *camera = reinterpret_cast(tCamera); + return camera->getFocalLength() * 1000.0; + } + + EMSCRIPTEN_KEEPALIVE double Camera_getNear(TCamera *const tCamera) + { + auto *camera = reinterpret_cast(tCamera); + return camera->getNear(); + } + + EMSCRIPTEN_KEEPALIVE double Camera_getCullingFar(TCamera *const tCamera) + { + auto *camera = reinterpret_cast(tCamera); + return camera->getCullingFar(); + } + + EMSCRIPTEN_KEEPALIVE void Camera_setProjection(TCamera *const tCamera, Projection projection, double left, double right, + double bottom, double top, + double near, double far) + { + auto *camera = reinterpret_cast(tCamera); + filament::Camera::Projection filamentProjection; + switch(projection) { + case Projection::Orthographic: + filamentProjection = filament::Camera::Projection::ORTHO; + case Projection::Perspective: + filamentProjection = filament::Camera::Projection::PERSPECTIVE; + } + camera->setProjection(filamentProjection, left, right, bottom, top, near, far); + } + +#ifdef __cplusplus + } +} +#endif diff --git a/thermion_dart/native/src/TGizmo.cpp b/thermion_dart/native/src/TGizmo.cpp new file mode 100644 index 00000000..d1c080b6 --- /dev/null +++ b/thermion_dart/native/src/TGizmo.cpp @@ -0,0 +1,40 @@ +#include +#include +#include + +#include "ThermionDartApi.h" +#include "TGizmo.h" +#include "Gizmo.hpp" +#include "Log.hpp" + +#ifdef __cplusplus +namespace thermion { +extern "C" +{ +using namespace filament; +#endif + + EMSCRIPTEN_KEEPALIVE TGizmo* Gizmo_new(TEngine *tEngine, TView *tView, TScene *tScene) + { + auto *view = reinterpret_cast(tView); + auto *engine = reinterpret_cast(tEngine); + auto *scene = reinterpret_cast(tScene); + auto gizmo = new Gizmo(engine, view, scene); + return reinterpret_cast(gizmo); + } + + EMSCRIPTEN_KEEPALIVE void Gizmo_pick(TGizmo *tGizmo, uint32_t x, uint32_t y, GizmoPickCallback callback) + { + auto *gizmo = reinterpret_cast(tGizmo); + gizmo->pick(x, y, reinterpret_cast(callback)); + } + + EMSCRIPTEN_KEEPALIVE void Gizmo_setVisibility(TGizmo *tGizmo, bool visible) { + auto *gizmo = reinterpret_cast(tGizmo); + gizmo->setVisibility(visible); + } + +#ifdef __cplusplus +} +} +#endif diff --git a/thermion_dart/native/src/TView.cpp b/thermion_dart/native/src/TView.cpp new file mode 100644 index 00000000..cc8df3b6 --- /dev/null +++ b/thermion_dart/native/src/TView.cpp @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include + +#include "ThermionDartApi.h" +#include "TView.h" +#include "Log.hpp" + +#ifdef __cplusplus +namespace thermion { +extern "C" +{ +using namespace filament; + +#endif + + EMSCRIPTEN_KEEPALIVE TViewport View_getViewport(TView *tView) + { + auto view = reinterpret_cast(tView); + auto & vp = view->getViewport(); + TViewport tvp; + tvp.left = vp.left; + tvp.bottom = vp.bottom; + tvp.width = vp.width; + tvp.height = vp.height; + return tvp; + } + + EMSCRIPTEN_KEEPALIVE void View_updateViewport(TView *tView, uint32_t width, uint32_t height) + { + auto view = reinterpret_cast(tView); + view->setViewport({0, 0, width, height}); + } + + EMSCRIPTEN_KEEPALIVE void View_setRenderTarget(TView *tView, TRenderTarget *tRenderTarget) + { + auto view = reinterpret_cast(tView); + auto renderTarget = reinterpret_cast(tRenderTarget); + view->setRenderTarget(renderTarget); + } + + EMSCRIPTEN_KEEPALIVE void View_setFrustumCullingEnabled(TView *tView, bool enabled) + { + auto view = reinterpret_cast(tView); + view->setFrustumCullingEnabled(enabled); + } + + EMSCRIPTEN_KEEPALIVE void View_setPostProcessing(TView *tView, bool enabled) + { + auto view = reinterpret_cast(tView); + view->setPostProcessingEnabled(enabled); + } + + EMSCRIPTEN_KEEPALIVE void View_setShadowsEnabled(TView *tView, bool enabled) + { + auto view = reinterpret_cast(tView); + view->setShadowingEnabled(enabled); + } + + EMSCRIPTEN_KEEPALIVE void View_setShadowType(TView *tView, int shadowType) + { + auto view = reinterpret_cast(tView); + view->setShadowType((ShadowType)shadowType); + } + + EMSCRIPTEN_KEEPALIVE void View_setSoftShadowOptions(TView *tView, float penumbraScale, float penumbraRatioScale) + { + auto view = reinterpret_cast(tView); + SoftShadowOptions opts; + opts.penumbraRatioScale = penumbraRatioScale; + opts.penumbraScale = penumbraScale; + view->setSoftShadowOptions(opts); + } + + EMSCRIPTEN_KEEPALIVE void View_setBloom(TView *tView, float strength) + { + auto view = reinterpret_cast(tView); +#ifndef __EMSCRIPTEN__ + decltype(view->getBloomOptions()) opts; + opts.enabled = true; + opts.strength = strength; + view->setBloomOptions(opts); +#endif + } + + EMSCRIPTEN_KEEPALIVE void View_setToneMapping(TView *tView, TEngine *tEngine, ToneMapping toneMapping) + { + auto view = reinterpret_cast(tView); + auto engine = reinterpret_cast(tEngine); + + ToneMapper *tm; + switch (toneMapping) + { + case ToneMapping::ACES: + Log("Setting tone mapping to ACES"); + tm = new ACESToneMapper(); + break; + case ToneMapping::LINEAR: + Log("Setting tone mapping to Linear"); + tm = new LinearToneMapper(); + break; + case ToneMapping::FILMIC: + Log("Setting tone mapping to Filmic"); + tm = new FilmicToneMapper(); + break; + default: + Log("ERROR: Unsupported tone mapping"); + return; + } + auto newColorGrading = ColorGrading::Builder().toneMapper(tm).build(*engine); + auto oldColorGrading = view->getColorGrading(); + view->setColorGrading(newColorGrading); + + if (oldColorGrading) + { + engine->destroy(oldColorGrading); + } + delete tm; + } + + void View_setAntiAliasing(TView *tView, bool msaa, bool fxaa, bool taa) + { + auto view = reinterpret_cast(tView); + View::MultiSampleAntiAliasingOptions multiSampleAntiAliasingOptions; + multiSampleAntiAliasingOptions.enabled = msaa; + + view->setMultiSampleAntiAliasingOptions(multiSampleAntiAliasingOptions); + TemporalAntiAliasingOptions taaOpts; + taaOpts.enabled = taa; + view->setTemporalAntiAliasingOptions(taaOpts); + view->setAntiAliasing(fxaa ? AntiAliasing::FXAA : AntiAliasing::NONE); + } + + EMSCRIPTEN_KEEPALIVE void View_setLayerEnabled(TView* tView, int layer, bool enabled) { + auto view = reinterpret_cast(tView); + view->setLayerEnabled(layer, enabled); + } + + EMSCRIPTEN_KEEPALIVE void View_setCamera(TView *tView, TCamera *tCamera) { + auto view = reinterpret_cast(tView); + auto *camera = reinterpret_cast(tCamera); + view->setCamera(camera); + } + + EMSCRIPTEN_KEEPALIVE TScene* View_getScene(TView* tView) { + auto view = reinterpret_cast(tView); + return reinterpret_cast(view->getScene()); + } + + EMSCRIPTEN_KEEPALIVE TCamera* View_getCamera(TView *tView) { + auto view = reinterpret_cast(tView); + return reinterpret_cast(&(view->getCamera())); + } + + +#ifdef __cplusplus +} +} +#endif diff --git a/thermion_dart/native/src/ThermionDartApi.cpp b/thermion_dart/native/src/ThermionDartApi.cpp index 71100c2a..17f8697f 100644 --- a/thermion_dart/native/src/ThermionDartApi.cpp +++ b/thermion_dart/native/src/ThermionDartApi.cpp @@ -1,14 +1,7 @@ #ifdef _WIN32 -#pragma comment(lib, "Shlwapi.lib") -#pragma comment(lib, "opengl32.lib") +#include "ThermionWin32.h" #endif -#include "ResourceBuffer.hpp" -#include "FilamentViewer.hpp" -#include "filament/LightManager.h" -#include "Log.hpp" -#include "ThreadPool.hpp" - #include #include @@ -16,49 +9,51 @@ #include #endif -using namespace thermion_filament; +#include "filament/LightManager.h" +#include "ResourceBuffer.hpp" +#include "FilamentViewer.hpp" +#include "Log.hpp" +#include "ThreadPool.hpp" + +using namespace thermion; extern "C" { #include "ThermionDartApi.h" - // Helper function to convert filament::math::mat4 to double4x4 - static double4x4 convert_mat4_to_double4x4(const filament::math::mat4 &mat) - { - return double4x4{ - {mat[0][0], mat[0][1], mat[0][2], mat[0][3]}, - {mat[1][0], mat[1][1], mat[1][2], mat[1][3]}, - {mat[2][0], mat[2][1], mat[2][2], mat[2][3]}, - {mat[3][0], mat[3][1], mat[3][2], mat[3][3]}, - }; - } - - // Helper function to convert double4x4 to filament::math::mat4 - static filament::math::mat4 convert_double4x4_to_mat4(const double4x4 &d_mat) - { - return filament::math::mat4{ - filament::math::float4{float(d_mat.col1[0]), float(d_mat.col1[1]), float(d_mat.col1[2]), float(d_mat.col1[3])}, - filament::math::float4{float(d_mat.col2[0]), float(d_mat.col2[1]), float(d_mat.col2[2]), float(d_mat.col2[3])}, - filament::math::float4{float(d_mat.col3[0]), float(d_mat.col3[1]), float(d_mat.col3[2]), float(d_mat.col3[3])}, - filament::math::float4{float(d_mat.col4[0]), float(d_mat.col4[1]), float(d_mat.col4[2]), float(d_mat.col4[3])}}; - } - - EMSCRIPTEN_KEEPALIVE TViewer *create_filament_viewer(const void *context, const void *const loader, void *const platform, const char *uberArchivePath) + EMSCRIPTEN_KEEPALIVE TViewer *Viewer_create(const void *context, const void *const loader, void *const platform, const char *uberArchivePath) { const auto *loaderImpl = new ResourceLoaderWrapperImpl((ResourceLoaderWrapper *)loader); auto viewer = new FilamentViewer(context, loaderImpl, platform, uberArchivePath); - return reinterpret_cast(viewer); + return reinterpret_cast(viewer); } - EMSCRIPTEN_KEEPALIVE TEngine *Viewer_getEngine(TViewer* viewer) { - auto* engine = reinterpret_cast(viewer)->getEngine(); - return reinterpret_cast(engine); - } - - EMSCRIPTEN_KEEPALIVE void create_render_target(TViewer *viewer, intptr_t texture, uint32_t width, uint32_t height) + EMSCRIPTEN_KEEPALIVE TEngine *Viewer_getEngine(TViewer *viewer) { - ((FilamentViewer *)viewer)->createRenderTarget(texture, width, height); + auto *engine = reinterpret_cast(viewer)->getEngine(); + return reinterpret_cast(engine); + } + + EMSCRIPTEN_KEEPALIVE TRenderTarget *Viewer_createRenderTarget(TViewer *tViewer, intptr_t texture, uint32_t width, uint32_t height) + { + auto viewer = reinterpret_cast(tViewer); + auto renderTarget = viewer->createRenderTarget(texture, width, height); + return reinterpret_cast(renderTarget); + } + + EMSCRIPTEN_KEEPALIVE void Viewer_destroyRenderTarget(TViewer *tViewer, TRenderTarget *tRenderTarget) + { + auto viewer = reinterpret_cast(tViewer); + auto renderTarget = reinterpret_cast(tRenderTarget); + viewer->destroyRenderTarget(renderTarget); + } + + EMSCRIPTEN_KEEPALIVE void Viewer_pick(TViewer *tViewer, TView* tView, int x, int y, void (*callback)(EntityId entityId, int x, int y, TView *tView)) + { + auto *viewer = reinterpret_cast(tViewer); + auto *view = reinterpret_cast(tView); + ((FilamentViewer *)viewer)->pick(view, static_cast(x), static_cast(y), reinterpret_cast(callback)); } EMSCRIPTEN_KEEPALIVE void destroy_filament_viewer(TViewer *viewer) @@ -78,23 +73,14 @@ extern "C" EMSCRIPTEN_KEEPALIVE void set_background_image(TViewer *viewer, const char *path, bool fillHeight) { - ((FilamentViewer *)viewer)->setBackgroundImage(path, fillHeight); + ((FilamentViewer *)viewer)->setBackgroundImage(path, fillHeight, 100, 100); } EMSCRIPTEN_KEEPALIVE void set_background_image_position(TViewer *viewer, float x, float y, bool clamp) { - ((FilamentViewer *)viewer)->setBackgroundImagePosition(x, y, clamp); + ((FilamentViewer *)viewer)->setBackgroundImagePosition(x, y, clamp, 100, 100); } - EMSCRIPTEN_KEEPALIVE void set_tone_mapping(TViewer *viewer, int toneMapping) - { - ((FilamentViewer *)viewer)->setToneMapping((ToneMapping)toneMapping); - } - - EMSCRIPTEN_KEEPALIVE void set_bloom(TViewer *viewer, float strength) - { - ((FilamentViewer *)viewer)->setBloom(strength); - } EMSCRIPTEN_KEEPALIVE void load_skybox(TViewer *viewer, const char *skyboxPath) { @@ -106,7 +92,7 @@ extern "C" ((FilamentViewer *)viewer)->createIbl(r, g, b, intensity); } - EMSCRIPTEN_KEEPALIVE void load_ibl(TViewer *viewer, const char *iblPath, float intensity) + EMSCRIPTEN_KEEPALIVE void Viewer_loadIbl(TViewer *viewer, const char *iblPath, float intensity) { ((FilamentViewer *)viewer)->loadIbl(iblPath, intensity); } @@ -182,7 +168,7 @@ extern "C" return ((SceneManager *)sceneManager)->loadGlb(assetPath, numInstances, keepData); } - EMSCRIPTEN_KEEPALIVE EntityId load_glb_from_buffer(TSceneManager *sceneManager, const void *const data, size_t length, bool keepData, int priority, int layer) + EMSCRIPTEN_KEEPALIVE EntityId SceneManager_loadGlbFromBuffer(TSceneManager *sceneManager, const uint8_t *const data, size_t length, bool keepData, int priority, int layer, bool loadResourcesAsync) { return ((SceneManager *)sceneManager)->loadGlbFromBuffer((const uint8_t *)data, length, 1, keepData, priority, layer); } @@ -207,9 +193,11 @@ extern "C" return ((SceneManager *)sceneManager)->loadGltf(assetPath, relativePath, keepData); } - EMSCRIPTEN_KEEPALIVE void set_main_camera(TViewer *viewer) + EMSCRIPTEN_KEEPALIVE void Viewer_setMainCamera(TViewer *tViewer, TView *tView) { - return ((FilamentViewer *)viewer)->setMainCamera(); + auto *viewer = reinterpret_cast(tViewer); + auto *view = reinterpret_cast(tView); + viewer->setMainCamera(view); } EMSCRIPTEN_KEEPALIVE EntityId get_main_camera(TViewer *viewer) @@ -217,11 +205,6 @@ extern "C" return ((FilamentViewer *)viewer)->getMainCamera(); } - EMSCRIPTEN_KEEPALIVE bool set_camera(TViewer *viewer, EntityId asset, const char *nodeName) - { - return ((FilamentViewer *)viewer)->setCamera(asset, nodeName); - } - EMSCRIPTEN_KEEPALIVE float get_camera_fov(TCamera *camera, bool horizontal) { auto cam = reinterpret_cast(camera); @@ -246,62 +229,62 @@ extern "C" return reinterpret_cast(filamentCamera); } - double4x4 get_camera_model_matrix(TCamera *camera) + EMSCRIPTEN_KEEPALIVE double4x4 get_camera_model_matrix(TCamera *camera) { const auto &mat = reinterpret_cast(camera)->getModelMatrix(); return convert_mat4_to_double4x4(mat); } - double4x4 get_camera_view_matrix(TCamera *camera) + EMSCRIPTEN_KEEPALIVE double4x4 get_camera_view_matrix(TCamera *camera) { const auto &mat = reinterpret_cast(camera)->getViewMatrix(); return convert_mat4_to_double4x4(mat); } - double4x4 get_camera_projection_matrix(TCamera *camera) + EMSCRIPTEN_KEEPALIVE double4x4 get_camera_projection_matrix(TCamera *camera) { const auto &mat = reinterpret_cast(camera)->getProjectionMatrix(); return convert_mat4_to_double4x4(mat); } - double4x4 get_camera_culling_projection_matrix(TCamera *camera) + EMSCRIPTEN_KEEPALIVE double4x4 get_camera_culling_projection_matrix(TCamera *camera) { const auto &mat = reinterpret_cast(camera)->getCullingProjectionMatrix(); return convert_mat4_to_double4x4(mat); } - void set_camera_projection_matrix(TCamera *camera, double4x4 matrix, double near, double far) + EMSCRIPTEN_KEEPALIVE void set_camera_projection_matrix(TCamera *camera, double4x4 matrix, double near, double far) { auto cam = reinterpret_cast(camera); const auto &mat = convert_double4x4_to_mat4(matrix); cam->setCustomProjection(mat, near, far); } - void Camera_setLensProjection(TCamera *camera, double near, double far, double aspect, double focalLength) + EMSCRIPTEN_KEEPALIVE void Camera_setLensProjection(TCamera *camera, double near, double far, double aspect, double focalLength) { auto cam = reinterpret_cast(camera); cam->setLensProjection(focalLength, aspect, near, far); } - void Camera_setModelMatrix(TCamera *camera, double4x4 matrix) + EMSCRIPTEN_KEEPALIVE void Camera_setModelMatrix(TCamera *camera, double4x4 matrix) { auto cam = reinterpret_cast(camera); cam->setModelMatrix(convert_double4x4_to_mat4(matrix)); } - double get_camera_near(TCamera *camera) + EMSCRIPTEN_KEEPALIVE double get_camera_near(TCamera *camera) { auto cam = reinterpret_cast(camera); return cam->getNear(); } - double get_camera_culling_far(TCamera *camera) + EMSCRIPTEN_KEEPALIVE double get_camera_culling_far(TCamera *camera) { auto cam = reinterpret_cast(camera); return cam->getCullingFar(); } - const double *const get_camera_frustum(TCamera *camera) + EMSCRIPTEN_KEEPALIVE const double *const get_camera_frustum(TCamera *camera) { const auto frustum = reinterpret_cast(camera)->getFrustum(); @@ -320,15 +303,6 @@ extern "C" return array; } - EMSCRIPTEN_KEEPALIVE void set_camera_manipulator_options(TViewer *viewer, _ManipulatorMode mode, double orbitSpeedX, double orbitSpeedY, double zoomSpeed) - { - ((FilamentViewer *)viewer)->setCameraManipulatorOptions((filament::camutils::Mode)mode, orbitSpeedX, orbitSpeedY, zoomSpeed); - } - - EMSCRIPTEN_KEEPALIVE void set_view_frustum_culling(TViewer *viewer, bool enabled) - { - ((FilamentViewer *)viewer)->setViewFrustumCulling(enabled); - } EMSCRIPTEN_KEEPALIVE void set_camera_focus_distance(TCamera *camera, float distance) { @@ -349,18 +323,24 @@ extern "C" cam->setModelMatrix(mat); } - EMSCRIPTEN_KEEPALIVE bool render( - TViewer *viewer, - uint64_t frameTimeInNanos, - void *pixelBuffer, - void (*callback)(void *buf, size_t size, void *data), - void *data) + EMSCRIPTEN_KEEPALIVE void Viewer_render( + TViewer *tViewer) { - return ((FilamentViewer *)viewer)->render(frameTimeInNanos, pixelBuffer, callback, data); + auto viewer = reinterpret_cast(tViewer); + viewer->render(0); } - EMSCRIPTEN_KEEPALIVE void capture( - TViewer *viewer, + EMSCRIPTEN_KEEPALIVE void Viewer_setViewRenderable(TViewer *tViewer, TSwapChain *tSwapChain, TView *tView, bool renderable) { + auto viewer = reinterpret_cast(tViewer); + auto swapChain = reinterpret_cast(tSwapChain); + auto *view = reinterpret_cast(tView); + viewer->setRenderable(view, swapChain, renderable); + } + + EMSCRIPTEN_KEEPALIVE void Viewer_capture( + TViewer *tViewer, + TView *tView, + TSwapChain *tSwapChain, uint8_t *pixelBuffer, void (*callback)(void)) { @@ -369,7 +349,30 @@ extern "C" #else bool useFence = false; #endif - ((FilamentViewer *)viewer)->capture(pixelBuffer, useFence, callback); + auto swapChain = reinterpret_cast(tSwapChain); + auto viewer = reinterpret_cast(tViewer); + auto *view = reinterpret_cast(tView); + viewer->capture(view, pixelBuffer, useFence, swapChain, callback); + }; + + EMSCRIPTEN_KEEPALIVE void Viewer_captureRenderTarget( + TViewer *tViewer, + TView *tView, + TSwapChain *tSwapChain, + TRenderTarget *tRenderTarget, + uint8_t *pixelBuffer, + void (*callback)(void)) + { +#ifdef __EMSCRIPTEN__ + bool useFence = true; +#else + bool useFence = false; +#endif + auto swapChain = reinterpret_cast(tSwapChain); + auto renderTarget = reinterpret_cast(tRenderTarget); + auto viewer = reinterpret_cast(tViewer); + auto *view = reinterpret_cast(tView); + viewer->capture(view, pixelBuffer, useFence, swapChain, renderTarget, callback); }; EMSCRIPTEN_KEEPALIVE void set_frame_interval( @@ -379,56 +382,54 @@ extern "C" ((FilamentViewer *)viewer)->setFrameInterval(frameInterval); } - EMSCRIPTEN_KEEPALIVE void destroy_swap_chain(TViewer *viewer) + EMSCRIPTEN_KEEPALIVE void Viewer_destroySwapChain(TViewer *tViewer, TSwapChain *tSwapChain) { - ((FilamentViewer *)viewer)->destroySwapChain(); + auto viewer = reinterpret_cast(tViewer); + auto swapChain = reinterpret_cast(tSwapChain); + viewer->destroySwapChain(swapChain); } - EMSCRIPTEN_KEEPALIVE void create_swap_chain(TViewer *viewer, const void *const window, uint32_t width, uint32_t height) + EMSCRIPTEN_KEEPALIVE TSwapChain *Viewer_createHeadlessSwapChain(TViewer *tViewer, uint32_t width, uint32_t height) { - ((FilamentViewer *)viewer)->createSwapChain(window, width, height); + auto viewer = reinterpret_cast(tViewer); + auto swapChain = viewer->createSwapChain(width, height); + return reinterpret_cast(swapChain); } - EMSCRIPTEN_KEEPALIVE void update_viewport(TViewer *viewer, uint32_t width, uint32_t height) + EMSCRIPTEN_KEEPALIVE TSwapChain *Viewer_createSwapChain(TViewer *tViewer, const void *const window) { - return ((FilamentViewer *)viewer)->updateViewport(width, height); + auto viewer = reinterpret_cast(tViewer); + auto swapChain = viewer->createSwapChain(window); + return reinterpret_cast(swapChain); } - EMSCRIPTEN_KEEPALIVE void scroll_update(TViewer *viewer, float x, float y, float delta) - { - ((FilamentViewer *)viewer)->scrollUpdate(x, y, delta); + EMSCRIPTEN_KEEPALIVE TSwapChain* Viewer_getSwapChainAt(TViewer *tViewer, int index) { + auto viewer = reinterpret_cast(tViewer); + auto swapChain = viewer->getSwapChainAt(index); + return reinterpret_cast(swapChain); } - EMSCRIPTEN_KEEPALIVE void scroll_begin(TViewer *viewer) + EMSCRIPTEN_KEEPALIVE TView *Viewer_createView(TViewer *tViewer) { - ((FilamentViewer *)viewer)->scrollBegin(); + auto viewer = reinterpret_cast(tViewer); + auto view = viewer->createView(); + return reinterpret_cast(view); } - EMSCRIPTEN_KEEPALIVE void scroll_end(TViewer *viewer) + EMSCRIPTEN_KEEPALIVE TView *Viewer_getViewAt(TViewer *tViewer, int32_t index) { - ((FilamentViewer *)viewer)->scrollEnd(); + auto viewer = reinterpret_cast(tViewer); + auto view = viewer->getViewAt(index); + return reinterpret_cast(view); } - EMSCRIPTEN_KEEPALIVE void grab_begin(TViewer *viewer, float x, float y, bool pan) - { - ((FilamentViewer *)viewer)->grabBegin(x, y, pan); - } + - EMSCRIPTEN_KEEPALIVE void grab_update(TViewer *viewer, float x, float y) + EMSCRIPTEN_KEEPALIVE TSceneManager *Viewer_getSceneManager(TViewer *tViewer) { - ((FilamentViewer *)viewer)->grabUpdate(x, y); - } - - EMSCRIPTEN_KEEPALIVE void grab_end(TViewer *viewer) - { - ((FilamentViewer *)viewer)->grabEnd(); - } - - EMSCRIPTEN_KEEPALIVE TSceneManager* Viewer_getSceneManager(TViewer *tViewer) - { - auto * viewer = reinterpret_cast(tViewer); - auto * sceneManager = viewer->getSceneManager(); - return reinterpret_cast(sceneManager); + auto *viewer = reinterpret_cast(tViewer); + auto *sceneManager = viewer->getSceneManager(); + return reinterpret_cast(sceneManager); } EMSCRIPTEN_KEEPALIVE void apply_weights( @@ -450,11 +451,11 @@ extern "C" return ((SceneManager *)sceneManager)->setMorphTargetWeights(asset, weights, numWeights); } - EMSCRIPTEN_KEEPALIVE bool set_morph_animation( + EMSCRIPTEN_KEEPALIVE bool SceneManager_setMorphAnimation( TSceneManager *sceneManager, EntityId asset, const float *const morphData, - const int *const morphIndices, + const uint32_t *const morphIndices, int numMorphTargets, int numFrames, float frameLengthInMs) @@ -488,31 +489,6 @@ extern "C" ((SceneManager *)sceneManager)->addBoneAnimation(asset, skinIndex, boneIndex, frameData, numFrames, frameLengthInMs, fadeOutInSecs, fadeInInSecs, maxDelta); } - EMSCRIPTEN_KEEPALIVE void set_post_processing(TViewer *viewer, bool enabled) - { - ((FilamentViewer *)viewer)->setPostProcessing(enabled); - } - - EMSCRIPTEN_KEEPALIVE void set_shadows_enabled(TViewer *viewer, bool enabled) - { - ((FilamentViewer *)viewer)->setShadowsEnabled(enabled); - } - - EMSCRIPTEN_KEEPALIVE void set_shadow_type(TViewer *viewer, int shadowType) - { - ((FilamentViewer *)viewer)->setShadowType((ShadowType)shadowType); - } - - EMSCRIPTEN_KEEPALIVE void set_soft_shadow_options(TViewer *viewer, float penumbraScale, float penumbraRatioScale) - { - ((FilamentViewer *)viewer)->setSoftShadowOptions(penumbraScale, penumbraRatioScale); - } - - EMSCRIPTEN_KEEPALIVE void set_antialiasing(TViewer *viewer, bool msaa, bool fxaa, bool taa) - { - ((FilamentViewer *)viewer)->setAntiAliasing(msaa, fxaa, taa); - } - EMSCRIPTEN_KEEPALIVE EntityId get_bone(TSceneManager *sceneManager, EntityId entityId, int skinIndex, @@ -696,6 +672,12 @@ extern "C" } } + EMSCRIPTEN_KEEPALIVE TCamera* SceneManager_getCameraByName(TSceneManager *tSceneManager, EntityId entityId, const char* name) { + auto *sceneManager = reinterpret_cast(tSceneManager); + return nullptr; + } + + EMSCRIPTEN_KEEPALIVE bool SceneManager_setTransform(TSceneManager *sceneManager, EntityId entityId, const double *const transform) { auto matrix = math::mat4( @@ -716,27 +698,31 @@ extern "C" return ((SceneManager *)sceneManager)->setTransform(entityId, matrix); } - EMSCRIPTEN_KEEPALIVE void SceneManager_queueTransformUpdates(TSceneManager *tSceneManager, EntityId* entities, const double* const transforms, int numEntities) { - auto * sceneManager = reinterpret_cast(tSceneManager); - math::mat4 matrices[numEntities]; - for(int i = 0; i < numEntities; i++) { - matrices[i] = math::mat4( - transforms[i * 16], transforms[i*16+1], transforms[i*16+2], - transforms[i*16+3], - transforms[i*16+4], - transforms[i*16+5], - transforms[i*16+6], - transforms[i*16+7], - transforms[i*16+8], - transforms[i*16+9], - transforms[i*16+10], - transforms[i*16+11], - transforms[i*16+12], - transforms[i*16+13], - transforms[i*16+14], - transforms[i*16+15]); + EMSCRIPTEN_KEEPALIVE void SceneManager_queueTransformUpdates(TSceneManager *tSceneManager, EntityId *entities, const double *const transforms, int numEntities) + { + auto *sceneManager = reinterpret_cast(tSceneManager); + + std::vector matrices( + numEntities); + for (int i = 0; i < numEntities; i++) + { + matrices[i] = math::mat4( + transforms[i * 16], transforms[i * 16 + 1], transforms[i * 16 + 2], + transforms[i * 16 + 3], + transforms[i * 16 + 4], + transforms[i * 16 + 5], + transforms[i * 16 + 6], + transforms[i * 16 + 7], + transforms[i * 16 + 8], + transforms[i * 16 + 9], + transforms[i * 16 + 10], + transforms[i * 16 + 11], + transforms[i * 16 + 12], + transforms[i * 16 + 13], + transforms[i * 16 + 14], + transforms[i * 16 + 15]); } - sceneManager->queueTransformUpdates(entities, matrices, numEntities); + sceneManager->queueTransformUpdates(entities, matrices.data(), numEntities); } EMSCRIPTEN_KEEPALIVE bool update_bone_matrices(TSceneManager *sceneManager, EntityId entityId) @@ -792,9 +778,10 @@ extern "C" ((SceneManager *)sceneManager)->setScale(asset, scale); } - EMSCRIPTEN_KEEPALIVE void queue_position_update_from_viewport_coords(TSceneManager *sceneManager, EntityId entity, float viewportX, float viewportY) + EMSCRIPTEN_KEEPALIVE void queue_position_update_from_viewport_coords(TSceneManager *sceneManager, TView *tView, EntityId entity, float viewportX, float viewportY) { - ((SceneManager *)sceneManager)->queueRelativePositionUpdateFromViewportVector(entity, viewportX, viewportY); + auto *view = reinterpret_cast(tView); + ((SceneManager *)sceneManager)->queueRelativePositionUpdateFromViewportVector(view, entity, viewportX, viewportY); } EMSCRIPTEN_KEEPALIVE void stop_animation(TSceneManager *sceneManager, EntityId asset, int index) @@ -812,11 +799,6 @@ extern "C" return ((SceneManager *)sceneManager)->reveal(asset, meshName); } - EMSCRIPTEN_KEEPALIVE void filament_pick(TViewer *viewer, int x, int y, void (*callback)(EntityId entityId, int x, int y)) - { - ((FilamentViewer *)viewer)->pick(static_cast(x), static_cast(y), callback); - } - EMSCRIPTEN_KEEPALIVE const char *get_name_for_entity(TSceneManager *sceneManager, const EntityId entityId) { return ((SceneManager *)sceneManager)->getNameForEntity(entityId); @@ -837,16 +819,6 @@ extern "C" return ((SceneManager *)sceneManager)->getEntityNameAt(target, index, renderableOnly); } - EMSCRIPTEN_KEEPALIVE void set_recording(TViewer *viewer, bool recording) - { - ((FilamentViewer *)viewer)->setRecording(recording); - } - - EMSCRIPTEN_KEEPALIVE void set_recording_output_directory(TViewer *viewer, const char *outputDirectory) - { - ((FilamentViewer *)viewer)->setRecordingOutputDirectory(outputDirectory); - } - EMSCRIPTEN_KEEPALIVE void ios_dummy() { Log("Dummy called"); @@ -925,37 +897,27 @@ extern "C" ((SceneManager *)sceneManager)->setPriority(entity, priority); } - EMSCRIPTEN_KEEPALIVE void get_gizmo(TSceneManager *sceneManager, EntityId *out) + + EMSCRIPTEN_KEEPALIVE Aabb2 get_bounding_box(TSceneManager *sceneManager, TView *tView, EntityId entity) { - auto gizmo = ((SceneManager *)sceneManager)->gizmo; - out[0] = Entity::smuggle(gizmo->x()); - out[1] = Entity::smuggle(gizmo->y()); - out[2] = Entity::smuggle(gizmo->z()); - out[3] = Entity::smuggle(gizmo->center()); + auto view = reinterpret_cast(tView); + return ((SceneManager *)sceneManager)->getBoundingBox(view, entity); } - EMSCRIPTEN_KEEPALIVE Aabb2 get_bounding_box(TSceneManager *sceneManager, EntityId entity) + EMSCRIPTEN_KEEPALIVE void get_bounding_box_to_out(TSceneManager *sceneManager, TView *tView, EntityId entity, float *minX, float *minY, float *maxX, float *maxY) { - return ((SceneManager *)sceneManager)->getBoundingBox(entity); - } - - EMSCRIPTEN_KEEPALIVE void get_bounding_box_to_out(TSceneManager *sceneManager, EntityId entity, float *minX, float *minY, float *maxX, float *maxY) - { - auto box = ((SceneManager *)sceneManager)->getBoundingBox(entity); + auto view = reinterpret_cast(tView); + auto box = ((SceneManager *)sceneManager)->getBoundingBox(view, entity); *minX = box.minX; *minY = box.minY; *maxX = box.maxX; *maxY = box.maxY; } - EMSCRIPTEN_KEEPALIVE void set_visibility_layer(TSceneManager *sceneManager, EntityId entity, int layer) { - ((SceneManager*)sceneManager)->setVisibilityLayer(entity, layer); - } - - - EMSCRIPTEN_KEEPALIVE void set_layer_visibility(TSceneManager *sceneManager, int layer, bool visible) + EMSCRIPTEN_KEEPALIVE void SceneManager_setVisibilityLayer(TSceneManager *tSceneManager, EntityId entity, int layer) { - ((SceneManager *)sceneManager)->setLayerVisibility((SceneManager::LAYERS)layer, visible); + auto *sceneManager = reinterpret_cast(tSceneManager); + sceneManager->setVisibilityLayer(entity, layer); } EMSCRIPTEN_KEEPALIVE void thermion_flutter_free(void *ptr) @@ -963,16 +925,6 @@ extern "C" free(ptr); } - EMSCRIPTEN_KEEPALIVE void pick_gizmo(TSceneManager *sceneManager, int x, int y, void (*callback)(EntityId entityId, int x, int y)) - { - ((SceneManager *)sceneManager)->gizmo->pick(x, y, callback); - } - - EMSCRIPTEN_KEEPALIVE void set_gizmo_visibility(TSceneManager *sceneManager, bool visible) - { - ((SceneManager *)sceneManager)->gizmo->setVisibility(visible); - } - EMSCRIPTEN_KEEPALIVE void set_stencil_highlight(TSceneManager *sceneManager, EntityId entityId, float r, float g, float b) { ((SceneManager *)sceneManager)->setStencilHighlight(entityId, r, g, b); @@ -988,9 +940,10 @@ extern "C" ((SceneManager *)sceneManager)->setMaterialProperty(entity, materialIndex, property, value); } - EMSCRIPTEN_KEEPALIVE TMaterialInstance* get_material_instance_at(TSceneManager *sceneManager, EntityId entity, int materialIndex) { + EMSCRIPTEN_KEEPALIVE TMaterialInstance *get_material_instance_at(TSceneManager *sceneManager, EntityId entity, int materialIndex) + { auto instance = ((SceneManager *)sceneManager)->getMaterialInstanceAt(entity, materialIndex); - return reinterpret_cast(instance); + return reinterpret_cast(instance); } EMSCRIPTEN_KEEPALIVE void set_material_property_int(TSceneManager *sceneManager, EntityId entity, int materialIndex, const char *property, int32_t value) @@ -999,16 +952,16 @@ extern "C" } EMSCRIPTEN_KEEPALIVE void set_material_property_float4(TSceneManager *sceneManager, EntityId entity, int materialIndex, const char *property, double4 value) - { + { filament::math::float4 filamentValue; - filamentValue.x = static_cast(value.x); - filamentValue.y = static_cast(value.y); - filamentValue.z = static_cast(value.z); - filamentValue.w = static_cast(value.w); + filamentValue.x = static_cast(value.x); + filamentValue.y = static_cast(value.y); + filamentValue.z = static_cast(value.z); + filamentValue.w = static_cast(value.w); ((SceneManager *)sceneManager)->setMaterialProperty(entity, materialIndex, property, filamentValue); } - EMSCRIPTEN_KEEPALIVE void unproject_texture(TViewer *viewer, EntityId entity, uint8_t* input, uint32_t inputWidth, uint32_t inputHeight, uint8_t *out, uint32_t outWidth, uint32_t outHeight) + EMSCRIPTEN_KEEPALIVE void unproject_texture(TViewer *viewer, EntityId entity, uint8_t *input, uint32_t inputWidth, uint32_t inputHeight, uint8_t *out, uint32_t outWidth, uint32_t outHeight) { ((FilamentViewer *)viewer)->unprojectTexture(entity, input, inputWidth, inputHeight, out, outWidth, outHeight); } @@ -1028,146 +981,113 @@ extern "C" ((SceneManager *)sceneManager)->destroyTexture(reinterpret_cast(texture)); } + EMSCRIPTEN_KEEPALIVE TMaterialInstance *create_material_instance(TSceneManager *sceneManager, TMaterialKey materialConfig) + { - EMSCRIPTEN_KEEPALIVE TMaterialInstance* create_material_instance(TSceneManager *sceneManager, TMaterialKey materialConfig) -{ + filament::gltfio::MaterialKey config; + memset(&config, 0, sizeof(MaterialKey)); - filament::gltfio::MaterialKey config; - memset(&config, 0, sizeof(MaterialKey)); - - // Set and log each field - config.unlit = materialConfig.unlit; - config.doubleSided = materialConfig.doubleSided; - config.useSpecularGlossiness = materialConfig.useSpecularGlossiness; - config.alphaMode = static_cast(materialConfig.alphaMode); - config.hasBaseColorTexture = materialConfig.hasBaseColorTexture; - config.hasClearCoat = materialConfig.hasClearCoat; - config.hasClearCoatNormalTexture = materialConfig.hasClearCoatNormalTexture; - config.hasClearCoatRoughnessTexture = materialConfig.hasClearCoatRoughnessTexture; - config.hasEmissiveTexture = materialConfig.hasEmissiveTexture; - config.hasIOR = materialConfig.hasIOR; - config.hasMetallicRoughnessTexture = materialConfig.hasMetallicRoughnessTexture; - config.hasNormalTexture = materialConfig.hasNormalTexture; - config.hasOcclusionTexture = materialConfig.hasOcclusionTexture; - config.hasSheen = materialConfig.hasSheen; - config.hasSheenColorTexture = materialConfig.hasSheenColorTexture; - config.hasSheenRoughnessTexture = materialConfig.hasSheenRoughnessTexture; - config.hasTextureTransforms = materialConfig.hasTextureTransforms; - config.hasTransmission = materialConfig.hasTransmission; - config.hasTransmissionTexture = materialConfig.hasTransmissionTexture; - config.hasVolume = materialConfig.hasVolume; - config.hasVolumeThicknessTexture = materialConfig.hasVolumeThicknessTexture; - config.baseColorUV = materialConfig.baseColorUV; - config.hasVertexColors = materialConfig.hasVertexColors; - auto materialInstance = ((SceneManager *)sceneManager)->createUbershaderMaterialInstance(config); - return reinterpret_cast(materialInstance); -} - -EMSCRIPTEN_KEEPALIVE TMaterialInstance *create_unlit_material_instance(TSceneManager *sceneManager) { - auto * instance = ((SceneManager*)sceneManager)->createUnlitMaterialInstance(); - return reinterpret_cast(instance); -} - -EMSCRIPTEN_KEEPALIVE void destroy_material_instance(TSceneManager *sceneManager, TMaterialInstance *instance) { - ((SceneManager *)sceneManager)->destroy(reinterpret_cast(instance)); -} - -EMSCRIPTEN_KEEPALIVE void MaterialInstance_setDepthWrite(TMaterialInstance* materialInstance, bool enabled) { - reinterpret_cast(materialInstance)->setDepthWrite(enabled); -} - -EMSCRIPTEN_KEEPALIVE void MaterialInstance_setDepthCulling(TMaterialInstance* materialInstance, bool enabled) { - reinterpret_cast(materialInstance)->setDepthCulling(enabled); -} - -EMSCRIPTEN_KEEPALIVE void MaterialInstance_setParameterFloat2(TMaterialInstance* materialInstance, const char* propertyName, double x, double y) { - filament::math::float2 data { static_cast(x), static_cast(y) }; - reinterpret_cast(materialInstance)->setParameter(propertyName, data); -} - -EMSCRIPTEN_KEEPALIVE void Camera_setCustomProjectionWithCulling(TCamera* tCamera, double4x4 projectionMatrix, double near, double far) { - auto * camera = reinterpret_cast(tCamera); - camera->setCustomProjection(convert_double4x4_to_mat4(projectionMatrix), near, far); -} - -EMSCRIPTEN_KEEPALIVE double4x4 Camera_getModelMatrix(TCamera* tCamera) { - auto * camera = reinterpret_cast(tCamera); - return convert_mat4_to_double4x4(camera->getModelMatrix()); -} - -EMSCRIPTEN_KEEPALIVE double4x4 Camera_getViewMatrix(TCamera *const tCamera) { - auto * camera = reinterpret_cast(tCamera); - return convert_mat4_to_double4x4(camera->getViewMatrix()); -} - -EMSCRIPTEN_KEEPALIVE EntityId Camera_getEntity(TCamera* tCamera) { - auto * camera = reinterpret_cast(tCamera); - return Entity::smuggle(camera->getEntity()); -} - -EMSCRIPTEN_KEEPALIVE double Camera_getFocalLength(TCamera *const tCamera) { - auto * camera = reinterpret_cast(tCamera); - return camera->getFocalLength(); -} - -EMSCRIPTEN_KEEPALIVE double Camera_getNear(TCamera *const tCamera) { - auto * camera = reinterpret_cast(tCamera); - return camera->getNear(); -} - -EMSCRIPTEN_KEEPALIVE double Camera_getCullingFar(TCamera *const tCamera) { - auto * camera = reinterpret_cast(tCamera); - return camera->getCullingFar(); -} - -EMSCRIPTEN_KEEPALIVE TCamera *Engine_getCameraComponent(TEngine* tEngine, EntityId entityId) { - auto * engine = reinterpret_cast(tEngine); - auto * camera = engine->getCameraComponent(utils::Entity::import(entityId)); - return reinterpret_cast(camera); -} - -EMSCRIPTEN_KEEPALIVE void Engine_setTransform(TEngine* tEngine, EntityId entity, double4x4 transform) { - auto * engine = reinterpret_cast(tEngine); - auto& transformManager = engine->getTransformManager(); - - auto transformInstance = transformManager.getInstance(utils::Entity::import(entity)); - if(!transformInstance.isValid()) { - Log("Transform instance not valid"); + // Set and log each field + config.unlit = materialConfig.unlit; + config.doubleSided = materialConfig.doubleSided; + config.useSpecularGlossiness = materialConfig.useSpecularGlossiness; + config.alphaMode = static_cast(materialConfig.alphaMode); + config.hasBaseColorTexture = materialConfig.hasBaseColorTexture; + config.hasClearCoat = materialConfig.hasClearCoat; + config.hasClearCoatNormalTexture = materialConfig.hasClearCoatNormalTexture; + config.hasClearCoatRoughnessTexture = materialConfig.hasClearCoatRoughnessTexture; + config.hasEmissiveTexture = materialConfig.hasEmissiveTexture; + config.hasIOR = materialConfig.hasIOR; + config.hasMetallicRoughnessTexture = materialConfig.hasMetallicRoughnessTexture; + config.hasNormalTexture = materialConfig.hasNormalTexture; + config.hasOcclusionTexture = materialConfig.hasOcclusionTexture; + config.hasSheen = materialConfig.hasSheen; + config.hasSheenColorTexture = materialConfig.hasSheenColorTexture; + config.hasSheenRoughnessTexture = materialConfig.hasSheenRoughnessTexture; + config.hasTextureTransforms = materialConfig.hasTextureTransforms; + config.hasTransmission = materialConfig.hasTransmission; + config.hasTransmissionTexture = materialConfig.hasTransmissionTexture; + config.hasVolume = materialConfig.hasVolume; + config.hasVolumeThicknessTexture = materialConfig.hasVolumeThicknessTexture; + config.baseColorUV = materialConfig.baseColorUV; + config.hasVertexColors = materialConfig.hasVertexColors; + auto materialInstance = ((SceneManager *)sceneManager)->createUbershaderMaterialInstance(config); + return reinterpret_cast(materialInstance); } - transformManager.setTransform(transformInstance, convert_double4x4_to_mat4(transform)); -} -EMSCRIPTEN_KEEPALIVE TCamera *SceneManager_createCamera(TSceneManager* tSceneManager) { - auto * sceneManager = reinterpret_cast(tSceneManager); - return reinterpret_cast(sceneManager->createCamera()); -} + EMSCRIPTEN_KEEPALIVE TMaterialInstance *create_unlit_material_instance(TSceneManager *sceneManager) + { + auto *instance = ((SceneManager *)sceneManager)->createUnlitMaterialInstance(); + return reinterpret_cast(instance); + } -EMSCRIPTEN_KEEPALIVE void SceneManager_destroyCamera(TSceneManager* tSceneManager, TCamera* tCamera) { - auto * sceneManager = reinterpret_cast(tSceneManager); - auto * camera = reinterpret_cast(tCamera); - sceneManager->destroyCamera(camera); -} + EMSCRIPTEN_KEEPALIVE void destroy_material_instance(TSceneManager *sceneManager, TMaterialInstance *instance) + { + ((SceneManager *)sceneManager)->destroy(reinterpret_cast(instance)); + } -EMSCRIPTEN_KEEPALIVE void SceneManager_setCamera(TSceneManager* tSceneManager, TCamera* tCamera) { - auto * sceneManager = reinterpret_cast(tSceneManager); - auto * camera = reinterpret_cast(tCamera); - sceneManager->setCamera(camera); -} + EMSCRIPTEN_KEEPALIVE void MaterialInstance_setDepthWrite(TMaterialInstance *materialInstance, bool enabled) + { + reinterpret_cast(materialInstance)->setDepthWrite(enabled); + } -EMSCRIPTEN_KEEPALIVE size_t SceneManager_getCameraCount(TSceneManager *tSceneManager) { - auto * sceneManager = reinterpret_cast(tSceneManager); - return sceneManager->getCameraCount(); -} -EMSCRIPTEN_KEEPALIVE TCamera* SceneManager_getCameraAt(TSceneManager *tSceneManager, size_t index) { - auto * sceneManager = reinterpret_cast(tSceneManager); - auto * camera = sceneManager->getCameraAt(index); - return reinterpret_cast(camera); -} + EMSCRIPTEN_KEEPALIVE void MaterialInstance_setDepthCulling(TMaterialInstance *materialInstance, bool enabled) + { + reinterpret_cast(materialInstance)->setDepthCulling(enabled); + } + + EMSCRIPTEN_KEEPALIVE void MaterialInstance_setParameterFloat2(TMaterialInstance *materialInstance, const char *propertyName, double x, double y) + { + filament::math::float2 data{static_cast(x), static_cast(y)}; + reinterpret_cast(materialInstance)->setParameter(propertyName, data); + } + + + EMSCRIPTEN_KEEPALIVE TCamera *Engine_getCameraComponent(TEngine *tEngine, EntityId entityId) + { + auto *engine = reinterpret_cast(tEngine); + auto *camera = engine->getCameraComponent(utils::Entity::import(entityId)); + return reinterpret_cast(camera); + } + + EMSCRIPTEN_KEEPALIVE void Engine_setTransform(TEngine *tEngine, EntityId entity, double4x4 transform) + { + auto *engine = reinterpret_cast(tEngine); + auto &transformManager = engine->getTransformManager(); + + auto transformInstance = transformManager.getInstance(utils::Entity::import(entity)); + if (!transformInstance.isValid()) + { + Log("Transform instance not valid"); + } + transformManager.setTransform(transformInstance, convert_double4x4_to_mat4(transform)); + } + + EMSCRIPTEN_KEEPALIVE TCamera *SceneManager_createCamera(TSceneManager *tSceneManager) + { + auto *sceneManager = reinterpret_cast(tSceneManager); + return reinterpret_cast(sceneManager->createCamera()); + } + + EMSCRIPTEN_KEEPALIVE void SceneManager_destroyCamera(TSceneManager *tSceneManager, TCamera *tCamera) + { + auto *sceneManager = reinterpret_cast(tSceneManager); + auto *camera = reinterpret_cast(tCamera); + sceneManager->destroyCamera(camera); + } + + EMSCRIPTEN_KEEPALIVE size_t SceneManager_getCameraCount(TSceneManager *tSceneManager) + { + auto *sceneManager = reinterpret_cast(tSceneManager); + return sceneManager->getCameraCount(); + } + + EMSCRIPTEN_KEEPALIVE TCamera *SceneManager_getCameraAt(TSceneManager *tSceneManager, size_t index) + { + auto *sceneManager = reinterpret_cast(tSceneManager); + auto *camera = sceneManager->getCameraAt(index); + return reinterpret_cast(camera); + } -EMSCRIPTEN_KEEPALIVE TCamera* SceneManager_getActiveCamera(TSceneManager *tSceneManager) { - auto * sceneManager = reinterpret_cast(tSceneManager); - auto * camera = sceneManager->getActiveCamera(); - return reinterpret_cast(camera); -} } diff --git a/thermion_dart/native/src/ThermionDartRenderThreadApi.cpp b/thermion_dart/native/src/ThermionDartRenderThreadApi.cpp index 57e3636b..227e629d 100644 --- a/thermion_dart/native/src/ThermionDartRenderThreadApi.cpp +++ b/thermion_dart/native/src/ThermionDartRenderThreadApi.cpp @@ -1,22 +1,6 @@ -#ifdef __EMSCRIPTEN__ -#define GL_GLEXT_PROTOTYPES -#include -#include - -#include -#include -#include -#include -#include - -extern "C" -{ - extern EMSCRIPTEN_KEEPALIVE EMSCRIPTEN_WEBGL_CONTEXT_HANDLE thermion_dart_web_create_gl_context(); -} -#endif - #include "ThermionDartRenderThreadApi.h" #include "FilamentViewer.hpp" +#include "TView.h" #include "Log.hpp" #include "ThreadPool.hpp" #include "filament/LightManager.h" @@ -26,7 +10,7 @@ extern "C" #include #include -using namespace thermion_filament; +using namespace thermion; using namespace std::chrono_literals; #include @@ -36,27 +20,16 @@ public: explicit RenderLoop() { srand(time(NULL)); -#ifdef __EMSCRIPTEN__ - pthread_attr_t attr; - pthread_attr_init(&attr); - emscripten_pthread_attr_settransferredcanvases(&attr, "canvas"); - pthread_create(&t, &attr, &RenderLoop::startHelper, this); -#else t = new std::thread([this]() { start(); }); -#endif } ~RenderLoop() { - _render = false; _stop = true; + swapChain = nullptr; _cv.notify_one(); -#ifdef __EMSCRIPTEN__ - pthread_join(t, NULL); -#else t->join(); -#endif } static void mainLoop(void *arg) @@ -66,11 +39,7 @@ public: static void *startHelper(void *parm) { -#ifdef __EMSCRIPTEN__ - emscripten_set_main_loop_arg(&RenderLoop::mainLoop, parm, 0, true); -#else ((RenderLoop *)parm)->start(); -#endif return nullptr; } @@ -84,49 +53,53 @@ public: void requestFrame(void (*callback)()) { - this->_render = true; + std::unique_lock lock(_mutex); this->_requestFrameRenderCallback = callback; + _cv.notify_one(); } - void iter() + void iter() { - std::unique_lock lock(_mutex); - if (_render) { - doRender(); - this->_requestFrameRenderCallback(); - _render = false; - - // Calculate and print FPS - auto currentTime = std::chrono::high_resolution_clock::now(); - float deltaTime = std::chrono::duration(currentTime - _lastFrameTime).count(); - _lastFrameTime = currentTime; - - _frameCount++; - _accumulatedTime += deltaTime; - - if (_accumulatedTime >= 1.0f) // Update FPS every second + std::unique_lock lock(_mutex); + if (_requestFrameRenderCallback) { - _fps = _frameCount / _accumulatedTime; - std::cout << "FPS: " << _fps << std::endl; - _frameCount = 0; - _accumulatedTime = 0.0f; + doRender(); + lock.unlock(); + this->_requestFrameRenderCallback(); + this->_requestFrameRenderCallback = nullptr; + + // Calculate and print FPS + auto currentTime = std::chrono::high_resolution_clock::now(); + float deltaTime = std::chrono::duration(currentTime - _lastFrameTime).count(); + _lastFrameTime = currentTime; + + _frameCount++; + _accumulatedTime += deltaTime; + + if (_accumulatedTime >= 1.0f) // Update FPS every second + { + _fps = _frameCount / _accumulatedTime; + // std::cout << "FPS: " << _fps << std::endl; + _frameCount = 0; + _accumulatedTime = 0.0f; + } } } + std::unique_lock taskLock(_taskMutex); + if (!_tasks.empty()) { auto task = std::move(_tasks.front()); _tasks.pop_front(); - lock.unlock(); + taskLock.unlock(); task(); - lock.lock(); + taskLock.lock(); } - _cv.wait_for(lock, std::chrono::microseconds(1000), [this] - { return !_tasks.empty() || _stop || _render; }); + _cv.wait_for(taskLock, std::chrono::microseconds(2000), [this] + { return !_tasks.empty() || _stop; }); - if (_stop) - return; } void createViewer(void *const context, @@ -141,26 +114,9 @@ public: _renderCallbackOwner = owner; std::packaged_task lambda([=]() mutable { -#ifdef __EMSCRIPTEN__ - _context = thermion_dart_web_create_gl_context(); - - auto success = emscripten_webgl_make_context_current((EMSCRIPTEN_WEBGL_CONTEXT_HANDLE)_context); - if (success != EMSCRIPTEN_RESULT_SUCCESS) - { - std::cout << "Failed to make context current." << std::endl; - return; - } - glClearColor(0.0, 0.5, 0.5, 1.0); - glClear(GL_COLOR_BUFFER_BIT); - // emscripten_webgl_commit_frame(); - - _viewer = (FilamentViewer *)create_filament_viewer((void *const)_context, loader, platform, uberArchivePath); - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0, $1); }, callback, _viewer); -#else - auto viewer = (FilamentViewer *)create_filament_viewer(context, loader, platform, uberArchivePath); + auto viewer = (FilamentViewer *)Viewer_create(context, loader, platform, uberArchivePath); _viewer = reinterpret_cast(viewer); callback(_viewer); -#endif }); auto fut = add_task(lambda); } @@ -169,45 +125,31 @@ public: { std::packaged_task lambda([=]() mutable { - _render = false; + swapChain = nullptr; _viewer = nullptr; destroy_filament_viewer(reinterpret_cast(viewer)); }); auto fut = add_task(lambda); fut.wait(); } - bool doRender() + void doRender() { -#ifdef __EMSCRIPTEN__ - if (emscripten_is_webgl_context_lost(_context) == EM_TRUE) - { - Log("Context lost"); - auto sleepFor = std::chrono::seconds(1); - std::this_thread::sleep_for(sleepFor); - return; - } -#endif - auto rendered = render(_viewer, 0, nullptr, nullptr, nullptr); + Viewer_render(_viewer); if (_renderCallback) { _renderCallback(_renderCallbackOwner); } - return rendered; -#ifdef __EMSCRIPTEN__ - // emscripten_webgl_commit_frame(); -#endif } void setFrameIntervalInMilliseconds(float frameIntervalInMilliseconds) { - std::unique_lock lock(_mutex); _frameIntervalInMicroseconds = static_cast(1000.0f * frameIntervalInMilliseconds); } template auto add_task(std::packaged_task &pt) -> std::future { - std::unique_lock lock(_mutex); + std::unique_lock lock(_taskMutex); auto ret = pt.get_future(); _tasks.push_back([pt = std::make_shared>( std::move(pt))] @@ -217,13 +159,14 @@ public: } public: - std::atomic_bool _render = false; + TSwapChain *swapChain; private: void(*_requestFrameRenderCallback)() = nullptr; bool _stop = false; int _frameIntervalInMicroseconds = 1000000 / 60; std::mutex _mutex; + std::mutex _taskMutex; std::condition_variable _cv; void (*_renderCallback)(void *const) = nullptr; void *_renderCallbackOwner = nullptr; @@ -233,13 +176,7 @@ private: int _frameCount = 0; float _accumulatedTime = 0.0f; float _fps = 0.0f; - -#ifdef __EMSCRIPTEN__ - pthread_t t; - EMSCRIPTEN_WEBGL_CONTEXT_HANDLE _context; -#else std::thread *t = nullptr; -#endif }; extern "C" @@ -247,7 +184,7 @@ extern "C" static RenderLoop *_rl; - EMSCRIPTEN_KEEPALIVE void create_filament_viewer_render_thread( + EMSCRIPTEN_KEEPALIVE void Viewer_createOnRenderThread( void *const context, void *const platform, const char *uberArchivePath, const void *const loader, void (*renderCallback)(void *const renderCallbackOwner), @@ -270,59 +207,46 @@ extern "C" _rl = nullptr; } - EMSCRIPTEN_KEEPALIVE void create_swap_chain_render_thread(TViewer *viewer, - void *const surface, + EMSCRIPTEN_KEEPALIVE void Viewer_createHeadlessSwapChainRenderThread(TViewer *viewer, uint32_t width, uint32_t height, - void (*onComplete)()) + void (*onComplete)(TSwapChain*)) { std::packaged_task lambda( [=]() mutable { - create_swap_chain(viewer, surface, width, height); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, onComplete); -#else - onComplete(); -#endif + auto *swapChain = Viewer_createHeadlessSwapChain(viewer, width, height); + onComplete(swapChain); }); auto fut = _rl->add_task(lambda); } - EMSCRIPTEN_KEEPALIVE void destroy_swap_chain_render_thread(TViewer *viewer, void (*onComplete)()) + EMSCRIPTEN_KEEPALIVE void Viewer_createSwapChainRenderThread(TViewer *viewer, + void *const surface, + void (*onComplete)(TSwapChain*)) { std::packaged_task lambda( [=]() mutable { - destroy_swap_chain(viewer); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, onComplete); -#else - onComplete(); -#endif + auto *swapChain = Viewer_createSwapChain(viewer, surface); + onComplete(swapChain); }); auto fut = _rl->add_task(lambda); } - EMSCRIPTEN_KEEPALIVE void create_render_target_render_thread(TViewer *viewer, - intptr_t nativeTextureId, - uint32_t width, - uint32_t height, - void (*onComplete)()) + EMSCRIPTEN_KEEPALIVE void Viewer_destroySwapChainRenderThread(TViewer *viewer, TSwapChain *swapChain, void (*onComplete)()) { - std::packaged_task lambda([=]() mutable - { - create_render_target(viewer, nativeTextureId, width, height); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, onComplete); -#else - onComplete(); -#endif - }); + std::packaged_task lambda( + [=]() mutable + { + Viewer_destroySwapChain(viewer, swapChain); + onComplete(); + }); auto fut = _rl->add_task(lambda); } - EMSCRIPTEN_KEEPALIVE void request_frame_render_thread(TViewer *viewer, void(*onComplete)()) + + EMSCRIPTEN_KEEPALIVE void Viewer_requestFrameRenderThread(TViewer *viewer, void(*onComplete)()) { if (!_rl) { @@ -334,6 +258,16 @@ extern "C" } } + EMSCRIPTEN_KEEPALIVE void Viewer_loadIblRenderThread(TViewer *viewer, const char *iblPath, float intensity, void(*onComplete)()) { + std::packaged_task lambda( + [=]() mutable + { + Viewer_loadIbl(viewer, iblPath, intensity); + onComplete(); + }); + auto fut = _rl->add_task(lambda); + } + EMSCRIPTEN_KEEPALIVE void set_frame_interval_render_thread(TViewer *viewer, float frameIntervalInMilliseconds) { @@ -343,17 +277,26 @@ extern "C" auto fut = _rl->add_task(lambda); } - EMSCRIPTEN_KEEPALIVE void render_render_thread(TViewer *viewer) + EMSCRIPTEN_KEEPALIVE void Viewer_renderRenderThread(TViewer *viewer, TView *tView, TSwapChain *tSwapChain) { std::packaged_task lambda([=]() mutable - { _rl->doRender(); }); + { + _rl->doRender(); + }); auto fut = _rl->add_task(lambda); } - EMSCRIPTEN_KEEPALIVE void capture_render_thread(TViewer *viewer, uint8_t *pixelBuffer, void (*onComplete)()) + EMSCRIPTEN_KEEPALIVE void Viewer_captureRenderThread(TViewer *viewer, TView *view, TSwapChain *tSwapChain, uint8_t *pixelBuffer, void (*onComplete)()) { std::packaged_task lambda([=]() mutable - { capture(viewer, pixelBuffer, onComplete); }); + { Viewer_capture(viewer, view, tSwapChain, pixelBuffer, onComplete); }); + auto fut = _rl->add_task(lambda); + } + + EMSCRIPTEN_KEEPALIVE void Viewer_captureRenderTargetRenderThread(TViewer *viewer, TView *view, TSwapChain *tSwapChain, TRenderTarget* tRenderTarget, uint8_t *pixelBuffer, void (*onComplete)()) + { + std::packaged_task lambda([=]() mutable + { Viewer_captureRenderTarget(viewer, view, tSwapChain, tRenderTarget, pixelBuffer, onComplete); }); auto fut = _rl->add_task(lambda); } @@ -376,13 +319,7 @@ extern "C" std::packaged_task lambda([=]() mutable { auto entity = load_gltf(sceneManager, path, relativeResourcePath, keepData); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ - moduleArg.dartFilamentResolveCallback($0, $1); - }, callback, entity); -#else - callback(entity); -#endif + callback(entity); return entity; }); auto fut = _rl->add_task(lambda); } @@ -397,29 +334,26 @@ extern "C" [=]() mutable { auto entity = load_glb(sceneManager, path, numInstances, keepData); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0, $1); }, callback, entity); -#else callback(entity); -#endif return entity; }); auto fut = _rl->add_task(lambda); } - EMSCRIPTEN_KEEPALIVE void load_glb_from_buffer_render_thread(TSceneManager *sceneManager, + EMSCRIPTEN_KEEPALIVE void SceneManager_loadGlbFromBufferRenderThread(TSceneManager *sceneManager, const uint8_t *const data, size_t length, int numInstances, bool keepData, int priority, int layer, + bool loadResourcesAsync, void (*callback)(EntityId)) { std::packaged_task lambda( [=]() mutable { - auto entity = load_glb_from_buffer(sceneManager, data, length, keepData, priority, layer); + auto entity = SceneManager_loadGlbFromBuffer(sceneManager, data, length, keepData, priority, layer, loadResourcesAsync); callback(entity); return entity; }); @@ -441,14 +375,11 @@ extern "C" [=] { set_background_image(viewer, path, fillHeight); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, callback); -#else callback(); -#endif }); auto fut = _rl->add_task(lambda); } + EMSCRIPTEN_KEEPALIVE void set_background_image_position_render_thread(TViewer *viewer, float x, float y, bool clamp) @@ -458,20 +389,7 @@ extern "C" { set_background_image_position(viewer, x, y, clamp); }); auto fut = _rl->add_task(lambda); } - EMSCRIPTEN_KEEPALIVE void set_tone_mapping_render_thread(TViewer *viewer, - int toneMapping) - { - std::packaged_task lambda( - [=] - { set_tone_mapping(viewer, toneMapping); }); - auto fut = _rl->add_task(lambda); - } - EMSCRIPTEN_KEEPALIVE void set_bloom_render_thread(TViewer *viewer, float strength) - { - std::packaged_task lambda([=] - { set_bloom(viewer, strength); }); - auto fut = _rl->add_task(lambda); - } + EMSCRIPTEN_KEEPALIVE void load_skybox_render_thread(TViewer *viewer, const char *skyboxPath, void (*onComplete)()) @@ -479,23 +397,11 @@ extern "C" std::packaged_task lambda([=] { load_skybox(viewer, skyboxPath); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, onComplete); -#else onComplete(); -#endif }); auto fut = _rl->add_task(lambda); } - - EMSCRIPTEN_KEEPALIVE void load_ibl_render_thread(TViewer *viewer, const char *iblPath, - float intensity) - { - std::packaged_task lambda( - [=] - { load_ibl(viewer, iblPath, intensity); }); - auto fut = _rl->add_task(lambda); - } + EMSCRIPTEN_KEEPALIVE void remove_skybox_render_thread(TViewer *viewer) { std::packaged_task lambda([=] @@ -516,11 +422,7 @@ extern "C" std::packaged_task lambda([=] { remove_entity(viewer, asset); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, callback); -#else callback(); -#endif }); auto fut = _rl->add_task(lambda); } @@ -530,31 +432,11 @@ extern "C" std::packaged_task lambda([=] { clear_entities(viewer); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, callback); -#else callback(); -#endif }); auto fut = _rl->add_task(lambda); } - EMSCRIPTEN_KEEPALIVE void set_camera_render_thread(TViewer *viewer, EntityId asset, - const char *nodeName, void (*callback)(bool)) - { - std::packaged_task lambda( - [=] - { - auto success = set_camera(viewer, asset, nodeName); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0, $1); }, callback, success); -#else - callback(success); -#endif - return success; - }); - auto fut = _rl->add_task(lambda); - } EMSCRIPTEN_KEEPALIVE void get_morph_target_name_render_thread(TSceneManager *sceneManager, EntityId assetEntity, @@ -563,11 +445,7 @@ extern "C" std::packaged_task lambda([=] { get_morph_target_name(sceneManager, assetEntity, childEntity, outPtr, index); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, callback); -#else callback(); -#endif }); auto fut = _rl->add_task(lambda); } @@ -579,13 +457,7 @@ extern "C" std::packaged_task lambda([=] { auto count = get_morph_target_name_count(sceneManager, assetEntity, childEntity); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ - moduleArg.dartFilamentResolveCallback($0,$1); - }, callback, count); -#else callback(count); -#endif return count; }); auto fut = _rl->add_task(lambda); } @@ -617,11 +489,7 @@ extern "C" [=] { auto count = get_animation_count(sceneManager, asset); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0, $1); }, callback, count); -#else callback(count); -#endif return count; }); auto fut = _rl->add_task(lambda); @@ -637,24 +505,11 @@ extern "C" [=] { get_animation_name(sceneManager, asset, outPtr, index); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, callback); -#else callback(); -#endif }); auto fut = _rl->add_task(lambda); } - EMSCRIPTEN_KEEPALIVE void set_post_processing_render_thread(TViewer *viewer, - bool enabled) - { - std::packaged_task lambda( - [=] - { set_post_processing(viewer, enabled); }); - auto fut = _rl->add_task(lambda); - } - EMSCRIPTEN_KEEPALIVE void get_name_for_entity_render_thread(TSceneManager *sceneManager, const EntityId entityId, void (*callback)(const char *)) { @@ -662,17 +517,13 @@ extern "C" [=] { auto name = get_name_for_entity(sceneManager, entityId); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0, $1); }, callback, name); -#else callback(name); -#endif return name; }); auto fut = _rl->add_task(lambda); } - void set_morph_target_weights_render_thread(TSceneManager *sceneManager, + EMSCRIPTEN_KEEPALIVE void set_morph_target_weights_render_thread(TSceneManager *sceneManager, EntityId asset, const float *const morphData, int numWeights, @@ -682,11 +533,7 @@ extern "C" [=] { auto result = set_morph_target_weights(sceneManager, asset, morphData, numWeights); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0, $1); }, callback, result); -#else callback(result); -#endif }); auto fut = _rl->add_task(lambda); } @@ -703,11 +550,7 @@ extern "C" [=] { auto success = set_bone_transform(sceneManager, asset, skinIndex, boneIndex, transform); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0, $1); }, callback, success); -#else callback(success); -#endif return success; }); auto fut = _rl->add_task(lambda); @@ -720,11 +563,25 @@ extern "C" [=] { auto success = update_bone_matrices(sceneManager, entity); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, callback, success); -#else callback(success); -#endif + }); + auto fut = _rl->add_task(lambda); + } + + EMSCRIPTEN_KEEPALIVE void View_setToneMappingRenderThread(TView *tView, TEngine *tEngine, thermion::ToneMapping toneMapping) { + std::packaged_task lambda( + [=] + { + View_setToneMapping(tView, tEngine, toneMapping); + }); + auto fut = _rl->add_task(lambda); + } + + EMSCRIPTEN_KEEPALIVE void View_setBloomRenderThread(TView *tView, double bloom) { + std::packaged_task lambda( + [=] + { + View_setBloom(tView, bloom); }); auto fut = _rl->add_task(lambda); } @@ -735,11 +592,7 @@ extern "C" [=] { reset_to_rest_pose(sceneManager, entityId); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0); }, callback); -#else callback(); -#endif }); auto fut = _rl->add_task(lambda); } @@ -763,11 +616,7 @@ extern "C" [=] { auto entity = create_geometry(sceneManager, vertices, numVertices, normals, numNormals, uvs, numUvs, indices, numIndices, primitiveType, materialInstance, keepData); -#ifdef __EMSCRIPTEN__ - MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0, $1); }, callback, entity); -#else callback(entity); -#endif return entity; }); auto fut = _rl->add_task(lambda); diff --git a/thermion_dart/native/src/ThermionWin32.h b/thermion_dart/native/src/ThermionWin32.h new file mode 100644 index 00000000..4b65119c --- /dev/null +++ b/thermion_dart/native/src/ThermionWin32.h @@ -0,0 +1,36 @@ +#pragma once + +#pragma comment(lib, "Shlwapi.lib") +#pragma comment(lib, "opengl32.lib") +#pragma comment(lib, "gdi32.lib") +#pragma comment(lib, "user32.lib") +#pragma comment(lib, "shell32.lib") +#pragma comment(lib, "dwmapi.lib") +#pragma comment(lib, "comctl32.lib") +#pragma comment(lib, "filament.lib") +#pragma comment(lib, "bluevk.lib") +#pragma comment(lib, "bluegl.lib") +#pragma comment(lib, "backend.lib") +#pragma comment(lib, "filameshio.lib") +#pragma comment(lib, "viewer.lib") +#pragma comment(lib, "filamat.lib") +#pragma comment(lib, "geometry.lib") +#pragma comment(lib, "utils.lib") +#pragma comment(lib, "filabridge.lib") +#pragma comment(lib, "gltfio_core.lib") +#pragma comment(lib, "filament-iblprefilter.lib") +#pragma comment(lib, "image.lib") +#pragma comment(lib, "imageio.lib") +#pragma comment(lib, "tinyexr.lib") +#pragma comment(lib, "filaflat.lib") +#pragma comment(lib, "dracodec.lib") +#pragma comment(lib, "ibl.lib") +#pragma comment(lib, "ktxreader.lib") +#pragma comment(lib, "png.lib") +#pragma comment(lib, "z.lib") +#pragma comment(lib, "stb.lib") +#pragma comment(lib, "uberzlib.lib") +#pragma comment(lib, "smol-v.lib") +#pragma comment(lib, "uberarchive.lib") +#pragma comment(lib, "zstd.lib") +#pragma comment(lib, "basis_transcoder.lib") \ No newline at end of file diff --git a/thermion_dart/native/src/UnprojectTexture.cpp b/thermion_dart/native/src/UnprojectTexture.cpp index 0f576c70..8af0e664 100644 --- a/thermion_dart/native/src/UnprojectTexture.cpp +++ b/thermion_dart/native/src/UnprojectTexture.cpp @@ -20,7 +20,7 @@ #include "CustomGeometry.hpp" #include "UnprojectTexture.hpp" -namespace thermion_filament +namespace thermion { bool UnprojectTexture::isInsideTriangle(const math::float2 &p, const math::float2 &a, const math::float2 &b, const math::float2 &c) @@ -207,5 +207,5 @@ namespace thermion_filament } } -} // namespace thermion_filament +} // namespace thermion diff --git a/thermion_dart/native/src/camutils/Manipulator.cpp b/thermion_dart/native/src/camutils/Manipulator.cpp index 5b675a5f..7f92bcfb 100644 --- a/thermion_dart/native/src/camutils/Manipulator.cpp +++ b/thermion_dart/native/src/camutils/Manipulator.cpp @@ -177,6 +177,8 @@ namespace filament case Mode::ORBIT: return new OrbitManipulator(mode, details); } + // just to make MSVC happy + return new OrbitManipulator(mode, details); } template diff --git a/thermion_dart/pubspec.yaml b/thermion_dart/pubspec.yaml index 1e08b38a..d190a6d9 100644 --- a/thermion_dart/pubspec.yaml +++ b/thermion_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: thermion_dart description: 3D rendering toolkit for Dart. -version: 0.2.0-dev.7.0 +version: 0.2.1-dev.0.0.6 homepage: https://thermion.dev repository: https://github.com/nmfisher/thermion @@ -11,17 +11,20 @@ dependencies: vector_math: ^2.1.2 plugin_platform_interface: ^2.0.0 ffi: ^2.1.2 - animation_tools_dart: ^0.0.4 + animation_tools_dart: ^0.1.0 native_toolchain_c: ^0.4.2 + native_assets_cli: ^0.6.1 archive: ^3.6.1 web: ^1.0.0 logging: ^1.2.0 http: ^1.2.2 - + dev_dependencies: - ffigen: ^12.0.0 + ffigen: ^13.0.0 + objective_c: ^1.1.0 test: image: path: mockito: ^5.0.0 - build_runner: ^2.0.0 \ No newline at end of file + build_runner: ^2.0.0 + \ No newline at end of file diff --git a/thermion_dart/test/animation_tests.dart b/thermion_dart/test/animation_tests.dart new file mode 100644 index 00000000..24d13354 --- /dev/null +++ b/thermion_dart/test/animation_tests.dart @@ -0,0 +1,36 @@ +import 'dart:async'; +import 'dart:io'; +import 'dart:math'; +import 'dart:typed_data'; +import 'package:animation_tools_dart/animation_tools_dart.dart'; +import 'package:thermion_dart/src/viewer/src/events.dart'; +import 'package:thermion_dart/thermion_dart.dart'; +import 'package:test/test.dart'; +import 'package:vector_math/vector_math_64.dart'; +import 'helpers.dart'; + +void main() async { + final testHelper = TestHelper("animation"); + + group('morph animation tests', () { + test('set morph animation', () async { + var viewer = await testHelper.createViewer( + bg: kRed, cameraPosition: Vector3(0, 0, 5)); + + final cube = await viewer + .loadGlb("${testHelper.testDir}/assets/cube_with_morph_targets.glb"); + var morphData = MorphAnimationData( + Float32List.fromList(List.generate(60, (i) => i / 60)), + ["Key 1"]); + + await viewer.setMorphAnimationData(cube, morphData); + for (int i = 0; i < 60; i++) { + await viewer.requestFrame(); + await Future.delayed(Duration(milliseconds: 17)); + } + + await testHelper.capture(viewer, "morph_animation"); + await viewer.dispose(); + }); + }); +} diff --git a/thermion_dart/test/assets/cube.glb b/thermion_dart/test/assets/cube.glb index 41825792..dfd15e67 100644 Binary files a/thermion_dart/test/assets/cube.glb and b/thermion_dart/test/assets/cube.glb differ diff --git a/thermion_dart/test/assets/cube_with_morph_targets.glb b/thermion_dart/test/assets/cube_with_morph_targets.glb new file mode 100644 index 00000000..af7f901d Binary files /dev/null and b/thermion_dart/test/assets/cube_with_morph_targets.glb differ diff --git a/thermion_dart/test/camera_tests.dart b/thermion_dart/test/camera_tests.dart index 1ed61534..39677e59 100644 --- a/thermion_dart/test/camera_tests.dart +++ b/thermion_dart/test/camera_tests.dart @@ -8,7 +8,7 @@ void main() async { group('camera', () { test('getCameraModelMatrix, getCameraPosition, rotation', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); var matrix = await viewer.getCameraModelMatrix(); expect(matrix.trace(), 4); @@ -26,7 +26,7 @@ void main() async { }); test('getCameraViewMatrix', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); var modelMatrix = await viewer.getCameraModelMatrix(); var viewMatrix = await viewer.getCameraViewMatrix(); @@ -49,34 +49,47 @@ void main() async { }); test('getCameraProjectionMatrix', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); var projectionMatrix = await viewer.getCameraProjectionMatrix(); print(projectionMatrix); }); test('getCameraCullingProjectionMatrix', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); var matrix = await viewer.getCameraCullingProjectionMatrix(); print(matrix); throw Exception("TODO"); }); test('getCameraFrustum', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); var frustum = await viewer.getCameraFrustum(); print(frustum.plane5.normal); print(frustum.plane5.constant); - await viewer.setCameraLensProjection( + var camera = await viewer.getMainCamera(); + + await camera.setLensProjection( near: 10.0, far: 1000.0, aspect: 1.0, focalLength: 28.0); frustum = await viewer.getCameraFrustum(); print(frustum.plane5.normal); print(frustum.plane5.constant); }); + test('set orthographic projection', () async { + var viewer = await testHelper.createViewer( + bg: kRed, cameraPosition: Vector3(0, 0, 4)); + var camera = await viewer.getMainCamera(); + await viewer.createGeometry(GeometryHelper.cube()); + + await camera.setProjection(Projection.Orthographic, -0.05, 0.05, -0.05, 0.05, 0.05, 10000); + await testHelper.capture( + viewer, "camera_set_orthographic_projection"); + }); + test('set custom projection/culling matrix', () async { - var viewer = - await createViewer(bg: kRed, cameraPosition: Vector3(0, 0, 4)); + var viewer = await testHelper.createViewer( + bg: kRed, cameraPosition: Vector3(0, 0, 4)); var camera = await viewer.getMainCamera(); final cube = await viewer.createGeometry(GeometryHelper.cube()); @@ -98,7 +111,7 @@ void main() async { test('setting transform on camera updates model matrix (no parent)', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); var cameraEntity = await viewer.getMainCameraEntity(); var camera = await viewer.getMainCamera(); @@ -114,7 +127,7 @@ void main() async { test('setting transform on camera updates model matrix (with parent)', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); var cameraEntity = await viewer.getMainCameraEntity(); var camera = await viewer.getMainCamera(); @@ -140,7 +153,7 @@ void main() async { }); test('create camera', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setCameraPosition(0, 0, 5); await viewer.setBackgroundColor(1.0, 0.0, 1.0, 1.0); @@ -155,7 +168,7 @@ void main() async { expect(await viewer.getActiveCamera(), newCamera); await testHelper.capture(viewer, "create_camera_new_camera"); - + final mainCamera = await viewer.getMainCamera(); await viewer.setActiveCamera(mainCamera); expect(await viewer.getActiveCamera(), mainCamera); diff --git a/thermion_dart/test/geometry_tests.dart b/thermion_dart/test/geometry_tests.dart new file mode 100644 index 00000000..cc922116 --- /dev/null +++ b/thermion_dart/test/geometry_tests.dart @@ -0,0 +1,181 @@ +import 'dart:io'; +import 'dart:math'; +import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_viewer_ffi.dart'; +import 'package:thermion_dart/thermion_dart.dart'; +import 'package:test/test.dart'; + +import 'package:vector_math/vector_math_64.dart'; + +import 'helpers.dart'; + +void main() async { + final testHelper = TestHelper("geometry"); + group("custom geometry", () { + test('create cube (no uvs/normals)', () async { + var viewer = await testHelper.createViewer(); + await viewer.addLight(LightType.SUN, 6500, 1000000, 0, 0, 0, 0, 0, -1); + await viewer.setCameraPosition(0, 2, 6); + await viewer + .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); + await viewer.setBackgroundColor(1.0, 1.0, 1.0, 1.0); + await viewer + .createGeometry(GeometryHelper.cube(normals: false, uvs: false)); + + await testHelper.capture(viewer, "geometry_cube_no_uv_no_normal"); + }); + + test('create cube (no normals)', () async { + var viewer = await testHelper.createViewer(); + var light = await viewer.addLight( + LightType.POINT, 6500, 10000000, 0, 2, 0, 0, 0, 0, + falloffRadius: 100.0); + await viewer.setCameraPosition(0, 2, 6); + await viewer + .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); + await viewer.setBackgroundColor(1.0, 0.0, 1.0, 1.0); + await viewer + .createGeometry(GeometryHelper.cube(normals: false, uvs: false)); + await testHelper.capture(viewer, "geometry_cube_no_normals"); + }); + + test('create cube (with normals)', () async { + var viewer = await testHelper.createViewer(); + + var light = await viewer.addLight( + LightType.POINT, 6500, 10000000, 0, 2, 0, 0, 0, 0, + falloffRadius: 100.0); + await viewer.setCameraPosition(0, 2, 6); + await viewer + .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); + await viewer.setBackgroundColor(1.0, 1.0, 1.0, 1.0); + await viewer + .createGeometry(GeometryHelper.cube(normals: true, uvs: false)); + await testHelper.capture(viewer, "geometry_cube_with_normals"); + }); + + test('create cube with custom ubershader material instance (color)', + () async { + var viewer = await testHelper.createViewer(); + await viewer.addLight(LightType.SUN, 6500, 1000000, 0, 0, 0, 0, 0, -1); + await viewer.setCameraPosition(0, 2, 6); + await viewer + .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); + await viewer.setBackgroundColor(1.0, 0.0, 1.0, 1.0); + + var materialInstance = + await viewer.createUbershaderMaterialInstance(unlit: true); + final cube = await viewer.createGeometry( + GeometryHelper.cube(uvs: false, normals: true), + materialInstance: materialInstance); + await viewer.setMaterialPropertyFloat4( + cube, "baseColorFactor", 0, 0.0, 1.0, 0.0, 0.0); + await testHelper.capture( + viewer, "geometry_cube_with_custom_material_ubershader"); + await viewer.removeEntity(cube); + await viewer.destroyMaterialInstance(materialInstance); + }); + + test('create cube with custom ubershader material instance (texture)', + () async { + var viewer = await testHelper.createViewer(); + await viewer.addLight(LightType.SUN, 6500, 1000000, 0, 0, 0, 0, 0, -1); + await viewer.setCameraPosition(0, 2, 6); + await viewer + .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); + await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); + + var materialInstance = await viewer.createUbershaderMaterialInstance(); + final cube = await viewer.createGeometry( + GeometryHelper.cube(uvs: true, normals: true), + materialInstance: materialInstance); + var textureData = + File("${testHelper.testDir}/assets/cube_texture_512x512.png") + .readAsBytesSync(); + var texture = await viewer.createTexture(textureData); + await viewer.applyTexture(texture as ThermionFFITexture, cube); + await testHelper.capture( + viewer, "geometry_cube_with_custom_material_ubershader_texture"); + await viewer.removeEntity(cube); + await viewer.destroyMaterialInstance(materialInstance); + await viewer.destroyTexture(texture); + }); + + test('unlit material with color only', () async { + var viewer = await testHelper.createViewer(); + await viewer.setCameraPosition(0, 0, 6); + await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); + await viewer.setPostProcessing(true); + await viewer.setToneMapping(ToneMapper.LINEAR); + + var materialInstance = await viewer.createUnlitMaterialInstance(); + var cube = await viewer.createGeometry(GeometryHelper.cube(), + materialInstance: materialInstance); + + await viewer.setMaterialPropertyFloat4( + cube, "baseColorFactor", 0, 0.0, 1.0, 0.0, 1.0); + + await testHelper.capture(viewer, "unlit_material_base_color"); + + await viewer.dispose(); + }); + + test('create cube with custom material instance (unlit)', () async { + var viewer = await testHelper.createViewer(); + await viewer.setCameraPosition(0, 2, 6); + await viewer + .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); + await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); + await viewer.setPostProcessing(true); + await viewer.setToneMapping(ToneMapper.LINEAR); + + var materialInstance = await viewer.createUnlitMaterialInstance(); + var cube = await viewer.createGeometry(GeometryHelper.cube(), + materialInstance: materialInstance); + + var textureData = + File("${testHelper.testDir}/assets/cube_texture_512x512.png") + .readAsBytesSync(); + var texture = await viewer.createTexture(textureData); + await viewer.applyTexture(texture, cube); + await testHelper.capture( + viewer, "geometry_cube_with_custom_material_unlit_texture_only"); + await viewer.removeEntity(cube); + + cube = await viewer.createGeometry(GeometryHelper.cube(), + materialInstance: materialInstance); + // reusing same material instance, so set baseColorIndex to -1 to disable the texture + await viewer.setMaterialPropertyInt(cube, "baseColorIndex", 0, -1); + await viewer.setMaterialPropertyFloat4( + cube, "baseColorFactor", 0, 0.0, 1.0, 0.0, 1.0); + await testHelper.capture( + viewer, "geometry_cube_with_custom_material_unlit_color_only"); + await viewer.removeEntity(cube); + + cube = await viewer.createGeometry(GeometryHelper.cube(), + materialInstance: materialInstance); + // now set baseColorIndex to 0 to enable the texture and the base color + await viewer.setMaterialPropertyInt(cube, "baseColorIndex", 0, 0); + await viewer.setMaterialPropertyFloat4( + cube, "baseColorFactor", 0, 0.0, 1.0, 0.0, 0.5); + await viewer.applyTexture(texture, cube); + + await testHelper.capture( + viewer, "geometry_cube_with_custom_material_unlit_color_and_texture"); + + await viewer.removeEntity(cube); + + await viewer.destroyTexture(texture); + await viewer.destroyMaterialInstance(materialInstance); + await viewer.dispose(); + }); + + test('create sphere (no normals)', () async { + var viewer = await testHelper.createViewer(); + await viewer.setBackgroundColor(0.0, 0.0, 1.0, 1.0); + await viewer.setCameraPosition(0, 0, 6); + await viewer + .createGeometry(GeometryHelper.sphere(normals: false, uvs: false)); + await testHelper.capture(viewer, "geometry_sphere_no_normals"); + }); + }); +} diff --git a/thermion_dart/test/gizmo_tests.dart b/thermion_dart/test/gizmo_tests.dart new file mode 100644 index 00000000..ad3ba1a3 --- /dev/null +++ b/thermion_dart/test/gizmo_tests.dart @@ -0,0 +1,17 @@ +import 'package:test/test.dart'; + +import 'helpers.dart'; + +void main() async { + final testHelper = TestHelper("gizmo"); + + group('gizmo', () { + test('add gizmo to scene', () async { + var viewer = await testHelper.createViewer(); + var view = await viewer.getViewAt(0); + var gizmo = await viewer.createGizmo(view); + await testHelper.capture(viewer, "gizmo_add_to_scene"); + await viewer.dispose(); + }); + }); +} diff --git a/thermion_dart/test/gltf_tests.dart b/thermion_dart/test/gltf_tests.dart new file mode 100644 index 00000000..627fe1ef --- /dev/null +++ b/thermion_dart/test/gltf_tests.dart @@ -0,0 +1,56 @@ +import 'dart:io'; +import 'package:thermion_dart/thermion_dart.dart'; +import 'package:test/test.dart'; + +import 'package:vector_math/vector_math_64.dart'; + +import 'helpers.dart'; + +void main() async { + final testHelper = TestHelper("gltf"); + group("gltf", () { + test('load glb from file', () async { + var viewer = await testHelper.createViewer(bg: kRed, cameraPosition: Vector3(0, 1, 5)); + var model = await viewer.loadGlb("file://${testHelper.testDir}/assets/cube.glb"); + await viewer + .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -0.5)); + await testHelper.capture(viewer, "load_glb_from_file"); + await viewer.dispose(); + }); + + test('load glb from buffer', () async { + var viewer = await testHelper.createViewer(); + var buffer = File("${testHelper.testDir}/cube.glb").readAsBytesSync(); + var model = await viewer.loadGlbFromBuffer(buffer); + await viewer.transformToUnitCube(model); + await viewer.setBackgroundColor(0.0, 0.0, 1.0, 1.0); + await viewer.setCameraPosition(0, 1, 5); + await viewer + .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -0.5)); + await testHelper.capture(viewer, "load_glb_from_buffer"); + }); + + test('load glb from buffer with priority', () async { + var viewer = await testHelper.createViewer(); + await viewer.addDirectLight(DirectLight.sun()); + await viewer.setBackgroundColor(1.0, 1.0, 1.0, 1.0); + await viewer.setCameraPosition(0, 3, 5); + await viewer + .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -0.5)); + + var buffer = File("${testHelper.testDir}/cube.glb").readAsBytesSync(); + var model1 = await viewer.loadGlbFromBuffer(buffer, priority: 7); + var model2 = await viewer.loadGlbFromBuffer(buffer, priority: 0); + + for (final entity in await viewer.getChildEntities(model1, true)) { + await viewer.setMaterialPropertyFloat4( + entity, "baseColorFactor", 0, 0, 0, 1.0, 1.0); + } + for (final entity in await viewer.getChildEntities(model2, true)) { + await viewer.setMaterialPropertyFloat4( + entity, "baseColorFactor", 0, 0, 1.0, 0.0, 1.0); + } + await testHelper.capture(viewer, "load_glb_from_buffer_with_priority"); + }); + }); +} diff --git a/thermion_dart/test/helpers.dart b/thermion_dart/test/helpers.dart index e078a95f..ddaf1a41 100644 --- a/thermion_dart/test/helpers.dart +++ b/thermion_dart/test/helpers.dart @@ -5,10 +5,12 @@ import 'package:image/image.dart' as img; import 'dart:typed_data'; import 'package:ffi/ffi.dart'; import 'package:image/image.dart'; -import 'package:thermion_dart/src/swift/swift_bindings.g.dart'; -import 'package:thermion_dart/src/utils/dart_resources.dart'; +import 'swift/swift_bindings.g.dart'; +import 'package:thermion_dart/src/utils/src/dart_resources.dart'; import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_viewer_ffi.dart'; import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart'; +import 'package:thermion_dart/src/viewer/src/shared_types/view.dart'; import 'package:thermion_dart/thermion_dart.dart'; import 'package:vector_math/vector_math_64.dart'; import 'package:path/path.dart' as p; @@ -55,7 +57,6 @@ extension on Uri { String get name => pathSegments.where((e) => e != '').last; } - Future savePixelBufferToBmp( Uint8List pixelBuffer, int width, int height, String outputPath) async { var data = await pixelBufferToBmp(pixelBuffer, width, height); @@ -65,7 +66,7 @@ Future savePixelBufferToBmp( } class TestHelper { - + late SwapChain swapChain; late Directory outDir; late String testDir; @@ -76,19 +77,67 @@ class TestHelper { outDir = Directory("$testDir/output/${dir}"); // outDir.deleteSync(recursive: true); outDir.createSync(); + DynamicLibrary.open('${testDir}/libThermionTextureSwift.dylib'); + } - Future capture(ThermionViewer viewer, String outputFilename) async { + Future capture(ThermionViewer viewer, String outputFilename, + {View? view, SwapChain? swapChain, RenderTarget? renderTarget}) async { await Future.delayed(Duration(milliseconds: 10)); var outPath = p.join(outDir.path, "$outputFilename.bmp"); - var pixelBuffer = await viewer.capture(); - await savePixelBufferToBmp( - pixelBuffer, - viewer.viewportDimensions.$1.toInt(), - viewer.viewportDimensions.$2.toInt(), - outPath); + var pixelBuffer = await viewer.capture( + view: view, + swapChain: swapChain ?? this.swapChain, + renderTarget: renderTarget); + view ??= await viewer.getViewAt(0); + var vp = await view.getViewport(); + await savePixelBufferToBmp(pixelBuffer, vp.width, vp.height, outPath); return pixelBuffer; } + + Future createTexture(int width, int height) async { + final packageUri = findPackageRoot('thermion_dart'); + var testDir = Directory("${packageUri.toFilePath()}/test").path; + + final object = ThermionTextureSwift.new1(); + object.initWithWidth_height_(width, height); + return object; + } + + Future createViewer( + {img.Color? bg, + Vector3? cameraPosition, + viewportDimensions = (width: 500, height: 500)}) async { + final resourceLoader = calloc(1); + var loadToOut = NativeCallable< + Void Function(Pointer, + Pointer)>.listener(DartResourceLoader.loadResource); + + resourceLoader.ref.loadToOut = loadToOut.nativeFunction; + var freeResource = NativeCallable.listener( + DartResourceLoader.freeResource); + resourceLoader.ref.freeResource = freeResource.nativeFunction; + + var viewer = ThermionViewerFFI(resourceLoader: resourceLoader.cast()); + + await viewer.initialized; + swapChain = await viewer.createHeadlessSwapChain( + viewportDimensions.width, viewportDimensions.height); + + await viewer.updateViewportAndCameraProjection( + viewportDimensions.width.toDouble(), + viewportDimensions.height.toDouble()); + if (bg != null) { + await viewer.setBackgroundColor( + bg.r.toDouble(), bg.g.toDouble(), bg.b.toDouble(), bg.a.toDouble()); + } + + if (cameraPosition != null) { + await viewer.setCameraPosition( + cameraPosition.x, cameraPosition.y, cameraPosition.z); + } + return viewer; + } } Future pixelBufferToBmp( @@ -203,50 +252,6 @@ int _linearToSRGB(double linearValue) { } } -Future createViewer( - {img.Color? bg, - Vector3? cameraPosition, - viewportDimensions = (width: 500, height: 500)}) async { - final packageUri = findPackageRoot('thermion_dart'); - - final lib = ThermionDartTexture1(DynamicLibrary.open( - '${packageUri.toFilePath()}/native/lib/macos/swift/libthermion_swift.dylib')); - final object = ThermionDartTexture.new1(lib); - object.initWithWidth_height_( - viewportDimensions.width, viewportDimensions.height); - - final resourceLoader = calloc(1); - var loadToOut = NativeCallable< - Void Function(Pointer, - Pointer)>.listener(DartResourceLoader.loadResource); - - resourceLoader.ref.loadToOut = loadToOut.nativeFunction; - var freeResource = NativeCallable.listener( - DartResourceLoader.freeResource); - resourceLoader.ref.freeResource = freeResource.nativeFunction; - - var viewer = ThermionViewerFFI(resourceLoader: resourceLoader.cast()); - - await viewer.initialized; - await viewer.createSwapChain(viewportDimensions.width.toDouble(), - viewportDimensions.height.toDouble()); - await viewer.createRenderTarget(viewportDimensions.width.toDouble(), - viewportDimensions.height.toDouble(), object.metalTextureAddress); - await viewer.updateViewportAndCameraProjection( - viewportDimensions.width.toDouble(), - viewportDimensions.height.toDouble()); - if (bg != null) { - await viewer.setBackgroundColor( - bg.r.toDouble(), bg.g.toDouble(), bg.b.toDouble(), bg.a.toDouble()); - } - - if (cameraPosition != null) { - await viewer.setCameraPosition( - cameraPosition.x, cameraPosition.y, cameraPosition.z); - } - return viewer; -} - Uint8List poissonBlend(List textures, int width, int height) { final int numTextures = textures.length; final int size = width * height; diff --git a/thermion_dart/test/integration_test.dart b/thermion_dart/test/integration_test.dart index 7daa522b..c5cb71ec 100644 --- a/thermion_dart/test/integration_test.dart +++ b/thermion_dart/test/integration_test.dart @@ -15,24 +15,22 @@ void main() async { group('background', () { test('set background color to solid green', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setBackgroundColor(0.0, 1.0, 0.0, 1.0); await testHelper.capture(viewer, "set_background_color_to_solid_green"); await viewer.dispose(); }); test('set background color to full transparency', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setBackgroundColor(0.0, 1.0, 0.0, 0.0); await testHelper.capture( viewer, "set_background_color_to_transparent_green"); await viewer.dispose(); }); - - test('set background image', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setBackgroundImage( "file:///${testHelper.testDir}/assets/cube_texture_512x512.png"); await viewer.setPostProcessing(true); @@ -42,57 +40,11 @@ void main() async { }); }); - group("gltf", () { - test('load glb from file', () async { - var viewer = await createViewer(); - var model = await viewer.loadGlb("file://${testHelper.testDir}/cube.glb"); - await viewer.transformToUnitCube(model); - await viewer.setBackgroundColor(0.0, 0.0, 1.0, 1.0); - await viewer.setCameraPosition(0, 1, 5); - await viewer - .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -0.5)); - await testHelper.capture(viewer, "load_glb_from_file"); - }); - - test('load glb from buffer', () async { - var viewer = await createViewer(); - var buffer = File("${testHelper.testDir}/cube.glb").readAsBytesSync(); - var model = await viewer.loadGlbFromBuffer(buffer); - await viewer.transformToUnitCube(model); - await viewer.setBackgroundColor(0.0, 0.0, 1.0, 1.0); - await viewer.setCameraPosition(0, 1, 5); - await viewer - .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -0.5)); - await testHelper.capture(viewer, "load_glb_from_buffer"); - }); - - test('load glb from buffer with priority', () async { - var viewer = await createViewer(); - await viewer.addDirectLight(DirectLight.sun()); - await viewer.setBackgroundColor(1.0, 1.0, 1.0, 1.0); - await viewer.setCameraPosition(0, 3, 5); - await viewer - .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -0.5)); - - var buffer = File("${testHelper.testDir}/cube.glb").readAsBytesSync(); - var model1 = await viewer.loadGlbFromBuffer(buffer, priority: 7); - var model2 = await viewer.loadGlbFromBuffer(buffer, priority: 0); - - for (final entity in await viewer.getChildEntities(model1, true)) { - await viewer.setMaterialPropertyFloat4( - entity, "baseColorFactor", 0, 0, 0, 1.0, 1.0); - } - for (final entity in await viewer.getChildEntities(model2, true)) { - await viewer.setMaterialPropertyFloat4( - entity, "baseColorFactor", 0, 0, 1.0, 0.0, 1.0); - } - await testHelper.capture(viewer, "load_glb_from_buffer_with_priority"); - }); - }); + group("scene update events", () { test('add light fires SceneUpdateEvent', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); final success = Completer(); var light = DirectLight( @@ -116,7 +68,7 @@ void main() async { }); test('remove light fires SceneUpdateEvent', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); final success = Completer(); var light = await viewer.addDirectLight(DirectLight.point()); @@ -135,7 +87,7 @@ void main() async { }); test('add geometry fires SceneUpdateEvent', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); final success = Completer(); var geometry = GeometryHelper.cube(); @@ -153,7 +105,7 @@ void main() async { }); test('remove geometry fires SceneUpdateEvent', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); var geometry = await viewer.createGeometry(GeometryHelper.cube()); final success = Completer(); @@ -171,7 +123,7 @@ void main() async { }); test('loadGlb fires SceneUpdateEvent', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); final success = Completer(); @@ -191,7 +143,7 @@ void main() async { }); test('remove glb fires SceneUpdateEvent', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); final uri = "${testHelper.testDir}/cube.glb"; var entity = await viewer.loadGlb(uri, keepData: false); @@ -209,176 +161,10 @@ void main() async { }); }); - group("custom geometry", () { - test('create cube (no uvs/normals)', () async { - var viewer = await createViewer(); - await viewer.addLight(LightType.SUN, 6500, 1000000, 0, 0, 0, 0, 0, -1); - await viewer.setCameraPosition(0, 2, 6); - await viewer - .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); - await viewer.setBackgroundColor(1.0, 1.0, 1.0, 1.0); - await viewer - .createGeometry(GeometryHelper.cube(normals: false, uvs: false)); - - await testHelper.capture(viewer, "geometry_cube_no_uv_no_normal"); - }); - - test('create cube (no normals)', () async { - var viewer = await createViewer(); - var light = await viewer.addLight( - LightType.POINT, 6500, 10000000, 0, 2, 0, 0, 0, 0, - falloffRadius: 100.0); - await viewer.setCameraPosition(0, 2, 6); - await viewer - .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); - await viewer.setBackgroundColor(1.0, 0.0, 1.0, 1.0); - await viewer - .createGeometry(GeometryHelper.cube(normals: false, uvs: false)); - await testHelper.capture(viewer, "geometry_cube_no_normals"); - }); - - test('create cube (with normals)', () async { - var viewer = await createViewer(); - - var light = await viewer.addLight( - LightType.POINT, 6500, 10000000, 0, 2, 0, 0, 0, 0, - falloffRadius: 100.0); - await viewer.setCameraPosition(0, 2, 6); - await viewer - .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); - await viewer.setBackgroundColor(1.0, 1.0, 1.0, 1.0); - await viewer - .createGeometry(GeometryHelper.cube(normals: true, uvs: false)); - await testHelper.capture(viewer, "geometry_cube_with_normals"); - }); - - test('create cube with custom ubershader material instance (color)', - () async { - var viewer = await createViewer(); - await viewer.addLight(LightType.SUN, 6500, 1000000, 0, 0, 0, 0, 0, -1); - await viewer.setCameraPosition(0, 2, 6); - await viewer - .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); - await viewer.setBackgroundColor(1.0, 0.0, 1.0, 1.0); - - var materialInstance = - await viewer.createUbershaderMaterialInstance(unlit: true); - final cube = await viewer.createGeometry( - GeometryHelper.cube(uvs: false, normals: true), - materialInstance: materialInstance); - await viewer.setMaterialPropertyFloat4( - cube, "baseColorFactor", 0, 0.0, 1.0, 0.0, 0.0); - await testHelper.capture( - viewer, "geometry_cube_with_custom_material_ubershader"); - await viewer.removeEntity(cube); - await viewer.destroyMaterialInstance(materialInstance); - }); - - test('create cube with custom ubershader material instance (texture)', - () async { - var viewer = await createViewer(); - await viewer.addLight(LightType.SUN, 6500, 1000000, 0, 0, 0, 0, 0, -1); - await viewer.setCameraPosition(0, 2, 6); - await viewer - .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); - await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); - - var materialInstance = await viewer.createUbershaderMaterialInstance(); - final cube = await viewer.createGeometry( - GeometryHelper.cube(uvs: true, normals: true), - materialInstance: materialInstance); - var textureData = - File("${testHelper.testDir}/assets/cube_texture_512x512.png").readAsBytesSync(); - var texture = await viewer.createTexture(textureData); - await viewer.applyTexture(texture as ThermionFFITexture, cube); - await testHelper.capture( - viewer, "geometry_cube_with_custom_material_ubershader_texture"); - await viewer.removeEntity(cube); - await viewer.destroyMaterialInstance(materialInstance); - await viewer.destroyTexture(texture); - }); - - test('unlit material with color only', () async { - var viewer = await createViewer(); - await viewer.setCameraPosition(0, 0, 6); - await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); - await viewer.setPostProcessing(true); - await viewer.setToneMapping(ToneMapper.LINEAR); - - var materialInstance = await viewer.createUnlitMaterialInstance(); - var cube = await viewer.createGeometry(GeometryHelper.cube(), - materialInstance: materialInstance); - - await viewer.setMaterialPropertyFloat4( - cube, "baseColorFactor", 0, 0.0, 1.0, 0.0, 1.0); - - await testHelper.capture(viewer, "unlit_material_base_color"); - - await viewer.dispose(); - }); - - test('create cube with custom material instance (unlit)', () async { - var viewer = await createViewer(); - await viewer.setCameraPosition(0, 2, 6); - await viewer - .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); - await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); - await viewer.setPostProcessing(true); - await viewer.setToneMapping(ToneMapper.LINEAR); - - var materialInstance = await viewer.createUnlitMaterialInstance(); - var cube = await viewer.createGeometry(GeometryHelper.cube(), - materialInstance: materialInstance); - - var textureData = - File("${testHelper.testDir}/assets/cube_texture_512x512.png").readAsBytesSync(); - var texture = await viewer.createTexture(textureData); - await viewer.applyTexture(texture, cube); - await testHelper.capture( - viewer, "geometry_cube_with_custom_material_unlit_texture_only"); - await viewer.removeEntity(cube); - - cube = await viewer.createGeometry(GeometryHelper.cube(), - materialInstance: materialInstance); - // reusing same material instance, so set baseColorIndex to -1 to disable the texture - await viewer.setMaterialPropertyInt(cube, "baseColorIndex", 0, -1); - await viewer.setMaterialPropertyFloat4( - cube, "baseColorFactor", 0, 0.0, 1.0, 0.0, 1.0); - await testHelper.capture( - viewer, "geometry_cube_with_custom_material_unlit_color_only"); - await viewer.removeEntity(cube); - - cube = await viewer.createGeometry(GeometryHelper.cube(), - materialInstance: materialInstance); - // now set baseColorIndex to 0 to enable the texture and the base color - await viewer.setMaterialPropertyInt(cube, "baseColorIndex", 0, 0); - await viewer.setMaterialPropertyFloat4( - cube, "baseColorFactor", 0, 0.0, 1.0, 0.0, 0.5); - await viewer.applyTexture(texture, cube); - - await testHelper.capture( - viewer, "geometry_cube_with_custom_material_unlit_color_and_texture"); - - await viewer.removeEntity(cube); - - await viewer.destroyTexture(texture); - await viewer.destroyMaterialInstance(materialInstance); - await viewer.dispose(); - }); - - test('create sphere (no normals)', () async { - var viewer = await createViewer(); - await viewer.setBackgroundColor(0.0, 0.0, 1.0, 1.0); - await viewer.setCameraPosition(0, 0, 6); - await viewer - .createGeometry(GeometryHelper.sphere(normals: false, uvs: false)); - await testHelper.capture(viewer, "geometry_sphere_no_normals"); - }); - }); - + group("MaterialInstance", () { test('disable depth write', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); await viewer.setCameraPosition(0, 0, 6); await viewer.addDirectLight( @@ -467,7 +253,7 @@ void main() async { group("materials", () { test('set float4 material property for custom geometry', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setCameraPosition(0, 0, 6); await viewer.setBackgroundColor(0.0, 0.0, 1.0, 1.0); @@ -482,7 +268,7 @@ void main() async { await testHelper.capture(viewer, "set_material_float4_post"); }); test('set float material property for custom geometry', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setCameraPosition(0, 0, 6); await viewer.setBackgroundColor(0.0, 0.0, 1.0, 1.0); @@ -500,7 +286,7 @@ void main() async { test('set float material property (roughness) for custom geometry', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setCameraPosition(0, 0, 6); await viewer.setBackgroundColor(0.0, 0.0, 1.0, 1.0); @@ -522,7 +308,7 @@ void main() async { group("transforms & parenting", () { test('set multiple transforms simultaneously with setTransforms', () async { var viewer = - await createViewer(bg: kRed, cameraPosition: Vector3(0, 0, 5)); + await testHelper.createViewer(bg: kRed, cameraPosition: Vector3(0, 0, 5)); final cube1 = await viewer.createGeometry(GeometryHelper.cube()); final cube2 = await viewer.createGeometry(GeometryHelper.cube()); @@ -534,14 +320,14 @@ void main() async { Matrix4.translation(Vector3(1, 0, 0)) ]); - await viewer.render(); + await viewer.render(testHelper.swapChain); await testHelper.capture(viewer, "set_multiple_transforms"); }); test('getParent and getAncestor both return null when entity has no parent', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); final cube = await viewer.createGeometry(GeometryHelper.cube()); @@ -552,7 +338,7 @@ void main() async { test( 'getParent returns the parent entity after one has been set via setParent', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); final cube1 = await viewer.createGeometry(GeometryHelper.cube()); @@ -566,7 +352,7 @@ void main() async { }); test('getAncestor returns the ultimate parent entity', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); final grandparent = await viewer.createGeometry(GeometryHelper.cube()); final parent = await viewer.createGeometry(GeometryHelper.cube()); @@ -579,7 +365,7 @@ void main() async { }); test('set position based on screenspace coord', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); print(await viewer.getCameraFov(true)); await viewer.createIbl(1.0, 1.0, 1.0, 1000); await viewer.setCameraPosition(0, 0, 6); @@ -591,7 +377,7 @@ void main() async { await viewer.queuePositionUpdateFromViewportCoords(cube, 0, 0); // we need an explicit render call here to process the transform queue - await viewer.render(); + await viewer.render(testHelper.swapChain); await testHelper.capture(viewer, "set_position_from_viewport_coords"); }); @@ -599,7 +385,7 @@ void main() async { group("layers & overlays", () { test('enable grid overlay', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setBackgroundColor(0, 0, 0, 1); await viewer .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); @@ -612,7 +398,7 @@ void main() async { }); test('load glb from buffer with layer', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setBackgroundColor(1, 0, 1, 1); await viewer.setCameraPosition(0, 2, 5); @@ -629,7 +415,7 @@ void main() async { }); test('change layer visibility at runtime', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setBackgroundColor(1, 0, 1, 1); await viewer.setCameraPosition(0, 2, 5); @@ -719,7 +505,7 @@ void main() async { group("stencil", () { test('set stencil highlight for glb', () async { - final viewer = await createViewer(); + final viewer = await testHelper.createViewer(); var model = await viewer.loadGlb("${testHelper.testDir}/cube.glb", keepData: true); await viewer.setPostProcessing(true); @@ -736,7 +522,7 @@ void main() async { }); test('set stencil highlight for geometry', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setPostProcessing(true); await viewer.setBackgroundColor(0.0, 1.0, 0.0, 1.0); await viewer.setCameraPosition(0, 2, 5); @@ -754,7 +540,7 @@ void main() async { }); test('set stencil highlight for gltf asset', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setPostProcessing(true); await viewer.setBackgroundColor(0.0, 1.0, 0.0, 1.0); await viewer.setCameraPosition(0, 1, 5); @@ -774,7 +560,7 @@ void main() async { }); test('set stencil highlight for multiple geometry ', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setPostProcessing(true); await viewer.setBackgroundColor(0.0, 1.0, 0.0, 1.0); await viewer.setCameraPosition(0, 1, 5); @@ -797,7 +583,7 @@ void main() async { }); test('set stencil highlight for multiple gltf assets ', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setPostProcessing(true); await viewer.setBackgroundColor(0.0, 1.0, 0.0, 1.0); await viewer.setCameraPosition(0, 1, 5); @@ -824,7 +610,7 @@ void main() async { group("texture", () { test("create/apply/dispose texture", () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); var textureData = File("${testHelper.testDir}/assets/cube_texture_512x512.png").readAsBytesSync(); @@ -861,21 +647,11 @@ void main() async { }); }); - group("render thread", () { - test("request frame on render thread", () async { - var viewer = await createViewer(); - viewer.requestFrame(); - - await Future.delayed(Duration(milliseconds: 20)); - await viewer.dispose(); - }); - }); - // group("unproject", () { // test("unproject", () async { // final dimensions = (width: 1280, height: 768); - // var viewer = await createViewer(viewportDimensions: dimensions); + // var viewer = await testHelper.createViewer(viewportDimensions: dimensions); // await viewer.setPostProcessing(false); // // await viewer.setToneMapping(ToneMapper.LINEAR); // await viewer.setBackgroundColor(1.0, 1.0, 1.0, 1.0); diff --git a/thermion_dart/test/libThermionTextureSwift.dylib b/thermion_dart/test/libThermionTextureSwift.dylib new file mode 100644 index 00000000..5a91f788 Binary files /dev/null and b/thermion_dart/test/libThermionTextureSwift.dylib differ diff --git a/thermion_dart/test/material_tests.dart b/thermion_dart/test/material_tests.dart index 2a50bc09..8df3dc54 100644 --- a/thermion_dart/test/material_tests.dart +++ b/thermion_dart/test/material_tests.dart @@ -15,7 +15,7 @@ void main() async { group("texture tests", () { test('apply texture to custom ubershader material instance', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.addLight(LightType.SUN, 6500, 1000000, 0, 0, 0, 0, 0, -1); await viewer.setCameraPosition(0, 2, 6); await viewer @@ -38,7 +38,7 @@ void main() async { }); test('unlit material with color only', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setCameraPosition(0, 0, 6); await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); await viewer.setPostProcessing(true); @@ -57,7 +57,7 @@ void main() async { }); test('create cube with custom material instance (unlit)', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setCameraPosition(0, 2, 6); await viewer .setCameraRotation(Quaternion.axisAngle(Vector3(1, 0, 0), -pi / 8)); @@ -106,7 +106,7 @@ void main() async { }); test('create sphere (no normals)', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setBackgroundColor(0.0, 0.0, 1.0, 1.0); await viewer.setCameraPosition(0, 0, 6); await viewer @@ -117,7 +117,7 @@ void main() async { group("MaterialInstance", () { test('disable depth write', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); await viewer.setCameraPosition(0, 0, 6); await viewer.addDirectLight( @@ -149,7 +149,7 @@ void main() async { }); test('set uv scaling (unlit)', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); await viewer.setCameraPosition(0, 0, 6); await viewer.addDirectLight( @@ -174,7 +174,7 @@ void main() async { group("stencil", () { test('set stencil highlight for glb', () async { - final viewer = await createViewer(); + final viewer = await testHelper.createViewer(); var model = await viewer.loadGlb("${testHelper.testDir}/cube.glb", keepData: true); await viewer.setPostProcessing(true); @@ -191,7 +191,7 @@ void main() async { }); test('set stencil highlight for geometry', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setPostProcessing(true); await viewer.setBackgroundColor(0.0, 1.0, 0.0, 1.0); await viewer.setCameraPosition(0, 2, 5); @@ -209,7 +209,7 @@ void main() async { }); test('set stencil highlight for gltf asset', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setPostProcessing(true); await viewer.setBackgroundColor(0.0, 1.0, 0.0, 1.0); await viewer.setCameraPosition(0, 1, 5); @@ -229,7 +229,7 @@ void main() async { }); test('set stencil highlight for multiple geometry ', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setPostProcessing(true); await viewer.setBackgroundColor(0.0, 1.0, 0.0, 1.0); await viewer.setCameraPosition(0, 1, 5); @@ -252,7 +252,7 @@ void main() async { }); test('set stencil highlight for multiple gltf assets ', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.setPostProcessing(true); await viewer.setBackgroundColor(0.0, 1.0, 0.0, 1.0); await viewer.setCameraPosition(0, 1, 5); @@ -279,7 +279,7 @@ void main() async { group("texture", () { test("create/apply/dispose texture", () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); var textureData = File("${testHelper.testDir}/assets/cube_texture_512x512.png").readAsBytesSync(); @@ -318,7 +318,7 @@ void main() async { group("render thread", () { test("request frame on render thread", () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); viewer.requestFrame(); await Future.delayed(Duration(milliseconds: 20)); @@ -330,7 +330,7 @@ void main() async { // test("unproject", () async { // final dimensions = (width: 1280, height: 768); - // var viewer = await createViewer(viewportDimensions: dimensions); + // var viewer = await testHelper.createViewer(viewportDimensions: dimensions); // await viewer.setPostProcessing(false); // // await viewer.setToneMapping(ToneMapper.LINEAR); // await viewer.setBackgroundColor(1.0, 1.0, 1.0, 1.0); diff --git a/thermion_dart/test/render_thread.dart b/thermion_dart/test/render_thread.dart new file mode 100644 index 00000000..ea8579be --- /dev/null +++ b/thermion_dart/test/render_thread.dart @@ -0,0 +1,33 @@ +import 'dart:async'; +import 'dart:ffi'; +import 'package:test/test.dart'; + +import 'helpers.dart'; + +void main() async { + final testHelper = TestHelper("render_thread"); + group("render thread/capture", () { + test("request frame on render thread", () async { + var viewer = await testHelper.createViewer(); + await viewer.setBackgroundColor(1.0, 0.0, 0.0, 1.0); + + var texture = await testHelper.createTexture(500, 500); + var renderTarget = await viewer.createRenderTarget( + 500, 500, texture.metalTextureAddress); + + final view = await viewer.getViewAt(0); + await view.setRenderTarget(renderTarget); + + await viewer.render(); + + await Future.delayed(Duration(milliseconds: 1)); + + var data = texture.getTextureBytes()!; + var pixels = data.bytes.cast().asTypedList(data.length); + + savePixelBufferToBmp( + pixels, 500, 500, "${testHelper.testDir}/request_frame.bmp"); + await viewer.dispose(); + }); + }); +} diff --git a/thermion_dart/test/skybox_tests.dart b/thermion_dart/test/skybox_tests.dart index 723ac172..e1a87695 100644 --- a/thermion_dart/test/skybox_tests.dart +++ b/thermion_dart/test/skybox_tests.dart @@ -8,7 +8,7 @@ void main() async { group("skybox", () { test('load skybox', () async { - var viewer = await createViewer(); + var viewer = await testHelper.createViewer(); await viewer.loadSkybox( "file:///${testHelper.testDir}/assets/default_env_skybox.ktx"); await testHelper.capture(viewer, "load_skybox"); diff --git a/thermion_dart/test/swift/swift_bindings.g.dart b/thermion_dart/test/swift/swift_bindings.g.dart new file mode 100644 index 00000000..6a41e446 --- /dev/null +++ b/thermion_dart/test/swift/swift_bindings.g.dart @@ -0,0 +1,20452 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field, return_of_invalid_type, void_checks, annotate_overrides, no_leading_underscores_for_local_identifiers, library_private_types_in_public_apia +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint +import 'dart:ffi' as ffi; +import 'package:objective_c/objective_c.dart' as objc; + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSDictionary_NSRange_bool( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSTimer( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSFileHandle( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSError( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSDictionary_NSError( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSArray( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSCachedURLResponse( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSDictionary( + ffi.Pointer block, +); + +@ffi.Native Function(ffi.Pointer)>( + isLeaf: true) +external ffi.Pointer + wrapListenerBlock_ObjCBlock_ffiVoid_NSURLCredential( + ffi.Pointer block, +); + +/// NSProgress +class NSProgress extends objc.NSObject { + NSProgress._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSProgress] that points to the same underlying object as [other]. + NSProgress.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSProgress] that wraps the given raw object pointer. + NSProgress.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSProgress]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0(obj.pointer, _sel_isKindOfClass_, _class_NSProgress); + } + + /// currentProgress + static NSProgress? currentProgress() { + final _ret = _objc_msgSend_1(_class_NSProgress, _sel_currentProgress); + return _ret.address == 0 + ? null + : NSProgress.castFromPointer(_ret, retain: true, release: true); + } + + /// progressWithTotalUnitCount: + static NSProgress progressWithTotalUnitCount_(int unitCount) { + final _ret = _objc_msgSend_2( + _class_NSProgress, _sel_progressWithTotalUnitCount_, unitCount); + return NSProgress.castFromPointer(_ret, retain: true, release: true); + } + + /// discreteProgressWithTotalUnitCount: + static NSProgress discreteProgressWithTotalUnitCount_(int unitCount) { + final _ret = _objc_msgSend_2( + _class_NSProgress, _sel_discreteProgressWithTotalUnitCount_, unitCount); + return NSProgress.castFromPointer(_ret, retain: true, release: true); + } + + /// progressWithTotalUnitCount:parent:pendingUnitCount: + static NSProgress progressWithTotalUnitCount_parent_pendingUnitCount_( + int unitCount, NSProgress parent, int portionOfParentTotalUnitCount) { + final _ret = _objc_msgSend_3( + _class_NSProgress, + _sel_progressWithTotalUnitCount_parent_pendingUnitCount_, + unitCount, + parent.pointer, + portionOfParentTotalUnitCount); + return NSProgress.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithParent:userInfo: + NSProgress initWithParent_userInfo_( + NSProgress? parentProgressOrNil, objc.ObjCObjectBase? userInfoOrNil) { + final _ret = _objc_msgSend_4( + this.pointer, + _sel_initWithParent_userInfo_, + parentProgressOrNil?.pointer ?? ffi.nullptr, + userInfoOrNil?.pointer ?? ffi.nullptr); + return NSProgress.castFromPointer(_ret, retain: true, release: true); + } + + /// becomeCurrentWithPendingUnitCount: + void becomeCurrentWithPendingUnitCount_(int unitCount) { + _objc_msgSend_5( + this.pointer, _sel_becomeCurrentWithPendingUnitCount_, unitCount); + } + + /// performAsCurrentWithPendingUnitCount:usingBlock: + void performAsCurrentWithPendingUnitCount_usingBlock_( + int unitCount, ObjCBlock_ffiVoid work) { + _objc_msgSend_6( + this.pointer, + _sel_performAsCurrentWithPendingUnitCount_usingBlock_, + unitCount, + work.pointer); + } + + /// resignCurrent + void resignCurrent() { + _objc_msgSend_7(this.pointer, _sel_resignCurrent); + } + + /// addChild:withPendingUnitCount: + void addChild_withPendingUnitCount_(NSProgress child, int inUnitCount) { + _objc_msgSend_8(this.pointer, _sel_addChild_withPendingUnitCount_, + child.pointer, inUnitCount); + } + + /// totalUnitCount + int get totalUnitCount { + return _objc_msgSend_9(this.pointer, _sel_totalUnitCount); + } + + /// setTotalUnitCount: + set totalUnitCount(int value) { + return _objc_msgSend_10(this.pointer, _sel_setTotalUnitCount_, value); + } + + /// completedUnitCount + int get completedUnitCount { + return _objc_msgSend_9(this.pointer, _sel_completedUnitCount); + } + + /// setCompletedUnitCount: + set completedUnitCount(int value) { + return _objc_msgSend_10(this.pointer, _sel_setCompletedUnitCount_, value); + } + + /// localizedDescription + objc.NSString get localizedDescription { + final _ret = _objc_msgSend_11(this.pointer, _sel_localizedDescription); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setLocalizedDescription: + set localizedDescription(objc.NSString value) { + return _objc_msgSend_12( + this.pointer, _sel_setLocalizedDescription_, value.pointer); + } + + /// localizedAdditionalDescription + objc.NSString get localizedAdditionalDescription { + final _ret = + _objc_msgSend_11(this.pointer, _sel_localizedAdditionalDescription); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setLocalizedAdditionalDescription: + set localizedAdditionalDescription(objc.NSString value) { + return _objc_msgSend_12( + this.pointer, _sel_setLocalizedAdditionalDescription_, value.pointer); + } + + /// isCancellable + bool get cancellable { + return _objc_msgSend_13(this.pointer, _sel_isCancellable); + } + + /// setCancellable: + set cancellable(bool value) { + return _objc_msgSend_14(this.pointer, _sel_setCancellable_, value); + } + + /// isPausable + bool get pausable { + return _objc_msgSend_13(this.pointer, _sel_isPausable); + } + + /// setPausable: + set pausable(bool value) { + return _objc_msgSend_14(this.pointer, _sel_setPausable_, value); + } + + /// isCancelled + bool get cancelled { + return _objc_msgSend_13(this.pointer, _sel_isCancelled); + } + + /// isPaused + bool get paused { + return _objc_msgSend_13(this.pointer, _sel_isPaused); + } + + /// cancellationHandler + ObjCBlock_ffiVoid? get cancellationHandler { + final _ret = _objc_msgSend_15(this.pointer, _sel_cancellationHandler); + return _ret.address == 0 + ? null + : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); + } + + /// setCancellationHandler: + set cancellationHandler(ObjCBlock_ffiVoid? value) { + return _objc_msgSend_16(this.pointer, _sel_setCancellationHandler_, + value?.pointer ?? ffi.nullptr); + } + + /// pausingHandler + ObjCBlock_ffiVoid? get pausingHandler { + final _ret = _objc_msgSend_15(this.pointer, _sel_pausingHandler); + return _ret.address == 0 + ? null + : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); + } + + /// setPausingHandler: + set pausingHandler(ObjCBlock_ffiVoid? value) { + return _objc_msgSend_16( + this.pointer, _sel_setPausingHandler_, value?.pointer ?? ffi.nullptr); + } + + /// resumingHandler + ObjCBlock_ffiVoid? get resumingHandler { + final _ret = _objc_msgSend_15(this.pointer, _sel_resumingHandler); + return _ret.address == 0 + ? null + : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); + } + + /// setResumingHandler: + set resumingHandler(ObjCBlock_ffiVoid? value) { + return _objc_msgSend_16( + this.pointer, _sel_setResumingHandler_, value?.pointer ?? ffi.nullptr); + } + + /// setUserInfoObject:forKey: + void setUserInfoObject_forKey_( + objc.ObjCObjectBase? objectOrNil, objc.NSString key) { + _objc_msgSend_17(this.pointer, _sel_setUserInfoObject_forKey_, + objectOrNil?.pointer ?? ffi.nullptr, key.pointer); + } + + /// isIndeterminate + bool get indeterminate { + return _objc_msgSend_13(this.pointer, _sel_isIndeterminate); + } + + /// fractionCompleted + double get fractionCompleted { + return objc.useMsgSendVariants + ? _objc_msgSend_18Fpret(this.pointer, _sel_fractionCompleted) + : _objc_msgSend_18(this.pointer, _sel_fractionCompleted); + } + + /// isFinished + bool get finished { + return _objc_msgSend_13(this.pointer, _sel_isFinished); + } + + /// cancel + void cancel() { + _objc_msgSend_7(this.pointer, _sel_cancel); + } + + /// pause + void pause() { + _objc_msgSend_7(this.pointer, _sel_pause); + } + + /// resume + void resume() { + _objc_msgSend_7(this.pointer, _sel_resume); + } + + /// userInfo + objc.ObjCObjectBase get userInfo { + final _ret = _objc_msgSend_19(this.pointer, _sel_userInfo); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// kind + objc.NSString? get kind { + final _ret = _objc_msgSend_20(this.pointer, _sel_kind); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setKind: + set kind(objc.NSString? value) { + return _objc_msgSend_21( + this.pointer, _sel_setKind_, value?.pointer ?? ffi.nullptr); + } + + /// estimatedTimeRemaining + objc.NSNumber? get estimatedTimeRemaining { + final _ret = _objc_msgSend_22(this.pointer, _sel_estimatedTimeRemaining); + return _ret.address == 0 + ? null + : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// setEstimatedTimeRemaining: + set estimatedTimeRemaining(objc.NSNumber? value) { + return _objc_msgSend_23(this.pointer, _sel_setEstimatedTimeRemaining_, + value?.pointer ?? ffi.nullptr); + } + + /// throughput + objc.NSNumber? get throughput { + final _ret = _objc_msgSend_22(this.pointer, _sel_throughput); + return _ret.address == 0 + ? null + : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// setThroughput: + set throughput(objc.NSNumber? value) { + return _objc_msgSend_23( + this.pointer, _sel_setThroughput_, value?.pointer ?? ffi.nullptr); + } + + /// fileOperationKind + objc.NSString? get fileOperationKind { + final _ret = _objc_msgSend_20(this.pointer, _sel_fileOperationKind); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setFileOperationKind: + set fileOperationKind(objc.NSString? value) { + return _objc_msgSend_21(this.pointer, _sel_setFileOperationKind_, + value?.pointer ?? ffi.nullptr); + } + + /// fileURL + objc.NSURL? get fileURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_fileURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// setFileURL: + set fileURL(objc.NSURL? value) { + return _objc_msgSend_25( + this.pointer, _sel_setFileURL_, value?.pointer ?? ffi.nullptr); + } + + /// fileTotalCount + objc.NSNumber? get fileTotalCount { + final _ret = _objc_msgSend_22(this.pointer, _sel_fileTotalCount); + return _ret.address == 0 + ? null + : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// setFileTotalCount: + set fileTotalCount(objc.NSNumber? value) { + return _objc_msgSend_23( + this.pointer, _sel_setFileTotalCount_, value?.pointer ?? ffi.nullptr); + } + + /// fileCompletedCount + objc.NSNumber? get fileCompletedCount { + final _ret = _objc_msgSend_22(this.pointer, _sel_fileCompletedCount); + return _ret.address == 0 + ? null + : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// setFileCompletedCount: + set fileCompletedCount(objc.NSNumber? value) { + return _objc_msgSend_23(this.pointer, _sel_setFileCompletedCount_, + value?.pointer ?? ffi.nullptr); + } + + /// publish + void publish() { + _objc_msgSend_7(this.pointer, _sel_publish); + } + + /// unpublish + void unpublish() { + _objc_msgSend_7(this.pointer, _sel_unpublish); + } + + /// addSubscriberForFileURL:withPublishingHandler: + static objc.ObjCObjectBase addSubscriberForFileURL_withPublishingHandler_( + objc.NSURL url, ObjCBlock_ffiVoid_NSProgress publishingHandler) { + final _ret = _objc_msgSend_26( + _class_NSProgress, + _sel_addSubscriberForFileURL_withPublishingHandler_, + url.pointer, + publishingHandler.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// removeSubscriber: + static void removeSubscriber_(objc.ObjCObjectBase subscriber) { + _objc_msgSend_27( + _class_NSProgress, _sel_removeSubscriber_, subscriber.pointer); + } + + /// isOld + bool get old { + return _objc_msgSend_13(this.pointer, _sel_isOld); + } + + /// init + NSProgress init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSProgress.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSProgress new1() { + final _ret = _objc_msgSend_19(_class_NSProgress, _sel_new); + return NSProgress.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSProgress allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28(_class_NSProgress, _sel_allocWithZone_, zone); + return NSProgress.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSProgress alloc() { + final _ret = _objc_msgSend_19(_class_NSProgress, _sel_alloc); + return NSProgress.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSProgress, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSProgress, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSProgress, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSProgress, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSProgress, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSProgress, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSProgress, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSProgress, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSProgress = objc.getClass("NSProgress"); +late final _sel_currentProgress = objc.registerName("currentProgress"); +final _objc_msgSend_1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_progressWithTotalUnitCount_ = + objc.registerName("progressWithTotalUnitCount:"); +final _objc_msgSend_2 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int64)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_discreteProgressWithTotalUnitCount_ = + objc.registerName("discreteProgressWithTotalUnitCount:"); +late final _sel_progressWithTotalUnitCount_parent_pendingUnitCount_ = + objc.registerName("progressWithTotalUnitCount:parent:pendingUnitCount:"); +final _objc_msgSend_3 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ffi.Int64)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); +typedef instancetype = ffi.Pointer; +typedef Dartinstancetype = objc.ObjCObjectBase; +late final _sel_initWithParent_userInfo_ = + objc.registerName("initWithParent:userInfo:"); +final _objc_msgSend_4 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_becomeCurrentWithPendingUnitCount_ = + objc.registerName("becomeCurrentWithPendingUnitCount:"); +final _objc_msgSend_5 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Int64)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +void _ObjCBlock_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, +) => + block.ref.target + .cast>() + .asFunction()(); +void _ObjCBlock_ffiVoid_closureTrampoline( + ffi.Pointer block, +) => + (objc.getBlockClosure(block) as void Function())(); + +class ObjCBlock_ffiVoid extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) { + return ObjCBlock_ffiVoid._(pointer, retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid.fromFunctionPointer( + ffi.Pointer> ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer)>( + _ObjCBlock_ffiVoid_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid.fromFunction(void Function() fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer)>( + _ObjCBlock_ffiVoid_closureTrampoline) + .cast(), + () => fn())); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid.listener(void Function() fn) + : this._((objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + () => fn()))); + static ffi.NativeCallable)>? + _dartFuncListenerTrampoline; + + void call() => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block)>>() + .asFunction)>()( + pointer, + ); +} + +late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_ = + objc.registerName("performAsCurrentWithPendingUnitCount:usingBlock:"); +final _objc_msgSend_6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_resignCurrent = objc.registerName("resignCurrent"); +final _objc_msgSend_7 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_addChild_withPendingUnitCount_ = + objc.registerName("addChild:withPendingUnitCount:"); +final _objc_msgSend_8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_totalUnitCount = objc.registerName("totalUnitCount"); +final _objc_msgSend_9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Int64 Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setTotalUnitCount_ = objc.registerName("setTotalUnitCount:"); +final _objc_msgSend_10 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Int64)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_completedUnitCount = objc.registerName("completedUnitCount"); +late final _sel_setCompletedUnitCount_ = + objc.registerName("setCompletedUnitCount:"); +late final _sel_localizedDescription = + objc.registerName("localizedDescription"); +final _objc_msgSend_11 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setLocalizedDescription_ = + objc.registerName("setLocalizedDescription:"); +final _objc_msgSend_12 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_localizedAdditionalDescription = + objc.registerName("localizedAdditionalDescription"); +late final _sel_setLocalizedAdditionalDescription_ = + objc.registerName("setLocalizedAdditionalDescription:"); +late final _sel_isCancellable = objc.registerName("isCancellable"); +final _objc_msgSend_13 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setCancellable_ = objc.registerName("setCancellable:"); +final _objc_msgSend_14 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, bool)>(); +late final _sel_isPausable = objc.registerName("isPausable"); +late final _sel_setPausable_ = objc.registerName("setPausable:"); +late final _sel_isCancelled = objc.registerName("isCancelled"); +late final _sel_isPaused = objc.registerName("isPaused"); +late final _sel_cancellationHandler = objc.registerName("cancellationHandler"); +final _objc_msgSend_15 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setCancellationHandler_ = + objc.registerName("setCancellationHandler:"); +final _objc_msgSend_16 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_pausingHandler = objc.registerName("pausingHandler"); +late final _sel_setPausingHandler_ = objc.registerName("setPausingHandler:"); +late final _sel_resumingHandler = objc.registerName("resumingHandler"); +late final _sel_setResumingHandler_ = objc.registerName("setResumingHandler:"); +late final _sel_setUserInfoObject_forKey_ = + objc.registerName("setUserInfoObject:forKey:"); +final _objc_msgSend_17 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_isIndeterminate = objc.registerName("isIndeterminate"); +late final _sel_fractionCompleted = objc.registerName("fractionCompleted"); +final _objc_msgSend_18 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_18Fpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_isFinished = objc.registerName("isFinished"); +late final _sel_cancel = objc.registerName("cancel"); +late final _sel_pause = objc.registerName("pause"); +late final _sel_resume = objc.registerName("resume"); +late final _sel_userInfo = objc.registerName("userInfo"); +final _objc_msgSend_19 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_kind = objc.registerName("kind"); +final _objc_msgSend_20 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setKind_ = objc.registerName("setKind:"); +final _objc_msgSend_21 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_estimatedTimeRemaining = + objc.registerName("estimatedTimeRemaining"); +final _objc_msgSend_22 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setEstimatedTimeRemaining_ = + objc.registerName("setEstimatedTimeRemaining:"); +final _objc_msgSend_23 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_throughput = objc.registerName("throughput"); +late final _sel_setThroughput_ = objc.registerName("setThroughput:"); +late final _sel_fileOperationKind = objc.registerName("fileOperationKind"); +late final _sel_setFileOperationKind_ = + objc.registerName("setFileOperationKind:"); +late final _sel_fileURL = objc.registerName("fileURL"); +final _objc_msgSend_24 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setFileURL_ = objc.registerName("setFileURL:"); +final _objc_msgSend_25 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_fileTotalCount = objc.registerName("fileTotalCount"); +late final _sel_setFileTotalCount_ = objc.registerName("setFileTotalCount:"); +late final _sel_fileCompletedCount = objc.registerName("fileCompletedCount"); +late final _sel_setFileCompletedCount_ = + objc.registerName("setFileCompletedCount:"); +late final _sel_publish = objc.registerName("publish"); +late final _sel_unpublish = objc.registerName("unpublish"); +ffi.Pointer _ObjCBlock_ffiVoid_NSProgress_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSProgress_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); + +class ObjCBlock_ffiVoid_NSProgress extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSProgress._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSProgress castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSProgress._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSProgress.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSProgress_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSProgress.fromFunction( + ObjCBlock_ffiVoid? Function(NSProgress) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSProgress_closureTrampoline) + .cast(), + (ffi.Pointer arg0) => + fn(NSProgress.castFromPointer(arg0, retain: true, release: true)) + ?.retainAndReturnPointer() ?? + ffi.nullptr)); + static ffi.Pointer? _dartFuncTrampoline; + + ObjCBlock_ffiVoid? call(NSProgress arg0) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction Function(ffi.Pointer, ffi.Pointer)>() + (pointer, arg0.pointer) + .address == + 0 + ? null + : ObjCBlock_ffiVoid.castFromPointer( + pointer.ref.invoke.cast Function(ffi.Pointer block, ffi.Pointer arg0)>>().asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>()(pointer, arg0.pointer), + retain: false, + release: true); +} + +late final _sel_addSubscriberForFileURL_withPublishingHandler_ = + objc.registerName("addSubscriberForFileURL:withPublishingHandler:"); +final _objc_msgSend_26 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removeSubscriber_ = objc.registerName("removeSubscriber:"); +final _objc_msgSend_27 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_isOld = objc.registerName("isOld"); +late final _sel_init = objc.registerName("init"); +late final _sel_new = objc.registerName("new"); + +final class _NSZone extends ffi.Opaque {} + +late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); +final _objc_msgSend_28 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); +late final _sel_alloc = objc.registerName("alloc"); +late final _sel_cancelPreviousPerformRequestsWithTarget_selector_object_ = objc + .registerName("cancelPreviousPerformRequestsWithTarget:selector:object:"); +final _objc_msgSend_29 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_cancelPreviousPerformRequestsWithTarget_ = + objc.registerName("cancelPreviousPerformRequestsWithTarget:"); +late final _sel_accessInstanceVariablesDirectly = + objc.registerName("accessInstanceVariablesDirectly"); +late final _sel_useStoredAccessor = objc.registerName("useStoredAccessor"); +late final _sel_keyPathsForValuesAffectingValueForKey_ = + objc.registerName("keyPathsForValuesAffectingValueForKey:"); +final _objc_msgSend_30 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_automaticallyNotifiesObserversForKey_ = + objc.registerName("automaticallyNotifiesObserversForKey:"); +final _objc_msgSend_31 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_classFallbacksForKeyedArchiver = + objc.registerName("classFallbacksForKeyedArchiver"); +final _objc_msgSend_32 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_classForKeyedUnarchiver = + objc.registerName("classForKeyedUnarchiver"); +final _objc_msgSend_0 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); + +/// NSBundle +class NSBundle extends objc.NSObject { + NSBundle._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSBundle] that points to the same underlying object as [other]. + NSBundle.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSBundle] that wraps the given raw object pointer. + NSBundle.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSBundle]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0(obj.pointer, _sel_isKindOfClass_, _class_NSBundle); + } + + /// mainBundle + static NSBundle getMainBundle() { + final _ret = _objc_msgSend_33(_class_NSBundle, _sel_mainBundle); + return NSBundle.castFromPointer(_ret, retain: true, release: true); + } + + /// bundleWithPath: + static NSBundle? bundleWithPath_(objc.NSString path) { + final _ret = + _objc_msgSend_34(_class_NSBundle, _sel_bundleWithPath_, path.pointer); + return _ret.address == 0 + ? null + : NSBundle.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithPath: + NSBundle? initWithPath_(objc.NSString path) { + final _ret = + _objc_msgSend_34(this.pointer, _sel_initWithPath_, path.pointer); + return _ret.address == 0 + ? null + : NSBundle.castFromPointer(_ret, retain: true, release: true); + } + + /// bundleWithURL: + static NSBundle? bundleWithURL_(objc.NSURL url) { + final _ret = + _objc_msgSend_35(_class_NSBundle, _sel_bundleWithURL_, url.pointer); + return _ret.address == 0 + ? null + : NSBundle.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithURL: + NSBundle? initWithURL_(objc.NSURL url) { + final _ret = _objc_msgSend_35(this.pointer, _sel_initWithURL_, url.pointer); + return _ret.address == 0 + ? null + : NSBundle.castFromPointer(_ret, retain: true, release: true); + } + + /// bundleForClass: + static NSBundle bundleForClass_(objc.ObjCObjectBase aClass) { + final _ret = + _objc_msgSend_36(_class_NSBundle, _sel_bundleForClass_, aClass.pointer); + return NSBundle.castFromPointer(_ret, retain: true, release: true); + } + + /// bundleWithIdentifier: + static NSBundle? bundleWithIdentifier_(objc.NSString identifier) { + final _ret = _objc_msgSend_37( + _class_NSBundle, _sel_bundleWithIdentifier_, identifier.pointer); + return _ret.address == 0 + ? null + : NSBundle.castFromPointer(_ret, retain: true, release: true); + } + + /// allBundles + static objc.NSArray getAllBundles() { + final _ret = _objc_msgSend_32(_class_NSBundle, _sel_allBundles); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// allFrameworks + static objc.NSArray getAllFrameworks() { + final _ret = _objc_msgSend_32(_class_NSBundle, _sel_allFrameworks); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// load + bool load() { + return _objc_msgSend_13(this.pointer, _sel_load); + } + + /// isLoaded + bool get loaded { + return _objc_msgSend_13(this.pointer, _sel_isLoaded); + } + + /// unload + bool unload() { + return _objc_msgSend_13(this.pointer, _sel_unload); + } + + /// preflightAndReturnError: + bool preflightAndReturnError_( + ffi.Pointer> error) { + return _objc_msgSend_38(this.pointer, _sel_preflightAndReturnError_, error); + } + + /// loadAndReturnError: + bool loadAndReturnError_(ffi.Pointer> error) { + return _objc_msgSend_38(this.pointer, _sel_loadAndReturnError_, error); + } + + /// bundleURL + objc.NSURL get bundleURL { + final _ret = _objc_msgSend_39(this.pointer, _sel_bundleURL); + return objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// resourceURL + objc.NSURL? get resourceURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_resourceURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// executableURL + objc.NSURL? get executableURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_executableURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLForAuxiliaryExecutable: + objc.NSURL? URLForAuxiliaryExecutable_(objc.NSString executableName) { + final _ret = _objc_msgSend_40( + this.pointer, _sel_URLForAuxiliaryExecutable_, executableName.pointer); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// privateFrameworksURL + objc.NSURL? get privateFrameworksURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_privateFrameworksURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// sharedFrameworksURL + objc.NSURL? get sharedFrameworksURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_sharedFrameworksURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// sharedSupportURL + objc.NSURL? get sharedSupportURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_sharedSupportURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// builtInPlugInsURL + objc.NSURL? get builtInPlugInsURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_builtInPlugInsURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// appStoreReceiptURL + objc.NSURL? get appStoreReceiptURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_appStoreReceiptURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// bundlePath + objc.NSString get bundlePath { + final _ret = _objc_msgSend_11(this.pointer, _sel_bundlePath); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// resourcePath + objc.NSString? get resourcePath { + final _ret = _objc_msgSend_20(this.pointer, _sel_resourcePath); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// executablePath + objc.NSString? get executablePath { + final _ret = _objc_msgSend_20(this.pointer, _sel_executablePath); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// pathForAuxiliaryExecutable: + objc.NSString? pathForAuxiliaryExecutable_(objc.NSString executableName) { + final _ret = _objc_msgSend_41( + this.pointer, _sel_pathForAuxiliaryExecutable_, executableName.pointer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// privateFrameworksPath + objc.NSString? get privateFrameworksPath { + final _ret = _objc_msgSend_20(this.pointer, _sel_privateFrameworksPath); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// sharedFrameworksPath + objc.NSString? get sharedFrameworksPath { + final _ret = _objc_msgSend_20(this.pointer, _sel_sharedFrameworksPath); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// sharedSupportPath + objc.NSString? get sharedSupportPath { + final _ret = _objc_msgSend_20(this.pointer, _sel_sharedSupportPath); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// builtInPlugInsPath + objc.NSString? get builtInPlugInsPath { + final _ret = _objc_msgSend_20(this.pointer, _sel_builtInPlugInsPath); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// URLForResource:withExtension:subdirectory:inBundleWithURL: + static objc.NSURL? URLForResource_withExtension_subdirectory_inBundleWithURL_( + objc.NSString? name, + objc.NSString? ext, + objc.NSString? subpath, + objc.NSURL bundleURL) { + final _ret = _objc_msgSend_42( + _class_NSBundle, + _sel_URLForResource_withExtension_subdirectory_inBundleWithURL_, + name?.pointer ?? ffi.nullptr, + ext?.pointer ?? ffi.nullptr, + subpath?.pointer ?? ffi.nullptr, + bundleURL.pointer); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLsForResourcesWithExtension:subdirectory:inBundleWithURL: + static objc.NSArray? + URLsForResourcesWithExtension_subdirectory_inBundleWithURL_( + objc.NSString? ext, objc.NSString? subpath, objc.NSURL bundleURL) { + final _ret = _objc_msgSend_43( + _class_NSBundle, + _sel_URLsForResourcesWithExtension_subdirectory_inBundleWithURL_, + ext?.pointer ?? ffi.nullptr, + subpath?.pointer ?? ffi.nullptr, + bundleURL.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// URLForResource:withExtension: + objc.NSURL? URLForResource_withExtension_( + objc.NSString? name, objc.NSString? ext) { + final _ret = _objc_msgSend_44( + this.pointer, + _sel_URLForResource_withExtension_, + name?.pointer ?? ffi.nullptr, + ext?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLForResource:withExtension:subdirectory: + objc.NSURL? URLForResource_withExtension_subdirectory_( + objc.NSString? name, objc.NSString? ext, objc.NSString? subpath) { + final _ret = _objc_msgSend_45( + this.pointer, + _sel_URLForResource_withExtension_subdirectory_, + name?.pointer ?? ffi.nullptr, + ext?.pointer ?? ffi.nullptr, + subpath?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLForResource:withExtension:subdirectory:localization: + objc.NSURL? URLForResource_withExtension_subdirectory_localization_( + objc.NSString? name, + objc.NSString? ext, + objc.NSString? subpath, + objc.NSString? localizationName) { + final _ret = _objc_msgSend_46( + this.pointer, + _sel_URLForResource_withExtension_subdirectory_localization_, + name?.pointer ?? ffi.nullptr, + ext?.pointer ?? ffi.nullptr, + subpath?.pointer ?? ffi.nullptr, + localizationName?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLsForResourcesWithExtension:subdirectory: + objc.NSArray? URLsForResourcesWithExtension_subdirectory_( + objc.NSString? ext, objc.NSString? subpath) { + final _ret = _objc_msgSend_47( + this.pointer, + _sel_URLsForResourcesWithExtension_subdirectory_, + ext?.pointer ?? ffi.nullptr, + subpath?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// URLsForResourcesWithExtension:subdirectory:localization: + objc.NSArray? URLsForResourcesWithExtension_subdirectory_localization_( + objc.NSString? ext, + objc.NSString? subpath, + objc.NSString? localizationName) { + final _ret = _objc_msgSend_48( + this.pointer, + _sel_URLsForResourcesWithExtension_subdirectory_localization_, + ext?.pointer ?? ffi.nullptr, + subpath?.pointer ?? ffi.nullptr, + localizationName?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// pathForResource:ofType:inDirectory: + objc.NSString? pathForResource_ofType_inDirectory_( + objc.NSString? name, objc.NSString? ext, objc.NSString? subpath) { + final _ret = _objc_msgSend_49( + this.pointer, + _sel_pathForResource_ofType_inDirectory_, + name?.pointer ?? ffi.nullptr, + ext?.pointer ?? ffi.nullptr, + subpath?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// pathsForResourcesOfType:inDirectory: + objc.NSArray pathsForResourcesOfType_inDirectory_( + objc.NSString? ext, objc.NSString? subpath) { + final _ret = _objc_msgSend_50( + this.pointer, + _sel_pathsForResourcesOfType_inDirectory_, + ext?.pointer ?? ffi.nullptr, + subpath?.pointer ?? ffi.nullptr); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// pathForResource:ofType: + objc.NSString? pathForResource_ofType_( + objc.NSString? name, objc.NSString? ext) { + final _ret = _objc_msgSend_51(this.pointer, _sel_pathForResource_ofType_, + name?.pointer ?? ffi.nullptr, ext?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// pathForResource:ofType:inDirectory:forLocalization: + objc.NSString? pathForResource_ofType_inDirectory_forLocalization_( + objc.NSString? name, + objc.NSString? ext, + objc.NSString? subpath, + objc.NSString? localizationName) { + final _ret = _objc_msgSend_52( + this.pointer, + _sel_pathForResource_ofType_inDirectory_forLocalization_, + name?.pointer ?? ffi.nullptr, + ext?.pointer ?? ffi.nullptr, + subpath?.pointer ?? ffi.nullptr, + localizationName?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// pathsForResourcesOfType:inDirectory:forLocalization: + objc.NSArray pathsForResourcesOfType_inDirectory_forLocalization_( + objc.NSString? ext, + objc.NSString? subpath, + objc.NSString? localizationName) { + final _ret = _objc_msgSend_53( + this.pointer, + _sel_pathsForResourcesOfType_inDirectory_forLocalization_, + ext?.pointer ?? ffi.nullptr, + subpath?.pointer ?? ffi.nullptr, + localizationName?.pointer ?? ffi.nullptr); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// localizedStringForKey:value:table: + objc.NSString localizedStringForKey_value_table_( + objc.NSString key, objc.NSString? value, objc.NSString? tableName) { + final _ret = _objc_msgSend_54( + this.pointer, + _sel_localizedStringForKey_value_table_, + key.pointer, + value?.pointer ?? ffi.nullptr, + tableName?.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// localizedAttributedStringForKey:value:table: + NSAttributedString localizedAttributedStringForKey_value_table_( + objc.NSString key, objc.NSString? value, objc.NSString? tableName) { + final _ret = _objc_msgSend_82( + this.pointer, + _sel_localizedAttributedStringForKey_value_table_, + key.pointer, + value?.pointer ?? ffi.nullptr, + tableName?.pointer ?? ffi.nullptr); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// bundleIdentifier + objc.NSString? get bundleIdentifier { + final _ret = _objc_msgSend_20(this.pointer, _sel_bundleIdentifier); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// infoDictionary + objc.NSDictionary? get infoDictionary { + final _ret = _objc_msgSend_83(this.pointer, _sel_infoDictionary); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// localizedInfoDictionary + objc.NSDictionary? get localizedInfoDictionary { + final _ret = _objc_msgSend_83(this.pointer, _sel_localizedInfoDictionary); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// objectForInfoDictionaryKey: + objc.ObjCObjectBase? objectForInfoDictionaryKey_(objc.NSString key) { + final _ret = _objc_msgSend_34( + this.pointer, _sel_objectForInfoDictionaryKey_, key.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// classNamed: + objc.ObjCObjectBase? classNamed_(objc.NSString className) { + final _ret = + _objc_msgSend_34(this.pointer, _sel_classNamed_, className.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// principalClass + objc.ObjCObjectBase? get principalClass { + final _ret = _objc_msgSend_84(this.pointer, _sel_principalClass); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// preferredLocalizations + objc.NSArray get preferredLocalizations { + final _ret = _objc_msgSend_32(this.pointer, _sel_preferredLocalizations); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// localizations + objc.NSArray get localizations { + final _ret = _objc_msgSend_32(this.pointer, _sel_localizations); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// developmentLocalization + objc.NSString? get developmentLocalization { + final _ret = _objc_msgSend_20(this.pointer, _sel_developmentLocalization); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// preferredLocalizationsFromArray: + static objc.NSArray preferredLocalizationsFromArray_( + objc.NSArray localizationsArray) { + final _ret = _objc_msgSend_85(_class_NSBundle, + _sel_preferredLocalizationsFromArray_, localizationsArray.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// preferredLocalizationsFromArray:forPreferences: + static objc.NSArray preferredLocalizationsFromArray_forPreferences_( + objc.NSArray localizationsArray, objc.NSArray? preferencesArray) { + final _ret = _objc_msgSend_86( + _class_NSBundle, + _sel_preferredLocalizationsFromArray_forPreferences_, + localizationsArray.pointer, + preferencesArray?.pointer ?? ffi.nullptr); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// executableArchitectures + objc.NSArray? get executableArchitectures { + final _ret = _objc_msgSend_87(this.pointer, _sel_executableArchitectures); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// setPreservationPriority:forTags: + void setPreservationPriority_forTags_(double priority, objc.NSSet tags) { + _objc_msgSend_88(this.pointer, _sel_setPreservationPriority_forTags_, + priority, tags.pointer); + } + + /// preservationPriorityForTag: + double preservationPriorityForTag_(objc.NSString tag) { + return objc.useMsgSendVariants + ? _objc_msgSend_89Fpret( + this.pointer, _sel_preservationPriorityForTag_, tag.pointer) + : _objc_msgSend_89( + this.pointer, _sel_preservationPriorityForTag_, tag.pointer); + } + + /// init + NSBundle init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSBundle.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSBundle new1() { + final _ret = _objc_msgSend_19(_class_NSBundle, _sel_new); + return NSBundle.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSBundle allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28(_class_NSBundle, _sel_allocWithZone_, zone); + return NSBundle.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSBundle alloc() { + final _ret = _objc_msgSend_19(_class_NSBundle, _sel_alloc); + return NSBundle.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSBundle, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSBundle, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSBundle, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSBundle, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSBundle, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSBundle, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = + _objc_msgSend_32(_class_NSBundle, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSBundle, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSBundle = objc.getClass("NSBundle"); +late final _sel_mainBundle = objc.registerName("mainBundle"); +final _objc_msgSend_33 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_bundleWithPath_ = objc.registerName("bundleWithPath:"); +final _objc_msgSend_34 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithPath_ = objc.registerName("initWithPath:"); +late final _sel_bundleWithURL_ = objc.registerName("bundleWithURL:"); +final _objc_msgSend_35 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithURL_ = objc.registerName("initWithURL:"); +late final _sel_bundleForClass_ = objc.registerName("bundleForClass:"); +final _objc_msgSend_36 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_bundleWithIdentifier_ = + objc.registerName("bundleWithIdentifier:"); +final _objc_msgSend_37 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_allBundles = objc.registerName("allBundles"); +late final _sel_allFrameworks = objc.registerName("allFrameworks"); +late final _sel_load = objc.registerName("load"); +late final _sel_isLoaded = objc.registerName("isLoaded"); +late final _sel_unload = objc.registerName("unload"); +late final _sel_preflightAndReturnError_ = + objc.registerName("preflightAndReturnError:"); +final _objc_msgSend_38 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_loadAndReturnError_ = objc.registerName("loadAndReturnError:"); +late final _sel_bundleURL = objc.registerName("bundleURL"); +final _objc_msgSend_39 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_resourceURL = objc.registerName("resourceURL"); +late final _sel_executableURL = objc.registerName("executableURL"); +late final _sel_URLForAuxiliaryExecutable_ = + objc.registerName("URLForAuxiliaryExecutable:"); +final _objc_msgSend_40 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_privateFrameworksURL = + objc.registerName("privateFrameworksURL"); +late final _sel_sharedFrameworksURL = objc.registerName("sharedFrameworksURL"); +late final _sel_sharedSupportURL = objc.registerName("sharedSupportURL"); +late final _sel_builtInPlugInsURL = objc.registerName("builtInPlugInsURL"); +late final _sel_appStoreReceiptURL = objc.registerName("appStoreReceiptURL"); +late final _sel_bundlePath = objc.registerName("bundlePath"); +late final _sel_resourcePath = objc.registerName("resourcePath"); +late final _sel_executablePath = objc.registerName("executablePath"); +late final _sel_pathForAuxiliaryExecutable_ = + objc.registerName("pathForAuxiliaryExecutable:"); +final _objc_msgSend_41 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_privateFrameworksPath = + objc.registerName("privateFrameworksPath"); +late final _sel_sharedFrameworksPath = + objc.registerName("sharedFrameworksPath"); +late final _sel_sharedSupportPath = objc.registerName("sharedSupportPath"); +late final _sel_builtInPlugInsPath = objc.registerName("builtInPlugInsPath"); +late final _sel_URLForResource_withExtension_subdirectory_inBundleWithURL_ = + objc.registerName( + "URLForResource:withExtension:subdirectory:inBundleWithURL:"); +final _objc_msgSend_42 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_URLsForResourcesWithExtension_subdirectory_inBundleWithURL_ = + objc.registerName( + "URLsForResourcesWithExtension:subdirectory:inBundleWithURL:"); +final _objc_msgSend_43 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_URLForResource_withExtension_ = + objc.registerName("URLForResource:withExtension:"); +final _objc_msgSend_44 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_URLForResource_withExtension_subdirectory_ = + objc.registerName("URLForResource:withExtension:subdirectory:"); +final _objc_msgSend_45 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_URLForResource_withExtension_subdirectory_localization_ = objc + .registerName("URLForResource:withExtension:subdirectory:localization:"); +final _objc_msgSend_46 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_URLsForResourcesWithExtension_subdirectory_ = + objc.registerName("URLsForResourcesWithExtension:subdirectory:"); +final _objc_msgSend_47 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_URLsForResourcesWithExtension_subdirectory_localization_ = objc + .registerName("URLsForResourcesWithExtension:subdirectory:localization:"); +final _objc_msgSend_48 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_pathForResource_ofType_inDirectory_ = + objc.registerName("pathForResource:ofType:inDirectory:"); +final _objc_msgSend_49 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_pathsForResourcesOfType_inDirectory_ = + objc.registerName("pathsForResourcesOfType:inDirectory:"); +final _objc_msgSend_50 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_pathForResource_ofType_ = + objc.registerName("pathForResource:ofType:"); +final _objc_msgSend_51 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_pathForResource_ofType_inDirectory_forLocalization_ = + objc.registerName("pathForResource:ofType:inDirectory:forLocalization:"); +final _objc_msgSend_52 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_pathsForResourcesOfType_inDirectory_forLocalization_ = + objc.registerName("pathsForResourcesOfType:inDirectory:forLocalization:"); +final _objc_msgSend_53 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_localizedStringForKey_value_table_ = + objc.registerName("localizedStringForKey:value:table:"); +final _objc_msgSend_54 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + +/// NSAttributedString +class NSAttributedString extends objc.NSObject { + NSAttributedString._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSAttributedString] that points to the same underlying object as [other]. + NSAttributedString.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSAttributedString] that wraps the given raw object pointer. + NSAttributedString.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSAttributedString]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSAttributedString); + } + + /// string + objc.NSString get string { + final _ret = _objc_msgSend_11(this.pointer, _sel_string); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// attributesAtIndex:effectiveRange: + objc.NSDictionary attributesAtIndex_effectiveRange_( + int location, ffi.Pointer<_NSRange> range) { + final _ret = _objc_msgSend_55( + this.pointer, _sel_attributesAtIndex_effectiveRange_, location, range); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// length + int get length { + return _objc_msgSend_56(this.pointer, _sel_length); + } + + /// attribute:atIndex:effectiveRange: + objc.ObjCObjectBase? attribute_atIndex_effectiveRange_( + objc.NSString attrName, int location, ffi.Pointer<_NSRange> range) { + final _ret = _objc_msgSend_57( + this.pointer, + _sel_attribute_atIndex_effectiveRange_, + attrName.pointer, + location, + range); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// attributedSubstringFromRange: + NSAttributedString attributedSubstringFromRange_(_NSRange range) { + final _ret = _objc_msgSend_58( + this.pointer, _sel_attributedSubstringFromRange_, range); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// attributesAtIndex:longestEffectiveRange:inRange: + objc.NSDictionary attributesAtIndex_longestEffectiveRange_inRange_( + int location, ffi.Pointer<_NSRange> range, _NSRange rangeLimit) { + final _ret = _objc_msgSend_59( + this.pointer, + _sel_attributesAtIndex_longestEffectiveRange_inRange_, + location, + range, + rangeLimit); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// attribute:atIndex:longestEffectiveRange:inRange: + objc.ObjCObjectBase? attribute_atIndex_longestEffectiveRange_inRange_( + objc.NSString attrName, + int location, + ffi.Pointer<_NSRange> range, + _NSRange rangeLimit) { + final _ret = _objc_msgSend_60( + this.pointer, + _sel_attribute_atIndex_longestEffectiveRange_inRange_, + attrName.pointer, + location, + range, + rangeLimit); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// isEqualToAttributedString: + bool isEqualToAttributedString_(NSAttributedString other) { + return _objc_msgSend_61( + this.pointer, _sel_isEqualToAttributedString_, other.pointer); + } + + /// initWithString: + NSAttributedString initWithString_(objc.NSString str) { + final _ret = + _objc_msgSend_62(this.pointer, _sel_initWithString_, str.pointer); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithString:attributes: + NSAttributedString initWithString_attributes_( + objc.NSString str, objc.NSDictionary? attrs) { + final _ret = _objc_msgSend_63(this.pointer, _sel_initWithString_attributes_, + str.pointer, attrs?.pointer ?? ffi.nullptr); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithAttributedString: + NSAttributedString initWithAttributedString_(NSAttributedString attrStr) { + final _ret = _objc_msgSend_64( + this.pointer, _sel_initWithAttributedString_, attrStr.pointer); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// enumerateAttributesInRange:options:usingBlock: + void enumerateAttributesInRange_options_usingBlock_( + _NSRange enumerationRange, + NSAttributedStringEnumerationOptions opts, + ObjCBlock_ffiVoid_NSDictionary_NSRange_bool block) { + _objc_msgSend_65( + this.pointer, + _sel_enumerateAttributesInRange_options_usingBlock_, + enumerationRange, + opts.value, + block.pointer); + } + + /// enumerateAttribute:inRange:options:usingBlock: + void enumerateAttribute_inRange_options_usingBlock_( + objc.NSString attrName, + _NSRange enumerationRange, + NSAttributedStringEnumerationOptions opts, + ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool block) { + _objc_msgSend_66( + this.pointer, + _sel_enumerateAttribute_inRange_options_usingBlock_, + attrName.pointer, + enumerationRange, + opts.value, + block.pointer); + } + + /// initWithContentsOfMarkdownFileAtURL:options:baseURL:error: + NSAttributedString? + initWithContentsOfMarkdownFileAtURL_options_baseURL_error_( + objc.NSURL markdownFile, + NSAttributedStringMarkdownParsingOptions? options, + objc.NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _objc_msgSend_71( + this.pointer, + _sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_, + markdownFile.pointer, + options?.pointer ?? ffi.nullptr, + baseURL?.pointer ?? ffi.nullptr, + error); + return _ret.address == 0 + ? null + : NSAttributedString.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithMarkdown:options:baseURL:error: + NSAttributedString? initWithMarkdown_options_baseURL_error_( + objc.NSData markdown, + NSAttributedStringMarkdownParsingOptions? options, + objc.NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _objc_msgSend_72( + this.pointer, + _sel_initWithMarkdown_options_baseURL_error_, + markdown.pointer, + options?.pointer ?? ffi.nullptr, + baseURL?.pointer ?? ffi.nullptr, + error); + return _ret.address == 0 + ? null + : NSAttributedString.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithMarkdownString:options:baseURL:error: + NSAttributedString? initWithMarkdownString_options_baseURL_error_( + objc.NSString markdownString, + NSAttributedStringMarkdownParsingOptions? options, + objc.NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _objc_msgSend_73( + this.pointer, + _sel_initWithMarkdownString_options_baseURL_error_, + markdownString.pointer, + options?.pointer ?? ffi.nullptr, + baseURL?.pointer ?? ffi.nullptr, + error); + return _ret.address == 0 + ? null + : NSAttributedString.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithFormat:options:locale: + NSAttributedString initWithFormat_options_locale_(NSAttributedString format, + NSAttributedStringFormattingOptions options, objc.NSLocale? locale) { + final _ret = _objc_msgSend_74( + this.pointer, + _sel_initWithFormat_options_locale_, + format.pointer, + options.value, + locale?.pointer ?? ffi.nullptr); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithFormat:options:locale:arguments: + NSAttributedString initWithFormat_options_locale_arguments_( + NSAttributedString format, + NSAttributedStringFormattingOptions options, + objc.NSLocale? locale, + ffi.Pointer arguments) { + final _ret = _objc_msgSend_75( + this.pointer, + _sel_initWithFormat_options_locale_arguments_, + format.pointer, + options.value, + locale?.pointer ?? ffi.nullptr, + arguments); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// localizedAttributedStringWithFormat: + static NSAttributedString localizedAttributedStringWithFormat_( + NSAttributedString format) { + final _ret = _objc_msgSend_64(_class_NSAttributedString, + _sel_localizedAttributedStringWithFormat_, format.pointer); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// localizedAttributedStringWithFormat:options: + static NSAttributedString localizedAttributedStringWithFormat_options_( + NSAttributedString format, NSAttributedStringFormattingOptions options) { + final _ret = _objc_msgSend_76( + _class_NSAttributedString, + _sel_localizedAttributedStringWithFormat_options_, + format.pointer, + options.value); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithFormat:options:locale:context: + NSAttributedString initWithFormat_options_locale_context_( + NSAttributedString format, + NSAttributedStringFormattingOptions options, + objc.NSLocale? locale, + objc.NSDictionary context) { + final _ret = _objc_msgSend_77( + this.pointer, + _sel_initWithFormat_options_locale_context_, + format.pointer, + options.value, + locale?.pointer ?? ffi.nullptr, + context.pointer); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithFormat:options:locale:context:arguments: + NSAttributedString initWithFormat_options_locale_context_arguments_( + NSAttributedString format, + NSAttributedStringFormattingOptions options, + objc.NSLocale? locale, + objc.NSDictionary context, + ffi.Pointer arguments) { + final _ret = _objc_msgSend_78( + this.pointer, + _sel_initWithFormat_options_locale_context_arguments_, + format.pointer, + options.value, + locale?.pointer ?? ffi.nullptr, + context.pointer, + arguments); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// localizedAttributedStringWithFormat:context: + static NSAttributedString localizedAttributedStringWithFormat_context_( + NSAttributedString format, objc.NSDictionary context) { + final _ret = _objc_msgSend_79( + _class_NSAttributedString, + _sel_localizedAttributedStringWithFormat_context_, + format.pointer, + context.pointer); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// localizedAttributedStringWithFormat:options:context: + static NSAttributedString + localizedAttributedStringWithFormat_options_context_( + NSAttributedString format, + NSAttributedStringFormattingOptions options, + objc.NSDictionary context) { + final _ret = _objc_msgSend_80( + _class_NSAttributedString, + _sel_localizedAttributedStringWithFormat_options_context_, + format.pointer, + options.value, + context.pointer); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// attributedStringByInflectingString + NSAttributedString attributedStringByInflectingString() { + final _ret = + _objc_msgSend_81(this.pointer, _sel_attributedStringByInflectingString); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// init + NSAttributedString init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSAttributedString new1() { + final _ret = _objc_msgSend_19(_class_NSAttributedString, _sel_new); + return NSAttributedString.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSAttributedString allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSAttributedString, _sel_allocWithZone_, zone); + return NSAttributedString.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSAttributedString alloc() { + final _ret = _objc_msgSend_19(_class_NSAttributedString, _sel_alloc); + return NSAttributedString.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSAttributedString, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSAttributedString, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSAttributedString, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSAttributedString, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSAttributedString, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSAttributedString, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSAttributedString, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSAttributedString, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSAttributedString = objc.getClass("NSAttributedString"); +late final _sel_string = objc.registerName("string"); + +final class _NSRange extends ffi.Struct { + @ffi.UnsignedLong() + external int location; + + @ffi.UnsignedLong() + external int length; +} + +late final _sel_attributesAtIndex_effectiveRange_ = + objc.registerName("attributesAtIndex:effectiveRange:"); +final _objc_msgSend_55 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_NSRange>)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_NSRange>)>(); +late final _sel_length = objc.registerName("length"); +final _objc_msgSend_56 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_attribute_atIndex_effectiveRange_ = + objc.registerName("attribute:atIndex:effectiveRange:"); +final _objc_msgSend_57 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_NSRange>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_NSRange>)>(); +late final _sel_attributedSubstringFromRange_ = + objc.registerName("attributedSubstringFromRange:"); +final _objc_msgSend_58 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>(); +late final _sel_attributesAtIndex_longestEffectiveRange_inRange_ = + objc.registerName("attributesAtIndex:longestEffectiveRange:inRange:"); +final _objc_msgSend_59 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_NSRange>, + _NSRange)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_NSRange>, + _NSRange)>(); +late final _sel_attribute_atIndex_longestEffectiveRange_inRange_ = + objc.registerName("attribute:atIndex:longestEffectiveRange:inRange:"); +final _objc_msgSend_60 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_NSRange>, + _NSRange)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_NSRange>, + _NSRange)>(); +late final _sel_isEqualToAttributedString_ = + objc.registerName("isEqualToAttributedString:"); +final _objc_msgSend_61 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithString_ = objc.registerName("initWithString:"); +final _objc_msgSend_62 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithString_attributes_ = + objc.registerName("initWithString:attributes:"); +final _objc_msgSend_63 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_initWithAttributedString_ = + objc.registerName("initWithAttributedString:"); +final _objc_msgSend_64 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + +enum NSAttributedStringEnumerationOptions { + NSAttributedStringEnumerationReverse(2), + NSAttributedStringEnumerationLongestEffectiveRangeNotRequired(1048576); + + final int value; + const NSAttributedStringEnumerationOptions(this.value); + + static NSAttributedStringEnumerationOptions fromValue(int value) => + switch (value) { + 2 => NSAttributedStringEnumerationReverse, + 1048576 => + NSAttributedStringEnumerationLongestEffectiveRangeNotRequired, + _ => throw ArgumentError( + "Unknown value for NSAttributedStringEnumerationOptions: $value"), + }; +} + +void _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + _NSRange arg1, ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, _NSRange, + ffi.Pointer)>()(arg0, arg1, arg2); +void _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + _NSRange, ffi.Pointer))(arg0, arg1, arg2); + +class ObjCBlock_ffiVoid_NSDictionary_NSRange_bool extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSDictionary_NSRange_bool._( + ffi.Pointer pointer, + {bool retain = false, + bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSDictionary_NSRange_bool castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSDictionary_NSRange_bool._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSDictionary_NSRange_bool.fromFunctionPointer( + ffi.Pointer< + ffi + .NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + _NSRange arg1, ffi.Pointer arg2)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSDictionary_NSRange_bool.fromFunction( + void Function(objc.NSDictionary, _NSRange, ffi.Pointer) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureTrampoline) + .cast(), + (ffi.Pointer arg0, _NSRange arg1, ffi.Pointer arg2) => + fn(objc.NSDictionary.castFromPointer(arg0, retain: true, release: true), + arg1, arg2))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSDictionary_NSRange_bool.listener( + void Function(objc.NSDictionary, _NSRange, ffi.Pointer) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSDictionary_NSRange_bool( + objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2) => + fn(objc.NSDictionary.castFromPointer(arg0, retain: false, release: true), arg1, arg2)))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>? _dartFuncListenerTrampoline; + + void call( + objc.NSDictionary arg0, _NSRange arg1, ffi.Pointer arg2) => + pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>()(pointer, arg0.pointer, arg1, arg2); +} + +late final _sel_enumerateAttributesInRange_options_usingBlock_ = + objc.registerName("enumerateAttributesInRange:options:usingBlock:"); +final _objc_msgSend_65 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + int, + ffi.Pointer)>(); +void _ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + _NSRange arg1, ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, _NSRange, + ffi.Pointer)>()(arg0, arg1, arg2); +void _ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + _NSRange, ffi.Pointer))(arg0, arg1, arg2); + +class ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool._( + ffi.Pointer pointer, + {bool retain = false, + bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + _NSRange arg1, ffi.Pointer arg2)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool.fromFunction( + void Function(objc.ObjCObjectBase?, _NSRange, ffi.Pointer) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool_closureTrampoline) + .cast(), + (ffi.Pointer arg0, _NSRange arg1, ffi.Pointer arg2) => + fn(arg0.address == 0 ? null : objc.ObjCObjectBase(arg0, retain: true, release: true), + arg1, arg2))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool.listener( + void Function(objc.ObjCObjectBase?, _NSRange, ffi.Pointer) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool( + objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2) => + fn(arg0.address == 0 ? null : objc.ObjCObjectBase(arg0, retain: false, release: true), arg1, arg2)))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>? _dartFuncListenerTrampoline; + + void call(objc.ObjCObjectBase? arg0, _NSRange arg1, + ffi.Pointer arg2) => + pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>()( + pointer, arg0?.pointer ?? ffi.nullptr, arg1, arg2); +} + +late final _sel_enumerateAttribute_inRange_options_usingBlock_ = + objc.registerName("enumerateAttribute:inRange:options:usingBlock:"); +final _objc_msgSend_66 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange, + int, + ffi.Pointer)>(); + +/// NSAttributedStringMarkdownParsingOptions +class NSAttributedStringMarkdownParsingOptions extends objc.NSObject { + NSAttributedStringMarkdownParsingOptions._( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSAttributedStringMarkdownParsingOptions] that points to the same underlying object as [other]. + NSAttributedStringMarkdownParsingOptions.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSAttributedStringMarkdownParsingOptions] that wraps the given raw object pointer. + NSAttributedStringMarkdownParsingOptions.castFromPointer( + ffi.Pointer other, + {bool retain = false, + bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSAttributedStringMarkdownParsingOptions]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0(obj.pointer, _sel_isKindOfClass_, + _class_NSAttributedStringMarkdownParsingOptions); + } + + /// init + NSAttributedStringMarkdownParsingOptions init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSAttributedStringMarkdownParsingOptions.castFromPointer(_ret, + retain: true, release: true); + } + + /// allowsExtendedAttributes + bool get allowsExtendedAttributes { + return _objc_msgSend_13(this.pointer, _sel_allowsExtendedAttributes); + } + + /// setAllowsExtendedAttributes: + set allowsExtendedAttributes(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setAllowsExtendedAttributes_, value); + } + + /// interpretedSyntax + NSAttributedStringMarkdownInterpretedSyntax get interpretedSyntax { + final _ret = _objc_msgSend_67(this.pointer, _sel_interpretedSyntax); + return NSAttributedStringMarkdownInterpretedSyntax.fromValue(_ret); + } + + /// setInterpretedSyntax: + set interpretedSyntax(NSAttributedStringMarkdownInterpretedSyntax value) { + return _objc_msgSend_68( + this.pointer, _sel_setInterpretedSyntax_, value.value); + } + + /// failurePolicy + NSAttributedStringMarkdownParsingFailurePolicy get failurePolicy { + final _ret = _objc_msgSend_69(this.pointer, _sel_failurePolicy); + return NSAttributedStringMarkdownParsingFailurePolicy.fromValue(_ret); + } + + /// setFailurePolicy: + set failurePolicy(NSAttributedStringMarkdownParsingFailurePolicy value) { + return _objc_msgSend_70(this.pointer, _sel_setFailurePolicy_, value.value); + } + + /// languageCode + objc.NSString? get languageCode { + final _ret = _objc_msgSend_20(this.pointer, _sel_languageCode); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setLanguageCode: + set languageCode(objc.NSString? value) { + return _objc_msgSend_21( + this.pointer, _sel_setLanguageCode_, value?.pointer ?? ffi.nullptr); + } + + /// appliesSourcePositionAttributes + bool get appliesSourcePositionAttributes { + return _objc_msgSend_13(this.pointer, _sel_appliesSourcePositionAttributes); + } + + /// setAppliesSourcePositionAttributes: + set appliesSourcePositionAttributes(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setAppliesSourcePositionAttributes_, value); + } + + /// new + static NSAttributedStringMarkdownParsingOptions new1() { + final _ret = _objc_msgSend_19( + _class_NSAttributedStringMarkdownParsingOptions, _sel_new); + return NSAttributedStringMarkdownParsingOptions.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSAttributedStringMarkdownParsingOptions allocWithZone_( + ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28( + _class_NSAttributedStringMarkdownParsingOptions, + _sel_allocWithZone_, + zone); + return NSAttributedStringMarkdownParsingOptions.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSAttributedStringMarkdownParsingOptions alloc() { + final _ret = _objc_msgSend_19( + _class_NSAttributedStringMarkdownParsingOptions, _sel_alloc); + return NSAttributedStringMarkdownParsingOptions.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSAttributedStringMarkdownParsingOptions, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSAttributedStringMarkdownParsingOptions, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13(_class_NSAttributedStringMarkdownParsingOptions, + _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSAttributedStringMarkdownParsingOptions, + _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30( + _class_NSAttributedStringMarkdownParsingOptions, + _sel_keyPathsForValuesAffectingValueForKey_, + key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSAttributedStringMarkdownParsingOptions, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSAttributedStringMarkdownParsingOptions, + _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSAttributedStringMarkdownParsingOptions, + _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSAttributedStringMarkdownParsingOptions = + objc.getClass("NSAttributedStringMarkdownParsingOptions"); +late final _sel_allowsExtendedAttributes = + objc.registerName("allowsExtendedAttributes"); +late final _sel_setAllowsExtendedAttributes_ = + objc.registerName("setAllowsExtendedAttributes:"); + +enum NSAttributedStringMarkdownInterpretedSyntax { + NSAttributedStringMarkdownInterpretedSyntaxFull(0), + NSAttributedStringMarkdownInterpretedSyntaxInlineOnly(1), + NSAttributedStringMarkdownInterpretedSyntaxInlineOnlyPreservingWhitespace(2); + + final int value; + const NSAttributedStringMarkdownInterpretedSyntax(this.value); + + static NSAttributedStringMarkdownInterpretedSyntax fromValue(int value) => + switch (value) { + 0 => NSAttributedStringMarkdownInterpretedSyntaxFull, + 1 => NSAttributedStringMarkdownInterpretedSyntaxInlineOnly, + 2 => + NSAttributedStringMarkdownInterpretedSyntaxInlineOnlyPreservingWhitespace, + _ => throw ArgumentError( + "Unknown value for NSAttributedStringMarkdownInterpretedSyntax: $value"), + }; +} + +late final _sel_interpretedSyntax = objc.registerName("interpretedSyntax"); +final _objc_msgSend_67 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setInterpretedSyntax_ = + objc.registerName("setInterpretedSyntax:"); +final _objc_msgSend_68 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); + +enum NSAttributedStringMarkdownParsingFailurePolicy { + NSAttributedStringMarkdownParsingFailureReturnError(0), + NSAttributedStringMarkdownParsingFailureReturnPartiallyParsedIfPossible(1); + + final int value; + const NSAttributedStringMarkdownParsingFailurePolicy(this.value); + + static NSAttributedStringMarkdownParsingFailurePolicy fromValue(int value) => + switch (value) { + 0 => NSAttributedStringMarkdownParsingFailureReturnError, + 1 => + NSAttributedStringMarkdownParsingFailureReturnPartiallyParsedIfPossible, + _ => throw ArgumentError( + "Unknown value for NSAttributedStringMarkdownParsingFailurePolicy: $value"), + }; +} + +late final _sel_failurePolicy = objc.registerName("failurePolicy"); +final _objc_msgSend_69 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setFailurePolicy_ = objc.registerName("setFailurePolicy:"); +final _objc_msgSend_70 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_languageCode = objc.registerName("languageCode"); +late final _sel_setLanguageCode_ = objc.registerName("setLanguageCode:"); +late final _sel_appliesSourcePositionAttributes = + objc.registerName("appliesSourcePositionAttributes"); +late final _sel_setAppliesSourcePositionAttributes_ = + objc.registerName("setAppliesSourcePositionAttributes:"); +late final _sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_ = + objc.registerName( + "initWithContentsOfMarkdownFileAtURL:options:baseURL:error:"); +final _objc_msgSend_71 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_initWithMarkdown_options_baseURL_error_ = + objc.registerName("initWithMarkdown:options:baseURL:error:"); +final _objc_msgSend_72 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_initWithMarkdownString_options_baseURL_error_ = + objc.registerName("initWithMarkdownString:options:baseURL:error:"); +final _objc_msgSend_73 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + +enum NSAttributedStringFormattingOptions { + NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging(1), + NSAttributedStringFormattingApplyReplacementIndexAttribute(2); + + final int value; + const NSAttributedStringFormattingOptions(this.value); + + static NSAttributedStringFormattingOptions fromValue(int value) => + switch (value) { + 1 => NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging, + 2 => NSAttributedStringFormattingApplyReplacementIndexAttribute, + _ => throw ArgumentError( + "Unknown value for NSAttributedStringFormattingOptions: $value"), + }; +} + +late final _sel_initWithFormat_options_locale_ = + objc.registerName("initWithFormat:options:locale:"); +final _objc_msgSend_74 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_initWithFormat_options_locale_arguments_ = + objc.registerName("initWithFormat:options:locale:arguments:"); +final _objc_msgSend_75 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_localizedAttributedStringWithFormat_ = + objc.registerName("localizedAttributedStringWithFormat:"); +late final _sel_localizedAttributedStringWithFormat_options_ = + objc.registerName("localizedAttributedStringWithFormat:options:"); +final _objc_msgSend_76 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_initWithFormat_options_locale_context_ = + objc.registerName("initWithFormat:options:locale:context:"); +final _objc_msgSend_77 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_initWithFormat_options_locale_context_arguments_ = + objc.registerName("initWithFormat:options:locale:context:arguments:"); +final _objc_msgSend_78 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_localizedAttributedStringWithFormat_context_ = + objc.registerName("localizedAttributedStringWithFormat:context:"); +final _objc_msgSend_79 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_localizedAttributedStringWithFormat_options_context_ = + objc.registerName("localizedAttributedStringWithFormat:options:context:"); +final _objc_msgSend_80 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_attributedStringByInflectingString = + objc.registerName("attributedStringByInflectingString"); +final _objc_msgSend_81 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_localizedAttributedStringForKey_value_table_ = + objc.registerName("localizedAttributedStringForKey:value:table:"); +final _objc_msgSend_82 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_bundleIdentifier = objc.registerName("bundleIdentifier"); +late final _sel_infoDictionary = objc.registerName("infoDictionary"); +final _objc_msgSend_83 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_localizedInfoDictionary = + objc.registerName("localizedInfoDictionary"); +late final _sel_objectForInfoDictionaryKey_ = + objc.registerName("objectForInfoDictionaryKey:"); +late final _sel_classNamed_ = objc.registerName("classNamed:"); +late final _sel_principalClass = objc.registerName("principalClass"); +final _objc_msgSend_84 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_preferredLocalizations = + objc.registerName("preferredLocalizations"); +late final _sel_localizations = objc.registerName("localizations"); +late final _sel_developmentLocalization = + objc.registerName("developmentLocalization"); +late final _sel_preferredLocalizationsFromArray_ = + objc.registerName("preferredLocalizationsFromArray:"); +final _objc_msgSend_85 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_preferredLocalizationsFromArray_forPreferences_ = + objc.registerName("preferredLocalizationsFromArray:forPreferences:"); +final _objc_msgSend_86 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_executableArchitectures = + objc.registerName("executableArchitectures"); +final _objc_msgSend_87 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setPreservationPriority_forTags_ = + objc.registerName("setPreservationPriority:forTags:"); +final _objc_msgSend_88 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer)>(); +late final _sel_preservationPriorityForTag_ = + objc.registerName("preservationPriorityForTag:"); +final _objc_msgSend_89 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_89Fpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + +/// NSMutableAttributedString +class NSMutableAttributedString extends NSAttributedString { + NSMutableAttributedString._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSMutableAttributedString] that points to the same underlying object as [other]. + NSMutableAttributedString.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSMutableAttributedString] that wraps the given raw object pointer. + NSMutableAttributedString.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSMutableAttributedString]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSMutableAttributedString); + } + + /// replaceCharactersInRange:withString: + void replaceCharactersInRange_withString_(_NSRange range, objc.NSString str) { + _objc_msgSend_90(this.pointer, _sel_replaceCharactersInRange_withString_, + range, str.pointer); + } + + /// setAttributes:range: + void setAttributes_range_(objc.NSDictionary? attrs, _NSRange range) { + _objc_msgSend_91(this.pointer, _sel_setAttributes_range_, + attrs?.pointer ?? ffi.nullptr, range); + } + + /// mutableString + objc.NSMutableString get mutableString { + final _ret = _objc_msgSend_92(this.pointer, _sel_mutableString); + return objc.NSMutableString.castFromPointer(_ret, + retain: true, release: true); + } + + /// addAttribute:value:range: + void addAttribute_value_range_( + objc.NSString name, objc.ObjCObjectBase value, _NSRange range) { + _objc_msgSend_93(this.pointer, _sel_addAttribute_value_range_, name.pointer, + value.pointer, range); + } + + /// addAttributes:range: + void addAttributes_range_(objc.NSDictionary attrs, _NSRange range) { + _objc_msgSend_94( + this.pointer, _sel_addAttributes_range_, attrs.pointer, range); + } + + /// removeAttribute:range: + void removeAttribute_range_(objc.NSString name, _NSRange range) { + _objc_msgSend_95( + this.pointer, _sel_removeAttribute_range_, name.pointer, range); + } + + /// replaceCharactersInRange:withAttributedString: + void replaceCharactersInRange_withAttributedString_( + _NSRange range, NSAttributedString attrString) { + _objc_msgSend_96( + this.pointer, + _sel_replaceCharactersInRange_withAttributedString_, + range, + attrString.pointer); + } + + /// insertAttributedString:atIndex: + void insertAttributedString_atIndex_(NSAttributedString attrString, int loc) { + _objc_msgSend_97(this.pointer, _sel_insertAttributedString_atIndex_, + attrString.pointer, loc); + } + + /// appendAttributedString: + void appendAttributedString_(NSAttributedString attrString) { + _objc_msgSend_98( + this.pointer, _sel_appendAttributedString_, attrString.pointer); + } + + /// deleteCharactersInRange: + void deleteCharactersInRange_(_NSRange range) { + _objc_msgSend_99(this.pointer, _sel_deleteCharactersInRange_, range); + } + + /// setAttributedString: + void setAttributedString_(NSAttributedString attrString) { + _objc_msgSend_98( + this.pointer, _sel_setAttributedString_, attrString.pointer); + } + + /// beginEditing + void beginEditing() { + _objc_msgSend_7(this.pointer, _sel_beginEditing); + } + + /// endEditing + void endEditing() { + _objc_msgSend_7(this.pointer, _sel_endEditing); + } + + /// appendLocalizedFormat: + void appendLocalizedFormat_(NSAttributedString format) { + _objc_msgSend_98(this.pointer, _sel_appendLocalizedFormat_, format.pointer); + } + + /// initWithString: + NSMutableAttributedString initWithString_(objc.NSString str) { + final _ret = + _objc_msgSend_62(this.pointer, _sel_initWithString_, str.pointer); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithString:attributes: + NSMutableAttributedString initWithString_attributes_( + objc.NSString str, objc.NSDictionary? attrs) { + final _ret = _objc_msgSend_63(this.pointer, _sel_initWithString_attributes_, + str.pointer, attrs?.pointer ?? ffi.nullptr); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithAttributedString: + NSMutableAttributedString initWithAttributedString_( + NSAttributedString attrStr) { + final _ret = _objc_msgSend_64( + this.pointer, _sel_initWithAttributedString_, attrStr.pointer); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithContentsOfMarkdownFileAtURL:options:baseURL:error: + NSMutableAttributedString? + initWithContentsOfMarkdownFileAtURL_options_baseURL_error_( + objc.NSURL markdownFile, + NSAttributedStringMarkdownParsingOptions? options, + objc.NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _objc_msgSend_71( + this.pointer, + _sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_, + markdownFile.pointer, + options?.pointer ?? ffi.nullptr, + baseURL?.pointer ?? ffi.nullptr, + error); + return _ret.address == 0 + ? null + : NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithMarkdown:options:baseURL:error: + NSMutableAttributedString? initWithMarkdown_options_baseURL_error_( + objc.NSData markdown, + NSAttributedStringMarkdownParsingOptions? options, + objc.NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _objc_msgSend_72( + this.pointer, + _sel_initWithMarkdown_options_baseURL_error_, + markdown.pointer, + options?.pointer ?? ffi.nullptr, + baseURL?.pointer ?? ffi.nullptr, + error); + return _ret.address == 0 + ? null + : NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithMarkdownString:options:baseURL:error: + NSMutableAttributedString? initWithMarkdownString_options_baseURL_error_( + objc.NSString markdownString, + NSAttributedStringMarkdownParsingOptions? options, + objc.NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _objc_msgSend_73( + this.pointer, + _sel_initWithMarkdownString_options_baseURL_error_, + markdownString.pointer, + options?.pointer ?? ffi.nullptr, + baseURL?.pointer ?? ffi.nullptr, + error); + return _ret.address == 0 + ? null + : NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithFormat:options:locale: + NSMutableAttributedString initWithFormat_options_locale_( + NSAttributedString format, + NSAttributedStringFormattingOptions options, + objc.NSLocale? locale) { + final _ret = _objc_msgSend_74( + this.pointer, + _sel_initWithFormat_options_locale_, + format.pointer, + options.value, + locale?.pointer ?? ffi.nullptr); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithFormat:options:locale:arguments: + NSMutableAttributedString initWithFormat_options_locale_arguments_( + NSAttributedString format, + NSAttributedStringFormattingOptions options, + objc.NSLocale? locale, + ffi.Pointer arguments) { + final _ret = _objc_msgSend_75( + this.pointer, + _sel_initWithFormat_options_locale_arguments_, + format.pointer, + options.value, + locale?.pointer ?? ffi.nullptr, + arguments); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// localizedAttributedStringWithFormat: + static NSMutableAttributedString localizedAttributedStringWithFormat_( + NSAttributedString format) { + final _ret = _objc_msgSend_64(_class_NSMutableAttributedString, + _sel_localizedAttributedStringWithFormat_, format.pointer); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// localizedAttributedStringWithFormat:options: + static NSMutableAttributedString localizedAttributedStringWithFormat_options_( + NSAttributedString format, NSAttributedStringFormattingOptions options) { + final _ret = _objc_msgSend_76( + _class_NSMutableAttributedString, + _sel_localizedAttributedStringWithFormat_options_, + format.pointer, + options.value); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithFormat:options:locale:context: + NSMutableAttributedString initWithFormat_options_locale_context_( + NSAttributedString format, + NSAttributedStringFormattingOptions options, + objc.NSLocale? locale, + objc.NSDictionary context) { + final _ret = _objc_msgSend_77( + this.pointer, + _sel_initWithFormat_options_locale_context_, + format.pointer, + options.value, + locale?.pointer ?? ffi.nullptr, + context.pointer); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithFormat:options:locale:context:arguments: + NSMutableAttributedString initWithFormat_options_locale_context_arguments_( + NSAttributedString format, + NSAttributedStringFormattingOptions options, + objc.NSLocale? locale, + objc.NSDictionary context, + ffi.Pointer arguments) { + final _ret = _objc_msgSend_78( + this.pointer, + _sel_initWithFormat_options_locale_context_arguments_, + format.pointer, + options.value, + locale?.pointer ?? ffi.nullptr, + context.pointer, + arguments); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// localizedAttributedStringWithFormat:context: + static NSMutableAttributedString localizedAttributedStringWithFormat_context_( + NSAttributedString format, objc.NSDictionary context) { + final _ret = _objc_msgSend_79( + _class_NSMutableAttributedString, + _sel_localizedAttributedStringWithFormat_context_, + format.pointer, + context.pointer); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// localizedAttributedStringWithFormat:options:context: + static NSMutableAttributedString + localizedAttributedStringWithFormat_options_context_( + NSAttributedString format, + NSAttributedStringFormattingOptions options, + objc.NSDictionary context) { + final _ret = _objc_msgSend_80( + _class_NSMutableAttributedString, + _sel_localizedAttributedStringWithFormat_options_context_, + format.pointer, + options.value, + context.pointer); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// init + NSMutableAttributedString init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSMutableAttributedString.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSMutableAttributedString new1() { + final _ret = _objc_msgSend_19(_class_NSMutableAttributedString, _sel_new); + return NSMutableAttributedString.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSMutableAttributedString allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28( + _class_NSMutableAttributedString, _sel_allocWithZone_, zone); + return NSMutableAttributedString.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSMutableAttributedString alloc() { + final _ret = _objc_msgSend_19(_class_NSMutableAttributedString, _sel_alloc); + return NSMutableAttributedString.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSMutableAttributedString, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSMutableAttributedString, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSMutableAttributedString, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13( + _class_NSMutableAttributedString, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSMutableAttributedString, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSMutableAttributedString, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSMutableAttributedString, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSMutableAttributedString, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSMutableAttributedString = + objc.getClass("NSMutableAttributedString"); +late final _sel_replaceCharactersInRange_withString_ = + objc.registerName("replaceCharactersInRange:withString:"); +final _objc_msgSend_90 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>(); +late final _sel_setAttributes_range_ = + objc.registerName("setAttributes:range:"); +final _objc_msgSend_91 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>(); +late final _sel_mutableString = objc.registerName("mutableString"); +final _objc_msgSend_92 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_addAttribute_value_range_ = + objc.registerName("addAttribute:value:range:"); +final _objc_msgSend_93 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>(); +late final _sel_addAttributes_range_ = + objc.registerName("addAttributes:range:"); +final _objc_msgSend_94 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>(); +late final _sel_removeAttribute_range_ = + objc.registerName("removeAttribute:range:"); +final _objc_msgSend_95 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>(); +late final _sel_replaceCharactersInRange_withAttributedString_ = + objc.registerName("replaceCharactersInRange:withAttributedString:"); +final _objc_msgSend_96 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>(); +late final _sel_insertAttributedString_atIndex_ = + objc.registerName("insertAttributedString:atIndex:"); +final _objc_msgSend_97 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_appendAttributedString_ = + objc.registerName("appendAttributedString:"); +final _objc_msgSend_98 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_deleteCharactersInRange_ = + objc.registerName("deleteCharactersInRange:"); +final _objc_msgSend_99 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, _NSRange)>(); +late final _sel_setAttributedString_ = + objc.registerName("setAttributedString:"); +late final _sel_beginEditing = objc.registerName("beginEditing"); +late final _sel_endEditing = objc.registerName("endEditing"); +late final _sel_appendLocalizedFormat_ = + objc.registerName("appendLocalizedFormat:"); + +enum NSLocaleLanguageDirection { + NSLocaleLanguageDirectionUnknown(0), + NSLocaleLanguageDirectionLeftToRight(1), + NSLocaleLanguageDirectionRightToLeft(2), + NSLocaleLanguageDirectionTopToBottom(3), + NSLocaleLanguageDirectionBottomToTop(4); + + final int value; + const NSLocaleLanguageDirection(this.value); + + static NSLocaleLanguageDirection fromValue(int value) => switch (value) { + 0 => NSLocaleLanguageDirectionUnknown, + 1 => NSLocaleLanguageDirectionLeftToRight, + 2 => NSLocaleLanguageDirectionRightToLeft, + 3 => NSLocaleLanguageDirectionTopToBottom, + 4 => NSLocaleLanguageDirectionBottomToTop, + _ => throw ArgumentError( + "Unknown value for NSLocaleLanguageDirection: $value"), + }; +} + +/// NSScanner +class NSScanner extends objc.NSObject { + NSScanner._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSScanner] that points to the same underlying object as [other]. + NSScanner.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSScanner] that wraps the given raw object pointer. + NSScanner.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSScanner]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0(obj.pointer, _sel_isKindOfClass_, _class_NSScanner); + } + + /// string + objc.NSString get string { + final _ret = _objc_msgSend_11(this.pointer, _sel_string); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// scanLocation + int get scanLocation { + return _objc_msgSend_56(this.pointer, _sel_scanLocation); + } + + /// setScanLocation: + set scanLocation(int value) { + return _objc_msgSend_100(this.pointer, _sel_setScanLocation_, value); + } + + /// charactersToBeSkipped + objc.NSCharacterSet? get charactersToBeSkipped { + final _ret = _objc_msgSend_101(this.pointer, _sel_charactersToBeSkipped); + return _ret.address == 0 + ? null + : objc.NSCharacterSet.castFromPointer(_ret, + retain: true, release: true); + } + + /// setCharactersToBeSkipped: + set charactersToBeSkipped(objc.NSCharacterSet? value) { + return _objc_msgSend_102(this.pointer, _sel_setCharactersToBeSkipped_, + value?.pointer ?? ffi.nullptr); + } + + /// caseSensitive + bool get caseSensitive { + return _objc_msgSend_13(this.pointer, _sel_caseSensitive); + } + + /// setCaseSensitive: + set caseSensitive(bool value) { + return _objc_msgSend_14(this.pointer, _sel_setCaseSensitive_, value); + } + + /// locale + objc.ObjCObjectBase? get locale { + final _ret = _objc_msgSend_84(this.pointer, _sel_locale); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// setLocale: + set locale(objc.ObjCObjectBase? value) { + return _objc_msgSend_103( + this.pointer, _sel_setLocale_, value?.pointer ?? ffi.nullptr); + } + + /// initWithString: + NSScanner initWithString_(objc.NSString string) { + final _ret = + _objc_msgSend_62(this.pointer, _sel_initWithString_, string.pointer); + return NSScanner.castFromPointer(_ret, retain: true, release: true); + } + + /// scanInt: + bool scanInt_(ffi.Pointer result) { + return _objc_msgSend_104(this.pointer, _sel_scanInt_, result); + } + + /// scanInteger: + bool scanInteger_(ffi.Pointer result) { + return _objc_msgSend_105(this.pointer, _sel_scanInteger_, result); + } + + /// scanLongLong: + bool scanLongLong_(ffi.Pointer result) { + return _objc_msgSend_106(this.pointer, _sel_scanLongLong_, result); + } + + /// scanUnsignedLongLong: + bool scanUnsignedLongLong_(ffi.Pointer result) { + return _objc_msgSend_107(this.pointer, _sel_scanUnsignedLongLong_, result); + } + + /// scanFloat: + bool scanFloat_(ffi.Pointer result) { + return _objc_msgSend_108(this.pointer, _sel_scanFloat_, result); + } + + /// scanDouble: + bool scanDouble_(ffi.Pointer result) { + return _objc_msgSend_109(this.pointer, _sel_scanDouble_, result); + } + + /// scanHexInt: + bool scanHexInt_(ffi.Pointer result) { + return _objc_msgSend_110(this.pointer, _sel_scanHexInt_, result); + } + + /// scanHexLongLong: + bool scanHexLongLong_(ffi.Pointer result) { + return _objc_msgSend_107(this.pointer, _sel_scanHexLongLong_, result); + } + + /// scanHexFloat: + bool scanHexFloat_(ffi.Pointer result) { + return _objc_msgSend_108(this.pointer, _sel_scanHexFloat_, result); + } + + /// scanHexDouble: + bool scanHexDouble_(ffi.Pointer result) { + return _objc_msgSend_109(this.pointer, _sel_scanHexDouble_, result); + } + + /// scanString:intoString: + bool scanString_intoString_( + objc.NSString string, ffi.Pointer> result) { + return _objc_msgSend_111( + this.pointer, _sel_scanString_intoString_, string.pointer, result); + } + + /// scanCharactersFromSet:intoString: + bool scanCharactersFromSet_intoString_(objc.NSCharacterSet set, + ffi.Pointer> result) { + return _objc_msgSend_112(this.pointer, + _sel_scanCharactersFromSet_intoString_, set.pointer, result); + } + + /// scanUpToString:intoString: + bool scanUpToString_intoString_( + objc.NSString string, ffi.Pointer> result) { + return _objc_msgSend_111( + this.pointer, _sel_scanUpToString_intoString_, string.pointer, result); + } + + /// scanUpToCharactersFromSet:intoString: + bool scanUpToCharactersFromSet_intoString_(objc.NSCharacterSet set, + ffi.Pointer> result) { + return _objc_msgSend_112(this.pointer, + _sel_scanUpToCharactersFromSet_intoString_, set.pointer, result); + } + + /// isAtEnd + bool get atEnd { + return _objc_msgSend_13(this.pointer, _sel_isAtEnd); + } + + /// scannerWithString: + static NSScanner scannerWithString_(objc.NSString string) { + final _ret = _objc_msgSend_62( + _class_NSScanner, _sel_scannerWithString_, string.pointer); + return NSScanner.castFromPointer(_ret, retain: true, release: true); + } + + /// localizedScannerWithString: + static objc.ObjCObjectBase localizedScannerWithString_(objc.NSString string) { + final _ret = _objc_msgSend_62( + _class_NSScanner, _sel_localizedScannerWithString_, string.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// scanDecimal: + bool scanDecimal_(ffi.Pointer dcm) { + return _objc_msgSend_113(this.pointer, _sel_scanDecimal_, dcm); + } + + /// init + NSScanner init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSScanner.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSScanner new1() { + final _ret = _objc_msgSend_19(_class_NSScanner, _sel_new); + return NSScanner.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSScanner allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28(_class_NSScanner, _sel_allocWithZone_, zone); + return NSScanner.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSScanner alloc() { + final _ret = _objc_msgSend_19(_class_NSScanner, _sel_alloc); + return NSScanner.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSScanner, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSScanner, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSScanner, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSScanner, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSScanner, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSScanner, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = + _objc_msgSend_32(_class_NSScanner, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSScanner, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSScanner = objc.getClass("NSScanner"); +late final _sel_scanLocation = objc.registerName("scanLocation"); +late final _sel_setScanLocation_ = objc.registerName("setScanLocation:"); +final _objc_msgSend_100 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_charactersToBeSkipped = + objc.registerName("charactersToBeSkipped"); +final _objc_msgSend_101 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setCharactersToBeSkipped_ = + objc.registerName("setCharactersToBeSkipped:"); +final _objc_msgSend_102 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_caseSensitive = objc.registerName("caseSensitive"); +late final _sel_setCaseSensitive_ = objc.registerName("setCaseSensitive:"); +late final _sel_locale = objc.registerName("locale"); +late final _sel_setLocale_ = objc.registerName("setLocale:"); +final _objc_msgSend_103 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_scanInt_ = objc.registerName("scanInt:"); +final _objc_msgSend_104 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_scanInteger_ = objc.registerName("scanInteger:"); +final _objc_msgSend_105 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_scanLongLong_ = objc.registerName("scanLongLong:"); +final _objc_msgSend_106 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_scanUnsignedLongLong_ = + objc.registerName("scanUnsignedLongLong:"); +final _objc_msgSend_107 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_scanFloat_ = objc.registerName("scanFloat:"); +final _objc_msgSend_108 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_scanDouble_ = objc.registerName("scanDouble:"); +final _objc_msgSend_109 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_scanHexInt_ = objc.registerName("scanHexInt:"); +final _objc_msgSend_110 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_scanHexLongLong_ = objc.registerName("scanHexLongLong:"); +late final _sel_scanHexFloat_ = objc.registerName("scanHexFloat:"); +late final _sel_scanHexDouble_ = objc.registerName("scanHexDouble:"); +late final _sel_scanString_intoString_ = + objc.registerName("scanString:intoString:"); +final _objc_msgSend_111 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_scanCharactersFromSet_intoString_ = + objc.registerName("scanCharactersFromSet:intoString:"); +final _objc_msgSend_112 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_scanUpToString_intoString_ = + objc.registerName("scanUpToString:intoString:"); +late final _sel_scanUpToCharactersFromSet_intoString_ = + objc.registerName("scanUpToCharactersFromSet:intoString:"); +late final _sel_isAtEnd = objc.registerName("isAtEnd"); +late final _sel_scannerWithString_ = objc.registerName("scannerWithString:"); +late final _sel_localizedScannerWithString_ = + objc.registerName("localizedScannerWithString:"); + +final class NSDecimal extends ffi.Opaque {} + +late final _sel_scanDecimal_ = objc.registerName("scanDecimal:"); +final _objc_msgSend_113 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + +/// NSException +class NSException extends objc.NSObject { + NSException._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSException] that points to the same underlying object as [other]. + NSException.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSException] that wraps the given raw object pointer. + NSException.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSException]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSException); + } + + /// exceptionWithName:reason:userInfo: + static NSException exceptionWithName_reason_userInfo_( + objc.NSString name, objc.NSString? reason, objc.NSDictionary? userInfo) { + final _ret = _objc_msgSend_114( + _class_NSException, + _sel_exceptionWithName_reason_userInfo_, + name.pointer, + reason?.pointer ?? ffi.nullptr, + userInfo?.pointer ?? ffi.nullptr); + return NSException.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithName:reason:userInfo: + NSException initWithName_reason_userInfo_(objc.NSString aName, + objc.NSString? aReason, objc.NSDictionary? aUserInfo) { + final _ret = _objc_msgSend_115( + this.pointer, + _sel_initWithName_reason_userInfo_, + aName.pointer, + aReason?.pointer ?? ffi.nullptr, + aUserInfo?.pointer ?? ffi.nullptr); + return NSException.castFromPointer(_ret, retain: true, release: true); + } + + /// name + objc.NSString get name { + final _ret = _objc_msgSend_11(this.pointer, _sel_name); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// reason + objc.NSString? get reason { + final _ret = _objc_msgSend_20(this.pointer, _sel_reason); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// userInfo + objc.NSDictionary? get userInfo { + final _ret = _objc_msgSend_83(this.pointer, _sel_userInfo); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// callStackReturnAddresses + objc.NSArray get callStackReturnAddresses { + final _ret = _objc_msgSend_32(this.pointer, _sel_callStackReturnAddresses); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// callStackSymbols + objc.NSArray get callStackSymbols { + final _ret = _objc_msgSend_32(this.pointer, _sel_callStackSymbols); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// raise + void raise() { + _objc_msgSend_7(this.pointer, _sel_raise); + } + + /// raise:format: + static void raise_format_(objc.NSString name, objc.NSString format) { + _objc_msgSend_116( + _class_NSException, _sel_raise_format_, name.pointer, format.pointer); + } + + /// raise:format:arguments: + static void raise_format_arguments_( + objc.NSString name, objc.NSString format, ffi.Pointer argList) { + _objc_msgSend_117(_class_NSException, _sel_raise_format_arguments_, + name.pointer, format.pointer, argList); + } + + /// init + NSException init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSException.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSException new1() { + final _ret = _objc_msgSend_19(_class_NSException, _sel_new); + return NSException.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSException allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSException, _sel_allocWithZone_, zone); + return NSException.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSException alloc() { + final _ret = _objc_msgSend_19(_class_NSException, _sel_alloc); + return NSException.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSException, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSException, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSException, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSException, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSException, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSException, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSException, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSException, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSException = objc.getClass("NSException"); +late final _sel_exceptionWithName_reason_userInfo_ = + objc.registerName("exceptionWithName:reason:userInfo:"); +final _objc_msgSend_114 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_initWithName_reason_userInfo_ = + objc.registerName("initWithName:reason:userInfo:"); +final _objc_msgSend_115 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_name = objc.registerName("name"); +late final _sel_reason = objc.registerName("reason"); +late final _sel_callStackReturnAddresses = + objc.registerName("callStackReturnAddresses"); +late final _sel_callStackSymbols = objc.registerName("callStackSymbols"); +late final _sel_raise = objc.registerName("raise"); +late final _sel_raise_format_ = objc.registerName("raise:format:"); +final _objc_msgSend_116 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_raise_format_arguments_ = + objc.registerName("raise:format:arguments:"); +final _objc_msgSend_117 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + +/// NSRunLoop +class NSRunLoop extends objc.NSObject { + NSRunLoop._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSRunLoop] that points to the same underlying object as [other]. + NSRunLoop.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSRunLoop] that wraps the given raw object pointer. + NSRunLoop.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSRunLoop]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0(obj.pointer, _sel_isKindOfClass_, _class_NSRunLoop); + } + + /// currentRunLoop + static NSRunLoop getCurrentRunLoop() { + final _ret = _objc_msgSend_118(_class_NSRunLoop, _sel_currentRunLoop); + return NSRunLoop.castFromPointer(_ret, retain: true, release: true); + } + + /// mainRunLoop + static NSRunLoop getMainRunLoop() { + final _ret = _objc_msgSend_118(_class_NSRunLoop, _sel_mainRunLoop); + return NSRunLoop.castFromPointer(_ret, retain: true, release: true); + } + + /// currentMode + objc.NSString? get currentMode { + final _ret = _objc_msgSend_20(this.pointer, _sel_currentMode); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// getCFRunLoop + ffi.Pointer<__CFRunLoop> getCFRunLoop() { + return _objc_msgSend_119(this.pointer, _sel_getCFRunLoop); + } + + /// addTimer:forMode: + void addTimer_forMode_(NSTimer timer, objc.NSString mode) { + _objc_msgSend_128( + this.pointer, _sel_addTimer_forMode_, timer.pointer, mode.pointer); + } + + /// addPort:forMode: + void addPort_forMode_(NSPort aPort, objc.NSString mode) { + _objc_msgSend_134( + this.pointer, _sel_addPort_forMode_, aPort.pointer, mode.pointer); + } + + /// removePort:forMode: + void removePort_forMode_(NSPort aPort, objc.NSString mode) { + _objc_msgSend_134( + this.pointer, _sel_removePort_forMode_, aPort.pointer, mode.pointer); + } + + /// limitDateForMode: + objc.NSDate? limitDateForMode_(objc.NSString mode) { + final _ret = + _objc_msgSend_135(this.pointer, _sel_limitDateForMode_, mode.pointer); + return _ret.address == 0 + ? null + : objc.NSDate.castFromPointer(_ret, retain: true, release: true); + } + + /// acceptInputForMode:beforeDate: + void acceptInputForMode_beforeDate_( + objc.NSString mode, objc.NSDate limitDate) { + _objc_msgSend_136(this.pointer, _sel_acceptInputForMode_beforeDate_, + mode.pointer, limitDate.pointer); + } + + /// run + void run() { + _objc_msgSend_7(this.pointer, _sel_run); + } + + /// runUntilDate: + void runUntilDate_(objc.NSDate limitDate) { + _objc_msgSend_137(this.pointer, _sel_runUntilDate_, limitDate.pointer); + } + + /// runMode:beforeDate: + bool runMode_beforeDate_(objc.NSString mode, objc.NSDate limitDate) { + return _objc_msgSend_138(this.pointer, _sel_runMode_beforeDate_, + mode.pointer, limitDate.pointer); + } + + /// performInModes:block: + void performInModes_block_(objc.NSArray modes, ObjCBlock_ffiVoid block) { + _objc_msgSend_139( + this.pointer, _sel_performInModes_block_, modes.pointer, block.pointer); + } + + /// performBlock: + void performBlock_(ObjCBlock_ffiVoid block) { + _objc_msgSend_140(this.pointer, _sel_performBlock_, block.pointer); + } + + /// performSelector:target:argument:order:modes: + void performSelector_target_argument_order_modes_( + ffi.Pointer aSelector, + objc.ObjCObjectBase target, + objc.ObjCObjectBase? arg, + int order, + objc.NSArray modes) { + _objc_msgSend_141( + this.pointer, + _sel_performSelector_target_argument_order_modes_, + aSelector, + target.pointer, + arg?.pointer ?? ffi.nullptr, + order, + modes.pointer); + } + + /// cancelPerformSelector:target:argument: + void cancelPerformSelector_target_argument_( + ffi.Pointer aSelector, + objc.ObjCObjectBase target, + objc.ObjCObjectBase? arg) { + _objc_msgSend_142(this.pointer, _sel_cancelPerformSelector_target_argument_, + aSelector, target.pointer, arg?.pointer ?? ffi.nullptr); + } + + /// cancelPerformSelectorsWithTarget: + void cancelPerformSelectorsWithTarget_(objc.ObjCObjectBase target) { + _objc_msgSend_27( + this.pointer, _sel_cancelPerformSelectorsWithTarget_, target.pointer); + } + + /// init + NSRunLoop init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSRunLoop.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSRunLoop new1() { + final _ret = _objc_msgSend_19(_class_NSRunLoop, _sel_new); + return NSRunLoop.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSRunLoop allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28(_class_NSRunLoop, _sel_allocWithZone_, zone); + return NSRunLoop.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSRunLoop alloc() { + final _ret = _objc_msgSend_19(_class_NSRunLoop, _sel_alloc); + return NSRunLoop.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSRunLoop, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSRunLoop, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSRunLoop, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSRunLoop, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSRunLoop, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSRunLoop, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = + _objc_msgSend_32(_class_NSRunLoop, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSRunLoop, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSRunLoop = objc.getClass("NSRunLoop"); +late final _sel_currentRunLoop = objc.registerName("currentRunLoop"); +final _objc_msgSend_118 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_mainRunLoop = objc.registerName("mainRunLoop"); +late final _sel_currentMode = objc.registerName("currentMode"); + +final class __CFRunLoop extends ffi.Opaque {} + +late final _sel_getCFRunLoop = objc.registerName("getCFRunLoop"); +final _objc_msgSend_119 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer<__CFRunLoop> Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer<__CFRunLoop> Function( + ffi.Pointer, ffi.Pointer)>(); + +/// NSTimer +class NSTimer extends objc.NSObject { + NSTimer._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSTimer] that points to the same underlying object as [other]. + NSTimer.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSTimer] that wraps the given raw object pointer. + NSTimer.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSTimer]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0(obj.pointer, _sel_isKindOfClass_, _class_NSTimer); + } + + /// timerWithTimeInterval:invocation:repeats: + static NSTimer timerWithTimeInterval_invocation_repeats_( + double ti, objc.NSInvocation invocation, bool yesOrNo) { + final _ret = _objc_msgSend_120( + _class_NSTimer, + _sel_timerWithTimeInterval_invocation_repeats_, + ti, + invocation.pointer, + yesOrNo); + return NSTimer.castFromPointer(_ret, retain: true, release: true); + } + + /// scheduledTimerWithTimeInterval:invocation:repeats: + static NSTimer scheduledTimerWithTimeInterval_invocation_repeats_( + double ti, objc.NSInvocation invocation, bool yesOrNo) { + final _ret = _objc_msgSend_120( + _class_NSTimer, + _sel_scheduledTimerWithTimeInterval_invocation_repeats_, + ti, + invocation.pointer, + yesOrNo); + return NSTimer.castFromPointer(_ret, retain: true, release: true); + } + + /// timerWithTimeInterval:target:selector:userInfo:repeats: + static NSTimer timerWithTimeInterval_target_selector_userInfo_repeats_( + double ti, + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? userInfo, + bool yesOrNo) { + final _ret = _objc_msgSend_121( + _class_NSTimer, + _sel_timerWithTimeInterval_target_selector_userInfo_repeats_, + ti, + aTarget.pointer, + aSelector, + userInfo?.pointer ?? ffi.nullptr, + yesOrNo); + return NSTimer.castFromPointer(_ret, retain: true, release: true); + } + + /// scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: + static NSTimer + scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( + double ti, + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? userInfo, + bool yesOrNo) { + final _ret = _objc_msgSend_121( + _class_NSTimer, + _sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_, + ti, + aTarget.pointer, + aSelector, + userInfo?.pointer ?? ffi.nullptr, + yesOrNo); + return NSTimer.castFromPointer(_ret, retain: true, release: true); + } + + /// timerWithTimeInterval:repeats:block: + static NSTimer timerWithTimeInterval_repeats_block_( + double interval, bool repeats, ObjCBlock_ffiVoid_NSTimer block) { + final _ret = _objc_msgSend_122( + _class_NSTimer, + _sel_timerWithTimeInterval_repeats_block_, + interval, + repeats, + block.pointer); + return NSTimer.castFromPointer(_ret, retain: true, release: true); + } + + /// scheduledTimerWithTimeInterval:repeats:block: + static NSTimer scheduledTimerWithTimeInterval_repeats_block_( + double interval, bool repeats, ObjCBlock_ffiVoid_NSTimer block) { + final _ret = _objc_msgSend_122( + _class_NSTimer, + _sel_scheduledTimerWithTimeInterval_repeats_block_, + interval, + repeats, + block.pointer); + return NSTimer.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithFireDate:interval:repeats:block: + NSTimer initWithFireDate_interval_repeats_block_(objc.NSDate date, + double interval, bool repeats, ObjCBlock_ffiVoid_NSTimer block) { + final _ret = _objc_msgSend_123( + this.pointer, + _sel_initWithFireDate_interval_repeats_block_, + date.pointer, + interval, + repeats, + block.pointer); + return NSTimer.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithFireDate:interval:target:selector:userInfo:repeats: + NSTimer initWithFireDate_interval_target_selector_userInfo_repeats_( + objc.NSDate date, + double ti, + objc.ObjCObjectBase t, + ffi.Pointer s, + objc.ObjCObjectBase? ui, + bool rep) { + final _ret = _objc_msgSend_124( + this.pointer, + _sel_initWithFireDate_interval_target_selector_userInfo_repeats_, + date.pointer, + ti, + t.pointer, + s, + ui?.pointer ?? ffi.nullptr, + rep); + return NSTimer.castFromPointer(_ret, retain: true, release: true); + } + + /// fire + void fire() { + _objc_msgSend_7(this.pointer, _sel_fire); + } + + /// fireDate + objc.NSDate get fireDate { + final _ret = _objc_msgSend_125(this.pointer, _sel_fireDate); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); + } + + /// setFireDate: + set fireDate(objc.NSDate value) { + return _objc_msgSend_126(this.pointer, _sel_setFireDate_, value.pointer); + } + + /// timeInterval + double get timeInterval { + return objc.useMsgSendVariants + ? _objc_msgSend_18Fpret(this.pointer, _sel_timeInterval) + : _objc_msgSend_18(this.pointer, _sel_timeInterval); + } + + /// tolerance + double get tolerance { + return objc.useMsgSendVariants + ? _objc_msgSend_18Fpret(this.pointer, _sel_tolerance) + : _objc_msgSend_18(this.pointer, _sel_tolerance); + } + + /// setTolerance: + set tolerance(double value) { + return _objc_msgSend_127(this.pointer, _sel_setTolerance_, value); + } + + /// invalidate + void invalidate() { + _objc_msgSend_7(this.pointer, _sel_invalidate); + } + + /// isValid + bool get valid { + return _objc_msgSend_13(this.pointer, _sel_isValid); + } + + /// userInfo + objc.ObjCObjectBase? get userInfo { + final _ret = _objc_msgSend_84(this.pointer, _sel_userInfo); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// init + NSTimer init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSTimer.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSTimer new1() { + final _ret = _objc_msgSend_19(_class_NSTimer, _sel_new); + return NSTimer.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSTimer allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28(_class_NSTimer, _sel_allocWithZone_, zone); + return NSTimer.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSTimer alloc() { + final _ret = _objc_msgSend_19(_class_NSTimer, _sel_alloc); + return NSTimer.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSTimer, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSTimer, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSTimer, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSTimer, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSTimer, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSTimer, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = + _objc_msgSend_32(_class_NSTimer, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19(_class_NSTimer, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSTimer = objc.getClass("NSTimer"); +late final _sel_timerWithTimeInterval_invocation_repeats_ = + objc.registerName("timerWithTimeInterval:invocation:repeats:"); +final _objc_msgSend_120 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer, + bool)>(); +late final _sel_scheduledTimerWithTimeInterval_invocation_repeats_ = + objc.registerName("scheduledTimerWithTimeInterval:invocation:repeats:"); +late final _sel_timerWithTimeInterval_target_selector_userInfo_repeats_ = objc + .registerName("timerWithTimeInterval:target:selector:userInfo:repeats:"); +final _objc_msgSend_121 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_ = + objc.registerName( + "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"); +void _ObjCBlock_ffiVoid_NSTimer_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +void _ObjCBlock_ffiVoid_NSTimer_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + +class ObjCBlock_ffiVoid_NSTimer extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSTimer._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSTimer castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSTimer._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSTimer.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSTimer_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSTimer.fromFunction(void Function(NSTimer) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSTimer_closureTrampoline) + .cast(), + (ffi.Pointer arg0) => fn( + NSTimer.castFromPointer(arg0, retain: true, release: true)))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSTimer.listener(void Function(NSTimer) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSTimer(objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSTimer_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0) => fn( + NSTimer.castFromPointer(arg0, retain: false, release: true))))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>? + _dartFuncListenerTrampoline; + + void call(NSTimer arg0) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(pointer, arg0.pointer); +} + +late final _sel_timerWithTimeInterval_repeats_block_ = + objc.registerName("timerWithTimeInterval:repeats:block:"); +final _objc_msgSend_122 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Bool, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + double, + bool, + ffi.Pointer)>(); +late final _sel_scheduledTimerWithTimeInterval_repeats_block_ = + objc.registerName("scheduledTimerWithTimeInterval:repeats:block:"); +late final _sel_initWithFireDate_interval_repeats_block_ = + objc.registerName("initWithFireDate:interval:repeats:block:"); +final _objc_msgSend_123 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Bool, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + double, + bool, + ffi.Pointer)>(); +late final _sel_initWithFireDate_interval_target_selector_userInfo_repeats_ = + objc.registerName( + "initWithFireDate:interval:target:selector:userInfo:repeats:"); +final _objc_msgSend_124 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_fire = objc.registerName("fire"); +late final _sel_fireDate = objc.registerName("fireDate"); +final _objc_msgSend_125 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setFireDate_ = objc.registerName("setFireDate:"); +final _objc_msgSend_126 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_timeInterval = objc.registerName("timeInterval"); +late final _sel_tolerance = objc.registerName("tolerance"); +late final _sel_setTolerance_ = objc.registerName("setTolerance:"); +final _objc_msgSend_127 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, double)>(); +late final _sel_invalidate = objc.registerName("invalidate"); +late final _sel_isValid = objc.registerName("isValid"); +late final _sel_addTimer_forMode_ = objc.registerName("addTimer:forMode:"); +final _objc_msgSend_128 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + +/// NSPort +class NSPort extends objc.NSObject { + NSPort._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSPort] that points to the same underlying object as [other]. + NSPort.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSPort] that wraps the given raw object pointer. + NSPort.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSPort]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0(obj.pointer, _sel_isKindOfClass_, _class_NSPort); + } + + /// port + static NSPort port() { + final _ret = _objc_msgSend_129(_class_NSPort, _sel_port); + return NSPort.castFromPointer(_ret, retain: true, release: true); + } + + /// invalidate + void invalidate() { + _objc_msgSend_7(this.pointer, _sel_invalidate); + } + + /// isValid + bool get valid { + return _objc_msgSend_13(this.pointer, _sel_isValid); + } + + /// setDelegate: + void setDelegate_(objc.ObjCObjectBase? anObject) { + _objc_msgSend_130( + this.pointer, _sel_setDelegate_, anObject?.pointer ?? ffi.nullptr); + } + + /// delegate + objc.ObjCObjectBase? delegate() { + final _ret = _objc_msgSend_84(this.pointer, _sel_delegate); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// scheduleInRunLoop:forMode: + void scheduleInRunLoop_forMode_(NSRunLoop runLoop, objc.NSString mode) { + _objc_msgSend_131(this.pointer, _sel_scheduleInRunLoop_forMode_, + runLoop.pointer, mode.pointer); + } + + /// removeFromRunLoop:forMode: + void removeFromRunLoop_forMode_(NSRunLoop runLoop, objc.NSString mode) { + _objc_msgSend_131(this.pointer, _sel_removeFromRunLoop_forMode_, + runLoop.pointer, mode.pointer); + } + + /// reservedSpaceLength + int get reservedSpaceLength { + return _objc_msgSend_56(this.pointer, _sel_reservedSpaceLength); + } + + /// sendBeforeDate:components:from:reserved: + bool sendBeforeDate_components_from_reserved_( + objc.NSDate limitDate, + objc.NSMutableArray? components, + NSPort? receivePort, + int headerSpaceReserved) { + return _objc_msgSend_132( + this.pointer, + _sel_sendBeforeDate_components_from_reserved_, + limitDate.pointer, + components?.pointer ?? ffi.nullptr, + receivePort?.pointer ?? ffi.nullptr, + headerSpaceReserved); + } + + /// sendBeforeDate:msgid:components:from:reserved: + bool sendBeforeDate_msgid_components_from_reserved_( + objc.NSDate limitDate, + int msgID, + objc.NSMutableArray? components, + NSPort? receivePort, + int headerSpaceReserved) { + return _objc_msgSend_133( + this.pointer, + _sel_sendBeforeDate_msgid_components_from_reserved_, + limitDate.pointer, + msgID, + components?.pointer ?? ffi.nullptr, + receivePort?.pointer ?? ffi.nullptr, + headerSpaceReserved); + } + + /// init + NSPort init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSPort.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSPort new1() { + final _ret = _objc_msgSend_19(_class_NSPort, _sel_new); + return NSPort.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSPort allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28(_class_NSPort, _sel_allocWithZone_, zone); + return NSPort.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSPort alloc() { + final _ret = _objc_msgSend_19(_class_NSPort, _sel_alloc); + return NSPort.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSPort, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSPort, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSPort, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSPort, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSPort, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31( + _class_NSPort, _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = + _objc_msgSend_32(_class_NSPort, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19(_class_NSPort, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSPort = objc.getClass("NSPort"); +late final _sel_port = objc.registerName("port"); +final _objc_msgSend_129 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setDelegate_ = objc.registerName("setDelegate:"); +final _objc_msgSend_130 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_delegate = objc.registerName("delegate"); +late final _sel_scheduleInRunLoop_forMode_ = + objc.registerName("scheduleInRunLoop:forMode:"); +final _objc_msgSend_131 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removeFromRunLoop_forMode_ = + objc.registerName("removeFromRunLoop:forMode:"); +late final _sel_reservedSpaceLength = objc.registerName("reservedSpaceLength"); +late final _sel_sendBeforeDate_components_from_reserved_ = + objc.registerName("sendBeforeDate:components:from:reserved:"); +final _objc_msgSend_132 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_sendBeforeDate_msgid_components_from_reserved_ = + objc.registerName("sendBeforeDate:msgid:components:from:reserved:"); +final _objc_msgSend_133 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_addPort_forMode_ = objc.registerName("addPort:forMode:"); +final _objc_msgSend_134 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removePort_forMode_ = objc.registerName("removePort:forMode:"); +late final _sel_limitDateForMode_ = objc.registerName("limitDateForMode:"); +final _objc_msgSend_135 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_acceptInputForMode_beforeDate_ = + objc.registerName("acceptInputForMode:beforeDate:"); +final _objc_msgSend_136 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_run = objc.registerName("run"); +late final _sel_runUntilDate_ = objc.registerName("runUntilDate:"); +final _objc_msgSend_137 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_runMode_beforeDate_ = objc.registerName("runMode:beforeDate:"); +final _objc_msgSend_138 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_performInModes_block_ = + objc.registerName("performInModes:block:"); +final _objc_msgSend_139 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_performBlock_ = objc.registerName("performBlock:"); +final _objc_msgSend_140 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_performSelector_target_argument_order_modes_ = + objc.registerName("performSelector:target:argument:order:modes:"); +final _objc_msgSend_141 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_cancelPerformSelector_target_argument_ = + objc.registerName("cancelPerformSelector:target:argument:"); +final _objc_msgSend_142 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_cancelPerformSelectorsWithTarget_ = + objc.registerName("cancelPerformSelectorsWithTarget:"); + +/// NSFileHandle +class NSFileHandle extends objc.NSObject { + NSFileHandle._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSFileHandle] that points to the same underlying object as [other]. + NSFileHandle.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSFileHandle] that wraps the given raw object pointer. + NSFileHandle.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSFileHandle]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSFileHandle); + } + + /// availableData + objc.NSData get availableData { + final _ret = _objc_msgSend_143(this.pointer, _sel_availableData); + return objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithFileDescriptor:closeOnDealloc: + NSFileHandle initWithFileDescriptor_closeOnDealloc_(int fd, bool closeopt) { + final _ret = _objc_msgSend_144(this.pointer, + _sel_initWithFileDescriptor_closeOnDealloc_, fd, closeopt); + return NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithCoder: + NSFileHandle? initWithCoder_(objc.NSCoder coder) { + final _ret = + _objc_msgSend_145(this.pointer, _sel_initWithCoder_, coder.pointer); + return _ret.address == 0 + ? null + : NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// readDataToEndOfFileAndReturnError: + objc.NSData? readDataToEndOfFileAndReturnError_( + ffi.Pointer> error) { + final _ret = _objc_msgSend_146( + this.pointer, _sel_readDataToEndOfFileAndReturnError_, error); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// readDataUpToLength:error: + objc.NSData? readDataUpToLength_error_( + int length, ffi.Pointer> error) { + final _ret = _objc_msgSend_147( + this.pointer, _sel_readDataUpToLength_error_, length, error); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// writeData:error: + bool writeData_error_( + objc.NSData data, ffi.Pointer> error) { + return _objc_msgSend_148( + this.pointer, _sel_writeData_error_, data.pointer, error); + } + + /// getOffset:error: + bool getOffset_error_(ffi.Pointer offsetInFile, + ffi.Pointer> error) { + return _objc_msgSend_149( + this.pointer, _sel_getOffset_error_, offsetInFile, error); + } + + /// seekToEndReturningOffset:error: + bool seekToEndReturningOffset_error_( + ffi.Pointer offsetInFile, + ffi.Pointer> error) { + return _objc_msgSend_149(this.pointer, _sel_seekToEndReturningOffset_error_, + offsetInFile, error); + } + + /// seekToOffset:error: + bool seekToOffset_error_( + int offset, ffi.Pointer> error) { + return _objc_msgSend_150( + this.pointer, _sel_seekToOffset_error_, offset, error); + } + + /// truncateAtOffset:error: + bool truncateAtOffset_error_( + int offset, ffi.Pointer> error) { + return _objc_msgSend_150( + this.pointer, _sel_truncateAtOffset_error_, offset, error); + } + + /// synchronizeAndReturnError: + bool synchronizeAndReturnError_( + ffi.Pointer> error) { + return _objc_msgSend_38( + this.pointer, _sel_synchronizeAndReturnError_, error); + } + + /// closeAndReturnError: + bool closeAndReturnError_(ffi.Pointer> error) { + return _objc_msgSend_38(this.pointer, _sel_closeAndReturnError_, error); + } + + /// fileHandleWithStandardInput + static NSFileHandle getFileHandleWithStandardInput() { + final _ret = _objc_msgSend_151( + _class_NSFileHandle, _sel_fileHandleWithStandardInput); + return NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// fileHandleWithStandardOutput + static NSFileHandle getFileHandleWithStandardOutput() { + final _ret = _objc_msgSend_151( + _class_NSFileHandle, _sel_fileHandleWithStandardOutput); + return NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// fileHandleWithStandardError + static NSFileHandle getFileHandleWithStandardError() { + final _ret = _objc_msgSend_151( + _class_NSFileHandle, _sel_fileHandleWithStandardError); + return NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// fileHandleWithNullDevice + static NSFileHandle getFileHandleWithNullDevice() { + final _ret = + _objc_msgSend_151(_class_NSFileHandle, _sel_fileHandleWithNullDevice); + return NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// fileHandleForReadingAtPath: + static NSFileHandle? fileHandleForReadingAtPath_(objc.NSString path) { + final _ret = _objc_msgSend_34( + _class_NSFileHandle, _sel_fileHandleForReadingAtPath_, path.pointer); + return _ret.address == 0 + ? null + : NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// fileHandleForWritingAtPath: + static NSFileHandle? fileHandleForWritingAtPath_(objc.NSString path) { + final _ret = _objc_msgSend_34( + _class_NSFileHandle, _sel_fileHandleForWritingAtPath_, path.pointer); + return _ret.address == 0 + ? null + : NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// fileHandleForUpdatingAtPath: + static NSFileHandle? fileHandleForUpdatingAtPath_(objc.NSString path) { + final _ret = _objc_msgSend_34( + _class_NSFileHandle, _sel_fileHandleForUpdatingAtPath_, path.pointer); + return _ret.address == 0 + ? null + : NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// fileHandleForReadingFromURL:error: + static NSFileHandle? fileHandleForReadingFromURL_error_( + objc.NSURL url, ffi.Pointer> error) { + final _ret = _objc_msgSend_152(_class_NSFileHandle, + _sel_fileHandleForReadingFromURL_error_, url.pointer, error); + return _ret.address == 0 + ? null + : NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// fileHandleForWritingToURL:error: + static NSFileHandle? fileHandleForWritingToURL_error_( + objc.NSURL url, ffi.Pointer> error) { + final _ret = _objc_msgSend_152(_class_NSFileHandle, + _sel_fileHandleForWritingToURL_error_, url.pointer, error); + return _ret.address == 0 + ? null + : NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// fileHandleForUpdatingURL:error: + static NSFileHandle? fileHandleForUpdatingURL_error_( + objc.NSURL url, ffi.Pointer> error) { + final _ret = _objc_msgSend_152(_class_NSFileHandle, + _sel_fileHandleForUpdatingURL_error_, url.pointer, error); + return _ret.address == 0 + ? null + : NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// readInBackgroundAndNotifyForModes: + void readInBackgroundAndNotifyForModes_(objc.NSArray? modes) { + _objc_msgSend_153(this.pointer, _sel_readInBackgroundAndNotifyForModes_, + modes?.pointer ?? ffi.nullptr); + } + + /// readInBackgroundAndNotify + void readInBackgroundAndNotify() { + _objc_msgSend_7(this.pointer, _sel_readInBackgroundAndNotify); + } + + /// readToEndOfFileInBackgroundAndNotifyForModes: + void readToEndOfFileInBackgroundAndNotifyForModes_(objc.NSArray? modes) { + _objc_msgSend_153( + this.pointer, + _sel_readToEndOfFileInBackgroundAndNotifyForModes_, + modes?.pointer ?? ffi.nullptr); + } + + /// readToEndOfFileInBackgroundAndNotify + void readToEndOfFileInBackgroundAndNotify() { + _objc_msgSend_7(this.pointer, _sel_readToEndOfFileInBackgroundAndNotify); + } + + /// acceptConnectionInBackgroundAndNotifyForModes: + void acceptConnectionInBackgroundAndNotifyForModes_(objc.NSArray? modes) { + _objc_msgSend_153( + this.pointer, + _sel_acceptConnectionInBackgroundAndNotifyForModes_, + modes?.pointer ?? ffi.nullptr); + } + + /// acceptConnectionInBackgroundAndNotify + void acceptConnectionInBackgroundAndNotify() { + _objc_msgSend_7(this.pointer, _sel_acceptConnectionInBackgroundAndNotify); + } + + /// waitForDataInBackgroundAndNotifyForModes: + void waitForDataInBackgroundAndNotifyForModes_(objc.NSArray? modes) { + _objc_msgSend_153( + this.pointer, + _sel_waitForDataInBackgroundAndNotifyForModes_, + modes?.pointer ?? ffi.nullptr); + } + + /// waitForDataInBackgroundAndNotify + void waitForDataInBackgroundAndNotify() { + _objc_msgSend_7(this.pointer, _sel_waitForDataInBackgroundAndNotify); + } + + /// readabilityHandler + ObjCBlock_ffiVoid_NSFileHandle? get readabilityHandler { + final _ret = _objc_msgSend_154(this.pointer, _sel_readabilityHandler); + return _ret.address == 0 + ? null + : ObjCBlock_ffiVoid_NSFileHandle.castFromPointer(_ret, + retain: true, release: true); + } + + /// setReadabilityHandler: + set readabilityHandler(ObjCBlock_ffiVoid_NSFileHandle? value) { + return _objc_msgSend_155(this.pointer, _sel_setReadabilityHandler_, + value?.pointer ?? ffi.nullptr); + } + + /// writeabilityHandler + ObjCBlock_ffiVoid_NSFileHandle? get writeabilityHandler { + final _ret = _objc_msgSend_154(this.pointer, _sel_writeabilityHandler); + return _ret.address == 0 + ? null + : ObjCBlock_ffiVoid_NSFileHandle.castFromPointer(_ret, + retain: true, release: true); + } + + /// setWriteabilityHandler: + set writeabilityHandler(ObjCBlock_ffiVoid_NSFileHandle? value) { + return _objc_msgSend_155(this.pointer, _sel_setWriteabilityHandler_, + value?.pointer ?? ffi.nullptr); + } + + /// initWithFileDescriptor: + NSFileHandle initWithFileDescriptor_(int fd) { + final _ret = + _objc_msgSend_156(this.pointer, _sel_initWithFileDescriptor_, fd); + return NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// fileDescriptor + int get fileDescriptor { + return _objc_msgSend_157(this.pointer, _sel_fileDescriptor); + } + + /// readDataToEndOfFile + objc.NSData readDataToEndOfFile() { + final _ret = _objc_msgSend_143(this.pointer, _sel_readDataToEndOfFile); + return objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// readDataOfLength: + objc.NSData readDataOfLength_(int length) { + final _ret = + _objc_msgSend_158(this.pointer, _sel_readDataOfLength_, length); + return objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// writeData: + void writeData_(objc.NSData data) { + _objc_msgSend_159(this.pointer, _sel_writeData_, data.pointer); + } + + /// offsetInFile + int get offsetInFile { + return _objc_msgSend_160(this.pointer, _sel_offsetInFile); + } + + /// seekToEndOfFile + int seekToEndOfFile() { + return _objc_msgSend_160(this.pointer, _sel_seekToEndOfFile); + } + + /// seekToFileOffset: + void seekToFileOffset_(int offset) { + _objc_msgSend_161(this.pointer, _sel_seekToFileOffset_, offset); + } + + /// truncateFileAtOffset: + void truncateFileAtOffset_(int offset) { + _objc_msgSend_161(this.pointer, _sel_truncateFileAtOffset_, offset); + } + + /// synchronizeFile + void synchronizeFile() { + _objc_msgSend_7(this.pointer, _sel_synchronizeFile); + } + + /// closeFile + void closeFile() { + _objc_msgSend_7(this.pointer, _sel_closeFile); + } + + /// init + NSFileHandle init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSFileHandle.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSFileHandle new1() { + final _ret = _objc_msgSend_19(_class_NSFileHandle, _sel_new); + return NSFileHandle.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSFileHandle allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSFileHandle, _sel_allocWithZone_, zone); + return NSFileHandle.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSFileHandle alloc() { + final _ret = _objc_msgSend_19(_class_NSFileHandle, _sel_alloc); + return NSFileHandle.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSFileHandle, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSFileHandle, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSFileHandle, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSFileHandle, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSFileHandle, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSFileHandle, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSFileHandle, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSFileHandle, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSFileHandle = objc.getClass("NSFileHandle"); +late final _sel_availableData = objc.registerName("availableData"); +final _objc_msgSend_143 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithFileDescriptor_closeOnDealloc_ = + objc.registerName("initWithFileDescriptor:closeOnDealloc:"); +final _objc_msgSend_144 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Int, ffi.Bool)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, int, bool)>(); +late final _sel_initWithCoder_ = objc.registerName("initWithCoder:"); +final _objc_msgSend_145 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_readDataToEndOfFileAndReturnError_ = + objc.registerName("readDataToEndOfFileAndReturnError:"); +final _objc_msgSend_146 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_readDataUpToLength_error_ = + objc.registerName("readDataUpToLength:error:"); +final _objc_msgSend_147 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); +late final _sel_writeData_error_ = objc.registerName("writeData:error:"); +final _objc_msgSend_148 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_getOffset_error_ = objc.registerName("getOffset:error:"); +final _objc_msgSend_149 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_seekToEndReturningOffset_error_ = + objc.registerName("seekToEndReturningOffset:error:"); +late final _sel_seekToOffset_error_ = objc.registerName("seekToOffset:error:"); +final _objc_msgSend_150 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLongLong, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); +late final _sel_truncateAtOffset_error_ = + objc.registerName("truncateAtOffset:error:"); +late final _sel_synchronizeAndReturnError_ = + objc.registerName("synchronizeAndReturnError:"); +late final _sel_closeAndReturnError_ = + objc.registerName("closeAndReturnError:"); +late final _sel_fileHandleWithStandardInput = + objc.registerName("fileHandleWithStandardInput"); +final _objc_msgSend_151 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_fileHandleWithStandardOutput = + objc.registerName("fileHandleWithStandardOutput"); +late final _sel_fileHandleWithStandardError = + objc.registerName("fileHandleWithStandardError"); +late final _sel_fileHandleWithNullDevice = + objc.registerName("fileHandleWithNullDevice"); +late final _sel_fileHandleForReadingAtPath_ = + objc.registerName("fileHandleForReadingAtPath:"); +late final _sel_fileHandleForWritingAtPath_ = + objc.registerName("fileHandleForWritingAtPath:"); +late final _sel_fileHandleForUpdatingAtPath_ = + objc.registerName("fileHandleForUpdatingAtPath:"); +late final _sel_fileHandleForReadingFromURL_error_ = + objc.registerName("fileHandleForReadingFromURL:error:"); +final _objc_msgSend_152 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_fileHandleForWritingToURL_error_ = + objc.registerName("fileHandleForWritingToURL:error:"); +late final _sel_fileHandleForUpdatingURL_error_ = + objc.registerName("fileHandleForUpdatingURL:error:"); +late final _sel_readInBackgroundAndNotifyForModes_ = + objc.registerName("readInBackgroundAndNotifyForModes:"); +final _objc_msgSend_153 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_readInBackgroundAndNotify = + objc.registerName("readInBackgroundAndNotify"); +late final _sel_readToEndOfFileInBackgroundAndNotifyForModes_ = + objc.registerName("readToEndOfFileInBackgroundAndNotifyForModes:"); +late final _sel_readToEndOfFileInBackgroundAndNotify = + objc.registerName("readToEndOfFileInBackgroundAndNotify"); +late final _sel_acceptConnectionInBackgroundAndNotifyForModes_ = + objc.registerName("acceptConnectionInBackgroundAndNotifyForModes:"); +late final _sel_acceptConnectionInBackgroundAndNotify = + objc.registerName("acceptConnectionInBackgroundAndNotify"); +late final _sel_waitForDataInBackgroundAndNotifyForModes_ = + objc.registerName("waitForDataInBackgroundAndNotifyForModes:"); +late final _sel_waitForDataInBackgroundAndNotify = + objc.registerName("waitForDataInBackgroundAndNotify"); +void _ObjCBlock_ffiVoid_NSFileHandle_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +void _ObjCBlock_ffiVoid_NSFileHandle_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + +class ObjCBlock_ffiVoid_NSFileHandle extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSFileHandle._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSFileHandle castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSFileHandle._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSFileHandle.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSFileHandle_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSFileHandle.fromFunction(void Function(NSFileHandle) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSFileHandle_closureTrampoline) + .cast(), + (ffi.Pointer arg0) => fn( + NSFileHandle.castFromPointer(arg0, + retain: true, release: true)))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSFileHandle.listener(void Function(NSFileHandle) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSFileHandle( + objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSFileHandle_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0) => fn( + NSFileHandle.castFromPointer(arg0, + retain: false, release: true))))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>? + _dartFuncListenerTrampoline; + + void call(NSFileHandle arg0) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(pointer, arg0.pointer); +} + +late final _sel_readabilityHandler = objc.registerName("readabilityHandler"); +final _objc_msgSend_154 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setReadabilityHandler_ = + objc.registerName("setReadabilityHandler:"); +final _objc_msgSend_155 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_writeabilityHandler = objc.registerName("writeabilityHandler"); +late final _sel_setWriteabilityHandler_ = + objc.registerName("setWriteabilityHandler:"); +late final _sel_initWithFileDescriptor_ = + objc.registerName("initWithFileDescriptor:"); +final _objc_msgSend_156 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_fileDescriptor = objc.registerName("fileDescriptor"); +final _objc_msgSend_157 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_readDataToEndOfFile = objc.registerName("readDataToEndOfFile"); +late final _sel_readDataOfLength_ = objc.registerName("readDataOfLength:"); +final _objc_msgSend_158 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_writeData_ = objc.registerName("writeData:"); +final _objc_msgSend_159 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_offsetInFile = objc.registerName("offsetInFile"); +final _objc_msgSend_160 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLongLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_seekToEndOfFile = objc.registerName("seekToEndOfFile"); +late final _sel_seekToFileOffset_ = objc.registerName("seekToFileOffset:"); +final _objc_msgSend_161 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLongLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_truncateFileAtOffset_ = + objc.registerName("truncateFileAtOffset:"); +late final _sel_synchronizeFile = objc.registerName("synchronizeFile"); +late final _sel_closeFile = objc.registerName("closeFile"); + +/// NSFileManager +class NSFileManager extends objc.NSObject { + NSFileManager._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSFileManager] that points to the same underlying object as [other]. + NSFileManager.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSFileManager] that wraps the given raw object pointer. + NSFileManager.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSFileManager]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSFileManager); + } + + /// defaultManager + static NSFileManager getDefaultManager() { + final _ret = _objc_msgSend_162(_class_NSFileManager, _sel_defaultManager); + return NSFileManager.castFromPointer(_ret, retain: true, release: true); + } + + /// mountedVolumeURLsIncludingResourceValuesForKeys:options: + objc.NSArray? mountedVolumeURLsIncludingResourceValuesForKeys_options_( + objc.NSArray? propertyKeys, NSVolumeEnumerationOptions options) { + final _ret = _objc_msgSend_163( + this.pointer, + _sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_, + propertyKeys?.pointer ?? ffi.nullptr, + options.value); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// unmountVolumeAtURL:options:completionHandler: + void unmountVolumeAtURL_options_completionHandler_( + objc.NSURL url, + NSFileManagerUnmountOptions mask, + ObjCBlock_ffiVoid_NSError completionHandler) { + _objc_msgSend_164( + this.pointer, + _sel_unmountVolumeAtURL_options_completionHandler_, + url.pointer, + mask.value, + completionHandler.pointer); + } + + /// contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error: + objc.NSArray? + contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_( + objc.NSURL url, + objc.NSArray? keys, + NSDirectoryEnumerationOptions mask, + ffi.Pointer> error) { + final _ret = _objc_msgSend_165( + this.pointer, + _sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_, + url.pointer, + keys?.pointer ?? ffi.nullptr, + mask.value, + error); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// URLsForDirectory:inDomains: + objc.NSArray URLsForDirectory_inDomains_( + NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask) { + final _ret = _objc_msgSend_166(this.pointer, + _sel_URLsForDirectory_inDomains_, directory.value, domainMask.value); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// URLForDirectory:inDomain:appropriateForURL:create:error: + objc.NSURL? URLForDirectory_inDomain_appropriateForURL_create_error_( + NSSearchPathDirectory directory, + NSSearchPathDomainMask domain, + objc.NSURL? url, + bool shouldCreate, + ffi.Pointer> error) { + final _ret = _objc_msgSend_167( + this.pointer, + _sel_URLForDirectory_inDomain_appropriateForURL_create_error_, + directory.value, + domain.value, + url?.pointer ?? ffi.nullptr, + shouldCreate, + error); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// getRelationship:ofDirectoryAtURL:toItemAtURL:error: + bool getRelationship_ofDirectoryAtURL_toItemAtURL_error_( + ffi.Pointer outRelationship, + objc.NSURL directoryURL, + objc.NSURL otherURL, + ffi.Pointer> error) { + return _objc_msgSend_168( + this.pointer, + _sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_, + outRelationship, + directoryURL.pointer, + otherURL.pointer, + error); + } + + /// getRelationship:ofDirectory:inDomain:toItemAtURL:error: + bool getRelationship_ofDirectory_inDomain_toItemAtURL_error_( + ffi.Pointer outRelationship, + NSSearchPathDirectory directory, + NSSearchPathDomainMask domainMask, + objc.NSURL url, + ffi.Pointer> error) { + return _objc_msgSend_169( + this.pointer, + _sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_, + outRelationship, + directory.value, + domainMask.value, + url.pointer, + error); + } + + /// createDirectoryAtURL:withIntermediateDirectories:attributes:error: + bool createDirectoryAtURL_withIntermediateDirectories_attributes_error_( + objc.NSURL url, + bool createIntermediates, + objc.NSDictionary? attributes, + ffi.Pointer> error) { + return _objc_msgSend_170( + this.pointer, + _sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_, + url.pointer, + createIntermediates, + attributes?.pointer ?? ffi.nullptr, + error); + } + + /// createSymbolicLinkAtURL:withDestinationURL:error: + bool createSymbolicLinkAtURL_withDestinationURL_error_(objc.NSURL url, + objc.NSURL destURL, ffi.Pointer> error) { + return _objc_msgSend_171( + this.pointer, + _sel_createSymbolicLinkAtURL_withDestinationURL_error_, + url.pointer, + destURL.pointer, + error); + } + + /// delegate + objc.ObjCObjectBase? get delegate { + final _ret = _objc_msgSend_84(this.pointer, _sel_delegate); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// setDelegate: + set delegate(objc.ObjCObjectBase? value) { + return _objc_msgSend_103( + this.pointer, _sel_setDelegate_, value?.pointer ?? ffi.nullptr); + } + + /// setAttributes:ofItemAtPath:error: + bool setAttributes_ofItemAtPath_error_(objc.NSDictionary attributes, + objc.NSString path, ffi.Pointer> error) { + return _objc_msgSend_172( + this.pointer, + _sel_setAttributes_ofItemAtPath_error_, + attributes.pointer, + path.pointer, + error); + } + + /// createDirectoryAtPath:withIntermediateDirectories:attributes:error: + bool createDirectoryAtPath_withIntermediateDirectories_attributes_error_( + objc.NSString path, + bool createIntermediates, + objc.NSDictionary? attributes, + ffi.Pointer> error) { + return _objc_msgSend_173( + this.pointer, + _sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_, + path.pointer, + createIntermediates, + attributes?.pointer ?? ffi.nullptr, + error); + } + + /// contentsOfDirectoryAtPath:error: + objc.NSArray? contentsOfDirectoryAtPath_error_( + objc.NSString path, ffi.Pointer> error) { + final _ret = _objc_msgSend_174(this.pointer, + _sel_contentsOfDirectoryAtPath_error_, path.pointer, error); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// subpathsOfDirectoryAtPath:error: + objc.NSArray? subpathsOfDirectoryAtPath_error_( + objc.NSString path, ffi.Pointer> error) { + final _ret = _objc_msgSend_174(this.pointer, + _sel_subpathsOfDirectoryAtPath_error_, path.pointer, error); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// attributesOfItemAtPath:error: + objc.NSDictionary? attributesOfItemAtPath_error_( + objc.NSString path, ffi.Pointer> error) { + final _ret = _objc_msgSend_175( + this.pointer, _sel_attributesOfItemAtPath_error_, path.pointer, error); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// attributesOfFileSystemForPath:error: + objc.NSDictionary? attributesOfFileSystemForPath_error_( + objc.NSString path, ffi.Pointer> error) { + final _ret = _objc_msgSend_175(this.pointer, + _sel_attributesOfFileSystemForPath_error_, path.pointer, error); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// createSymbolicLinkAtPath:withDestinationPath:error: + bool createSymbolicLinkAtPath_withDestinationPath_error_(objc.NSString path, + objc.NSString destPath, ffi.Pointer> error) { + return _objc_msgSend_176( + this.pointer, + _sel_createSymbolicLinkAtPath_withDestinationPath_error_, + path.pointer, + destPath.pointer, + error); + } + + /// destinationOfSymbolicLinkAtPath:error: + objc.NSString? destinationOfSymbolicLinkAtPath_error_( + objc.NSString path, ffi.Pointer> error) { + final _ret = _objc_msgSend_177(this.pointer, + _sel_destinationOfSymbolicLinkAtPath_error_, path.pointer, error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// copyItemAtPath:toPath:error: + bool copyItemAtPath_toPath_error_(objc.NSString srcPath, + objc.NSString dstPath, ffi.Pointer> error) { + return _objc_msgSend_176(this.pointer, _sel_copyItemAtPath_toPath_error_, + srcPath.pointer, dstPath.pointer, error); + } + + /// moveItemAtPath:toPath:error: + bool moveItemAtPath_toPath_error_(objc.NSString srcPath, + objc.NSString dstPath, ffi.Pointer> error) { + return _objc_msgSend_176(this.pointer, _sel_moveItemAtPath_toPath_error_, + srcPath.pointer, dstPath.pointer, error); + } + + /// linkItemAtPath:toPath:error: + bool linkItemAtPath_toPath_error_(objc.NSString srcPath, + objc.NSString dstPath, ffi.Pointer> error) { + return _objc_msgSend_176(this.pointer, _sel_linkItemAtPath_toPath_error_, + srcPath.pointer, dstPath.pointer, error); + } + + /// removeItemAtPath:error: + bool removeItemAtPath_error_( + objc.NSString path, ffi.Pointer> error) { + return _objc_msgSend_178( + this.pointer, _sel_removeItemAtPath_error_, path.pointer, error); + } + + /// copyItemAtURL:toURL:error: + bool copyItemAtURL_toURL_error_(objc.NSURL srcURL, objc.NSURL dstURL, + ffi.Pointer> error) { + return _objc_msgSend_171(this.pointer, _sel_copyItemAtURL_toURL_error_, + srcURL.pointer, dstURL.pointer, error); + } + + /// moveItemAtURL:toURL:error: + bool moveItemAtURL_toURL_error_(objc.NSURL srcURL, objc.NSURL dstURL, + ffi.Pointer> error) { + return _objc_msgSend_171(this.pointer, _sel_moveItemAtURL_toURL_error_, + srcURL.pointer, dstURL.pointer, error); + } + + /// linkItemAtURL:toURL:error: + bool linkItemAtURL_toURL_error_(objc.NSURL srcURL, objc.NSURL dstURL, + ffi.Pointer> error) { + return _objc_msgSend_171(this.pointer, _sel_linkItemAtURL_toURL_error_, + srcURL.pointer, dstURL.pointer, error); + } + + /// removeItemAtURL:error: + bool removeItemAtURL_error_( + objc.NSURL URL, ffi.Pointer> error) { + return _objc_msgSend_179( + this.pointer, _sel_removeItemAtURL_error_, URL.pointer, error); + } + + /// trashItemAtURL:resultingItemURL:error: + bool trashItemAtURL_resultingItemURL_error_( + objc.NSURL url, + ffi.Pointer> outResultingURL, + ffi.Pointer> error) { + return _objc_msgSend_180( + this.pointer, + _sel_trashItemAtURL_resultingItemURL_error_, + url.pointer, + outResultingURL, + error); + } + + /// fileAttributesAtPath:traverseLink: + objc.NSDictionary? fileAttributesAtPath_traverseLink_( + objc.NSString path, bool yorn) { + final _ret = _objc_msgSend_181(this.pointer, + _sel_fileAttributesAtPath_traverseLink_, path.pointer, yorn); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// changeFileAttributes:atPath: + bool changeFileAttributes_atPath_( + objc.NSDictionary attributes, objc.NSString path) { + return _objc_msgSend_182(this.pointer, _sel_changeFileAttributes_atPath_, + attributes.pointer, path.pointer); + } + + /// directoryContentsAtPath: + objc.NSArray? directoryContentsAtPath_(objc.NSString path) { + final _ret = _objc_msgSend_183( + this.pointer, _sel_directoryContentsAtPath_, path.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// fileSystemAttributesAtPath: + objc.NSDictionary? fileSystemAttributesAtPath_(objc.NSString path) { + final _ret = _objc_msgSend_184( + this.pointer, _sel_fileSystemAttributesAtPath_, path.pointer); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// pathContentOfSymbolicLinkAtPath: + objc.NSString? pathContentOfSymbolicLinkAtPath_(objc.NSString path) { + final _ret = _objc_msgSend_41( + this.pointer, _sel_pathContentOfSymbolicLinkAtPath_, path.pointer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// createSymbolicLinkAtPath:pathContent: + bool createSymbolicLinkAtPath_pathContent_( + objc.NSString path, objc.NSString otherpath) { + return _objc_msgSend_185( + this.pointer, + _sel_createSymbolicLinkAtPath_pathContent_, + path.pointer, + otherpath.pointer); + } + + /// createDirectoryAtPath:attributes: + bool createDirectoryAtPath_attributes_( + objc.NSString path, objc.NSDictionary attributes) { + return _objc_msgSend_186( + this.pointer, + _sel_createDirectoryAtPath_attributes_, + path.pointer, + attributes.pointer); + } + + /// currentDirectoryPath + objc.NSString get currentDirectoryPath { + final _ret = _objc_msgSend_11(this.pointer, _sel_currentDirectoryPath); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// changeCurrentDirectoryPath: + bool changeCurrentDirectoryPath_(objc.NSString path) { + return _objc_msgSend_31( + this.pointer, _sel_changeCurrentDirectoryPath_, path.pointer); + } + + /// fileExistsAtPath: + bool fileExistsAtPath_(objc.NSString path) { + return _objc_msgSend_31(this.pointer, _sel_fileExistsAtPath_, path.pointer); + } + + /// fileExistsAtPath:isDirectory: + bool fileExistsAtPath_isDirectory_( + objc.NSString path, ffi.Pointer isDirectory) { + return _objc_msgSend_187(this.pointer, _sel_fileExistsAtPath_isDirectory_, + path.pointer, isDirectory); + } + + /// isReadableFileAtPath: + bool isReadableFileAtPath_(objc.NSString path) { + return _objc_msgSend_31( + this.pointer, _sel_isReadableFileAtPath_, path.pointer); + } + + /// isWritableFileAtPath: + bool isWritableFileAtPath_(objc.NSString path) { + return _objc_msgSend_31( + this.pointer, _sel_isWritableFileAtPath_, path.pointer); + } + + /// isExecutableFileAtPath: + bool isExecutableFileAtPath_(objc.NSString path) { + return _objc_msgSend_31( + this.pointer, _sel_isExecutableFileAtPath_, path.pointer); + } + + /// isDeletableFileAtPath: + bool isDeletableFileAtPath_(objc.NSString path) { + return _objc_msgSend_31( + this.pointer, _sel_isDeletableFileAtPath_, path.pointer); + } + + /// contentsEqualAtPath:andPath: + bool contentsEqualAtPath_andPath_(objc.NSString path1, objc.NSString path2) { + return _objc_msgSend_185(this.pointer, _sel_contentsEqualAtPath_andPath_, + path1.pointer, path2.pointer); + } + + /// displayNameAtPath: + objc.NSString displayNameAtPath_(objc.NSString path) { + final _ret = + _objc_msgSend_188(this.pointer, _sel_displayNameAtPath_, path.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// componentsToDisplayForPath: + objc.NSArray? componentsToDisplayForPath_(objc.NSString path) { + final _ret = _objc_msgSend_183( + this.pointer, _sel_componentsToDisplayForPath_, path.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// enumeratorAtPath: + objc.ObjCObjectBase? enumeratorAtPath_(objc.NSString path) { + final _ret = + _objc_msgSend_34(this.pointer, _sel_enumeratorAtPath_, path.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: + objc.ObjCObjectBase? + enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_( + objc.NSURL url, + objc.NSArray? keys, + NSDirectoryEnumerationOptions mask, + ObjCBlock_bool_NSURL_NSError? handler) { + final _ret = _objc_msgSend_189( + this.pointer, + _sel_enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_, + url.pointer, + keys?.pointer ?? ffi.nullptr, + mask.value, + handler?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// subpathsAtPath: + objc.NSArray? subpathsAtPath_(objc.NSString path) { + final _ret = + _objc_msgSend_183(this.pointer, _sel_subpathsAtPath_, path.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// contentsAtPath: + objc.NSData? contentsAtPath_(objc.NSString path) { + final _ret = + _objc_msgSend_190(this.pointer, _sel_contentsAtPath_, path.pointer); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// createFileAtPath:contents:attributes: + bool createFileAtPath_contents_attributes_( + objc.NSString path, objc.NSData? data, objc.NSDictionary? attr) { + return _objc_msgSend_191( + this.pointer, + _sel_createFileAtPath_contents_attributes_, + path.pointer, + data?.pointer ?? ffi.nullptr, + attr?.pointer ?? ffi.nullptr); + } + + /// fileSystemRepresentationWithPath: + ffi.Pointer fileSystemRepresentationWithPath_(objc.NSString path) { + return _objc_msgSend_192( + this.pointer, _sel_fileSystemRepresentationWithPath_, path.pointer); + } + + /// stringWithFileSystemRepresentation:length: + objc.NSString stringWithFileSystemRepresentation_length_( + ffi.Pointer str, int len) { + final _ret = _objc_msgSend_193(this.pointer, + _sel_stringWithFileSystemRepresentation_length_, str, len); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: + bool + replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_( + objc.NSURL originalItemURL, + objc.NSURL newItemURL, + objc.NSString? backupItemName, + NSFileManagerItemReplacementOptions options, + ffi.Pointer> resultingURL, + ffi.Pointer> error) { + return _objc_msgSend_194( + this.pointer, + _sel_replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_, + originalItemURL.pointer, + newItemURL.pointer, + backupItemName?.pointer ?? ffi.nullptr, + options.value, + resultingURL, + error); + } + + /// setUbiquitous:itemAtURL:destinationURL:error: + bool setUbiquitous_itemAtURL_destinationURL_error_( + bool flag, + objc.NSURL url, + objc.NSURL destinationURL, + ffi.Pointer> error) { + return _objc_msgSend_195( + this.pointer, + _sel_setUbiquitous_itemAtURL_destinationURL_error_, + flag, + url.pointer, + destinationURL.pointer, + error); + } + + /// isUbiquitousItemAtURL: + bool isUbiquitousItemAtURL_(objc.NSURL url) { + return _objc_msgSend_196( + this.pointer, _sel_isUbiquitousItemAtURL_, url.pointer); + } + + /// startDownloadingUbiquitousItemAtURL:error: + bool startDownloadingUbiquitousItemAtURL_error_( + objc.NSURL url, ffi.Pointer> error) { + return _objc_msgSend_179(this.pointer, + _sel_startDownloadingUbiquitousItemAtURL_error_, url.pointer, error); + } + + /// evictUbiquitousItemAtURL:error: + bool evictUbiquitousItemAtURL_error_( + objc.NSURL url, ffi.Pointer> error) { + return _objc_msgSend_179( + this.pointer, _sel_evictUbiquitousItemAtURL_error_, url.pointer, error); + } + + /// URLForUbiquityContainerIdentifier: + objc.NSURL? URLForUbiquityContainerIdentifier_( + objc.NSString? containerIdentifier) { + final _ret = _objc_msgSend_197( + this.pointer, + _sel_URLForUbiquityContainerIdentifier_, + containerIdentifier?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLForPublishingUbiquitousItemAtURL:expirationDate:error: + objc.NSURL? URLForPublishingUbiquitousItemAtURL_expirationDate_error_( + objc.NSURL url, + ffi.Pointer> outDate, + ffi.Pointer> error) { + final _ret = _objc_msgSend_198( + this.pointer, + _sel_URLForPublishingUbiquitousItemAtURL_expirationDate_error_, + url.pointer, + outDate, + error); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// ubiquityIdentityToken + objc.ObjCObjectBase? get ubiquityIdentityToken { + final _ret = _objc_msgSend_84(this.pointer, _sel_ubiquityIdentityToken); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// getFileProviderServicesForItemAtURL:completionHandler: + void getFileProviderServicesForItemAtURL_completionHandler_(objc.NSURL url, + ObjCBlock_ffiVoid_NSDictionary_NSError completionHandler) { + _objc_msgSend_199( + this.pointer, + _sel_getFileProviderServicesForItemAtURL_completionHandler_, + url.pointer, + completionHandler.pointer); + } + + /// containerURLForSecurityApplicationGroupIdentifier: + objc.NSURL? containerURLForSecurityApplicationGroupIdentifier_( + objc.NSString groupIdentifier) { + final _ret = _objc_msgSend_40( + this.pointer, + _sel_containerURLForSecurityApplicationGroupIdentifier_, + groupIdentifier.pointer); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// homeDirectoryForCurrentUser + objc.NSURL get homeDirectoryForCurrentUser { + final _ret = + _objc_msgSend_39(this.pointer, _sel_homeDirectoryForCurrentUser); + return objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// temporaryDirectory + objc.NSURL get temporaryDirectory { + final _ret = _objc_msgSend_39(this.pointer, _sel_temporaryDirectory); + return objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// homeDirectoryForUser: + objc.NSURL? homeDirectoryForUser_(objc.NSString userName) { + final _ret = _objc_msgSend_40( + this.pointer, _sel_homeDirectoryForUser_, userName.pointer); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSFileManager init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSFileManager.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSFileManager new1() { + final _ret = _objc_msgSend_19(_class_NSFileManager, _sel_new); + return NSFileManager.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSFileManager allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSFileManager, _sel_allocWithZone_, zone); + return NSFileManager.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSFileManager alloc() { + final _ret = _objc_msgSend_19(_class_NSFileManager, _sel_alloc); + return NSFileManager.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSFileManager, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSFileManager, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSFileManager, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSFileManager, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSFileManager, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSFileManager, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSFileManager, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSFileManager, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSFileManager = objc.getClass("NSFileManager"); +late final _sel_defaultManager = objc.registerName("defaultManager"); +final _objc_msgSend_162 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + +enum NSVolumeEnumerationOptions { + NSVolumeEnumerationSkipHiddenVolumes(2), + NSVolumeEnumerationProduceFileReferenceURLs(4); + + final int value; + const NSVolumeEnumerationOptions(this.value); + + static NSVolumeEnumerationOptions fromValue(int value) => switch (value) { + 2 => NSVolumeEnumerationSkipHiddenVolumes, + 4 => NSVolumeEnumerationProduceFileReferenceURLs, + _ => throw ArgumentError( + "Unknown value for NSVolumeEnumerationOptions: $value"), + }; +} + +late final _sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_ = objc + .registerName("mountedVolumeURLsIncludingResourceValuesForKeys:options:"); +final _objc_msgSend_163 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + +enum NSFileManagerUnmountOptions { + NSFileManagerUnmountAllPartitionsAndEjectDisk(1), + NSFileManagerUnmountWithoutUI(2); + + final int value; + const NSFileManagerUnmountOptions(this.value); + + static NSFileManagerUnmountOptions fromValue(int value) => switch (value) { + 1 => NSFileManagerUnmountAllPartitionsAndEjectDisk, + 2 => NSFileManagerUnmountWithoutUI, + _ => throw ArgumentError( + "Unknown value for NSFileManagerUnmountOptions: $value"), + }; +} + +void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +void _ObjCBlock_ffiVoid_NSError_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + +class ObjCBlock_ffiVoid_NSError extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSError._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSError castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSError._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSError.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSError.fromFunction(void Function(objc.NSError?) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSError_closureTrampoline) + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSError.castFromPointer(arg0, + retain: true, release: true)))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSError.listener(void Function(objc.NSError?) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSError(objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSError_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSError.castFromPointer(arg0, + retain: false, release: true))))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>? + _dartFuncListenerTrampoline; + + void call(objc.NSError? arg0) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>()( + pointer, arg0?.pointer ?? ffi.nullptr); +} + +late final _sel_unmountVolumeAtURL_options_completionHandler_ = + objc.registerName("unmountVolumeAtURL:options:completionHandler:"); +final _objc_msgSend_164 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + +enum NSDirectoryEnumerationOptions { + NSDirectoryEnumerationSkipsSubdirectoryDescendants(1), + NSDirectoryEnumerationSkipsPackageDescendants(2), + NSDirectoryEnumerationSkipsHiddenFiles(4), + NSDirectoryEnumerationIncludesDirectoriesPostOrder(8), + NSDirectoryEnumerationProducesRelativePathURLs(16); + + final int value; + const NSDirectoryEnumerationOptions(this.value); + + static NSDirectoryEnumerationOptions fromValue(int value) => switch (value) { + 1 => NSDirectoryEnumerationSkipsSubdirectoryDescendants, + 2 => NSDirectoryEnumerationSkipsPackageDescendants, + 4 => NSDirectoryEnumerationSkipsHiddenFiles, + 8 => NSDirectoryEnumerationIncludesDirectoriesPostOrder, + 16 => NSDirectoryEnumerationProducesRelativePathURLs, + _ => throw ArgumentError( + "Unknown value for NSDirectoryEnumerationOptions: $value"), + }; +} + +late final _sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_ = + objc.registerName( + "contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:"); +final _objc_msgSend_165 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + +enum NSSearchPathDirectory { + NSApplicationDirectory(1), + NSDemoApplicationDirectory(2), + NSDeveloperApplicationDirectory(3), + NSAdminApplicationDirectory(4), + NSLibraryDirectory(5), + NSDeveloperDirectory(6), + NSUserDirectory(7), + NSDocumentationDirectory(8), + NSDocumentDirectory(9), + NSCoreServiceDirectory(10), + NSAutosavedInformationDirectory(11), + NSDesktopDirectory(12), + NSCachesDirectory(13), + NSApplicationSupportDirectory(14), + NSDownloadsDirectory(15), + NSInputMethodsDirectory(16), + NSMoviesDirectory(17), + NSMusicDirectory(18), + NSPicturesDirectory(19), + NSPrinterDescriptionDirectory(20), + NSSharedPublicDirectory(21), + NSPreferencePanesDirectory(22), + NSApplicationScriptsDirectory(23), + NSItemReplacementDirectory(99), + NSAllApplicationsDirectory(100), + NSAllLibrariesDirectory(101), + NSTrashDirectory(102); + + final int value; + const NSSearchPathDirectory(this.value); + + static NSSearchPathDirectory fromValue(int value) => switch (value) { + 1 => NSApplicationDirectory, + 2 => NSDemoApplicationDirectory, + 3 => NSDeveloperApplicationDirectory, + 4 => NSAdminApplicationDirectory, + 5 => NSLibraryDirectory, + 6 => NSDeveloperDirectory, + 7 => NSUserDirectory, + 8 => NSDocumentationDirectory, + 9 => NSDocumentDirectory, + 10 => NSCoreServiceDirectory, + 11 => NSAutosavedInformationDirectory, + 12 => NSDesktopDirectory, + 13 => NSCachesDirectory, + 14 => NSApplicationSupportDirectory, + 15 => NSDownloadsDirectory, + 16 => NSInputMethodsDirectory, + 17 => NSMoviesDirectory, + 18 => NSMusicDirectory, + 19 => NSPicturesDirectory, + 20 => NSPrinterDescriptionDirectory, + 21 => NSSharedPublicDirectory, + 22 => NSPreferencePanesDirectory, + 23 => NSApplicationScriptsDirectory, + 99 => NSItemReplacementDirectory, + 100 => NSAllApplicationsDirectory, + 101 => NSAllLibrariesDirectory, + 102 => NSTrashDirectory, + _ => throw ArgumentError( + "Unknown value for NSSearchPathDirectory: $value"), + }; +} + +enum NSSearchPathDomainMask { + NSUserDomainMask(1), + NSLocalDomainMask(2), + NSNetworkDomainMask(4), + NSSystemDomainMask(8), + NSAllDomainsMask(65535); + + final int value; + const NSSearchPathDomainMask(this.value); + + static NSSearchPathDomainMask fromValue(int value) => switch (value) { + 1 => NSUserDomainMask, + 2 => NSLocalDomainMask, + 4 => NSNetworkDomainMask, + 8 => NSSystemDomainMask, + 65535 => NSAllDomainsMask, + _ => throw ArgumentError( + "Unknown value for NSSearchPathDomainMask: $value"), + }; +} + +late final _sel_URLsForDirectory_inDomains_ = + objc.registerName("URLsForDirectory:inDomains:"); +final _objc_msgSend_166 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int)>(); +late final _sel_URLForDirectory_inDomain_appropriateForURL_create_error_ = objc + .registerName("URLForDirectory:inDomain:appropriateForURL:create:error:"); +final _objc_msgSend_167 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Bool, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + bool, + ffi.Pointer>)>(); + +enum NSURLRelationship { + NSURLRelationshipContains(0), + NSURLRelationshipSame(1), + NSURLRelationshipOther(2); + + final int value; + const NSURLRelationship(this.value); + + static NSURLRelationship fromValue(int value) => switch (value) { + 0 => NSURLRelationshipContains, + 1 => NSURLRelationshipSame, + 2 => NSURLRelationshipOther, + _ => throw ArgumentError("Unknown value for NSURLRelationship: $value"), + }; +} + +late final _sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_ = + objc.registerName("getRelationship:ofDirectoryAtURL:toItemAtURL:error:"); +final _objc_msgSend_168 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_ = objc + .registerName("getRelationship:ofDirectory:inDomain:toItemAtURL:error:"); +final _objc_msgSend_169 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_ = + objc.registerName( + "createDirectoryAtURL:withIntermediateDirectories:attributes:error:"); +final _objc_msgSend_170 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_createSymbolicLinkAtURL_withDestinationURL_error_ = + objc.registerName("createSymbolicLinkAtURL:withDestinationURL:error:"); +final _objc_msgSend_171 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_setAttributes_ofItemAtPath_error_ = + objc.registerName("setAttributes:ofItemAtPath:error:"); +final _objc_msgSend_172 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_ = + objc.registerName( + "createDirectoryAtPath:withIntermediateDirectories:attributes:error:"); +final _objc_msgSend_173 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_contentsOfDirectoryAtPath_error_ = + objc.registerName("contentsOfDirectoryAtPath:error:"); +final _objc_msgSend_174 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_subpathsOfDirectoryAtPath_error_ = + objc.registerName("subpathsOfDirectoryAtPath:error:"); +late final _sel_attributesOfItemAtPath_error_ = + objc.registerName("attributesOfItemAtPath:error:"); +final _objc_msgSend_175 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_attributesOfFileSystemForPath_error_ = + objc.registerName("attributesOfFileSystemForPath:error:"); +late final _sel_createSymbolicLinkAtPath_withDestinationPath_error_ = + objc.registerName("createSymbolicLinkAtPath:withDestinationPath:error:"); +final _objc_msgSend_176 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_destinationOfSymbolicLinkAtPath_error_ = + objc.registerName("destinationOfSymbolicLinkAtPath:error:"); +final _objc_msgSend_177 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_copyItemAtPath_toPath_error_ = + objc.registerName("copyItemAtPath:toPath:error:"); +late final _sel_moveItemAtPath_toPath_error_ = + objc.registerName("moveItemAtPath:toPath:error:"); +late final _sel_linkItemAtPath_toPath_error_ = + objc.registerName("linkItemAtPath:toPath:error:"); +late final _sel_removeItemAtPath_error_ = + objc.registerName("removeItemAtPath:error:"); +final _objc_msgSend_178 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_copyItemAtURL_toURL_error_ = + objc.registerName("copyItemAtURL:toURL:error:"); +late final _sel_moveItemAtURL_toURL_error_ = + objc.registerName("moveItemAtURL:toURL:error:"); +late final _sel_linkItemAtURL_toURL_error_ = + objc.registerName("linkItemAtURL:toURL:error:"); +late final _sel_removeItemAtURL_error_ = + objc.registerName("removeItemAtURL:error:"); +final _objc_msgSend_179 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_trashItemAtURL_resultingItemURL_error_ = + objc.registerName("trashItemAtURL:resultingItemURL:error:"); +final _objc_msgSend_180 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); +late final _sel_fileAttributesAtPath_traverseLink_ = + objc.registerName("fileAttributesAtPath:traverseLink:"); +final _objc_msgSend_181 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_changeFileAttributes_atPath_ = + objc.registerName("changeFileAttributes:atPath:"); +final _objc_msgSend_182 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_directoryContentsAtPath_ = + objc.registerName("directoryContentsAtPath:"); +final _objc_msgSend_183 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_fileSystemAttributesAtPath_ = + objc.registerName("fileSystemAttributesAtPath:"); +final _objc_msgSend_184 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_pathContentOfSymbolicLinkAtPath_ = + objc.registerName("pathContentOfSymbolicLinkAtPath:"); +late final _sel_createSymbolicLinkAtPath_pathContent_ = + objc.registerName("createSymbolicLinkAtPath:pathContent:"); +final _objc_msgSend_185 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_createDirectoryAtPath_attributes_ = + objc.registerName("createDirectoryAtPath:attributes:"); +final _objc_msgSend_186 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_currentDirectoryPath = + objc.registerName("currentDirectoryPath"); +late final _sel_changeCurrentDirectoryPath_ = + objc.registerName("changeCurrentDirectoryPath:"); +late final _sel_fileExistsAtPath_ = objc.registerName("fileExistsAtPath:"); +late final _sel_fileExistsAtPath_isDirectory_ = + objc.registerName("fileExistsAtPath:isDirectory:"); +final _objc_msgSend_187 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_isReadableFileAtPath_ = + objc.registerName("isReadableFileAtPath:"); +late final _sel_isWritableFileAtPath_ = + objc.registerName("isWritableFileAtPath:"); +late final _sel_isExecutableFileAtPath_ = + objc.registerName("isExecutableFileAtPath:"); +late final _sel_isDeletableFileAtPath_ = + objc.registerName("isDeletableFileAtPath:"); +late final _sel_contentsEqualAtPath_andPath_ = + objc.registerName("contentsEqualAtPath:andPath:"); +late final _sel_displayNameAtPath_ = objc.registerName("displayNameAtPath:"); +final _objc_msgSend_188 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_componentsToDisplayForPath_ = + objc.registerName("componentsToDisplayForPath:"); +late final _sel_enumeratorAtPath_ = objc.registerName("enumeratorAtPath:"); +bool _ObjCBlock_bool_NSURL_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +bool _ObjCBlock_bool_NSURL_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as bool Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); + +class ObjCBlock_bool_NSURL_NSError extends objc.ObjCBlockBase { + ObjCBlock_bool_NSURL_NSError._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_bool_NSURL_NSError castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_bool_NSURL_NSError._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_bool_NSURL_NSError.fromFunctionPointer( + ffi.Pointer arg0, ffi.Pointer arg1)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_bool_NSURL_NSError_fnPtrTrampoline, false) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_bool_NSURL_NSError.fromFunction( + bool Function(objc.NSURL, objc.NSError) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_bool_NSURL_NSError_closureTrampoline, false) + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + objc.NSURL.castFromPointer(arg0, retain: true, release: true), + objc.NSError.castFromPointer(arg1, retain: true, release: true)))); + static ffi.Pointer? _dartFuncTrampoline; + + bool call(objc.NSURL arg0, objc.NSError arg1) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + pointer, arg0.pointer, arg1.pointer); +} + +late final _sel_enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_ = + objc.registerName( + "enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:"); +final _objc_msgSend_189 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_subpathsAtPath_ = objc.registerName("subpathsAtPath:"); +late final _sel_contentsAtPath_ = objc.registerName("contentsAtPath:"); +final _objc_msgSend_190 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_createFileAtPath_contents_attributes_ = + objc.registerName("createFileAtPath:contents:attributes:"); +final _objc_msgSend_191 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_fileSystemRepresentationWithPath_ = + objc.registerName("fileSystemRepresentationWithPath:"); +final _objc_msgSend_192 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_stringWithFileSystemRepresentation_length_ = + objc.registerName("stringWithFileSystemRepresentation:length:"); +final _objc_msgSend_193 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + +enum NSFileManagerItemReplacementOptions { + NSFileManagerItemReplacementUsingNewMetadataOnly(1), + NSFileManagerItemReplacementWithoutDeletingBackupItem(2); + + final int value; + const NSFileManagerItemReplacementOptions(this.value); + + static NSFileManagerItemReplacementOptions fromValue(int value) => + switch (value) { + 1 => NSFileManagerItemReplacementUsingNewMetadataOnly, + 2 => NSFileManagerItemReplacementWithoutDeletingBackupItem, + _ => throw ArgumentError( + "Unknown value for NSFileManagerItemReplacementOptions: $value"), + }; +} + +late final _sel_replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_ = + objc.registerName( + "replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:"); +final _objc_msgSend_194 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); +late final _sel_setUbiquitous_itemAtURL_destinationURL_error_ = + objc.registerName("setUbiquitous:itemAtURL:destinationURL:error:"); +final _objc_msgSend_195 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_isUbiquitousItemAtURL_ = + objc.registerName("isUbiquitousItemAtURL:"); +final _objc_msgSend_196 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_startDownloadingUbiquitousItemAtURL_error_ = + objc.registerName("startDownloadingUbiquitousItemAtURL:error:"); +late final _sel_evictUbiquitousItemAtURL_error_ = + objc.registerName("evictUbiquitousItemAtURL:error:"); +late final _sel_URLForUbiquityContainerIdentifier_ = + objc.registerName("URLForUbiquityContainerIdentifier:"); +final _objc_msgSend_197 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_URLForPublishingUbiquitousItemAtURL_expirationDate_error_ = objc + .registerName("URLForPublishingUbiquitousItemAtURL:expirationDate:error:"); +final _objc_msgSend_198 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); +late final _sel_ubiquityIdentityToken = + objc.registerName("ubiquityIdentityToken"); +void _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +void _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); + +class ObjCBlock_ffiVoid_NSDictionary_NSError extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSDictionary_NSError._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSDictionary_NSError castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSDictionary_NSError._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSDictionary_NSError.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSDictionary_NSError.fromFunction( + void Function(objc.NSDictionary?, objc.NSError?) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline) + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0.address == 0 + ? null + : objc.NSDictionary.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true)))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSDictionary_NSError.listener( + void Function(objc.NSDictionary?, objc.NSError?) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSDictionary_NSError(objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= + ffi.NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0.address == 0 + ? null + : objc.NSDictionary.castFromPointer(arg0, + retain: false, release: true), + arg1.address == 0 + ? null + : objc.NSError.castFromPointer(arg1, retain: false, release: true))))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>? _dartFuncListenerTrampoline; + + void call(objc.NSDictionary? arg0, objc.NSError? arg1) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + pointer, arg0?.pointer ?? ffi.nullptr, arg1?.pointer ?? ffi.nullptr); +} + +late final _sel_getFileProviderServicesForItemAtURL_completionHandler_ = + objc.registerName("getFileProviderServicesForItemAtURL:completionHandler:"); +final _objc_msgSend_199 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_containerURLForSecurityApplicationGroupIdentifier_ = + objc.registerName("containerURLForSecurityApplicationGroupIdentifier:"); +late final _sel_homeDirectoryForCurrentUser = + objc.registerName("homeDirectoryForCurrentUser"); +late final _sel_temporaryDirectory = objc.registerName("temporaryDirectory"); +late final _sel_homeDirectoryForUser_ = + objc.registerName("homeDirectoryForUser:"); + +/// NSHTTPCookieStorage +class NSHTTPCookieStorage extends objc.NSObject { + NSHTTPCookieStorage._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSHTTPCookieStorage] that points to the same underlying object as [other]. + NSHTTPCookieStorage.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSHTTPCookieStorage] that wraps the given raw object pointer. + NSHTTPCookieStorage.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSHTTPCookieStorage]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSHTTPCookieStorage); + } + + /// sharedHTTPCookieStorage + static NSHTTPCookieStorage getSharedHTTPCookieStorage() { + final _ret = _objc_msgSend_200( + _class_NSHTTPCookieStorage, _sel_sharedHTTPCookieStorage); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: true, release: true); + } + + /// sharedCookieStorageForGroupContainerIdentifier: + static NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier_( + objc.NSString identifier) { + final _ret = _objc_msgSend_201( + _class_NSHTTPCookieStorage, + _sel_sharedCookieStorageForGroupContainerIdentifier_, + identifier.pointer); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: true, release: true); + } + + /// cookies + objc.NSArray? get cookies { + final _ret = _objc_msgSend_87(this.pointer, _sel_cookies); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// setCookie: + void setCookie_(NSHTTPCookie cookie) { + _objc_msgSend_207(this.pointer, _sel_setCookie_, cookie.pointer); + } + + /// deleteCookie: + void deleteCookie_(NSHTTPCookie cookie) { + _objc_msgSend_207(this.pointer, _sel_deleteCookie_, cookie.pointer); + } + + /// removeCookiesSinceDate: + void removeCookiesSinceDate_(objc.NSDate date) { + _objc_msgSend_137(this.pointer, _sel_removeCookiesSinceDate_, date.pointer); + } + + /// cookiesForURL: + objc.NSArray? cookiesForURL_(objc.NSURL URL) { + final _ret = + _objc_msgSend_208(this.pointer, _sel_cookiesForURL_, URL.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// setCookies:forURL:mainDocumentURL: + void setCookies_forURL_mainDocumentURL_( + objc.NSArray cookies, objc.NSURL? URL, objc.NSURL? mainDocumentURL) { + _objc_msgSend_209( + this.pointer, + _sel_setCookies_forURL_mainDocumentURL_, + cookies.pointer, + URL?.pointer ?? ffi.nullptr, + mainDocumentURL?.pointer ?? ffi.nullptr); + } + + /// cookieAcceptPolicy + NSHTTPCookieAcceptPolicy get cookieAcceptPolicy { + final _ret = _objc_msgSend_210(this.pointer, _sel_cookieAcceptPolicy); + return NSHTTPCookieAcceptPolicy.fromValue(_ret); + } + + /// setCookieAcceptPolicy: + set cookieAcceptPolicy(NSHTTPCookieAcceptPolicy value) { + return _objc_msgSend_211( + this.pointer, _sel_setCookieAcceptPolicy_, value.value); + } + + /// sortedCookiesUsingDescriptors: + objc.NSArray sortedCookiesUsingDescriptors_(objc.NSArray sortOrder) { + final _ret = _objc_msgSend_85( + this.pointer, _sel_sortedCookiesUsingDescriptors_, sortOrder.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// storeCookies:forTask: + void storeCookies_forTask_(objc.NSArray cookies, NSURLSessionTask task) { + _objc_msgSend_212(this.pointer, _sel_storeCookies_forTask_, cookies.pointer, + task.pointer); + } + + /// getCookiesForTask:completionHandler: + void getCookiesForTask_completionHandler_( + NSURLSessionTask task, ObjCBlock_ffiVoid_NSArray completionHandler) { + _objc_msgSend_213(this.pointer, _sel_getCookiesForTask_completionHandler_, + task.pointer, completionHandler.pointer); + } + + /// init + NSHTTPCookieStorage init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSHTTPCookieStorage new1() { + final _ret = _objc_msgSend_19(_class_NSHTTPCookieStorage, _sel_new); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSHTTPCookieStorage allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSHTTPCookieStorage, _sel_allocWithZone_, zone); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSHTTPCookieStorage alloc() { + final _ret = _objc_msgSend_19(_class_NSHTTPCookieStorage, _sel_alloc); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSHTTPCookieStorage, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSHTTPCookieStorage, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSHTTPCookieStorage, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSHTTPCookieStorage, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSHTTPCookieStorage, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSHTTPCookieStorage, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSHTTPCookieStorage, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSHTTPCookieStorage, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSHTTPCookieStorage = objc.getClass("NSHTTPCookieStorage"); +late final _sel_sharedHTTPCookieStorage = + objc.registerName("sharedHTTPCookieStorage"); +final _objc_msgSend_200 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_sharedCookieStorageForGroupContainerIdentifier_ = + objc.registerName("sharedCookieStorageForGroupContainerIdentifier:"); +final _objc_msgSend_201 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_cookies = objc.registerName("cookies"); + +/// NSHTTPCookie +class NSHTTPCookie extends objc.NSObject { + NSHTTPCookie._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSHTTPCookie] that points to the same underlying object as [other]. + NSHTTPCookie.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSHTTPCookie] that wraps the given raw object pointer. + NSHTTPCookie.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSHTTPCookie]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSHTTPCookie); + } + + /// initWithProperties: + NSHTTPCookie? initWithProperties_(objc.NSDictionary properties) { + final _ret = _objc_msgSend_202( + this.pointer, _sel_initWithProperties_, properties.pointer); + return _ret.address == 0 + ? null + : NSHTTPCookie.castFromPointer(_ret, retain: true, release: true); + } + + /// cookieWithProperties: + static NSHTTPCookie? cookieWithProperties_(objc.NSDictionary properties) { + final _ret = _objc_msgSend_203( + _class_NSHTTPCookie, _sel_cookieWithProperties_, properties.pointer); + return _ret.address == 0 + ? null + : NSHTTPCookie.castFromPointer(_ret, retain: true, release: true); + } + + /// requestHeaderFieldsWithCookies: + static objc.NSDictionary requestHeaderFieldsWithCookies_( + objc.NSArray cookies) { + final _ret = _objc_msgSend_204(_class_NSHTTPCookie, + _sel_requestHeaderFieldsWithCookies_, cookies.pointer); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// cookiesWithResponseHeaderFields:forURL: + static objc.NSArray cookiesWithResponseHeaderFields_forURL_( + objc.NSDictionary headerFields, objc.NSURL URL) { + final _ret = _objc_msgSend_205( + _class_NSHTTPCookie, + _sel_cookiesWithResponseHeaderFields_forURL_, + headerFields.pointer, + URL.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// properties + objc.NSDictionary? get properties { + final _ret = _objc_msgSend_83(this.pointer, _sel_properties); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// version + int get version { + return _objc_msgSend_56(this.pointer, _sel_version); + } + + /// name + objc.NSString get name { + final _ret = _objc_msgSend_11(this.pointer, _sel_name); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// value + objc.NSString get value { + final _ret = _objc_msgSend_11(this.pointer, _sel_value); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// expiresDate + objc.NSDate? get expiresDate { + final _ret = _objc_msgSend_206(this.pointer, _sel_expiresDate); + return _ret.address == 0 + ? null + : objc.NSDate.castFromPointer(_ret, retain: true, release: true); + } + + /// isSessionOnly + bool get sessionOnly { + return _objc_msgSend_13(this.pointer, _sel_isSessionOnly); + } + + /// domain + objc.NSString get domain { + final _ret = _objc_msgSend_11(this.pointer, _sel_domain); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// path + objc.NSString get path { + final _ret = _objc_msgSend_11(this.pointer, _sel_path); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// isSecure + bool get secure { + return _objc_msgSend_13(this.pointer, _sel_isSecure); + } + + /// isHTTPOnly + bool get HTTPOnly { + return _objc_msgSend_13(this.pointer, _sel_isHTTPOnly); + } + + /// comment + objc.NSString? get comment { + final _ret = _objc_msgSend_20(this.pointer, _sel_comment); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// commentURL + objc.NSURL? get commentURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_commentURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// portList + objc.NSArray? get portList { + final _ret = _objc_msgSend_87(this.pointer, _sel_portList); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// sameSitePolicy + objc.NSString? get sameSitePolicy { + final _ret = _objc_msgSend_20(this.pointer, _sel_sameSitePolicy); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSHTTPCookie init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSHTTPCookie.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSHTTPCookie new1() { + final _ret = _objc_msgSend_19(_class_NSHTTPCookie, _sel_new); + return NSHTTPCookie.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSHTTPCookie allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSHTTPCookie, _sel_allocWithZone_, zone); + return NSHTTPCookie.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSHTTPCookie alloc() { + final _ret = _objc_msgSend_19(_class_NSHTTPCookie, _sel_alloc); + return NSHTTPCookie.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSHTTPCookie, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSHTTPCookie, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSHTTPCookie, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSHTTPCookie, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSHTTPCookie, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSHTTPCookie, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSHTTPCookie, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSHTTPCookie, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSHTTPCookie = objc.getClass("NSHTTPCookie"); +late final _sel_initWithProperties_ = objc.registerName("initWithProperties:"); +final _objc_msgSend_202 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_cookieWithProperties_ = + objc.registerName("cookieWithProperties:"); +final _objc_msgSend_203 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_requestHeaderFieldsWithCookies_ = + objc.registerName("requestHeaderFieldsWithCookies:"); +final _objc_msgSend_204 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_cookiesWithResponseHeaderFields_forURL_ = + objc.registerName("cookiesWithResponseHeaderFields:forURL:"); +final _objc_msgSend_205 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_properties = objc.registerName("properties"); +late final _sel_version = objc.registerName("version"); +late final _sel_value = objc.registerName("value"); +late final _sel_expiresDate = objc.registerName("expiresDate"); +final _objc_msgSend_206 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_isSessionOnly = objc.registerName("isSessionOnly"); +late final _sel_domain = objc.registerName("domain"); +late final _sel_path = objc.registerName("path"); +late final _sel_isSecure = objc.registerName("isSecure"); +late final _sel_isHTTPOnly = objc.registerName("isHTTPOnly"); +late final _sel_comment = objc.registerName("comment"); +late final _sel_commentURL = objc.registerName("commentURL"); +late final _sel_portList = objc.registerName("portList"); +late final _sel_sameSitePolicy = objc.registerName("sameSitePolicy"); +late final _sel_setCookie_ = objc.registerName("setCookie:"); +final _objc_msgSend_207 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_deleteCookie_ = objc.registerName("deleteCookie:"); +late final _sel_removeCookiesSinceDate_ = + objc.registerName("removeCookiesSinceDate:"); +late final _sel_cookiesForURL_ = objc.registerName("cookiesForURL:"); +final _objc_msgSend_208 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setCookies_forURL_mainDocumentURL_ = + objc.registerName("setCookies:forURL:mainDocumentURL:"); +final _objc_msgSend_209 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + +enum NSHTTPCookieAcceptPolicy { + NSHTTPCookieAcceptPolicyAlways(0), + NSHTTPCookieAcceptPolicyNever(1), + NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain(2); + + final int value; + const NSHTTPCookieAcceptPolicy(this.value); + + static NSHTTPCookieAcceptPolicy fromValue(int value) => switch (value) { + 0 => NSHTTPCookieAcceptPolicyAlways, + 1 => NSHTTPCookieAcceptPolicyNever, + 2 => NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain, + _ => throw ArgumentError( + "Unknown value for NSHTTPCookieAcceptPolicy: $value"), + }; +} + +late final _sel_cookieAcceptPolicy = objc.registerName("cookieAcceptPolicy"); +final _objc_msgSend_210 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setCookieAcceptPolicy_ = + objc.registerName("setCookieAcceptPolicy:"); +final _objc_msgSend_211 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_sortedCookiesUsingDescriptors_ = + objc.registerName("sortedCookiesUsingDescriptors:"); + +/// NSURLSessionTask +class NSURLSessionTask extends objc.ObjCObjectBase { + NSURLSessionTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionTask] that points to the same underlying object as [other]. + NSURLSessionTask.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionTask] that wraps the given raw object pointer. + NSURLSessionTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSURLSessionTask); + } +} + +late final _class_NSURLSessionTask = objc.getClass("NSURLSessionTask"); +late final _sel_storeCookies_forTask_ = + objc.registerName("storeCookies:forTask:"); +final _objc_msgSend_212 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +void _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +void _ObjCBlock_ffiVoid_NSArray_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + +class ObjCBlock_ffiVoid_NSArray extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSArray._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSArray castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSArray._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSArray.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSArray.fromFunction(void Function(objc.NSArray?) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSArray_closureTrampoline) + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSArray.castFromPointer(arg0, + retain: true, release: true)))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSArray.listener(void Function(objc.NSArray?) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSArray(objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSArray_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSArray.castFromPointer(arg0, + retain: false, release: true))))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>? + _dartFuncListenerTrampoline; + + void call(objc.NSArray? arg0) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>()( + pointer, arg0?.pointer ?? ffi.nullptr); +} + +late final _sel_getCookiesForTask_completionHandler_ = + objc.registerName("getCookiesForTask:completionHandler:"); +final _objc_msgSend_213 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + +/// NSIndexPath +class NSIndexPath extends objc.NSObject { + NSIndexPath._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSIndexPath] that points to the same underlying object as [other]. + NSIndexPath.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSIndexPath] that wraps the given raw object pointer. + NSIndexPath.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSIndexPath]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSIndexPath); + } + + /// indexPathWithIndex: + static NSIndexPath indexPathWithIndex_(int index) { + final _ret = + _objc_msgSend_214(_class_NSIndexPath, _sel_indexPathWithIndex_, index); + return NSIndexPath.castFromPointer(_ret, retain: true, release: true); + } + + /// indexPathWithIndexes:length: + static NSIndexPath indexPathWithIndexes_length_( + ffi.Pointer indexes, int length) { + final _ret = _objc_msgSend_215( + _class_NSIndexPath, _sel_indexPathWithIndexes_length_, indexes, length); + return NSIndexPath.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithIndexes:length: + NSIndexPath initWithIndexes_length_( + ffi.Pointer indexes, int length) { + final _ret = _objc_msgSend_215( + this.pointer, _sel_initWithIndexes_length_, indexes, length); + return NSIndexPath.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithIndex: + NSIndexPath initWithIndex_(int index) { + final _ret = _objc_msgSend_214(this.pointer, _sel_initWithIndex_, index); + return NSIndexPath.castFromPointer(_ret, retain: true, release: true); + } + + /// indexPathByAddingIndex: + NSIndexPath indexPathByAddingIndex_(int index) { + final _ret = + _objc_msgSend_216(this.pointer, _sel_indexPathByAddingIndex_, index); + return NSIndexPath.castFromPointer(_ret, retain: true, release: true); + } + + /// indexPathByRemovingLastIndex + NSIndexPath indexPathByRemovingLastIndex() { + final _ret = + _objc_msgSend_217(this.pointer, _sel_indexPathByRemovingLastIndex); + return NSIndexPath.castFromPointer(_ret, retain: true, release: true); + } + + /// indexAtPosition: + int indexAtPosition_(int position) { + return _objc_msgSend_218(this.pointer, _sel_indexAtPosition_, position); + } + + /// length + int get length { + return _objc_msgSend_56(this.pointer, _sel_length); + } + + /// getIndexes:range: + void getIndexes_range_( + ffi.Pointer indexes, _NSRange positionRange) { + _objc_msgSend_219( + this.pointer, _sel_getIndexes_range_, indexes, positionRange); + } + + /// compare: + objc.NSComparisonResult compare_(NSIndexPath otherObject) { + final _ret = + _objc_msgSend_220(this.pointer, _sel_compare_, otherObject.pointer); + return objc.NSComparisonResult.fromValue(_ret); + } + + /// getIndexes: + void getIndexes_(ffi.Pointer indexes) { + _objc_msgSend_221(this.pointer, _sel_getIndexes_, indexes); + } + + /// init + NSIndexPath init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSIndexPath.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSIndexPath new1() { + final _ret = _objc_msgSend_19(_class_NSIndexPath, _sel_new); + return NSIndexPath.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSIndexPath allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSIndexPath, _sel_allocWithZone_, zone); + return NSIndexPath.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSIndexPath alloc() { + final _ret = _objc_msgSend_19(_class_NSIndexPath, _sel_alloc); + return NSIndexPath.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSIndexPath, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSIndexPath, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSIndexPath, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSIndexPath, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSIndexPath, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSIndexPath, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSIndexPath, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSIndexPath, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSIndexPath = objc.getClass("NSIndexPath"); +late final _sel_indexPathWithIndex_ = objc.registerName("indexPathWithIndex:"); +final _objc_msgSend_214 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_indexPathWithIndexes_length_ = + objc.registerName("indexPathWithIndexes:length:"); +final _objc_msgSend_215 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_initWithIndexes_length_ = + objc.registerName("initWithIndexes:length:"); +late final _sel_initWithIndex_ = objc.registerName("initWithIndex:"); +late final _sel_indexPathByAddingIndex_ = + objc.registerName("indexPathByAddingIndex:"); +final _objc_msgSend_216 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_indexPathByRemovingLastIndex = + objc.registerName("indexPathByRemovingLastIndex"); +final _objc_msgSend_217 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_indexAtPosition_ = objc.registerName("indexAtPosition:"); +final _objc_msgSend_218 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_getIndexes_range_ = objc.registerName("getIndexes:range:"); +final _objc_msgSend_219 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>(); +late final _sel_compare_ = objc.registerName("compare:"); +final _objc_msgSend_220 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_getIndexes_ = objc.registerName("getIndexes:"); +final _objc_msgSend_221 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + +/// NSInflectionRule +class NSInflectionRule extends objc.NSObject { + NSInflectionRule._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSInflectionRule] that points to the same underlying object as [other]. + NSInflectionRule.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSInflectionRule] that wraps the given raw object pointer. + NSInflectionRule.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSInflectionRule]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSInflectionRule); + } + + /// init + NSInflectionRule init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSInflectionRule.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticRule + static NSInflectionRule getAutomaticRule() { + final _ret = _objc_msgSend_222(_class_NSInflectionRule, _sel_automaticRule); + return NSInflectionRule.castFromPointer(_ret, retain: true, release: true); + } + + /// canInflectLanguage: + static bool canInflectLanguage_(objc.NSString language) { + return _objc_msgSend_31( + _class_NSInflectionRule, _sel_canInflectLanguage_, language.pointer); + } + + /// canInflectPreferredLocalization + static bool getCanInflectPreferredLocalization() { + return _objc_msgSend_13( + _class_NSInflectionRule, _sel_canInflectPreferredLocalization); + } + + /// new + static NSInflectionRule new1() { + final _ret = _objc_msgSend_19(_class_NSInflectionRule, _sel_new); + return NSInflectionRule.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSInflectionRule allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSInflectionRule, _sel_allocWithZone_, zone); + return NSInflectionRule.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSInflectionRule alloc() { + final _ret = _objc_msgSend_19(_class_NSInflectionRule, _sel_alloc); + return NSInflectionRule.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSInflectionRule, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSInflectionRule, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSInflectionRule, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSInflectionRule, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSInflectionRule, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSInflectionRule, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSInflectionRule, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSInflectionRule, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSInflectionRule = objc.getClass("NSInflectionRule"); +late final _sel_automaticRule = objc.registerName("automaticRule"); +final _objc_msgSend_222 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_canInflectLanguage_ = objc.registerName("canInflectLanguage:"); +late final _sel_canInflectPreferredLocalization = + objc.registerName("canInflectPreferredLocalization"); + +/// NSMorphology +class NSMorphology extends objc.NSObject { + NSMorphology._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSMorphology] that points to the same underlying object as [other]. + NSMorphology.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSMorphology] that wraps the given raw object pointer. + NSMorphology.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSMorphology]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSMorphology); + } + + /// grammaticalGender + NSGrammaticalGender get grammaticalGender { + final _ret = _objc_msgSend_223(this.pointer, _sel_grammaticalGender); + return NSGrammaticalGender.fromValue(_ret); + } + + /// setGrammaticalGender: + set grammaticalGender(NSGrammaticalGender value) { + return _objc_msgSend_224( + this.pointer, _sel_setGrammaticalGender_, value.value); + } + + /// partOfSpeech + NSGrammaticalPartOfSpeech get partOfSpeech { + final _ret = _objc_msgSend_225(this.pointer, _sel_partOfSpeech); + return NSGrammaticalPartOfSpeech.fromValue(_ret); + } + + /// setPartOfSpeech: + set partOfSpeech(NSGrammaticalPartOfSpeech value) { + return _objc_msgSend_226(this.pointer, _sel_setPartOfSpeech_, value.value); + } + + /// number + NSGrammaticalNumber get number { + final _ret = _objc_msgSend_227(this.pointer, _sel_number); + return NSGrammaticalNumber.fromValue(_ret); + } + + /// setNumber: + set number(NSGrammaticalNumber value) { + return _objc_msgSend_228(this.pointer, _sel_setNumber_, value.value); + } + + /// grammaticalCase + NSGrammaticalCase get grammaticalCase { + final _ret = _objc_msgSend_229(this.pointer, _sel_grammaticalCase); + return NSGrammaticalCase.fromValue(_ret); + } + + /// setGrammaticalCase: + set grammaticalCase(NSGrammaticalCase value) { + return _objc_msgSend_230( + this.pointer, _sel_setGrammaticalCase_, value.value); + } + + /// determination + NSGrammaticalDetermination get determination { + final _ret = _objc_msgSend_231(this.pointer, _sel_determination); + return NSGrammaticalDetermination.fromValue(_ret); + } + + /// setDetermination: + set determination(NSGrammaticalDetermination value) { + return _objc_msgSend_232(this.pointer, _sel_setDetermination_, value.value); + } + + /// grammaticalPerson + NSGrammaticalPerson get grammaticalPerson { + final _ret = _objc_msgSend_233(this.pointer, _sel_grammaticalPerson); + return NSGrammaticalPerson.fromValue(_ret); + } + + /// setGrammaticalPerson: + set grammaticalPerson(NSGrammaticalPerson value) { + return _objc_msgSend_234( + this.pointer, _sel_setGrammaticalPerson_, value.value); + } + + /// pronounType + NSGrammaticalPronounType get pronounType { + final _ret = _objc_msgSend_235(this.pointer, _sel_pronounType); + return NSGrammaticalPronounType.fromValue(_ret); + } + + /// setPronounType: + set pronounType(NSGrammaticalPronounType value) { + return _objc_msgSend_236(this.pointer, _sel_setPronounType_, value.value); + } + + /// definiteness + NSGrammaticalDefiniteness get definiteness { + final _ret = _objc_msgSend_237(this.pointer, _sel_definiteness); + return NSGrammaticalDefiniteness.fromValue(_ret); + } + + /// setDefiniteness: + set definiteness(NSGrammaticalDefiniteness value) { + return _objc_msgSend_238(this.pointer, _sel_setDefiniteness_, value.value); + } + + /// customPronounForLanguage: + NSMorphologyCustomPronoun? customPronounForLanguage_(objc.NSString language) { + final _ret = _objc_msgSend_240( + this.pointer, _sel_customPronounForLanguage_, language.pointer); + return _ret.address == 0 + ? null + : NSMorphologyCustomPronoun.castFromPointer(_ret, + retain: true, release: true); + } + + /// setCustomPronoun:forLanguage:error: + bool setCustomPronoun_forLanguage_error_(NSMorphologyCustomPronoun? features, + objc.NSString language, ffi.Pointer> error) { + return _objc_msgSend_241( + this.pointer, + _sel_setCustomPronoun_forLanguage_error_, + features?.pointer ?? ffi.nullptr, + language.pointer, + error); + } + + /// isUnspecified + bool get unspecified { + return _objc_msgSend_13(this.pointer, _sel_isUnspecified); + } + + /// userMorphology + static NSMorphology getUserMorphology() { + final _ret = _objc_msgSend_242(_class_NSMorphology, _sel_userMorphology); + return NSMorphology.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSMorphology init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSMorphology.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSMorphology new1() { + final _ret = _objc_msgSend_19(_class_NSMorphology, _sel_new); + return NSMorphology.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSMorphology allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSMorphology, _sel_allocWithZone_, zone); + return NSMorphology.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSMorphology alloc() { + final _ret = _objc_msgSend_19(_class_NSMorphology, _sel_alloc); + return NSMorphology.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSMorphology, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSMorphology, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSMorphology, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSMorphology, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSMorphology, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSMorphology, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSMorphology, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSMorphology, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSMorphology = objc.getClass("NSMorphology"); + +enum NSGrammaticalGender { + NSGrammaticalGenderNotSet(0), + NSGrammaticalGenderFeminine(1), + NSGrammaticalGenderMasculine(2), + NSGrammaticalGenderNeuter(3); + + final int value; + const NSGrammaticalGender(this.value); + + static NSGrammaticalGender fromValue(int value) => switch (value) { + 0 => NSGrammaticalGenderNotSet, + 1 => NSGrammaticalGenderFeminine, + 2 => NSGrammaticalGenderMasculine, + 3 => NSGrammaticalGenderNeuter, + _ => + throw ArgumentError("Unknown value for NSGrammaticalGender: $value"), + }; +} + +late final _sel_grammaticalGender = objc.registerName("grammaticalGender"); +final _objc_msgSend_223 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setGrammaticalGender_ = + objc.registerName("setGrammaticalGender:"); +final _objc_msgSend_224 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); + +enum NSGrammaticalPartOfSpeech { + NSGrammaticalPartOfSpeechNotSet(0), + NSGrammaticalPartOfSpeechDeterminer(1), + NSGrammaticalPartOfSpeechPronoun(2), + NSGrammaticalPartOfSpeechLetter(3), + NSGrammaticalPartOfSpeechAdverb(4), + NSGrammaticalPartOfSpeechParticle(5), + NSGrammaticalPartOfSpeechAdjective(6), + NSGrammaticalPartOfSpeechAdposition(7), + NSGrammaticalPartOfSpeechVerb(8), + NSGrammaticalPartOfSpeechNoun(9), + NSGrammaticalPartOfSpeechConjunction(10), + NSGrammaticalPartOfSpeechNumeral(11), + NSGrammaticalPartOfSpeechInterjection(12), + NSGrammaticalPartOfSpeechPreposition(13), + NSGrammaticalPartOfSpeechAbbreviation(14); + + final int value; + const NSGrammaticalPartOfSpeech(this.value); + + static NSGrammaticalPartOfSpeech fromValue(int value) => switch (value) { + 0 => NSGrammaticalPartOfSpeechNotSet, + 1 => NSGrammaticalPartOfSpeechDeterminer, + 2 => NSGrammaticalPartOfSpeechPronoun, + 3 => NSGrammaticalPartOfSpeechLetter, + 4 => NSGrammaticalPartOfSpeechAdverb, + 5 => NSGrammaticalPartOfSpeechParticle, + 6 => NSGrammaticalPartOfSpeechAdjective, + 7 => NSGrammaticalPartOfSpeechAdposition, + 8 => NSGrammaticalPartOfSpeechVerb, + 9 => NSGrammaticalPartOfSpeechNoun, + 10 => NSGrammaticalPartOfSpeechConjunction, + 11 => NSGrammaticalPartOfSpeechNumeral, + 12 => NSGrammaticalPartOfSpeechInterjection, + 13 => NSGrammaticalPartOfSpeechPreposition, + 14 => NSGrammaticalPartOfSpeechAbbreviation, + _ => throw ArgumentError( + "Unknown value for NSGrammaticalPartOfSpeech: $value"), + }; +} + +late final _sel_partOfSpeech = objc.registerName("partOfSpeech"); +final _objc_msgSend_225 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setPartOfSpeech_ = objc.registerName("setPartOfSpeech:"); +final _objc_msgSend_226 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); + +enum NSGrammaticalNumber { + NSGrammaticalNumberNotSet(0), + NSGrammaticalNumberSingular(1), + NSGrammaticalNumberZero(2), + NSGrammaticalNumberPlural(3), + NSGrammaticalNumberPluralTwo(4), + NSGrammaticalNumberPluralFew(5), + NSGrammaticalNumberPluralMany(6); + + final int value; + const NSGrammaticalNumber(this.value); + + static NSGrammaticalNumber fromValue(int value) => switch (value) { + 0 => NSGrammaticalNumberNotSet, + 1 => NSGrammaticalNumberSingular, + 2 => NSGrammaticalNumberZero, + 3 => NSGrammaticalNumberPlural, + 4 => NSGrammaticalNumberPluralTwo, + 5 => NSGrammaticalNumberPluralFew, + 6 => NSGrammaticalNumberPluralMany, + _ => + throw ArgumentError("Unknown value for NSGrammaticalNumber: $value"), + }; +} + +late final _sel_number = objc.registerName("number"); +final _objc_msgSend_227 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setNumber_ = objc.registerName("setNumber:"); +final _objc_msgSend_228 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); + +enum NSGrammaticalCase { + NSGrammaticalCaseNotSet(0), + NSGrammaticalCaseNominative(1), + NSGrammaticalCaseAccusative(2), + NSGrammaticalCaseDative(3), + NSGrammaticalCaseGenitive(4), + NSGrammaticalCasePrepositional(5), + NSGrammaticalCaseAblative(6), + NSGrammaticalCaseAdessive(7), + NSGrammaticalCaseAllative(8), + NSGrammaticalCaseElative(9), + NSGrammaticalCaseIllative(10), + NSGrammaticalCaseEssive(11), + NSGrammaticalCaseInessive(12), + NSGrammaticalCaseLocative(13), + NSGrammaticalCaseTranslative(14); + + final int value; + const NSGrammaticalCase(this.value); + + static NSGrammaticalCase fromValue(int value) => switch (value) { + 0 => NSGrammaticalCaseNotSet, + 1 => NSGrammaticalCaseNominative, + 2 => NSGrammaticalCaseAccusative, + 3 => NSGrammaticalCaseDative, + 4 => NSGrammaticalCaseGenitive, + 5 => NSGrammaticalCasePrepositional, + 6 => NSGrammaticalCaseAblative, + 7 => NSGrammaticalCaseAdessive, + 8 => NSGrammaticalCaseAllative, + 9 => NSGrammaticalCaseElative, + 10 => NSGrammaticalCaseIllative, + 11 => NSGrammaticalCaseEssive, + 12 => NSGrammaticalCaseInessive, + 13 => NSGrammaticalCaseLocative, + 14 => NSGrammaticalCaseTranslative, + _ => throw ArgumentError("Unknown value for NSGrammaticalCase: $value"), + }; +} + +late final _sel_grammaticalCase = objc.registerName("grammaticalCase"); +final _objc_msgSend_229 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setGrammaticalCase_ = objc.registerName("setGrammaticalCase:"); +final _objc_msgSend_230 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); + +enum NSGrammaticalDetermination { + NSGrammaticalDeterminationNotSet(0), + NSGrammaticalDeterminationIndependent(1), + NSGrammaticalDeterminationDependent(2); + + final int value; + const NSGrammaticalDetermination(this.value); + + static NSGrammaticalDetermination fromValue(int value) => switch (value) { + 0 => NSGrammaticalDeterminationNotSet, + 1 => NSGrammaticalDeterminationIndependent, + 2 => NSGrammaticalDeterminationDependent, + _ => throw ArgumentError( + "Unknown value for NSGrammaticalDetermination: $value"), + }; +} + +late final _sel_determination = objc.registerName("determination"); +final _objc_msgSend_231 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setDetermination_ = objc.registerName("setDetermination:"); +final _objc_msgSend_232 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); + +enum NSGrammaticalPerson { + NSGrammaticalPersonNotSet(0), + NSGrammaticalPersonFirst(1), + NSGrammaticalPersonSecond(2), + NSGrammaticalPersonThird(3); + + final int value; + const NSGrammaticalPerson(this.value); + + static NSGrammaticalPerson fromValue(int value) => switch (value) { + 0 => NSGrammaticalPersonNotSet, + 1 => NSGrammaticalPersonFirst, + 2 => NSGrammaticalPersonSecond, + 3 => NSGrammaticalPersonThird, + _ => + throw ArgumentError("Unknown value for NSGrammaticalPerson: $value"), + }; +} + +late final _sel_grammaticalPerson = objc.registerName("grammaticalPerson"); +final _objc_msgSend_233 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setGrammaticalPerson_ = + objc.registerName("setGrammaticalPerson:"); +final _objc_msgSend_234 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); + +enum NSGrammaticalPronounType { + NSGrammaticalPronounTypeNotSet(0), + NSGrammaticalPronounTypePersonal(1), + NSGrammaticalPronounTypeReflexive(2), + NSGrammaticalPronounTypePossessive(3); + + final int value; + const NSGrammaticalPronounType(this.value); + + static NSGrammaticalPronounType fromValue(int value) => switch (value) { + 0 => NSGrammaticalPronounTypeNotSet, + 1 => NSGrammaticalPronounTypePersonal, + 2 => NSGrammaticalPronounTypeReflexive, + 3 => NSGrammaticalPronounTypePossessive, + _ => throw ArgumentError( + "Unknown value for NSGrammaticalPronounType: $value"), + }; +} + +late final _sel_pronounType = objc.registerName("pronounType"); +final _objc_msgSend_235 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setPronounType_ = objc.registerName("setPronounType:"); +final _objc_msgSend_236 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); + +enum NSGrammaticalDefiniteness { + NSGrammaticalDefinitenessNotSet(0), + NSGrammaticalDefinitenessIndefinite(1), + NSGrammaticalDefinitenessDefinite(2); + + final int value; + const NSGrammaticalDefiniteness(this.value); + + static NSGrammaticalDefiniteness fromValue(int value) => switch (value) { + 0 => NSGrammaticalDefinitenessNotSet, + 1 => NSGrammaticalDefinitenessIndefinite, + 2 => NSGrammaticalDefinitenessDefinite, + _ => throw ArgumentError( + "Unknown value for NSGrammaticalDefiniteness: $value"), + }; +} + +late final _sel_definiteness = objc.registerName("definiteness"); +final _objc_msgSend_237 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setDefiniteness_ = objc.registerName("setDefiniteness:"); +final _objc_msgSend_238 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); + +/// NSMorphologyCustomPronoun +class NSMorphologyCustomPronoun extends objc.NSObject { + NSMorphologyCustomPronoun._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSMorphologyCustomPronoun] that points to the same underlying object as [other]. + NSMorphologyCustomPronoun.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSMorphologyCustomPronoun] that wraps the given raw object pointer. + NSMorphologyCustomPronoun.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSMorphologyCustomPronoun]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSMorphologyCustomPronoun); + } + + /// isSupportedForLanguage: + static bool isSupportedForLanguage_(objc.NSString language) { + return _objc_msgSend_31(_class_NSMorphologyCustomPronoun, + _sel_isSupportedForLanguage_, language.pointer); + } + + /// requiredKeysForLanguage: + static objc.NSArray requiredKeysForLanguage_(objc.NSString language) { + final _ret = _objc_msgSend_239(_class_NSMorphologyCustomPronoun, + _sel_requiredKeysForLanguage_, language.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// subjectForm + objc.NSString? get subjectForm { + final _ret = _objc_msgSend_20(this.pointer, _sel_subjectForm); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setSubjectForm: + set subjectForm(objc.NSString? value) { + return _objc_msgSend_21( + this.pointer, _sel_setSubjectForm_, value?.pointer ?? ffi.nullptr); + } + + /// objectForm + objc.NSString? get objectForm { + final _ret = _objc_msgSend_20(this.pointer, _sel_objectForm); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setObjectForm: + set objectForm(objc.NSString? value) { + return _objc_msgSend_21( + this.pointer, _sel_setObjectForm_, value?.pointer ?? ffi.nullptr); + } + + /// possessiveForm + objc.NSString? get possessiveForm { + final _ret = _objc_msgSend_20(this.pointer, _sel_possessiveForm); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setPossessiveForm: + set possessiveForm(objc.NSString? value) { + return _objc_msgSend_21( + this.pointer, _sel_setPossessiveForm_, value?.pointer ?? ffi.nullptr); + } + + /// possessiveAdjectiveForm + objc.NSString? get possessiveAdjectiveForm { + final _ret = _objc_msgSend_20(this.pointer, _sel_possessiveAdjectiveForm); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setPossessiveAdjectiveForm: + set possessiveAdjectiveForm(objc.NSString? value) { + return _objc_msgSend_21(this.pointer, _sel_setPossessiveAdjectiveForm_, + value?.pointer ?? ffi.nullptr); + } + + /// reflexiveForm + objc.NSString? get reflexiveForm { + final _ret = _objc_msgSend_20(this.pointer, _sel_reflexiveForm); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setReflexiveForm: + set reflexiveForm(objc.NSString? value) { + return _objc_msgSend_21( + this.pointer, _sel_setReflexiveForm_, value?.pointer ?? ffi.nullptr); + } + + /// init + NSMorphologyCustomPronoun init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSMorphologyCustomPronoun.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSMorphologyCustomPronoun new1() { + final _ret = _objc_msgSend_19(_class_NSMorphologyCustomPronoun, _sel_new); + return NSMorphologyCustomPronoun.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSMorphologyCustomPronoun allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28( + _class_NSMorphologyCustomPronoun, _sel_allocWithZone_, zone); + return NSMorphologyCustomPronoun.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSMorphologyCustomPronoun alloc() { + final _ret = _objc_msgSend_19(_class_NSMorphologyCustomPronoun, _sel_alloc); + return NSMorphologyCustomPronoun.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSMorphologyCustomPronoun, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSMorphologyCustomPronoun, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSMorphologyCustomPronoun, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13( + _class_NSMorphologyCustomPronoun, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSMorphologyCustomPronoun, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSMorphologyCustomPronoun, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSMorphologyCustomPronoun, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSMorphologyCustomPronoun, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSMorphologyCustomPronoun = + objc.getClass("NSMorphologyCustomPronoun"); +late final _sel_isSupportedForLanguage_ = + objc.registerName("isSupportedForLanguage:"); +late final _sel_requiredKeysForLanguage_ = + objc.registerName("requiredKeysForLanguage:"); +final _objc_msgSend_239 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_subjectForm = objc.registerName("subjectForm"); +late final _sel_setSubjectForm_ = objc.registerName("setSubjectForm:"); +late final _sel_objectForm = objc.registerName("objectForm"); +late final _sel_setObjectForm_ = objc.registerName("setObjectForm:"); +late final _sel_possessiveForm = objc.registerName("possessiveForm"); +late final _sel_setPossessiveForm_ = objc.registerName("setPossessiveForm:"); +late final _sel_possessiveAdjectiveForm = + objc.registerName("possessiveAdjectiveForm"); +late final _sel_setPossessiveAdjectiveForm_ = + objc.registerName("setPossessiveAdjectiveForm:"); +late final _sel_reflexiveForm = objc.registerName("reflexiveForm"); +late final _sel_setReflexiveForm_ = objc.registerName("setReflexiveForm:"); +late final _sel_customPronounForLanguage_ = + objc.registerName("customPronounForLanguage:"); +final _objc_msgSend_240 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setCustomPronoun_forLanguage_error_ = + objc.registerName("setCustomPronoun:forLanguage:error:"); +final _objc_msgSend_241 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_isUnspecified = objc.registerName("isUnspecified"); +late final _sel_userMorphology = objc.registerName("userMorphology"); +final _objc_msgSend_242 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + +/// NSOperationQueue +class NSOperationQueue extends objc.NSObject { + NSOperationQueue._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSOperationQueue] that points to the same underlying object as [other]. + NSOperationQueue.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSOperationQueue] that wraps the given raw object pointer. + NSOperationQueue.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSOperationQueue]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSOperationQueue); + } + + /// progress + NSProgress get progress { + final _ret = _objc_msgSend_243(this.pointer, _sel_progress); + return NSProgress.castFromPointer(_ret, retain: true, release: true); + } + + /// addOperation: + void addOperation_(NSOperation op) { + _objc_msgSend_244(this.pointer, _sel_addOperation_, op.pointer); + } + + /// addOperations:waitUntilFinished: + void addOperations_waitUntilFinished_(objc.NSArray ops, bool wait) { + _objc_msgSend_249( + this.pointer, _sel_addOperations_waitUntilFinished_, ops.pointer, wait); + } + + /// addOperationWithBlock: + void addOperationWithBlock_(ObjCBlock_ffiVoid block) { + _objc_msgSend_140(this.pointer, _sel_addOperationWithBlock_, block.pointer); + } + + /// addBarrierBlock: + void addBarrierBlock_(ObjCBlock_ffiVoid barrier) { + _objc_msgSend_140(this.pointer, _sel_addBarrierBlock_, barrier.pointer); + } + + /// maxConcurrentOperationCount + int get maxConcurrentOperationCount { + return _objc_msgSend_250(this.pointer, _sel_maxConcurrentOperationCount); + } + + /// setMaxConcurrentOperationCount: + set maxConcurrentOperationCount(int value) { + return _objc_msgSend_251( + this.pointer, _sel_setMaxConcurrentOperationCount_, value); + } + + /// isSuspended + bool get suspended { + return _objc_msgSend_13(this.pointer, _sel_isSuspended); + } + + /// setSuspended: + set suspended(bool value) { + return _objc_msgSend_14(this.pointer, _sel_setSuspended_, value); + } + + /// name + objc.NSString? get name { + final _ret = _objc_msgSend_20(this.pointer, _sel_name); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setName: + set name(objc.NSString? value) { + return _objc_msgSend_21( + this.pointer, _sel_setName_, value?.pointer ?? ffi.nullptr); + } + + /// qualityOfService + NSQualityOfService get qualityOfService { + final _ret = _objc_msgSend_247(this.pointer, _sel_qualityOfService); + return NSQualityOfService.fromValue(_ret); + } + + /// setQualityOfService: + set qualityOfService(NSQualityOfService value) { + return _objc_msgSend_248( + this.pointer, _sel_setQualityOfService_, value.value); + } + + /// underlyingQueue + ffi.Pointer get underlyingQueue { + return _objc_msgSend_252(this.pointer, _sel_underlyingQueue); + } + + /// setUnderlyingQueue: + set underlyingQueue(ffi.Pointer value) { + return _objc_msgSend_253(this.pointer, _sel_setUnderlyingQueue_, value); + } + + /// cancelAllOperations + void cancelAllOperations() { + _objc_msgSend_7(this.pointer, _sel_cancelAllOperations); + } + + /// waitUntilAllOperationsAreFinished + void waitUntilAllOperationsAreFinished() { + _objc_msgSend_7(this.pointer, _sel_waitUntilAllOperationsAreFinished); + } + + /// currentQueue + static NSOperationQueue? getCurrentQueue() { + final _ret = _objc_msgSend_254(_class_NSOperationQueue, _sel_currentQueue); + return _ret.address == 0 + ? null + : NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + } + + /// mainQueue + static NSOperationQueue getMainQueue() { + final _ret = _objc_msgSend_255(_class_NSOperationQueue, _sel_mainQueue); + return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + } + + /// operations + objc.NSArray get operations { + final _ret = _objc_msgSend_32(this.pointer, _sel_operations); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// operationCount + int get operationCount { + return _objc_msgSend_56(this.pointer, _sel_operationCount); + } + + /// init + NSOperationQueue init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSOperationQueue new1() { + final _ret = _objc_msgSend_19(_class_NSOperationQueue, _sel_new); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSOperationQueue allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSOperationQueue, _sel_allocWithZone_, zone); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSOperationQueue alloc() { + final _ret = _objc_msgSend_19(_class_NSOperationQueue, _sel_alloc); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSOperationQueue, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSOperationQueue, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSOperationQueue, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSOperationQueue, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSOperationQueue, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSOperationQueue, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSOperationQueue, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSOperationQueue, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSOperationQueue = objc.getClass("NSOperationQueue"); +late final _sel_progress = objc.registerName("progress"); +final _objc_msgSend_243 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + +/// NSOperation +class NSOperation extends objc.NSObject { + NSOperation._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSOperation] that points to the same underlying object as [other]. + NSOperation.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSOperation] that wraps the given raw object pointer. + NSOperation.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSOperation]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSOperation); + } + + /// start + void start() { + _objc_msgSend_7(this.pointer, _sel_start); + } + + /// main + void main() { + _objc_msgSend_7(this.pointer, _sel_main); + } + + /// isCancelled + bool get cancelled { + return _objc_msgSend_13(this.pointer, _sel_isCancelled); + } + + /// cancel + void cancel() { + _objc_msgSend_7(this.pointer, _sel_cancel); + } + + /// isExecuting + bool get executing { + return _objc_msgSend_13(this.pointer, _sel_isExecuting); + } + + /// isFinished + bool get finished { + return _objc_msgSend_13(this.pointer, _sel_isFinished); + } + + /// isConcurrent + bool get concurrent { + return _objc_msgSend_13(this.pointer, _sel_isConcurrent); + } + + /// isAsynchronous + bool get asynchronous { + return _objc_msgSend_13(this.pointer, _sel_isAsynchronous); + } + + /// isReady + bool get ready { + return _objc_msgSend_13(this.pointer, _sel_isReady); + } + + /// addDependency: + void addDependency_(NSOperation op) { + _objc_msgSend_244(this.pointer, _sel_addDependency_, op.pointer); + } + + /// removeDependency: + void removeDependency_(NSOperation op) { + _objc_msgSend_244(this.pointer, _sel_removeDependency_, op.pointer); + } + + /// dependencies + objc.NSArray get dependencies { + final _ret = _objc_msgSend_32(this.pointer, _sel_dependencies); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// queuePriority + NSOperationQueuePriority get queuePriority { + final _ret = _objc_msgSend_245(this.pointer, _sel_queuePriority); + return NSOperationQueuePriority.fromValue(_ret); + } + + /// setQueuePriority: + set queuePriority(NSOperationQueuePriority value) { + return _objc_msgSend_246(this.pointer, _sel_setQueuePriority_, value.value); + } + + /// completionBlock + ObjCBlock_ffiVoid? get completionBlock { + final _ret = _objc_msgSend_15(this.pointer, _sel_completionBlock); + return _ret.address == 0 + ? null + : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); + } + + /// setCompletionBlock: + set completionBlock(ObjCBlock_ffiVoid? value) { + return _objc_msgSend_16( + this.pointer, _sel_setCompletionBlock_, value?.pointer ?? ffi.nullptr); + } + + /// waitUntilFinished + void waitUntilFinished() { + _objc_msgSend_7(this.pointer, _sel_waitUntilFinished); + } + + /// threadPriority + double get threadPriority { + return objc.useMsgSendVariants + ? _objc_msgSend_18Fpret(this.pointer, _sel_threadPriority) + : _objc_msgSend_18(this.pointer, _sel_threadPriority); + } + + /// setThreadPriority: + set threadPriority(double value) { + return _objc_msgSend_127(this.pointer, _sel_setThreadPriority_, value); + } + + /// qualityOfService + NSQualityOfService get qualityOfService { + final _ret = _objc_msgSend_247(this.pointer, _sel_qualityOfService); + return NSQualityOfService.fromValue(_ret); + } + + /// setQualityOfService: + set qualityOfService(NSQualityOfService value) { + return _objc_msgSend_248( + this.pointer, _sel_setQualityOfService_, value.value); + } + + /// name + objc.NSString? get name { + final _ret = _objc_msgSend_20(this.pointer, _sel_name); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setName: + set name(objc.NSString? value) { + return _objc_msgSend_21( + this.pointer, _sel_setName_, value?.pointer ?? ffi.nullptr); + } + + /// init + NSOperation init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSOperation.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSOperation new1() { + final _ret = _objc_msgSend_19(_class_NSOperation, _sel_new); + return NSOperation.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSOperation allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSOperation, _sel_allocWithZone_, zone); + return NSOperation.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSOperation alloc() { + final _ret = _objc_msgSend_19(_class_NSOperation, _sel_alloc); + return NSOperation.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSOperation, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSOperation, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSOperation, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSOperation, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSOperation, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSOperation, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSOperation, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSOperation, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSOperation = objc.getClass("NSOperation"); +late final _sel_start = objc.registerName("start"); +late final _sel_main = objc.registerName("main"); +late final _sel_isExecuting = objc.registerName("isExecuting"); +late final _sel_isConcurrent = objc.registerName("isConcurrent"); +late final _sel_isAsynchronous = objc.registerName("isAsynchronous"); +late final _sel_isReady = objc.registerName("isReady"); +late final _sel_addDependency_ = objc.registerName("addDependency:"); +final _objc_msgSend_244 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_removeDependency_ = objc.registerName("removeDependency:"); +late final _sel_dependencies = objc.registerName("dependencies"); + +enum NSOperationQueuePriority { + NSOperationQueuePriorityVeryLow(-8), + NSOperationQueuePriorityLow(-4), + NSOperationQueuePriorityNormal(0), + NSOperationQueuePriorityHigh(4), + NSOperationQueuePriorityVeryHigh(8); + + final int value; + const NSOperationQueuePriority(this.value); + + static NSOperationQueuePriority fromValue(int value) => switch (value) { + -8 => NSOperationQueuePriorityVeryLow, + -4 => NSOperationQueuePriorityLow, + 0 => NSOperationQueuePriorityNormal, + 4 => NSOperationQueuePriorityHigh, + 8 => NSOperationQueuePriorityVeryHigh, + _ => throw ArgumentError( + "Unknown value for NSOperationQueuePriority: $value"), + }; +} + +late final _sel_queuePriority = objc.registerName("queuePriority"); +final _objc_msgSend_245 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setQueuePriority_ = objc.registerName("setQueuePriority:"); +final _objc_msgSend_246 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_completionBlock = objc.registerName("completionBlock"); +late final _sel_setCompletionBlock_ = objc.registerName("setCompletionBlock:"); +late final _sel_waitUntilFinished = objc.registerName("waitUntilFinished"); +late final _sel_threadPriority = objc.registerName("threadPriority"); +late final _sel_setThreadPriority_ = objc.registerName("setThreadPriority:"); + +enum NSQualityOfService { + NSQualityOfServiceUserInteractive(33), + NSQualityOfServiceUserInitiated(25), + NSQualityOfServiceUtility(17), + NSQualityOfServiceBackground(9), + NSQualityOfServiceDefault(-1); + + final int value; + const NSQualityOfService(this.value); + + static NSQualityOfService fromValue(int value) => switch (value) { + 33 => NSQualityOfServiceUserInteractive, + 25 => NSQualityOfServiceUserInitiated, + 17 => NSQualityOfServiceUtility, + 9 => NSQualityOfServiceBackground, + -1 => NSQualityOfServiceDefault, + _ => + throw ArgumentError("Unknown value for NSQualityOfService: $value"), + }; +} + +late final _sel_qualityOfService = objc.registerName("qualityOfService"); +final _objc_msgSend_247 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setQualityOfService_ = + objc.registerName("setQualityOfService:"); +final _objc_msgSend_248 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_setName_ = objc.registerName("setName:"); +late final _sel_addOperation_ = objc.registerName("addOperation:"); +late final _sel_addOperations_waitUntilFinished_ = + objc.registerName("addOperations:waitUntilFinished:"); +final _objc_msgSend_249 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_addOperationWithBlock_ = + objc.registerName("addOperationWithBlock:"); +late final _sel_addBarrierBlock_ = objc.registerName("addBarrierBlock:"); +late final _sel_maxConcurrentOperationCount = + objc.registerName("maxConcurrentOperationCount"); +final _objc_msgSend_250 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setMaxConcurrentOperationCount_ = + objc.registerName("setMaxConcurrentOperationCount:"); +final _objc_msgSend_251 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_isSuspended = objc.registerName("isSuspended"); +late final _sel_setSuspended_ = objc.registerName("setSuspended:"); + +final class dispatch_queue_s extends ffi.Opaque {} + +late final _sel_underlyingQueue = objc.registerName("underlyingQueue"); +final _objc_msgSend_252 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setUnderlyingQueue_ = objc.registerName("setUnderlyingQueue:"); +final _objc_msgSend_253 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_cancelAllOperations = objc.registerName("cancelAllOperations"); +late final _sel_waitUntilAllOperationsAreFinished = + objc.registerName("waitUntilAllOperationsAreFinished"); +late final _sel_currentQueue = objc.registerName("currentQueue"); +final _objc_msgSend_254 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_mainQueue = objc.registerName("mainQueue"); +final _objc_msgSend_255 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_operations = objc.registerName("operations"); +late final _sel_operationCount = objc.registerName("operationCount"); + +/// NSOrthography +class NSOrthography extends objc.NSObject { + NSOrthography._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSOrthography] that points to the same underlying object as [other]. + NSOrthography.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSOrthography] that wraps the given raw object pointer. + NSOrthography.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSOrthography]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSOrthography); + } + + /// dominantScript + objc.NSString get dominantScript { + final _ret = _objc_msgSend_11(this.pointer, _sel_dominantScript); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// languageMap + objc.NSDictionary get languageMap { + final _ret = _objc_msgSend_256(this.pointer, _sel_languageMap); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithDominantScript:languageMap: + NSOrthography initWithDominantScript_languageMap_( + objc.NSString script, objc.NSDictionary map) { + final _ret = _objc_msgSend_257(this.pointer, + _sel_initWithDominantScript_languageMap_, script.pointer, map.pointer); + return NSOrthography.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithCoder: + NSOrthography? initWithCoder_(objc.NSCoder coder) { + final _ret = + _objc_msgSend_145(this.pointer, _sel_initWithCoder_, coder.pointer); + return _ret.address == 0 + ? null + : NSOrthography.castFromPointer(_ret, retain: true, release: true); + } + + /// languagesForScript: + objc.NSArray? languagesForScript_(objc.NSString script) { + final _ret = _objc_msgSend_183( + this.pointer, _sel_languagesForScript_, script.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// dominantLanguageForScript: + objc.NSString? dominantLanguageForScript_(objc.NSString script) { + final _ret = _objc_msgSend_41( + this.pointer, _sel_dominantLanguageForScript_, script.pointer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// dominantLanguage + objc.NSString get dominantLanguage { + final _ret = _objc_msgSend_11(this.pointer, _sel_dominantLanguage); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// allScripts + objc.NSArray get allScripts { + final _ret = _objc_msgSend_32(this.pointer, _sel_allScripts); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// allLanguages + objc.NSArray get allLanguages { + final _ret = _objc_msgSend_32(this.pointer, _sel_allLanguages); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// defaultOrthographyForLanguage: + static NSOrthography defaultOrthographyForLanguage_(objc.NSString language) { + final _ret = _objc_msgSend_62(_class_NSOrthography, + _sel_defaultOrthographyForLanguage_, language.pointer); + return NSOrthography.castFromPointer(_ret, retain: true, release: true); + } + + /// orthographyWithDominantScript:languageMap: + static NSOrthography orthographyWithDominantScript_languageMap_( + objc.NSString script, objc.NSDictionary map) { + final _ret = _objc_msgSend_257( + _class_NSOrthography, + _sel_orthographyWithDominantScript_languageMap_, + script.pointer, + map.pointer); + return NSOrthography.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSOrthography init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSOrthography.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSOrthography new1() { + final _ret = _objc_msgSend_19(_class_NSOrthography, _sel_new); + return NSOrthography.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSOrthography allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSOrthography, _sel_allocWithZone_, zone); + return NSOrthography.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSOrthography alloc() { + final _ret = _objc_msgSend_19(_class_NSOrthography, _sel_alloc); + return NSOrthography.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSOrthography, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSOrthography, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSOrthography, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSOrthography, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSOrthography, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSOrthography, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSOrthography, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSOrthography, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSOrthography = objc.getClass("NSOrthography"); +late final _sel_dominantScript = objc.registerName("dominantScript"); +late final _sel_languageMap = objc.registerName("languageMap"); +final _objc_msgSend_256 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithDominantScript_languageMap_ = + objc.registerName("initWithDominantScript:languageMap:"); +final _objc_msgSend_257 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_languagesForScript_ = objc.registerName("languagesForScript:"); +late final _sel_dominantLanguageForScript_ = + objc.registerName("dominantLanguageForScript:"); +late final _sel_dominantLanguage = objc.registerName("dominantLanguage"); +late final _sel_allScripts = objc.registerName("allScripts"); +late final _sel_allLanguages = objc.registerName("allLanguages"); +late final _sel_defaultOrthographyForLanguage_ = + objc.registerName("defaultOrthographyForLanguage:"); +late final _sel_orthographyWithDominantScript_languageMap_ = + objc.registerName("orthographyWithDominantScript:languageMap:"); + +/// NSPointerArray +class NSPointerArray extends objc.NSObject { + NSPointerArray._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSPointerArray] that points to the same underlying object as [other]. + NSPointerArray.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSPointerArray] that wraps the given raw object pointer. + NSPointerArray.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSPointerArray]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSPointerArray); + } + + /// initWithOptions: + NSPointerArray initWithOptions_(NSPointerFunctionsOptions options) { + final _ret = + _objc_msgSend_258(this.pointer, _sel_initWithOptions_, options.value); + return NSPointerArray.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithPointerFunctions: + NSPointerArray initWithPointerFunctions_(NSPointerFunctions functions) { + final _ret = _objc_msgSend_272( + this.pointer, _sel_initWithPointerFunctions_, functions.pointer); + return NSPointerArray.castFromPointer(_ret, retain: true, release: true); + } + + /// pointerArrayWithOptions: + static NSPointerArray pointerArrayWithOptions_( + NSPointerFunctionsOptions options) { + final _ret = _objc_msgSend_273( + _class_NSPointerArray, _sel_pointerArrayWithOptions_, options.value); + return NSPointerArray.castFromPointer(_ret, retain: true, release: true); + } + + /// pointerArrayWithPointerFunctions: + static NSPointerArray pointerArrayWithPointerFunctions_( + NSPointerFunctions functions) { + final _ret = _objc_msgSend_274(_class_NSPointerArray, + _sel_pointerArrayWithPointerFunctions_, functions.pointer); + return NSPointerArray.castFromPointer(_ret, retain: true, release: true); + } + + /// pointerFunctions + NSPointerFunctions get pointerFunctions { + final _ret = _objc_msgSend_275(this.pointer, _sel_pointerFunctions); + return NSPointerFunctions.castFromPointer(_ret, + retain: true, release: true); + } + + /// pointerAtIndex: + ffi.Pointer pointerAtIndex_(int index) { + return _objc_msgSend_276(this.pointer, _sel_pointerAtIndex_, index); + } + + /// addPointer: + void addPointer_(ffi.Pointer pointer) { + _objc_msgSend_277(this.pointer, _sel_addPointer_, pointer); + } + + /// removePointerAtIndex: + void removePointerAtIndex_(int index) { + _objc_msgSend_278(this.pointer, _sel_removePointerAtIndex_, index); + } + + /// insertPointer:atIndex: + void insertPointer_atIndex_(ffi.Pointer item, int index) { + _objc_msgSend_279(this.pointer, _sel_insertPointer_atIndex_, item, index); + } + + /// replacePointerAtIndex:withPointer: + void replacePointerAtIndex_withPointer_( + int index, ffi.Pointer item) { + _objc_msgSend_280( + this.pointer, _sel_replacePointerAtIndex_withPointer_, index, item); + } + + /// compact + void compact() { + _objc_msgSend_7(this.pointer, _sel_compact); + } + + /// count + int get count { + return _objc_msgSend_56(this.pointer, _sel_count); + } + + /// setCount: + set count(int value) { + return _objc_msgSend_100(this.pointer, _sel_setCount_, value); + } + + /// strongObjectsPointerArray + static NSPointerArray strongObjectsPointerArray() { + final _ret = _objc_msgSend_281( + _class_NSPointerArray, _sel_strongObjectsPointerArray); + return NSPointerArray.castFromPointer(_ret, retain: true, release: true); + } + + /// weakObjectsPointerArray + static NSPointerArray weakObjectsPointerArray() { + final _ret = + _objc_msgSend_281(_class_NSPointerArray, _sel_weakObjectsPointerArray); + return NSPointerArray.castFromPointer(_ret, retain: true, release: true); + } + + /// allObjects + objc.NSArray get allObjects { + final _ret = _objc_msgSend_32(this.pointer, _sel_allObjects); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSPointerArray init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSPointerArray.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSPointerArray new1() { + final _ret = _objc_msgSend_19(_class_NSPointerArray, _sel_new); + return NSPointerArray.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSPointerArray allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSPointerArray, _sel_allocWithZone_, zone); + return NSPointerArray.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSPointerArray alloc() { + final _ret = _objc_msgSend_19(_class_NSPointerArray, _sel_alloc); + return NSPointerArray.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSPointerArray, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSPointerArray, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSPointerArray, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSPointerArray, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSPointerArray, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSPointerArray, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSPointerArray, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSPointerArray, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSPointerArray = objc.getClass("NSPointerArray"); + +enum NSPointerFunctionsOptions { + NSPointerFunctionsStrongMemory(0), + NSPointerFunctionsZeroingWeakMemory(1), + NSPointerFunctionsOpaqueMemory(2), + NSPointerFunctionsMallocMemory(3), + NSPointerFunctionsMachVirtualMemory(4), + NSPointerFunctionsWeakMemory(5), + NSPointerFunctionsOpaquePersonality(256), + NSPointerFunctionsObjectPointerPersonality(512), + NSPointerFunctionsCStringPersonality(768), + NSPointerFunctionsStructPersonality(1024), + NSPointerFunctionsIntegerPersonality(1280), + NSPointerFunctionsCopyIn(65536); + + static const NSPointerFunctionsObjectPersonality = + NSPointerFunctionsStrongMemory; + + final int value; + const NSPointerFunctionsOptions(this.value); + + static NSPointerFunctionsOptions fromValue(int value) => switch (value) { + 0 => NSPointerFunctionsStrongMemory, + 1 => NSPointerFunctionsZeroingWeakMemory, + 2 => NSPointerFunctionsOpaqueMemory, + 3 => NSPointerFunctionsMallocMemory, + 4 => NSPointerFunctionsMachVirtualMemory, + 5 => NSPointerFunctionsWeakMemory, + 256 => NSPointerFunctionsOpaquePersonality, + 512 => NSPointerFunctionsObjectPointerPersonality, + 768 => NSPointerFunctionsCStringPersonality, + 1024 => NSPointerFunctionsStructPersonality, + 1280 => NSPointerFunctionsIntegerPersonality, + 65536 => NSPointerFunctionsCopyIn, + _ => throw ArgumentError( + "Unknown value for NSPointerFunctionsOptions: $value"), + }; + + @override + String toString() { + if (this == NSPointerFunctionsStrongMemory) + return "NSPointerFunctionsOptions.NSPointerFunctionsStrongMemory, NSPointerFunctionsOptions.NSPointerFunctionsObjectPersonality"; + return super.toString(); + } +} + +late final _sel_initWithOptions_ = objc.registerName("initWithOptions:"); +final _objc_msgSend_258 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, int)>(); + +/// NSPointerFunctions +class NSPointerFunctions extends objc.NSObject { + NSPointerFunctions._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSPointerFunctions] that points to the same underlying object as [other]. + NSPointerFunctions.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSPointerFunctions] that wraps the given raw object pointer. + NSPointerFunctions.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSPointerFunctions]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSPointerFunctions); + } + + /// initWithOptions: + NSPointerFunctions initWithOptions_(NSPointerFunctionsOptions options) { + final _ret = + _objc_msgSend_258(this.pointer, _sel_initWithOptions_, options.value); + return NSPointerFunctions.castFromPointer(_ret, + retain: true, release: true); + } + + /// pointerFunctionsWithOptions: + static NSPointerFunctions pointerFunctionsWithOptions_( + NSPointerFunctionsOptions options) { + final _ret = _objc_msgSend_259(_class_NSPointerFunctions, + _sel_pointerFunctionsWithOptions_, options.value); + return NSPointerFunctions.castFromPointer(_ret, + retain: true, release: true); + } + + /// hashFunction + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>> + get hashFunction { + return _objc_msgSend_260(this.pointer, _sel_hashFunction); + } + + /// setHashFunction: + set hashFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + value) { + return _objc_msgSend_261(this.pointer, _sel_setHashFunction_, value); + } + + /// isEqualFunction + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>> + get isEqualFunction { + return _objc_msgSend_262(this.pointer, _sel_isEqualFunction); + } + + /// setIsEqualFunction: + set isEqualFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + value) { + return _objc_msgSend_263(this.pointer, _sel_setIsEqualFunction_, value); + } + + /// sizeFunction + ffi.Pointer< + ffi.NativeFunction)>> + get sizeFunction { + return _objc_msgSend_264(this.pointer, _sel_sizeFunction); + } + + /// setSizeFunction: + set sizeFunction( + ffi.Pointer< + ffi + .NativeFunction)>> + value) { + return _objc_msgSend_265(this.pointer, _sel_setSizeFunction_, value); + } + + /// descriptionFunction + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + get descriptionFunction { + return _objc_msgSend_266(this.pointer, _sel_descriptionFunction); + } + + /// setDescriptionFunction: + set descriptionFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + value) { + return _objc_msgSend_267(this.pointer, _sel_setDescriptionFunction_, value); + } + + /// relinquishFunction + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>> + get relinquishFunction { + return _objc_msgSend_268(this.pointer, _sel_relinquishFunction); + } + + /// setRelinquishFunction: + set relinquishFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + value) { + return _objc_msgSend_269(this.pointer, _sel_setRelinquishFunction_, value); + } + + /// acquireFunction + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>, + ffi.Bool)>> get acquireFunction { + return _objc_msgSend_270(this.pointer, _sel_acquireFunction); + } + + /// setAcquireFunction: + set acquireFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>, + ffi.Bool)>> + value) { + return _objc_msgSend_271(this.pointer, _sel_setAcquireFunction_, value); + } + + /// usesStrongWriteBarrier + bool get usesStrongWriteBarrier { + return _objc_msgSend_13(this.pointer, _sel_usesStrongWriteBarrier); + } + + /// setUsesStrongWriteBarrier: + set usesStrongWriteBarrier(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setUsesStrongWriteBarrier_, value); + } + + /// usesWeakReadAndWriteBarriers + bool get usesWeakReadAndWriteBarriers { + return _objc_msgSend_13(this.pointer, _sel_usesWeakReadAndWriteBarriers); + } + + /// setUsesWeakReadAndWriteBarriers: + set usesWeakReadAndWriteBarriers(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setUsesWeakReadAndWriteBarriers_, value); + } + + /// init + NSPointerFunctions init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSPointerFunctions.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSPointerFunctions new1() { + final _ret = _objc_msgSend_19(_class_NSPointerFunctions, _sel_new); + return NSPointerFunctions.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSPointerFunctions allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSPointerFunctions, _sel_allocWithZone_, zone); + return NSPointerFunctions.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSPointerFunctions alloc() { + final _ret = _objc_msgSend_19(_class_NSPointerFunctions, _sel_alloc); + return NSPointerFunctions.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSPointerFunctions, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSPointerFunctions, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSPointerFunctions, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSPointerFunctions, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSPointerFunctions, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSPointerFunctions, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSPointerFunctions, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSPointerFunctions, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSPointerFunctions = objc.getClass("NSPointerFunctions"); +late final _sel_pointerFunctionsWithOptions_ = + objc.registerName("pointerFunctionsWithOptions:"); +final _objc_msgSend_259 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_hashFunction = objc.registerName("hashFunction"); +final _objc_msgSend_260 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer, ffi.Pointer)>>)>> Function( + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); +late final _sel_setHashFunction_ = objc.registerName("setHashFunction:"); +final _objc_msgSend_261 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>(); +late final _sel_isEqualFunction = objc.registerName("isEqualFunction"); +final _objc_msgSend_262 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer, ffi.Pointer, ffi.Pointer)>>)>> Function( + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); +late final _sel_setIsEqualFunction_ = objc.registerName("setIsEqualFunction:"); +final _objc_msgSend_263 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>>)>(); +late final _sel_sizeFunction = objc.registerName("sizeFunction"); +final _objc_msgSend_264 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer)>> Function( + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>(); +late final _sel_setSizeFunction_ = objc.registerName("setSizeFunction:"); +final _objc_msgSend_265 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>(); +late final _sel_descriptionFunction = objc.registerName("descriptionFunction"); +final _objc_msgSend_266 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> Function( + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>(); +late final _sel_setDescriptionFunction_ = + objc.registerName("setDescriptionFunction:"); +final _objc_msgSend_267 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>)>(); +late final _sel_relinquishFunction = objc.registerName("relinquishFunction"); +final _objc_msgSend_268 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer, ffi.Pointer)>>)>> Function( + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); +late final _sel_setRelinquishFunction_ = + objc.registerName("setRelinquishFunction:"); +final _objc_msgSend_269 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>(); +late final _sel_acquireFunction = objc.registerName("acquireFunction"); +final _objc_msgSend_270 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>, ffi.Bool)>> Function( + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>, + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>(); +late final _sel_setAcquireFunction_ = objc.registerName("setAcquireFunction:"); +final _objc_msgSend_271 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>, + ffi.Bool)>>)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi + .NativeFunction)>>, + ffi.Bool)>>)>(); +late final _sel_usesStrongWriteBarrier = + objc.registerName("usesStrongWriteBarrier"); +late final _sel_setUsesStrongWriteBarrier_ = + objc.registerName("setUsesStrongWriteBarrier:"); +late final _sel_usesWeakReadAndWriteBarriers = + objc.registerName("usesWeakReadAndWriteBarriers"); +late final _sel_setUsesWeakReadAndWriteBarriers_ = + objc.registerName("setUsesWeakReadAndWriteBarriers:"); +late final _sel_initWithPointerFunctions_ = + objc.registerName("initWithPointerFunctions:"); +final _objc_msgSend_272 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_pointerArrayWithOptions_ = + objc.registerName("pointerArrayWithOptions:"); +final _objc_msgSend_273 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_pointerArrayWithPointerFunctions_ = + objc.registerName("pointerArrayWithPointerFunctions:"); +final _objc_msgSend_274 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_pointerFunctions = objc.registerName("pointerFunctions"); +final _objc_msgSend_275 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_pointerAtIndex_ = objc.registerName("pointerAtIndex:"); +final _objc_msgSend_276 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_addPointer_ = objc.registerName("addPointer:"); +final _objc_msgSend_277 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_removePointerAtIndex_ = + objc.registerName("removePointerAtIndex:"); +final _objc_msgSend_278 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_insertPointer_atIndex_ = + objc.registerName("insertPointer:atIndex:"); +final _objc_msgSend_279 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); +late final _sel_replacePointerAtIndex_withPointer_ = + objc.registerName("replacePointerAtIndex:withPointer:"); +final _objc_msgSend_280 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); +late final _sel_compact = objc.registerName("compact"); +late final _sel_count = objc.registerName("count"); +late final _sel_setCount_ = objc.registerName("setCount:"); +late final _sel_strongObjectsPointerArray = + objc.registerName("strongObjectsPointerArray"); +final _objc_msgSend_281 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_weakObjectsPointerArray = + objc.registerName("weakObjectsPointerArray"); +late final _sel_allObjects = objc.registerName("allObjects"); + +/// NSProcessInfo +class NSProcessInfo extends objc.NSObject { + NSProcessInfo._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSProcessInfo] that points to the same underlying object as [other]. + NSProcessInfo.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSProcessInfo] that wraps the given raw object pointer. + NSProcessInfo.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSProcessInfo]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSProcessInfo); + } + + /// processInfo + static NSProcessInfo getProcessInfo() { + final _ret = _objc_msgSend_282(_class_NSProcessInfo, _sel_processInfo); + return NSProcessInfo.castFromPointer(_ret, retain: true, release: true); + } + + /// environment + objc.NSDictionary get environment { + final _ret = _objc_msgSend_256(this.pointer, _sel_environment); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// arguments + objc.NSArray get arguments { + final _ret = _objc_msgSend_32(this.pointer, _sel_arguments); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// hostName + objc.NSString get hostName { + final _ret = _objc_msgSend_11(this.pointer, _sel_hostName); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// processName + objc.NSString get processName { + final _ret = _objc_msgSend_11(this.pointer, _sel_processName); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setProcessName: + set processName(objc.NSString value) { + return _objc_msgSend_12(this.pointer, _sel_setProcessName_, value.pointer); + } + + /// processIdentifier + int get processIdentifier { + return _objc_msgSend_157(this.pointer, _sel_processIdentifier); + } + + /// globallyUniqueString + objc.NSString get globallyUniqueString { + final _ret = _objc_msgSend_11(this.pointer, _sel_globallyUniqueString); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// operatingSystem + int operatingSystem() { + return _objc_msgSend_56(this.pointer, _sel_operatingSystem); + } + + /// operatingSystemName + objc.NSString operatingSystemName() { + final _ret = _objc_msgSend_11(this.pointer, _sel_operatingSystemName); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// operatingSystemVersionString + objc.NSString get operatingSystemVersionString { + final _ret = + _objc_msgSend_11(this.pointer, _sel_operatingSystemVersionString); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// operatingSystemVersion + void getOperatingSystemVersion(ffi.Pointer stret) { + objc.useMsgSendVariants + ? _objc_msgSend_283Stret( + stret, this.pointer, _sel_operatingSystemVersion) + : stret.ref = + _objc_msgSend_283(this.pointer, _sel_operatingSystemVersion); + } + + /// processorCount + int get processorCount { + return _objc_msgSend_56(this.pointer, _sel_processorCount); + } + + /// activeProcessorCount + int get activeProcessorCount { + return _objc_msgSend_56(this.pointer, _sel_activeProcessorCount); + } + + /// physicalMemory + int get physicalMemory { + return _objc_msgSend_160(this.pointer, _sel_physicalMemory); + } + + /// isOperatingSystemAtLeastVersion: + bool isOperatingSystemAtLeastVersion_(NSOperatingSystemVersion version) { + return _objc_msgSend_284( + this.pointer, _sel_isOperatingSystemAtLeastVersion_, version); + } + + /// systemUptime + double get systemUptime { + return objc.useMsgSendVariants + ? _objc_msgSend_18Fpret(this.pointer, _sel_systemUptime) + : _objc_msgSend_18(this.pointer, _sel_systemUptime); + } + + /// disableSuddenTermination + void disableSuddenTermination() { + _objc_msgSend_7(this.pointer, _sel_disableSuddenTermination); + } + + /// enableSuddenTermination + void enableSuddenTermination() { + _objc_msgSend_7(this.pointer, _sel_enableSuddenTermination); + } + + /// disableAutomaticTermination: + void disableAutomaticTermination_(objc.NSString reason) { + _objc_msgSend_285( + this.pointer, _sel_disableAutomaticTermination_, reason.pointer); + } + + /// enableAutomaticTermination: + void enableAutomaticTermination_(objc.NSString reason) { + _objc_msgSend_285( + this.pointer, _sel_enableAutomaticTermination_, reason.pointer); + } + + /// automaticTerminationSupportEnabled + bool get automaticTerminationSupportEnabled { + return _objc_msgSend_13( + this.pointer, _sel_automaticTerminationSupportEnabled); + } + + /// setAutomaticTerminationSupportEnabled: + set automaticTerminationSupportEnabled(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setAutomaticTerminationSupportEnabled_, value); + } + + /// beginActivityWithOptions:reason: + objc.ObjCObjectBase beginActivityWithOptions_reason_( + NSActivityOptions options, objc.NSString reason) { + final _ret = _objc_msgSend_286(this.pointer, + _sel_beginActivityWithOptions_reason_, options.value, reason.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// endActivity: + void endActivity_(objc.ObjCObjectBase activity) { + _objc_msgSend_27(this.pointer, _sel_endActivity_, activity.pointer); + } + + /// performActivityWithOptions:reason:usingBlock: + void performActivityWithOptions_reason_usingBlock_(NSActivityOptions options, + objc.NSString reason, ObjCBlock_ffiVoid block) { + _objc_msgSend_287( + this.pointer, + _sel_performActivityWithOptions_reason_usingBlock_, + options.value, + reason.pointer, + block.pointer); + } + + /// performExpiringActivityWithReason:usingBlock: + void performExpiringActivityWithReason_usingBlock_( + objc.NSString reason, ObjCBlock_ffiVoid_bool block) { + _objc_msgSend_288( + this.pointer, + _sel_performExpiringActivityWithReason_usingBlock_, + reason.pointer, + block.pointer); + } + + /// userName + objc.NSString get userName { + final _ret = _objc_msgSend_11(this.pointer, _sel_userName); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// fullUserName + objc.NSString get fullUserName { + final _ret = _objc_msgSend_11(this.pointer, _sel_fullUserName); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// thermalState + NSProcessInfoThermalState get thermalState { + final _ret = _objc_msgSend_289(this.pointer, _sel_thermalState); + return NSProcessInfoThermalState.fromValue(_ret); + } + + /// isLowPowerModeEnabled + bool get lowPowerModeEnabled { + return _objc_msgSend_13(this.pointer, _sel_isLowPowerModeEnabled); + } + + /// isMacCatalystApp + bool get macCatalystApp { + return _objc_msgSend_13(this.pointer, _sel_isMacCatalystApp); + } + + /// isiOSAppOnMac + bool get iOSAppOnMac { + return _objc_msgSend_13(this.pointer, _sel_isiOSAppOnMac); + } + + /// init + NSProcessInfo init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSProcessInfo.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSProcessInfo new1() { + final _ret = _objc_msgSend_19(_class_NSProcessInfo, _sel_new); + return NSProcessInfo.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSProcessInfo allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSProcessInfo, _sel_allocWithZone_, zone); + return NSProcessInfo.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSProcessInfo alloc() { + final _ret = _objc_msgSend_19(_class_NSProcessInfo, _sel_alloc); + return NSProcessInfo.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSProcessInfo, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSProcessInfo, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSProcessInfo, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSProcessInfo, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSProcessInfo, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSProcessInfo, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSProcessInfo, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSProcessInfo, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSProcessInfo = objc.getClass("NSProcessInfo"); +late final _sel_processInfo = objc.registerName("processInfo"); +final _objc_msgSend_282 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_environment = objc.registerName("environment"); +late final _sel_arguments = objc.registerName("arguments"); +late final _sel_hostName = objc.registerName("hostName"); +late final _sel_processName = objc.registerName("processName"); +late final _sel_setProcessName_ = objc.registerName("setProcessName:"); +late final _sel_processIdentifier = objc.registerName("processIdentifier"); +late final _sel_globallyUniqueString = + objc.registerName("globallyUniqueString"); +late final _sel_operatingSystem = objc.registerName("operatingSystem"); +late final _sel_operatingSystemName = objc.registerName("operatingSystemName"); +late final _sel_operatingSystemVersionString = + objc.registerName("operatingSystemVersionString"); + +final class NSOperatingSystemVersion extends ffi.Struct { + @ffi.Long() + external int majorVersion; + + @ffi.Long() + external int minorVersion; + + @ffi.Long() + external int patchVersion; +} + +late final _sel_operatingSystemVersion = + objc.registerName("operatingSystemVersion"); +final _objc_msgSend_283 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSOperatingSystemVersion Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + NSOperatingSystemVersion Function( + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_283Stret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_processorCount = objc.registerName("processorCount"); +late final _sel_activeProcessorCount = + objc.registerName("activeProcessorCount"); +late final _sel_physicalMemory = objc.registerName("physicalMemory"); +late final _sel_isOperatingSystemAtLeastVersion_ = + objc.registerName("isOperatingSystemAtLeastVersion:"); +final _objc_msgSend_284 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, NSOperatingSystemVersion)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, NSOperatingSystemVersion)>(); +late final _sel_systemUptime = objc.registerName("systemUptime"); +late final _sel_disableSuddenTermination = + objc.registerName("disableSuddenTermination"); +late final _sel_enableSuddenTermination = + objc.registerName("enableSuddenTermination"); +late final _sel_disableAutomaticTermination_ = + objc.registerName("disableAutomaticTermination:"); +final _objc_msgSend_285 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_enableAutomaticTermination_ = + objc.registerName("enableAutomaticTermination:"); +late final _sel_automaticTerminationSupportEnabled = + objc.registerName("automaticTerminationSupportEnabled"); +late final _sel_setAutomaticTerminationSupportEnabled_ = + objc.registerName("setAutomaticTerminationSupportEnabled:"); + +enum NSActivityOptions { + NSActivityIdleDisplaySleepDisabled(1099511627776), + NSActivityIdleSystemSleepDisabled(1048576), + NSActivitySuddenTerminationDisabled(16384), + NSActivityAutomaticTerminationDisabled(32768), + NSActivityAnimationTrackingEnabled(35184372088832), + NSActivityTrackingEnabled(70368744177664), + NSActivityUserInitiated(16777215), + NSActivityUserInitiatedAllowingIdleSystemSleep(15728639), + NSActivityBackground(255), + NSActivityLatencyCritical(1095216660480), + NSActivityUserInteractive(1095233437695); + + final int value; + const NSActivityOptions(this.value); + + static NSActivityOptions fromValue(int value) => switch (value) { + 1099511627776 => NSActivityIdleDisplaySleepDisabled, + 1048576 => NSActivityIdleSystemSleepDisabled, + 16384 => NSActivitySuddenTerminationDisabled, + 32768 => NSActivityAutomaticTerminationDisabled, + 35184372088832 => NSActivityAnimationTrackingEnabled, + 70368744177664 => NSActivityTrackingEnabled, + 16777215 => NSActivityUserInitiated, + 15728639 => NSActivityUserInitiatedAllowingIdleSystemSleep, + 255 => NSActivityBackground, + 1095216660480 => NSActivityLatencyCritical, + 1095233437695 => NSActivityUserInteractive, + _ => throw ArgumentError("Unknown value for NSActivityOptions: $value"), + }; +} + +late final _sel_beginActivityWithOptions_reason_ = + objc.registerName("beginActivityWithOptions:reason:"); +final _objc_msgSend_286 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_endActivity_ = objc.registerName("endActivity:"); +late final _sel_performActivityWithOptions_reason_usingBlock_ = + objc.registerName("performActivityWithOptions:reason:usingBlock:"); +final _objc_msgSend_287 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer)>(); +void _ObjCBlock_ffiVoid_bool_fnPtrTrampoline( + ffi.Pointer block, bool arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +void _ObjCBlock_ffiVoid_bool_closureTrampoline( + ffi.Pointer block, bool arg0) => + (objc.getBlockClosure(block) as void Function(bool))(arg0); + +class ObjCBlock_ffiVoid_bool extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_bool._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_bool castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_bool._(pointer, retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_bool.fromFunctionPointer( + ffi.Pointer> ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Bool)>(_ObjCBlock_ffiVoid_bool_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_bool.fromFunction(void Function(bool) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Bool)>(_ObjCBlock_ffiVoid_bool_closureTrampoline) + .cast(), + (bool arg0) => fn(arg0))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_bool.listener(void Function(bool) fn) + : this._((objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Bool)>.listener( + _ObjCBlock_ffiVoid_bool_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (bool arg0) => fn(arg0)))); + static ffi + .NativeCallable, ffi.Bool)>? + _dartFuncListenerTrampoline; + + void call(bool arg0) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, ffi.Bool arg0)>>() + .asFunction, bool)>()( + pointer, arg0); +} + +late final _sel_performExpiringActivityWithReason_usingBlock_ = + objc.registerName("performExpiringActivityWithReason:usingBlock:"); +final _objc_msgSend_288 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_userName = objc.registerName("userName"); +late final _sel_fullUserName = objc.registerName("fullUserName"); + +enum NSProcessInfoThermalState { + NSProcessInfoThermalStateNominal(0), + NSProcessInfoThermalStateFair(1), + NSProcessInfoThermalStateSerious(2), + NSProcessInfoThermalStateCritical(3); + + final int value; + const NSProcessInfoThermalState(this.value); + + static NSProcessInfoThermalState fromValue(int value) => switch (value) { + 0 => NSProcessInfoThermalStateNominal, + 1 => NSProcessInfoThermalStateFair, + 2 => NSProcessInfoThermalStateSerious, + 3 => NSProcessInfoThermalStateCritical, + _ => throw ArgumentError( + "Unknown value for NSProcessInfoThermalState: $value"), + }; +} + +late final _sel_thermalState = objc.registerName("thermalState"); +final _objc_msgSend_289 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_isLowPowerModeEnabled = + objc.registerName("isLowPowerModeEnabled"); +late final _sel_isMacCatalystApp = objc.registerName("isMacCatalystApp"); +late final _sel_isiOSAppOnMac = objc.registerName("isiOSAppOnMac"); + +/// NSTextCheckingResult +class NSTextCheckingResult extends objc.NSObject { + NSTextCheckingResult._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSTextCheckingResult] that points to the same underlying object as [other]. + NSTextCheckingResult.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSTextCheckingResult] that wraps the given raw object pointer. + NSTextCheckingResult.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSTextCheckingResult]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSTextCheckingResult); + } + + /// resultType + NSTextCheckingType get resultType { + final _ret = _objc_msgSend_290(this.pointer, _sel_resultType); + return NSTextCheckingType.fromValue(_ret); + } + + /// range + void getRange(ffi.Pointer<_NSRange> stret) { + objc.useMsgSendVariants + ? _objc_msgSend_291Stret(stret, this.pointer, _sel_range) + : stret.ref = _objc_msgSend_291(this.pointer, _sel_range); + } + + /// orthography + NSOrthography? get orthography { + final _ret = _objc_msgSend_292(this.pointer, _sel_orthography); + return _ret.address == 0 + ? null + : NSOrthography.castFromPointer(_ret, retain: true, release: true); + } + + /// grammarDetails + objc.NSArray? get grammarDetails { + final _ret = _objc_msgSend_87(this.pointer, _sel_grammarDetails); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// date + objc.NSDate? get date { + final _ret = _objc_msgSend_206(this.pointer, _sel_date); + return _ret.address == 0 + ? null + : objc.NSDate.castFromPointer(_ret, retain: true, release: true); + } + + /// timeZone + NSTimeZone? get timeZone { + final _ret = _objc_msgSend_305(this.pointer, _sel_timeZone); + return _ret.address == 0 + ? null + : NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// duration + double get duration { + return objc.useMsgSendVariants + ? _objc_msgSend_18Fpret(this.pointer, _sel_duration) + : _objc_msgSend_18(this.pointer, _sel_duration); + } + + /// components + objc.NSDictionary? get components { + final _ret = _objc_msgSend_83(this.pointer, _sel_components); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// URL + objc.NSURL? get URL { + final _ret = _objc_msgSend_24(this.pointer, _sel_URL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// replacementString + objc.NSString? get replacementString { + final _ret = _objc_msgSend_20(this.pointer, _sel_replacementString); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// alternativeStrings + objc.NSArray? get alternativeStrings { + final _ret = _objc_msgSend_87(this.pointer, _sel_alternativeStrings); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// regularExpression + NSRegularExpression? get regularExpression { + final _ret = _objc_msgSend_317(this.pointer, _sel_regularExpression); + return _ret.address == 0 + ? null + : NSRegularExpression.castFromPointer(_ret, + retain: true, release: true); + } + + /// phoneNumber + objc.NSString? get phoneNumber { + final _ret = _objc_msgSend_20(this.pointer, _sel_phoneNumber); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// numberOfRanges + int get numberOfRanges { + return _objc_msgSend_56(this.pointer, _sel_numberOfRanges); + } + + /// rangeAtIndex: + void rangeAtIndex_(ffi.Pointer<_NSRange> stret, int idx) { + objc.useMsgSendVariants + ? _objc_msgSend_318Stret(stret, this.pointer, _sel_rangeAtIndex_, idx) + : stret.ref = _objc_msgSend_318(this.pointer, _sel_rangeAtIndex_, idx); + } + + /// rangeWithName: + void rangeWithName_(ffi.Pointer<_NSRange> stret, objc.NSString name) { + objc.useMsgSendVariants + ? _objc_msgSend_319Stret( + stret, this.pointer, _sel_rangeWithName_, name.pointer) + : stret.ref = + _objc_msgSend_319(this.pointer, _sel_rangeWithName_, name.pointer); + } + + /// resultByAdjustingRangesWithOffset: + NSTextCheckingResult resultByAdjustingRangesWithOffset_(int offset) { + final _ret = _objc_msgSend_320( + this.pointer, _sel_resultByAdjustingRangesWithOffset_, offset); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// addressComponents + objc.NSDictionary? get addressComponents { + final _ret = _objc_msgSend_83(this.pointer, _sel_addressComponents); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// orthographyCheckingResultWithRange:orthography: + static NSTextCheckingResult orthographyCheckingResultWithRange_orthography_( + _NSRange range, NSOrthography orthography) { + final _ret = _objc_msgSend_321( + _class_NSTextCheckingResult, + _sel_orthographyCheckingResultWithRange_orthography_, + range, + orthography.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// spellCheckingResultWithRange: + static NSTextCheckingResult spellCheckingResultWithRange_(_NSRange range) { + final _ret = _objc_msgSend_322( + _class_NSTextCheckingResult, _sel_spellCheckingResultWithRange_, range); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// grammarCheckingResultWithRange:details: + static NSTextCheckingResult grammarCheckingResultWithRange_details_( + _NSRange range, objc.NSArray details) { + final _ret = _objc_msgSend_323(_class_NSTextCheckingResult, + _sel_grammarCheckingResultWithRange_details_, range, details.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// dateCheckingResultWithRange:date: + static NSTextCheckingResult dateCheckingResultWithRange_date_( + _NSRange range, objc.NSDate date) { + final _ret = _objc_msgSend_324(_class_NSTextCheckingResult, + _sel_dateCheckingResultWithRange_date_, range, date.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// dateCheckingResultWithRange:date:timeZone:duration: + static NSTextCheckingResult + dateCheckingResultWithRange_date_timeZone_duration_(_NSRange range, + objc.NSDate date, NSTimeZone timeZone, double duration) { + final _ret = _objc_msgSend_325( + _class_NSTextCheckingResult, + _sel_dateCheckingResultWithRange_date_timeZone_duration_, + range, + date.pointer, + timeZone.pointer, + duration); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// addressCheckingResultWithRange:components: + static NSTextCheckingResult addressCheckingResultWithRange_components_( + _NSRange range, objc.NSDictionary components) { + final _ret = _objc_msgSend_326( + _class_NSTextCheckingResult, + _sel_addressCheckingResultWithRange_components_, + range, + components.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// linkCheckingResultWithRange:URL: + static NSTextCheckingResult linkCheckingResultWithRange_URL_( + _NSRange range, objc.NSURL url) { + final _ret = _objc_msgSend_327(_class_NSTextCheckingResult, + _sel_linkCheckingResultWithRange_URL_, range, url.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// quoteCheckingResultWithRange:replacementString: + static NSTextCheckingResult quoteCheckingResultWithRange_replacementString_( + _NSRange range, objc.NSString replacementString) { + final _ret = _objc_msgSend_328( + _class_NSTextCheckingResult, + _sel_quoteCheckingResultWithRange_replacementString_, + range, + replacementString.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// dashCheckingResultWithRange:replacementString: + static NSTextCheckingResult dashCheckingResultWithRange_replacementString_( + _NSRange range, objc.NSString replacementString) { + final _ret = _objc_msgSend_328( + _class_NSTextCheckingResult, + _sel_dashCheckingResultWithRange_replacementString_, + range, + replacementString.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// replacementCheckingResultWithRange:replacementString: + static NSTextCheckingResult + replacementCheckingResultWithRange_replacementString_( + _NSRange range, objc.NSString replacementString) { + final _ret = _objc_msgSend_328( + _class_NSTextCheckingResult, + _sel_replacementCheckingResultWithRange_replacementString_, + range, + replacementString.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// correctionCheckingResultWithRange:replacementString: + static NSTextCheckingResult + correctionCheckingResultWithRange_replacementString_( + _NSRange range, objc.NSString replacementString) { + final _ret = _objc_msgSend_328( + _class_NSTextCheckingResult, + _sel_correctionCheckingResultWithRange_replacementString_, + range, + replacementString.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// correctionCheckingResultWithRange:replacementString:alternativeStrings: + static NSTextCheckingResult + correctionCheckingResultWithRange_replacementString_alternativeStrings_( + _NSRange range, + objc.NSString replacementString, + objc.NSArray alternativeStrings) { + final _ret = _objc_msgSend_329( + _class_NSTextCheckingResult, + _sel_correctionCheckingResultWithRange_replacementString_alternativeStrings_, + range, + replacementString.pointer, + alternativeStrings.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// regularExpressionCheckingResultWithRanges:count:regularExpression: + static NSTextCheckingResult + regularExpressionCheckingResultWithRanges_count_regularExpression_( + ffi.Pointer<_NSRange> ranges, + int count, + NSRegularExpression regularExpression) { + final _ret = _objc_msgSend_330( + _class_NSTextCheckingResult, + _sel_regularExpressionCheckingResultWithRanges_count_regularExpression_, + ranges, + count, + regularExpression.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// phoneNumberCheckingResultWithRange:phoneNumber: + static NSTextCheckingResult phoneNumberCheckingResultWithRange_phoneNumber_( + _NSRange range, objc.NSString phoneNumber) { + final _ret = _objc_msgSend_328( + _class_NSTextCheckingResult, + _sel_phoneNumberCheckingResultWithRange_phoneNumber_, + range, + phoneNumber.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// transitInformationCheckingResultWithRange:components: + static NSTextCheckingResult + transitInformationCheckingResultWithRange_components_( + _NSRange range, objc.NSDictionary components) { + final _ret = _objc_msgSend_326( + _class_NSTextCheckingResult, + _sel_transitInformationCheckingResultWithRange_components_, + range, + components.pointer); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// init + NSTextCheckingResult init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSTextCheckingResult new1() { + final _ret = _objc_msgSend_19(_class_NSTextCheckingResult, _sel_new); + return NSTextCheckingResult.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSTextCheckingResult allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28( + _class_NSTextCheckingResult, _sel_allocWithZone_, zone); + return NSTextCheckingResult.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSTextCheckingResult alloc() { + final _ret = _objc_msgSend_19(_class_NSTextCheckingResult, _sel_alloc); + return NSTextCheckingResult.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSTextCheckingResult, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSTextCheckingResult, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSTextCheckingResult, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13( + _class_NSTextCheckingResult, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSTextCheckingResult, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSTextCheckingResult, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSTextCheckingResult, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSTextCheckingResult, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSTextCheckingResult = objc.getClass("NSTextCheckingResult"); + +enum NSTextCheckingType { + NSTextCheckingTypeOrthography(1), + NSTextCheckingTypeSpelling(2), + NSTextCheckingTypeGrammar(4), + NSTextCheckingTypeDate(8), + NSTextCheckingTypeAddress(16), + NSTextCheckingTypeLink(32), + NSTextCheckingTypeQuote(64), + NSTextCheckingTypeDash(128), + NSTextCheckingTypeReplacement(256), + NSTextCheckingTypeCorrection(512), + NSTextCheckingTypeRegularExpression(1024), + NSTextCheckingTypePhoneNumber(2048), + NSTextCheckingTypeTransitInformation(4096); + + final int value; + const NSTextCheckingType(this.value); + + static NSTextCheckingType fromValue(int value) => switch (value) { + 1 => NSTextCheckingTypeOrthography, + 2 => NSTextCheckingTypeSpelling, + 4 => NSTextCheckingTypeGrammar, + 8 => NSTextCheckingTypeDate, + 16 => NSTextCheckingTypeAddress, + 32 => NSTextCheckingTypeLink, + 64 => NSTextCheckingTypeQuote, + 128 => NSTextCheckingTypeDash, + 256 => NSTextCheckingTypeReplacement, + 512 => NSTextCheckingTypeCorrection, + 1024 => NSTextCheckingTypeRegularExpression, + 2048 => NSTextCheckingTypePhoneNumber, + 4096 => NSTextCheckingTypeTransitInformation, + _ => + throw ArgumentError("Unknown value for NSTextCheckingType: $value"), + }; +} + +late final _sel_resultType = objc.registerName("resultType"); +final _objc_msgSend_290 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Uint64 Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_range = objc.registerName("range"); +final _objc_msgSend_291 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + _NSRange Function( + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_291Stret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer)>(); +late final _sel_orthography = objc.registerName("orthography"); +final _objc_msgSend_292 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_grammarDetails = objc.registerName("grammarDetails"); +late final _sel_date = objc.registerName("date"); + +/// NSTimeZone +class NSTimeZone extends objc.NSObject { + NSTimeZone._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSTimeZone] that points to the same underlying object as [other]. + NSTimeZone.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSTimeZone] that wraps the given raw object pointer. + NSTimeZone.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSTimeZone]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0(obj.pointer, _sel_isKindOfClass_, _class_NSTimeZone); + } + + /// name + objc.NSString get name { + final _ret = _objc_msgSend_11(this.pointer, _sel_name); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// data + objc.NSData get data { + final _ret = _objc_msgSend_143(this.pointer, _sel_data); + return objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// secondsFromGMTForDate: + int secondsFromGMTForDate_(objc.NSDate aDate) { + return _objc_msgSend_293( + this.pointer, _sel_secondsFromGMTForDate_, aDate.pointer); + } + + /// abbreviationForDate: + objc.NSString? abbreviationForDate_(objc.NSDate aDate) { + final _ret = _objc_msgSend_294( + this.pointer, _sel_abbreviationForDate_, aDate.pointer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// isDaylightSavingTimeForDate: + bool isDaylightSavingTimeForDate_(objc.NSDate aDate) { + return _objc_msgSend_295( + this.pointer, _sel_isDaylightSavingTimeForDate_, aDate.pointer); + } + + /// daylightSavingTimeOffsetForDate: + double daylightSavingTimeOffsetForDate_(objc.NSDate aDate) { + return objc.useMsgSendVariants + ? _objc_msgSend_296Fpret( + this.pointer, _sel_daylightSavingTimeOffsetForDate_, aDate.pointer) + : _objc_msgSend_296( + this.pointer, _sel_daylightSavingTimeOffsetForDate_, aDate.pointer); + } + + /// nextDaylightSavingTimeTransitionAfterDate: + objc.NSDate? nextDaylightSavingTimeTransitionAfterDate_(objc.NSDate aDate) { + final _ret = _objc_msgSend_297(this.pointer, + _sel_nextDaylightSavingTimeTransitionAfterDate_, aDate.pointer); + return _ret.address == 0 + ? null + : objc.NSDate.castFromPointer(_ret, retain: true, release: true); + } + + /// systemTimeZone + static NSTimeZone getSystemTimeZone() { + final _ret = _objc_msgSend_298(_class_NSTimeZone, _sel_systemTimeZone); + return NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// resetSystemTimeZone + static void resetSystemTimeZone() { + _objc_msgSend_7(_class_NSTimeZone, _sel_resetSystemTimeZone); + } + + /// defaultTimeZone + static NSTimeZone getDefaultTimeZone() { + final _ret = _objc_msgSend_298(_class_NSTimeZone, _sel_defaultTimeZone); + return NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// setDefaultTimeZone: + static void setDefaultTimeZone(NSTimeZone value) { + return _objc_msgSend_299( + _class_NSTimeZone, _sel_setDefaultTimeZone_, value.pointer); + } + + /// localTimeZone + static NSTimeZone getLocalTimeZone() { + final _ret = _objc_msgSend_298(_class_NSTimeZone, _sel_localTimeZone); + return NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// knownTimeZoneNames + static objc.NSArray getKnownTimeZoneNames() { + final _ret = _objc_msgSend_32(_class_NSTimeZone, _sel_knownTimeZoneNames); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// abbreviationDictionary + static objc.NSDictionary getAbbreviationDictionary() { + final _ret = + _objc_msgSend_256(_class_NSTimeZone, _sel_abbreviationDictionary); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// setAbbreviationDictionary: + static void setAbbreviationDictionary(objc.NSDictionary value) { + return _objc_msgSend_300( + _class_NSTimeZone, _sel_setAbbreviationDictionary_, value.pointer); + } + + /// timeZoneDataVersion + static objc.NSString getTimeZoneDataVersion() { + final _ret = _objc_msgSend_11(_class_NSTimeZone, _sel_timeZoneDataVersion); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// secondsFromGMT + int get secondsFromGMT { + return _objc_msgSend_250(this.pointer, _sel_secondsFromGMT); + } + + /// abbreviation + objc.NSString? get abbreviation { + final _ret = _objc_msgSend_20(this.pointer, _sel_abbreviation); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// isDaylightSavingTime + bool get daylightSavingTime { + return _objc_msgSend_13(this.pointer, _sel_isDaylightSavingTime); + } + + /// daylightSavingTimeOffset + double get daylightSavingTimeOffset { + return objc.useMsgSendVariants + ? _objc_msgSend_18Fpret(this.pointer, _sel_daylightSavingTimeOffset) + : _objc_msgSend_18(this.pointer, _sel_daylightSavingTimeOffset); + } + + /// nextDaylightSavingTimeTransition + objc.NSDate? get nextDaylightSavingTimeTransition { + final _ret = + _objc_msgSend_206(this.pointer, _sel_nextDaylightSavingTimeTransition); + return _ret.address == 0 + ? null + : objc.NSDate.castFromPointer(_ret, retain: true, release: true); + } + + /// description + objc.NSString get description { + final _ret = _objc_msgSend_11(this.pointer, _sel_description); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// isEqualToTimeZone: + bool isEqualToTimeZone_(NSTimeZone aTimeZone) { + return _objc_msgSend_301( + this.pointer, _sel_isEqualToTimeZone_, aTimeZone.pointer); + } + + /// localizedName:locale: + objc.NSString? localizedName_locale_( + NSTimeZoneNameStyle style, objc.NSLocale? locale) { + final _ret = _objc_msgSend_302(this.pointer, _sel_localizedName_locale_, + style.value, locale?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// timeZoneWithName: + static NSTimeZone? timeZoneWithName_(objc.NSString tzName) { + final _ret = _objc_msgSend_34( + _class_NSTimeZone, _sel_timeZoneWithName_, tzName.pointer); + return _ret.address == 0 + ? null + : NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// timeZoneWithName:data: + static NSTimeZone? timeZoneWithName_data_( + objc.NSString tzName, objc.NSData? aData) { + final _ret = _objc_msgSend_303( + _class_NSTimeZone, + _sel_timeZoneWithName_data_, + tzName.pointer, + aData?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithName: + NSTimeZone? initWithName_(objc.NSString tzName) { + final _ret = + _objc_msgSend_34(this.pointer, _sel_initWithName_, tzName.pointer); + return _ret.address == 0 + ? null + : NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithName:data: + NSTimeZone? initWithName_data_(objc.NSString tzName, objc.NSData? aData) { + final _ret = _objc_msgSend_303(this.pointer, _sel_initWithName_data_, + tzName.pointer, aData?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// timeZoneForSecondsFromGMT: + static NSTimeZone timeZoneForSecondsFromGMT_(int seconds) { + final _ret = _objc_msgSend_304( + _class_NSTimeZone, _sel_timeZoneForSecondsFromGMT_, seconds); + return NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// timeZoneWithAbbreviation: + static NSTimeZone? timeZoneWithAbbreviation_(objc.NSString abbreviation) { + final _ret = _objc_msgSend_34(_class_NSTimeZone, + _sel_timeZoneWithAbbreviation_, abbreviation.pointer); + return _ret.address == 0 + ? null + : NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSTimeZone init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSTimeZone.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSTimeZone new1() { + final _ret = _objc_msgSend_19(_class_NSTimeZone, _sel_new); + return NSTimeZone.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSTimeZone allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28(_class_NSTimeZone, _sel_allocWithZone_, zone); + return NSTimeZone.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSTimeZone alloc() { + final _ret = _objc_msgSend_19(_class_NSTimeZone, _sel_alloc); + return NSTimeZone.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSTimeZone, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSTimeZone, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSTimeZone, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSTimeZone, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSTimeZone, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSTimeZone, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSTimeZone, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSTimeZone, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSTimeZone = objc.getClass("NSTimeZone"); +late final _sel_data = objc.registerName("data"); +late final _sel_secondsFromGMTForDate_ = + objc.registerName("secondsFromGMTForDate:"); +final _objc_msgSend_293 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Long Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_abbreviationForDate_ = + objc.registerName("abbreviationForDate:"); +final _objc_msgSend_294 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_isDaylightSavingTimeForDate_ = + objc.registerName("isDaylightSavingTimeForDate:"); +final _objc_msgSend_295 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_daylightSavingTimeOffsetForDate_ = + objc.registerName("daylightSavingTimeOffsetForDate:"); +final _objc_msgSend_296 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_296Fpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_nextDaylightSavingTimeTransitionAfterDate_ = + objc.registerName("nextDaylightSavingTimeTransitionAfterDate:"); +final _objc_msgSend_297 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_systemTimeZone = objc.registerName("systemTimeZone"); +final _objc_msgSend_298 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_resetSystemTimeZone = objc.registerName("resetSystemTimeZone"); +late final _sel_defaultTimeZone = objc.registerName("defaultTimeZone"); +late final _sel_setDefaultTimeZone_ = objc.registerName("setDefaultTimeZone:"); +final _objc_msgSend_299 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_localTimeZone = objc.registerName("localTimeZone"); +late final _sel_knownTimeZoneNames = objc.registerName("knownTimeZoneNames"); +late final _sel_abbreviationDictionary = + objc.registerName("abbreviationDictionary"); +late final _sel_setAbbreviationDictionary_ = + objc.registerName("setAbbreviationDictionary:"); +final _objc_msgSend_300 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_timeZoneDataVersion = objc.registerName("timeZoneDataVersion"); +late final _sel_secondsFromGMT = objc.registerName("secondsFromGMT"); +late final _sel_abbreviation = objc.registerName("abbreviation"); +late final _sel_isDaylightSavingTime = + objc.registerName("isDaylightSavingTime"); +late final _sel_daylightSavingTimeOffset = + objc.registerName("daylightSavingTimeOffset"); +late final _sel_nextDaylightSavingTimeTransition = + objc.registerName("nextDaylightSavingTimeTransition"); +late final _sel_description = objc.registerName("description"); +late final _sel_isEqualToTimeZone_ = objc.registerName("isEqualToTimeZone:"); +final _objc_msgSend_301 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + +enum NSTimeZoneNameStyle { + NSTimeZoneNameStyleStandard(0), + NSTimeZoneNameStyleShortStandard(1), + NSTimeZoneNameStyleDaylightSaving(2), + NSTimeZoneNameStyleShortDaylightSaving(3), + NSTimeZoneNameStyleGeneric(4), + NSTimeZoneNameStyleShortGeneric(5); + + final int value; + const NSTimeZoneNameStyle(this.value); + + static NSTimeZoneNameStyle fromValue(int value) => switch (value) { + 0 => NSTimeZoneNameStyleStandard, + 1 => NSTimeZoneNameStyleShortStandard, + 2 => NSTimeZoneNameStyleDaylightSaving, + 3 => NSTimeZoneNameStyleShortDaylightSaving, + 4 => NSTimeZoneNameStyleGeneric, + 5 => NSTimeZoneNameStyleShortGeneric, + _ => + throw ArgumentError("Unknown value for NSTimeZoneNameStyle: $value"), + }; +} + +late final _sel_localizedName_locale_ = + objc.registerName("localizedName:locale:"); +final _objc_msgSend_302 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_timeZoneWithName_ = objc.registerName("timeZoneWithName:"); +late final _sel_timeZoneWithName_data_ = + objc.registerName("timeZoneWithName:data:"); +final _objc_msgSend_303 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_initWithName_ = objc.registerName("initWithName:"); +late final _sel_initWithName_data_ = objc.registerName("initWithName:data:"); +late final _sel_timeZoneForSecondsFromGMT_ = + objc.registerName("timeZoneForSecondsFromGMT:"); +final _objc_msgSend_304 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_timeZoneWithAbbreviation_ = + objc.registerName("timeZoneWithAbbreviation:"); +late final _sel_timeZone = objc.registerName("timeZone"); +final _objc_msgSend_305 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_duration = objc.registerName("duration"); +late final _sel_components = objc.registerName("components"); +late final _sel_URL = objc.registerName("URL"); +late final _sel_replacementString = objc.registerName("replacementString"); +late final _sel_alternativeStrings = objc.registerName("alternativeStrings"); + +/// NSRegularExpression +class NSRegularExpression extends objc.NSObject { + NSRegularExpression._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSRegularExpression] that points to the same underlying object as [other]. + NSRegularExpression.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSRegularExpression] that wraps the given raw object pointer. + NSRegularExpression.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSRegularExpression]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSRegularExpression); + } + + /// regularExpressionWithPattern:options:error: + static NSRegularExpression? regularExpressionWithPattern_options_error_( + objc.NSString pattern, + NSRegularExpressionOptions options, + ffi.Pointer> error) { + final _ret = _objc_msgSend_306( + _class_NSRegularExpression, + _sel_regularExpressionWithPattern_options_error_, + pattern.pointer, + options.value, + error); + return _ret.address == 0 + ? null + : NSRegularExpression.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithPattern:options:error: + NSRegularExpression? initWithPattern_options_error_( + objc.NSString pattern, + NSRegularExpressionOptions options, + ffi.Pointer> error) { + final _ret = _objc_msgSend_307( + this.pointer, + _sel_initWithPattern_options_error_, + pattern.pointer, + options.value, + error); + return _ret.address == 0 + ? null + : NSRegularExpression.castFromPointer(_ret, + retain: true, release: true); + } + + /// pattern + objc.NSString get pattern { + final _ret = _objc_msgSend_11(this.pointer, _sel_pattern); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// options + NSRegularExpressionOptions get options { + final _ret = _objc_msgSend_308(this.pointer, _sel_options); + return NSRegularExpressionOptions.fromValue(_ret); + } + + /// numberOfCaptureGroups + int get numberOfCaptureGroups { + return _objc_msgSend_56(this.pointer, _sel_numberOfCaptureGroups); + } + + /// escapedPatternForString: + static objc.NSString escapedPatternForString_(objc.NSString string) { + final _ret = _objc_msgSend_188(_class_NSRegularExpression, + _sel_escapedPatternForString_, string.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// enumerateMatchesInString:options:range:usingBlock: + void enumerateMatchesInString_options_range_usingBlock_( + objc.NSString string, + NSMatchingOptions options, + _NSRange range, + ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool block) { + _objc_msgSend_309( + this.pointer, + _sel_enumerateMatchesInString_options_range_usingBlock_, + string.pointer, + options.value, + range, + block.pointer); + } + + /// matchesInString:options:range: + objc.NSArray matchesInString_options_range_( + objc.NSString string, NSMatchingOptions options, _NSRange range) { + final _ret = _objc_msgSend_310( + this.pointer, + _sel_matchesInString_options_range_, + string.pointer, + options.value, + range); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// numberOfMatchesInString:options:range: + int numberOfMatchesInString_options_range_( + objc.NSString string, NSMatchingOptions options, _NSRange range) { + return _objc_msgSend_311( + this.pointer, + _sel_numberOfMatchesInString_options_range_, + string.pointer, + options.value, + range); + } + + /// firstMatchInString:options:range: + NSTextCheckingResult? firstMatchInString_options_range_( + objc.NSString string, NSMatchingOptions options, _NSRange range) { + final _ret = _objc_msgSend_312( + this.pointer, + _sel_firstMatchInString_options_range_, + string.pointer, + options.value, + range); + return _ret.address == 0 + ? null + : NSTextCheckingResult.castFromPointer(_ret, + retain: true, release: true); + } + + /// rangeOfFirstMatchInString:options:range: + void rangeOfFirstMatchInString_options_range_(ffi.Pointer<_NSRange> stret, + objc.NSString string, NSMatchingOptions options, _NSRange range) { + objc.useMsgSendVariants + ? _objc_msgSend_313Stret( + stret, + this.pointer, + _sel_rangeOfFirstMatchInString_options_range_, + string.pointer, + options.value, + range) + : stret.ref = _objc_msgSend_313( + this.pointer, + _sel_rangeOfFirstMatchInString_options_range_, + string.pointer, + options.value, + range); + } + + /// stringByReplacingMatchesInString:options:range:withTemplate: + objc.NSString stringByReplacingMatchesInString_options_range_withTemplate_( + objc.NSString string, + NSMatchingOptions options, + _NSRange range, + objc.NSString templ) { + final _ret = _objc_msgSend_314( + this.pointer, + _sel_stringByReplacingMatchesInString_options_range_withTemplate_, + string.pointer, + options.value, + range, + templ.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// replaceMatchesInString:options:range:withTemplate: + int replaceMatchesInString_options_range_withTemplate_( + objc.NSMutableString string, + NSMatchingOptions options, + _NSRange range, + objc.NSString templ) { + return _objc_msgSend_315( + this.pointer, + _sel_replaceMatchesInString_options_range_withTemplate_, + string.pointer, + options.value, + range, + templ.pointer); + } + + /// replacementStringForResult:inString:offset:template: + objc.NSString replacementStringForResult_inString_offset_template_( + NSTextCheckingResult result, + objc.NSString string, + int offset, + objc.NSString templ) { + final _ret = _objc_msgSend_316( + this.pointer, + _sel_replacementStringForResult_inString_offset_template_, + result.pointer, + string.pointer, + offset, + templ.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// escapedTemplateForString: + static objc.NSString escapedTemplateForString_(objc.NSString string) { + final _ret = _objc_msgSend_188(_class_NSRegularExpression, + _sel_escapedTemplateForString_, string.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSRegularExpression init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSRegularExpression.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSRegularExpression new1() { + final _ret = _objc_msgSend_19(_class_NSRegularExpression, _sel_new); + return NSRegularExpression.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSRegularExpression allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSRegularExpression, _sel_allocWithZone_, zone); + return NSRegularExpression.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSRegularExpression alloc() { + final _ret = _objc_msgSend_19(_class_NSRegularExpression, _sel_alloc); + return NSRegularExpression.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSRegularExpression, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSRegularExpression, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSRegularExpression, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSRegularExpression, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSRegularExpression, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSRegularExpression, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSRegularExpression, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSRegularExpression, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSRegularExpression = objc.getClass("NSRegularExpression"); + +enum NSRegularExpressionOptions { + NSRegularExpressionCaseInsensitive(1), + NSRegularExpressionAllowCommentsAndWhitespace(2), + NSRegularExpressionIgnoreMetacharacters(4), + NSRegularExpressionDotMatchesLineSeparators(8), + NSRegularExpressionAnchorsMatchLines(16), + NSRegularExpressionUseUnixLineSeparators(32), + NSRegularExpressionUseUnicodeWordBoundaries(64); + + final int value; + const NSRegularExpressionOptions(this.value); + + static NSRegularExpressionOptions fromValue(int value) => switch (value) { + 1 => NSRegularExpressionCaseInsensitive, + 2 => NSRegularExpressionAllowCommentsAndWhitespace, + 4 => NSRegularExpressionIgnoreMetacharacters, + 8 => NSRegularExpressionDotMatchesLineSeparators, + 16 => NSRegularExpressionAnchorsMatchLines, + 32 => NSRegularExpressionUseUnixLineSeparators, + 64 => NSRegularExpressionUseUnicodeWordBoundaries, + _ => throw ArgumentError( + "Unknown value for NSRegularExpressionOptions: $value"), + }; +} + +late final _sel_regularExpressionWithPattern_options_error_ = + objc.registerName("regularExpressionWithPattern:options:error:"); +final _objc_msgSend_306 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); +late final _sel_initWithPattern_options_error_ = + objc.registerName("initWithPattern:options:error:"); +final _objc_msgSend_307 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); +late final _sel_pattern = objc.registerName("pattern"); +late final _sel_options = objc.registerName("options"); +final _objc_msgSend_308 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_numberOfCaptureGroups = + objc.registerName("numberOfCaptureGroups"); +late final _sel_escapedPatternForString_ = + objc.registerName("escapedPatternForString:"); + +enum NSMatchingOptions { + NSMatchingReportProgress(1), + NSMatchingReportCompletion(2), + NSMatchingAnchored(4), + NSMatchingWithTransparentBounds(8), + NSMatchingWithoutAnchoringBounds(16); + + final int value; + const NSMatchingOptions(this.value); + + static NSMatchingOptions fromValue(int value) => switch (value) { + 1 => NSMatchingReportProgress, + 2 => NSMatchingReportCompletion, + 4 => NSMatchingAnchored, + 8 => NSMatchingWithTransparentBounds, + 16 => NSMatchingWithoutAnchoringBounds, + _ => throw ArgumentError("Unknown value for NSMatchingOptions: $value"), + }; +} + +void + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.UnsignedLong arg1, ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, int, + ffi.Pointer)>()(arg0, arg1, arg2); +void + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + int, + ffi.Pointer))(arg0, arg1, arg2); + +class ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool + extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool._( + ffi.Pointer pointer, + {bool retain = false, + bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) { + return ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool._( + pointer, + retain: retain, + release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.UnsignedLong arg1, ffi.Pointer arg2)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool.fromFunction( + void Function(NSTextCheckingResult?, NSMatchingFlags, ffi.Pointer) + fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureTrampoline) + .cast(), + (ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) => + fn(arg0.address == 0 ? null : NSTextCheckingResult.castFromPointer(arg0, retain: true, release: true), NSMatchingFlags.fromValue(arg1), arg2))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool.listener( + void Function(NSTextCheckingResult?, NSMatchingFlags, ffi.Pointer) + fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool(objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable, ffi.Pointer, ffi.UnsignedLong, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0, int arg1, ffi.Pointer arg2) => fn( + arg0.address == 0 + ? null + : NSTextCheckingResult.castFromPointer(arg0, retain: false, release: true), + NSMatchingFlags.fromValue(arg1), + arg2)))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>? _dartFuncListenerTrampoline; + + void call(NSTextCheckingResult? arg0, NSMatchingFlags arg1, + ffi.Pointer arg2) => + pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>()( + pointer, arg0?.pointer ?? ffi.nullptr, arg1.value, arg2); +} + +enum NSMatchingFlags { + NSMatchingProgress(1), + NSMatchingCompleted(2), + NSMatchingHitEnd(4), + NSMatchingRequiredEnd(8), + NSMatchingInternalError(16); + + final int value; + const NSMatchingFlags(this.value); + + static NSMatchingFlags fromValue(int value) => switch (value) { + 1 => NSMatchingProgress, + 2 => NSMatchingCompleted, + 4 => NSMatchingHitEnd, + 8 => NSMatchingRequiredEnd, + 16 => NSMatchingInternalError, + _ => throw ArgumentError("Unknown value for NSMatchingFlags: $value"), + }; +} + +late final _sel_enumerateMatchesInString_options_range_usingBlock_ = + objc.registerName("enumerateMatchesInString:options:range:usingBlock:"); +final _objc_msgSend_309 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + _NSRange, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange, + ffi.Pointer)>(); +late final _sel_matchesInString_options_range_ = + objc.registerName("matchesInString:options:range:"); +final _objc_msgSend_310 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + _NSRange)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange)>(); +late final _sel_numberOfMatchesInString_options_range_ = + objc.registerName("numberOfMatchesInString:options:range:"); +final _objc_msgSend_311 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + _NSRange)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange)>(); +late final _sel_firstMatchInString_options_range_ = + objc.registerName("firstMatchInString:options:range:"); +final _objc_msgSend_312 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + _NSRange)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange)>(); +late final _sel_rangeOfFirstMatchInString_options_range_ = + objc.registerName("rangeOfFirstMatchInString:options:range:"); +final _objc_msgSend_313 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + _NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + _NSRange)>>() + .asFunction< + _NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange)>(); +final _objc_msgSend_313Stret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + _NSRange)>>() + .asFunction< + void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange)>(); +late final _sel_stringByReplacingMatchesInString_options_range_withTemplate_ = + objc.registerName( + "stringByReplacingMatchesInString:options:range:withTemplate:"); +final _objc_msgSend_314 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + _NSRange, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange, + ffi.Pointer)>(); +late final _sel_replaceMatchesInString_options_range_withTemplate_ = + objc.registerName("replaceMatchesInString:options:range:withTemplate:"); +final _objc_msgSend_315 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + _NSRange, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange, + ffi.Pointer)>(); +late final _sel_replacementStringForResult_inString_offset_template_ = + objc.registerName("replacementStringForResult:inString:offset:template:"); +final _objc_msgSend_316 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_escapedTemplateForString_ = + objc.registerName("escapedTemplateForString:"); +late final _sel_regularExpression = objc.registerName("regularExpression"); +final _objc_msgSend_317 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_phoneNumber = objc.registerName("phoneNumber"); +late final _sel_numberOfRanges = objc.registerName("numberOfRanges"); +late final _sel_rangeAtIndex_ = objc.registerName("rangeAtIndex:"); +final _objc_msgSend_318 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + _NSRange Function(ffi.Pointer, + ffi.Pointer, int)>(); +final _objc_msgSend_318Stret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_rangeWithName_ = objc.registerName("rangeWithName:"); +final _objc_msgSend_319 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + _NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + _NSRange Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_319Stret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_resultByAdjustingRangesWithOffset_ = + objc.registerName("resultByAdjustingRangesWithOffset:"); +final _objc_msgSend_320 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_addressComponents = objc.registerName("addressComponents"); +late final _sel_orthographyCheckingResultWithRange_orthography_ = + objc.registerName("orthographyCheckingResultWithRange:orthography:"); +final _objc_msgSend_321 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>(); +late final _sel_spellCheckingResultWithRange_ = + objc.registerName("spellCheckingResultWithRange:"); +final _objc_msgSend_322 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>(); +late final _sel_grammarCheckingResultWithRange_details_ = + objc.registerName("grammarCheckingResultWithRange:details:"); +final _objc_msgSend_323 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>(); +late final _sel_dateCheckingResultWithRange_date_ = + objc.registerName("dateCheckingResultWithRange:date:"); +final _objc_msgSend_324 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>(); +late final _sel_dateCheckingResultWithRange_date_timeZone_duration_ = + objc.registerName("dateCheckingResultWithRange:date:timeZone:duration:"); +final _objc_msgSend_325 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.Pointer, + ffi.Double)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.Pointer, + double)>(); +late final _sel_addressCheckingResultWithRange_components_ = + objc.registerName("addressCheckingResultWithRange:components:"); +final _objc_msgSend_326 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>(); +late final _sel_linkCheckingResultWithRange_URL_ = + objc.registerName("linkCheckingResultWithRange:URL:"); +final _objc_msgSend_327 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>(); +late final _sel_quoteCheckingResultWithRange_replacementString_ = + objc.registerName("quoteCheckingResultWithRange:replacementString:"); +final _objc_msgSend_328 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>(); +late final _sel_dashCheckingResultWithRange_replacementString_ = + objc.registerName("dashCheckingResultWithRange:replacementString:"); +late final _sel_replacementCheckingResultWithRange_replacementString_ = + objc.registerName("replacementCheckingResultWithRange:replacementString:"); +late final _sel_correctionCheckingResultWithRange_replacementString_ = + objc.registerName("correctionCheckingResultWithRange:replacementString:"); +late final _sel_correctionCheckingResultWithRange_replacementString_alternativeStrings_ = + objc.registerName( + "correctionCheckingResultWithRange:replacementString:alternativeStrings:"); +final _objc_msgSend_329 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_regularExpressionCheckingResultWithRanges_count_regularExpression_ = + objc.registerName( + "regularExpressionCheckingResultWithRanges:count:regularExpression:"); +final _objc_msgSend_330 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_NSRange>, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_NSRange>, + int, + ffi.Pointer)>(); +late final _sel_phoneNumberCheckingResultWithRange_phoneNumber_ = + objc.registerName("phoneNumberCheckingResultWithRange:phoneNumber:"); +late final _sel_transitInformationCheckingResultWithRange_components_ = + objc.registerName("transitInformationCheckingResultWithRange:components:"); + +/// NSStream +class NSStream extends objc.NSObject { + NSStream._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSStream] that points to the same underlying object as [other]. + NSStream.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSStream] that wraps the given raw object pointer. + NSStream.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSStream]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0(obj.pointer, _sel_isKindOfClass_, _class_NSStream); + } + + /// open + void open() { + _objc_msgSend_7(this.pointer, _sel_open); + } + + /// close + void close() { + _objc_msgSend_7(this.pointer, _sel_close); + } + + /// delegate + objc.ObjCObjectBase? get delegate { + final _ret = _objc_msgSend_84(this.pointer, _sel_delegate); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// setDelegate: + set delegate(objc.ObjCObjectBase? value) { + return _objc_msgSend_103( + this.pointer, _sel_setDelegate_, value?.pointer ?? ffi.nullptr); + } + + /// propertyForKey: + objc.ObjCObjectBase? propertyForKey_(objc.NSString key) { + final _ret = + _objc_msgSend_34(this.pointer, _sel_propertyForKey_, key.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// setProperty:forKey: + bool setProperty_forKey_(objc.ObjCObjectBase? property, objc.NSString key) { + return _objc_msgSend_331(this.pointer, _sel_setProperty_forKey_, + property?.pointer ?? ffi.nullptr, key.pointer); + } + + /// scheduleInRunLoop:forMode: + void scheduleInRunLoop_forMode_(NSRunLoop aRunLoop, objc.NSString mode) { + _objc_msgSend_131(this.pointer, _sel_scheduleInRunLoop_forMode_, + aRunLoop.pointer, mode.pointer); + } + + /// removeFromRunLoop:forMode: + void removeFromRunLoop_forMode_(NSRunLoop aRunLoop, objc.NSString mode) { + _objc_msgSend_131(this.pointer, _sel_removeFromRunLoop_forMode_, + aRunLoop.pointer, mode.pointer); + } + + /// streamStatus + NSStreamStatus get streamStatus { + final _ret = _objc_msgSend_332(this.pointer, _sel_streamStatus); + return NSStreamStatus.fromValue(_ret); + } + + /// streamError + objc.NSError? get streamError { + final _ret = _objc_msgSend_333(this.pointer, _sel_streamError); + return _ret.address == 0 + ? null + : objc.NSError.castFromPointer(_ret, retain: true, release: true); + } + + /// getStreamsToHostWithName:port:inputStream:outputStream: + static void getStreamsToHostWithName_port_inputStream_outputStream_( + objc.NSString hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _objc_msgSend_342( + _class_NSStream, + _sel_getStreamsToHostWithName_port_inputStream_outputStream_, + hostname.pointer, + port, + inputStream, + outputStream); + } + + /// getBoundStreamsWithBufferSize:inputStream:outputStream: + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _objc_msgSend_343( + _class_NSStream, + _sel_getBoundStreamsWithBufferSize_inputStream_outputStream_, + bufferSize, + inputStream, + outputStream); + } + + /// init + NSStream init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSStream.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSStream new1() { + final _ret = _objc_msgSend_19(_class_NSStream, _sel_new); + return NSStream.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSStream allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28(_class_NSStream, _sel_allocWithZone_, zone); + return NSStream.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSStream alloc() { + final _ret = _objc_msgSend_19(_class_NSStream, _sel_alloc); + return NSStream.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSStream, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSStream, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSStream, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSStream, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSStream, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSStream, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = + _objc_msgSend_32(_class_NSStream, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSStream, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSStream = objc.getClass("NSStream"); +late final _sel_open = objc.registerName("open"); +late final _sel_close = objc.registerName("close"); +late final _sel_propertyForKey_ = objc.registerName("propertyForKey:"); +late final _sel_setProperty_forKey_ = objc.registerName("setProperty:forKey:"); +final _objc_msgSend_331 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + +enum NSStreamStatus { + NSStreamStatusNotOpen(0), + NSStreamStatusOpening(1), + NSStreamStatusOpen(2), + NSStreamStatusReading(3), + NSStreamStatusWriting(4), + NSStreamStatusAtEnd(5), + NSStreamStatusClosed(6), + NSStreamStatusError(7); + + final int value; + const NSStreamStatus(this.value); + + static NSStreamStatus fromValue(int value) => switch (value) { + 0 => NSStreamStatusNotOpen, + 1 => NSStreamStatusOpening, + 2 => NSStreamStatusOpen, + 3 => NSStreamStatusReading, + 4 => NSStreamStatusWriting, + 5 => NSStreamStatusAtEnd, + 6 => NSStreamStatusClosed, + 7 => NSStreamStatusError, + _ => throw ArgumentError("Unknown value for NSStreamStatus: $value"), + }; +} + +late final _sel_streamStatus = objc.registerName("streamStatus"); +final _objc_msgSend_332 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_streamError = objc.registerName("streamError"); +final _objc_msgSend_333 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + +/// NSInputStream +class NSInputStream extends NSStream { + NSInputStream._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSInputStream] that points to the same underlying object as [other]. + NSInputStream.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSInputStream] that wraps the given raw object pointer. + NSInputStream.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSInputStream]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSInputStream); + } + + /// read:maxLength: + int read_maxLength_(ffi.Pointer buffer, int len) { + return _objc_msgSend_334(this.pointer, _sel_read_maxLength_, buffer, len); + } + + /// getBuffer:length: + bool getBuffer_length_(ffi.Pointer> buffer, + ffi.Pointer len) { + return _objc_msgSend_335(this.pointer, _sel_getBuffer_length_, buffer, len); + } + + /// hasBytesAvailable + bool get hasBytesAvailable { + return _objc_msgSend_13(this.pointer, _sel_hasBytesAvailable); + } + + /// initWithData: + NSInputStream initWithData_(objc.NSData data) { + final _ret = + _objc_msgSend_336(this.pointer, _sel_initWithData_, data.pointer); + return NSInputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithURL: + NSInputStream? initWithURL_(objc.NSURL url) { + final _ret = _objc_msgSend_35(this.pointer, _sel_initWithURL_, url.pointer); + return _ret.address == 0 + ? null + : NSInputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithFileAtPath: + NSInputStream? initWithFileAtPath_(objc.NSString path) { + final _ret = + _objc_msgSend_34(this.pointer, _sel_initWithFileAtPath_, path.pointer); + return _ret.address == 0 + ? null + : NSInputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// inputStreamWithData: + static NSInputStream? inputStreamWithData_(objc.NSData data) { + final _ret = _objc_msgSend_337( + _class_NSInputStream, _sel_inputStreamWithData_, data.pointer); + return _ret.address == 0 + ? null + : NSInputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// inputStreamWithFileAtPath: + static NSInputStream? inputStreamWithFileAtPath_(objc.NSString path) { + final _ret = _objc_msgSend_34( + _class_NSInputStream, _sel_inputStreamWithFileAtPath_, path.pointer); + return _ret.address == 0 + ? null + : NSInputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// inputStreamWithURL: + static NSInputStream? inputStreamWithURL_(objc.NSURL url) { + final _ret = _objc_msgSend_35( + _class_NSInputStream, _sel_inputStreamWithURL_, url.pointer); + return _ret.address == 0 + ? null + : NSInputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// getStreamsToHostWithName:port:inputStream:outputStream: + static void getStreamsToHostWithName_port_inputStream_outputStream_( + objc.NSString hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _objc_msgSend_342( + _class_NSInputStream, + _sel_getStreamsToHostWithName_port_inputStream_outputStream_, + hostname.pointer, + port, + inputStream, + outputStream); + } + + /// getBoundStreamsWithBufferSize:inputStream:outputStream: + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _objc_msgSend_343( + _class_NSInputStream, + _sel_getBoundStreamsWithBufferSize_inputStream_outputStream_, + bufferSize, + inputStream, + outputStream); + } +} + +late final _class_NSInputStream = objc.getClass("NSInputStream"); +late final _sel_read_maxLength_ = objc.registerName("read:maxLength:"); +final _objc_msgSend_334 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Long Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); +late final _sel_getBuffer_length_ = objc.registerName("getBuffer:length:"); +final _objc_msgSend_335 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>(); +late final _sel_hasBytesAvailable = objc.registerName("hasBytesAvailable"); +late final _sel_initWithData_ = objc.registerName("initWithData:"); +final _objc_msgSend_336 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithFileAtPath_ = objc.registerName("initWithFileAtPath:"); +late final _sel_inputStreamWithData_ = + objc.registerName("inputStreamWithData:"); +final _objc_msgSend_337 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_inputStreamWithFileAtPath_ = + objc.registerName("inputStreamWithFileAtPath:"); +late final _sel_inputStreamWithURL_ = objc.registerName("inputStreamWithURL:"); + +/// NSOutputStream +class NSOutputStream extends NSStream { + NSOutputStream._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSOutputStream] that points to the same underlying object as [other]. + NSOutputStream.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSOutputStream] that wraps the given raw object pointer. + NSOutputStream.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSOutputStream]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSOutputStream); + } + + /// write:maxLength: + int write_maxLength_(ffi.Pointer buffer, int len) { + return _objc_msgSend_334(this.pointer, _sel_write_maxLength_, buffer, len); + } + + /// hasSpaceAvailable + bool get hasSpaceAvailable { + return _objc_msgSend_13(this.pointer, _sel_hasSpaceAvailable); + } + + /// initToMemory + NSOutputStream initToMemory() { + final _ret = _objc_msgSend_19(this.pointer, _sel_initToMemory); + return NSOutputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// initToBuffer:capacity: + NSOutputStream initToBuffer_capacity_( + ffi.Pointer buffer, int capacity) { + final _ret = _objc_msgSend_338( + this.pointer, _sel_initToBuffer_capacity_, buffer, capacity); + return NSOutputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithURL:append: + NSOutputStream? initWithURL_append_(objc.NSURL url, bool shouldAppend) { + final _ret = _objc_msgSend_339( + this.pointer, _sel_initWithURL_append_, url.pointer, shouldAppend); + return _ret.address == 0 + ? null + : NSOutputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// initToFileAtPath:append: + NSOutputStream? initToFileAtPath_append_( + objc.NSString path, bool shouldAppend) { + final _ret = _objc_msgSend_340(this.pointer, _sel_initToFileAtPath_append_, + path.pointer, shouldAppend); + return _ret.address == 0 + ? null + : NSOutputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// outputStreamToMemory + static NSOutputStream outputStreamToMemory() { + final _ret = + _objc_msgSend_19(_class_NSOutputStream, _sel_outputStreamToMemory); + return NSOutputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// outputStreamToBuffer:capacity: + static NSOutputStream outputStreamToBuffer_capacity_( + ffi.Pointer buffer, int capacity) { + final _ret = _objc_msgSend_338(_class_NSOutputStream, + _sel_outputStreamToBuffer_capacity_, buffer, capacity); + return NSOutputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// outputStreamToFileAtPath:append: + static NSOutputStream outputStreamToFileAtPath_append_( + objc.NSString path, bool shouldAppend) { + final _ret = _objc_msgSend_341(_class_NSOutputStream, + _sel_outputStreamToFileAtPath_append_, path.pointer, shouldAppend); + return NSOutputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// outputStreamWithURL:append: + static NSOutputStream? outputStreamWithURL_append_( + objc.NSURL url, bool shouldAppend) { + final _ret = _objc_msgSend_339(_class_NSOutputStream, + _sel_outputStreamWithURL_append_, url.pointer, shouldAppend); + return _ret.address == 0 + ? null + : NSOutputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// getStreamsToHostWithName:port:inputStream:outputStream: + static void getStreamsToHostWithName_port_inputStream_outputStream_( + objc.NSString hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _objc_msgSend_342( + _class_NSOutputStream, + _sel_getStreamsToHostWithName_port_inputStream_outputStream_, + hostname.pointer, + port, + inputStream, + outputStream); + } + + /// getBoundStreamsWithBufferSize:inputStream:outputStream: + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _objc_msgSend_343( + _class_NSOutputStream, + _sel_getBoundStreamsWithBufferSize_inputStream_outputStream_, + bufferSize, + inputStream, + outputStream); + } +} + +late final _class_NSOutputStream = objc.getClass("NSOutputStream"); +late final _sel_write_maxLength_ = objc.registerName("write:maxLength:"); +late final _sel_hasSpaceAvailable = objc.registerName("hasSpaceAvailable"); +late final _sel_initToMemory = objc.registerName("initToMemory"); +late final _sel_initToBuffer_capacity_ = + objc.registerName("initToBuffer:capacity:"); +final _objc_msgSend_338 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); +late final _sel_initWithURL_append_ = objc.registerName("initWithURL:append:"); +final _objc_msgSend_339 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_initToFileAtPath_append_ = + objc.registerName("initToFileAtPath:append:"); +final _objc_msgSend_340 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_outputStreamToMemory = + objc.registerName("outputStreamToMemory"); +late final _sel_outputStreamToBuffer_capacity_ = + objc.registerName("outputStreamToBuffer:capacity:"); +late final _sel_outputStreamToFileAtPath_append_ = + objc.registerName("outputStreamToFileAtPath:append:"); +final _objc_msgSend_341 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_outputStreamWithURL_append_ = + objc.registerName("outputStreamWithURL:append:"); +late final _sel_getStreamsToHostWithName_port_inputStream_outputStream_ = objc + .registerName("getStreamsToHostWithName:port:inputStream:outputStream:"); +final _objc_msgSend_342 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer>, + ffi.Pointer>)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); +late final _sel_getBoundStreamsWithBufferSize_inputStream_outputStream_ = objc + .registerName("getBoundStreamsWithBufferSize:inputStream:outputStream:"); +final _objc_msgSend_343 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>, + ffi.Pointer>)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + +/// NSURLCache +class NSURLCache extends objc.NSObject { + NSURLCache._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLCache] that points to the same underlying object as [other]. + NSURLCache.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSURLCache] that wraps the given raw object pointer. + NSURLCache.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLCache]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0(obj.pointer, _sel_isKindOfClass_, _class_NSURLCache); + } + + /// sharedURLCache + static NSURLCache getSharedURLCache() { + final _ret = _objc_msgSend_344(_class_NSURLCache, _sel_sharedURLCache); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); + } + + /// setSharedURLCache: + static void setSharedURLCache(NSURLCache value) { + return _objc_msgSend_345( + _class_NSURLCache, _sel_setSharedURLCache_, value.pointer); + } + + /// initWithMemoryCapacity:diskCapacity:diskPath: + NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( + int memoryCapacity, int diskCapacity, objc.NSString? path) { + final _ret = _objc_msgSend_346( + this.pointer, + _sel_initWithMemoryCapacity_diskCapacity_diskPath_, + memoryCapacity, + diskCapacity, + path?.pointer ?? ffi.nullptr); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithMemoryCapacity:diskCapacity:directoryURL: + NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( + int memoryCapacity, int diskCapacity, objc.NSURL? directoryURL) { + final _ret = _objc_msgSend_347( + this.pointer, + _sel_initWithMemoryCapacity_diskCapacity_directoryURL_, + memoryCapacity, + diskCapacity, + directoryURL?.pointer ?? ffi.nullptr); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); + } + + /// cachedResponseForRequest: + NSCachedURLResponse? cachedResponseForRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_361( + this.pointer, _sel_cachedResponseForRequest_, request.pointer); + return _ret.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(_ret, + retain: true, release: true); + } + + /// storeCachedResponse:forRequest: + void storeCachedResponse_forRequest_( + NSCachedURLResponse cachedResponse, NSURLRequest request) { + _objc_msgSend_362(this.pointer, _sel_storeCachedResponse_forRequest_, + cachedResponse.pointer, request.pointer); + } + + /// removeCachedResponseForRequest: + void removeCachedResponseForRequest_(NSURLRequest request) { + _objc_msgSend_363( + this.pointer, _sel_removeCachedResponseForRequest_, request.pointer); + } + + /// removeAllCachedResponses + void removeAllCachedResponses() { + _objc_msgSend_7(this.pointer, _sel_removeAllCachedResponses); + } + + /// removeCachedResponsesSinceDate: + void removeCachedResponsesSinceDate_(objc.NSDate date) { + _objc_msgSend_137( + this.pointer, _sel_removeCachedResponsesSinceDate_, date.pointer); + } + + /// memoryCapacity + int get memoryCapacity { + return _objc_msgSend_56(this.pointer, _sel_memoryCapacity); + } + + /// setMemoryCapacity: + set memoryCapacity(int value) { + return _objc_msgSend_100(this.pointer, _sel_setMemoryCapacity_, value); + } + + /// diskCapacity + int get diskCapacity { + return _objc_msgSend_56(this.pointer, _sel_diskCapacity); + } + + /// setDiskCapacity: + set diskCapacity(int value) { + return _objc_msgSend_100(this.pointer, _sel_setDiskCapacity_, value); + } + + /// currentMemoryUsage + int get currentMemoryUsage { + return _objc_msgSend_56(this.pointer, _sel_currentMemoryUsage); + } + + /// currentDiskUsage + int get currentDiskUsage { + return _objc_msgSend_56(this.pointer, _sel_currentDiskUsage); + } + + /// storeCachedResponse:forDataTask: + void storeCachedResponse_forDataTask_( + NSCachedURLResponse cachedResponse, NSURLSessionDataTask dataTask) { + _objc_msgSend_364(this.pointer, _sel_storeCachedResponse_forDataTask_, + cachedResponse.pointer, dataTask.pointer); + } + + /// getCachedResponseForDataTask:completionHandler: + void getCachedResponseForDataTask_completionHandler_( + NSURLSessionDataTask dataTask, + ObjCBlock_ffiVoid_NSCachedURLResponse completionHandler) { + _objc_msgSend_365( + this.pointer, + _sel_getCachedResponseForDataTask_completionHandler_, + dataTask.pointer, + completionHandler.pointer); + } + + /// removeCachedResponseForDataTask: + void removeCachedResponseForDataTask_(NSURLSessionDataTask dataTask) { + _objc_msgSend_366( + this.pointer, _sel_removeCachedResponseForDataTask_, dataTask.pointer); + } + + /// init + NSURLCache init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSURLCache new1() { + final _ret = _objc_msgSend_19(_class_NSURLCache, _sel_new); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLCache allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28(_class_NSURLCache, _sel_allocWithZone_, zone); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSURLCache alloc() { + final _ret = _objc_msgSend_19(_class_NSURLCache, _sel_alloc); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSURLCache, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSURLCache, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSURLCache, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSURLCache, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSURLCache, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSURLCache, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSURLCache, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSURLCache, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSURLCache = objc.getClass("NSURLCache"); +late final _sel_sharedURLCache = objc.registerName("sharedURLCache"); +final _objc_msgSend_344 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setSharedURLCache_ = objc.registerName("setSharedURLCache:"); +final _objc_msgSend_345 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_ = + objc.registerName("initWithMemoryCapacity:diskCapacity:diskPath:"); +final _objc_msgSend_346 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); +late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_ = + objc.registerName("initWithMemoryCapacity:diskCapacity:directoryURL:"); +final _objc_msgSend_347 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); + +/// NSCachedURLResponse +class NSCachedURLResponse extends objc.NSObject { + NSCachedURLResponse._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSCachedURLResponse] that points to the same underlying object as [other]. + NSCachedURLResponse.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSCachedURLResponse] that wraps the given raw object pointer. + NSCachedURLResponse.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSCachedURLResponse]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSCachedURLResponse); + } + + /// initWithResponse:data: + NSCachedURLResponse initWithResponse_data_( + NSURLResponse response, objc.NSData data) { + final _ret = _objc_msgSend_350(this.pointer, _sel_initWithResponse_data_, + response.pointer, data.pointer); + return NSCachedURLResponse.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithResponse:data:userInfo:storagePolicy: + NSCachedURLResponse initWithResponse_data_userInfo_storagePolicy_( + NSURLResponse response, + objc.NSData data, + objc.NSDictionary? userInfo, + NSURLCacheStoragePolicy storagePolicy) { + final _ret = _objc_msgSend_351( + this.pointer, + _sel_initWithResponse_data_userInfo_storagePolicy_, + response.pointer, + data.pointer, + userInfo?.pointer ?? ffi.nullptr, + storagePolicy.value); + return NSCachedURLResponse.castFromPointer(_ret, + retain: true, release: true); + } + + /// response + NSURLResponse get response { + final _ret = _objc_msgSend_352(this.pointer, _sel_response); + return NSURLResponse.castFromPointer(_ret, retain: true, release: true); + } + + /// data + objc.NSData get data { + final _ret = _objc_msgSend_143(this.pointer, _sel_data); + return objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// userInfo + objc.NSDictionary? get userInfo { + final _ret = _objc_msgSend_83(this.pointer, _sel_userInfo); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// storagePolicy + NSURLCacheStoragePolicy get storagePolicy { + final _ret = _objc_msgSend_353(this.pointer, _sel_storagePolicy); + return NSURLCacheStoragePolicy.fromValue(_ret); + } + + /// init + NSCachedURLResponse init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSCachedURLResponse.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSCachedURLResponse new1() { + final _ret = _objc_msgSend_19(_class_NSCachedURLResponse, _sel_new); + return NSCachedURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSCachedURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSCachedURLResponse, _sel_allocWithZone_, zone); + return NSCachedURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSCachedURLResponse alloc() { + final _ret = _objc_msgSend_19(_class_NSCachedURLResponse, _sel_alloc); + return NSCachedURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSCachedURLResponse, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSCachedURLResponse, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSCachedURLResponse, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSCachedURLResponse, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSCachedURLResponse, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSCachedURLResponse, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSCachedURLResponse, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSCachedURLResponse, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSCachedURLResponse = objc.getClass("NSCachedURLResponse"); + +/// NSURLResponse +class NSURLResponse extends objc.NSObject { + NSURLResponse._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLResponse] that points to the same underlying object as [other]. + NSURLResponse.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSURLResponse] that wraps the given raw object pointer. + NSURLResponse.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLResponse]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSURLResponse); + } + + /// initWithURL:MIMEType:expectedContentLength:textEncodingName: + NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( + objc.NSURL URL, + objc.NSString? MIMEType, + int length, + objc.NSString? name) { + final _ret = _objc_msgSend_348( + this.pointer, + _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, + URL.pointer, + MIMEType?.pointer ?? ffi.nullptr, + length, + name?.pointer ?? ffi.nullptr); + return NSURLResponse.castFromPointer(_ret, retain: true, release: true); + } + + /// URL + objc.NSURL? get URL { + final _ret = _objc_msgSend_24(this.pointer, _sel_URL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// MIMEType + objc.NSString? get MIMEType { + final _ret = _objc_msgSend_20(this.pointer, _sel_MIMEType); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// expectedContentLength + int get expectedContentLength { + return _objc_msgSend_349(this.pointer, _sel_expectedContentLength); + } + + /// textEncodingName + objc.NSString? get textEncodingName { + final _ret = _objc_msgSend_20(this.pointer, _sel_textEncodingName); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// suggestedFilename + objc.NSString? get suggestedFilename { + final _ret = _objc_msgSend_20(this.pointer, _sel_suggestedFilename); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSURLResponse init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSURLResponse.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSURLResponse new1() { + final _ret = _objc_msgSend_19(_class_NSURLResponse, _sel_new); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSURLResponse, _sel_allocWithZone_, zone); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSURLResponse alloc() { + final _ret = _objc_msgSend_19(_class_NSURLResponse, _sel_alloc); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSURLResponse, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSURLResponse, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSURLResponse, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSURLResponse, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSURLResponse, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSURLResponse, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSURLResponse, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSURLResponse, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSURLResponse = objc.getClass("NSURLResponse"); +late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_ = + objc.registerName( + "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); +final _objc_msgSend_348 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_MIMEType = objc.registerName("MIMEType"); +late final _sel_expectedContentLength = + objc.registerName("expectedContentLength"); +final _objc_msgSend_349 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.LongLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_textEncodingName = objc.registerName("textEncodingName"); +late final _sel_suggestedFilename = objc.registerName("suggestedFilename"); +late final _sel_initWithResponse_data_ = + objc.registerName("initWithResponse:data:"); +final _objc_msgSend_350 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + +enum NSURLCacheStoragePolicy { + NSURLCacheStorageAllowed(0), + NSURLCacheStorageAllowedInMemoryOnly(1), + NSURLCacheStorageNotAllowed(2); + + final int value; + const NSURLCacheStoragePolicy(this.value); + + static NSURLCacheStoragePolicy fromValue(int value) => switch (value) { + 0 => NSURLCacheStorageAllowed, + 1 => NSURLCacheStorageAllowedInMemoryOnly, + 2 => NSURLCacheStorageNotAllowed, + _ => throw ArgumentError( + "Unknown value for NSURLCacheStoragePolicy: $value"), + }; +} + +late final _sel_initWithResponse_data_userInfo_storagePolicy_ = + objc.registerName("initWithResponse:data:userInfo:storagePolicy:"); +final _objc_msgSend_351 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_response = objc.registerName("response"); +final _objc_msgSend_352 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_storagePolicy = objc.registerName("storagePolicy"); +final _objc_msgSend_353 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); + +/// NSURLRequest +class NSURLRequest extends objc.NSObject { + NSURLRequest._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLRequest] that points to the same underlying object as [other]. + NSURLRequest.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSURLRequest] that wraps the given raw object pointer. + NSURLRequest.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLRequest]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSURLRequest); + } + + /// requestWithURL: + static NSURLRequest requestWithURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_354( + _class_NSURLRequest, _sel_requestWithURL_, URL.pointer); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_13(_class_NSURLRequest, _sel_supportsSecureCoding); + } + + /// requestWithURL:cachePolicy:timeoutInterval: + static NSURLRequest requestWithURL_cachePolicy_timeoutInterval_( + objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, + double timeoutInterval) { + final _ret = _objc_msgSend_355( + _class_NSURLRequest, + _sel_requestWithURL_cachePolicy_timeoutInterval_, + URL.pointer, + cachePolicy.value, + timeoutInterval); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithURL: + NSURLRequest initWithURL_(objc.NSURL URL) { + final _ret = + _objc_msgSend_354(this.pointer, _sel_initWithURL_, URL.pointer); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithURL:cachePolicy:timeoutInterval: + NSURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, double timeoutInterval) { + final _ret = _objc_msgSend_355( + this.pointer, + _sel_initWithURL_cachePolicy_timeoutInterval_, + URL.pointer, + cachePolicy.value, + timeoutInterval); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// URL + objc.NSURL? get URL { + final _ret = _objc_msgSend_24(this.pointer, _sel_URL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// cachePolicy + NSURLRequestCachePolicy get cachePolicy { + final _ret = _objc_msgSend_356(this.pointer, _sel_cachePolicy); + return NSURLRequestCachePolicy.fromValue(_ret); + } + + /// timeoutInterval + double get timeoutInterval { + return objc.useMsgSendVariants + ? _objc_msgSend_18Fpret(this.pointer, _sel_timeoutInterval) + : _objc_msgSend_18(this.pointer, _sel_timeoutInterval); + } + + /// mainDocumentURL + objc.NSURL? get mainDocumentURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_mainDocumentURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// networkServiceType + NSURLRequestNetworkServiceType get networkServiceType { + final _ret = _objc_msgSend_357(this.pointer, _sel_networkServiceType); + return NSURLRequestNetworkServiceType.fromValue(_ret); + } + + /// allowsCellularAccess + bool get allowsCellularAccess { + return _objc_msgSend_13(this.pointer, _sel_allowsCellularAccess); + } + + /// allowsExpensiveNetworkAccess + bool get allowsExpensiveNetworkAccess { + return _objc_msgSend_13(this.pointer, _sel_allowsExpensiveNetworkAccess); + } + + /// allowsConstrainedNetworkAccess + bool get allowsConstrainedNetworkAccess { + return _objc_msgSend_13(this.pointer, _sel_allowsConstrainedNetworkAccess); + } + + /// assumesHTTP3Capable + bool get assumesHTTP3Capable { + return _objc_msgSend_13(this.pointer, _sel_assumesHTTP3Capable); + } + + /// attribution + NSURLRequestAttribution get attribution { + final _ret = _objc_msgSend_358(this.pointer, _sel_attribution); + return NSURLRequestAttribution.fromValue(_ret); + } + + /// requiresDNSSECValidation + bool get requiresDNSSECValidation { + return _objc_msgSend_13(this.pointer, _sel_requiresDNSSECValidation); + } + + /// HTTPMethod + objc.NSString? get HTTPMethod { + final _ret = _objc_msgSend_20(this.pointer, _sel_HTTPMethod); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// allHTTPHeaderFields + objc.NSDictionary? get allHTTPHeaderFields { + final _ret = _objc_msgSend_83(this.pointer, _sel_allHTTPHeaderFields); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// valueForHTTPHeaderField: + objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { + final _ret = _objc_msgSend_41( + this.pointer, _sel_valueForHTTPHeaderField_, field.pointer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// HTTPBody + objc.NSData? get HTTPBody { + final _ret = _objc_msgSend_359(this.pointer, _sel_HTTPBody); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// HTTPBodyStream + NSInputStream? get HTTPBodyStream { + final _ret = _objc_msgSend_360(this.pointer, _sel_HTTPBodyStream); + return _ret.address == 0 + ? null + : NSInputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// HTTPShouldHandleCookies + bool get HTTPShouldHandleCookies { + return _objc_msgSend_13(this.pointer, _sel_HTTPShouldHandleCookies); + } + + /// HTTPShouldUsePipelining + bool get HTTPShouldUsePipelining { + return _objc_msgSend_13(this.pointer, _sel_HTTPShouldUsePipelining); + } + + /// init + NSURLRequest init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSURLRequest new1() { + final _ret = _objc_msgSend_19(_class_NSURLRequest, _sel_new); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSURLRequest, _sel_allocWithZone_, zone); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSURLRequest alloc() { + final _ret = _objc_msgSend_19(_class_NSURLRequest, _sel_alloc); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSURLRequest, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSURLRequest, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSURLRequest, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSURLRequest, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSURLRequest, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSURLRequest, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSURLRequest, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSURLRequest, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSURLRequest = objc.getClass("NSURLRequest"); +late final _sel_requestWithURL_ = objc.registerName("requestWithURL:"); +final _objc_msgSend_354 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_supportsSecureCoding = + objc.registerName("supportsSecureCoding"); + +enum NSURLRequestCachePolicy { + NSURLRequestUseProtocolCachePolicy(0), + NSURLRequestReloadIgnoringLocalCacheData(1), + NSURLRequestReloadIgnoringLocalAndRemoteCacheData(4), + NSURLRequestReturnCacheDataElseLoad(2), + NSURLRequestReturnCacheDataDontLoad(3), + NSURLRequestReloadRevalidatingCacheData(5); + + static const NSURLRequestReloadIgnoringCacheData = + NSURLRequestReloadIgnoringLocalCacheData; + + final int value; + const NSURLRequestCachePolicy(this.value); + + static NSURLRequestCachePolicy fromValue(int value) => switch (value) { + 0 => NSURLRequestUseProtocolCachePolicy, + 1 => NSURLRequestReloadIgnoringLocalCacheData, + 4 => NSURLRequestReloadIgnoringLocalAndRemoteCacheData, + 2 => NSURLRequestReturnCacheDataElseLoad, + 3 => NSURLRequestReturnCacheDataDontLoad, + 5 => NSURLRequestReloadRevalidatingCacheData, + _ => throw ArgumentError( + "Unknown value for NSURLRequestCachePolicy: $value"), + }; + + @override + String toString() { + if (this == NSURLRequestReloadIgnoringLocalCacheData) + return "NSURLRequestCachePolicy.NSURLRequestReloadIgnoringLocalCacheData, NSURLRequestCachePolicy.NSURLRequestReloadIgnoringCacheData"; + return super.toString(); + } +} + +late final _sel_requestWithURL_cachePolicy_timeoutInterval_ = + objc.registerName("requestWithURL:cachePolicy:timeoutInterval:"); +final _objc_msgSend_355 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Double)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + double)>(); +late final _sel_initWithURL_cachePolicy_timeoutInterval_ = + objc.registerName("initWithURL:cachePolicy:timeoutInterval:"); +late final _sel_cachePolicy = objc.registerName("cachePolicy"); +final _objc_msgSend_356 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_timeoutInterval = objc.registerName("timeoutInterval"); +late final _sel_mainDocumentURL = objc.registerName("mainDocumentURL"); + +enum NSURLRequestNetworkServiceType { + NSURLNetworkServiceTypeDefault(0), + NSURLNetworkServiceTypeVoIP(1), + NSURLNetworkServiceTypeVideo(2), + NSURLNetworkServiceTypeBackground(3), + NSURLNetworkServiceTypeVoice(4), + NSURLNetworkServiceTypeResponsiveData(6), + NSURLNetworkServiceTypeAVStreaming(8), + NSURLNetworkServiceTypeResponsiveAV(9), + NSURLNetworkServiceTypeCallSignaling(11); + + final int value; + const NSURLRequestNetworkServiceType(this.value); + + static NSURLRequestNetworkServiceType fromValue(int value) => switch (value) { + 0 => NSURLNetworkServiceTypeDefault, + 1 => NSURLNetworkServiceTypeVoIP, + 2 => NSURLNetworkServiceTypeVideo, + 3 => NSURLNetworkServiceTypeBackground, + 4 => NSURLNetworkServiceTypeVoice, + 6 => NSURLNetworkServiceTypeResponsiveData, + 8 => NSURLNetworkServiceTypeAVStreaming, + 9 => NSURLNetworkServiceTypeResponsiveAV, + 11 => NSURLNetworkServiceTypeCallSignaling, + _ => throw ArgumentError( + "Unknown value for NSURLRequestNetworkServiceType: $value"), + }; +} + +late final _sel_networkServiceType = objc.registerName("networkServiceType"); +final _objc_msgSend_357 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_allowsCellularAccess = + objc.registerName("allowsCellularAccess"); +late final _sel_allowsExpensiveNetworkAccess = + objc.registerName("allowsExpensiveNetworkAccess"); +late final _sel_allowsConstrainedNetworkAccess = + objc.registerName("allowsConstrainedNetworkAccess"); +late final _sel_assumesHTTP3Capable = objc.registerName("assumesHTTP3Capable"); + +enum NSURLRequestAttribution { + NSURLRequestAttributionDeveloper(0), + NSURLRequestAttributionUser(1); + + final int value; + const NSURLRequestAttribution(this.value); + + static NSURLRequestAttribution fromValue(int value) => switch (value) { + 0 => NSURLRequestAttributionDeveloper, + 1 => NSURLRequestAttributionUser, + _ => throw ArgumentError( + "Unknown value for NSURLRequestAttribution: $value"), + }; +} + +late final _sel_attribution = objc.registerName("attribution"); +final _objc_msgSend_358 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_requiresDNSSECValidation = + objc.registerName("requiresDNSSECValidation"); +late final _sel_HTTPMethod = objc.registerName("HTTPMethod"); +late final _sel_allHTTPHeaderFields = objc.registerName("allHTTPHeaderFields"); +late final _sel_valueForHTTPHeaderField_ = + objc.registerName("valueForHTTPHeaderField:"); +late final _sel_HTTPBody = objc.registerName("HTTPBody"); +final _objc_msgSend_359 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_HTTPBodyStream = objc.registerName("HTTPBodyStream"); +final _objc_msgSend_360 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_HTTPShouldHandleCookies = + objc.registerName("HTTPShouldHandleCookies"); +late final _sel_HTTPShouldUsePipelining = + objc.registerName("HTTPShouldUsePipelining"); +late final _sel_cachedResponseForRequest_ = + objc.registerName("cachedResponseForRequest:"); +final _objc_msgSend_361 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_storeCachedResponse_forRequest_ = + objc.registerName("storeCachedResponse:forRequest:"); +final _objc_msgSend_362 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removeCachedResponseForRequest_ = + objc.registerName("removeCachedResponseForRequest:"); +final _objc_msgSend_363 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_removeAllCachedResponses = + objc.registerName("removeAllCachedResponses"); +late final _sel_removeCachedResponsesSinceDate_ = + objc.registerName("removeCachedResponsesSinceDate:"); +late final _sel_memoryCapacity = objc.registerName("memoryCapacity"); +late final _sel_setMemoryCapacity_ = objc.registerName("setMemoryCapacity:"); +late final _sel_diskCapacity = objc.registerName("diskCapacity"); +late final _sel_setDiskCapacity_ = objc.registerName("setDiskCapacity:"); +late final _sel_currentMemoryUsage = objc.registerName("currentMemoryUsage"); +late final _sel_currentDiskUsage = objc.registerName("currentDiskUsage"); + +/// NSURLSessionDataTask +class NSURLSessionDataTask extends objc.ObjCObjectBase { + NSURLSessionDataTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionDataTask] that points to the same underlying object as [other]. + NSURLSessionDataTask.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionDataTask] that wraps the given raw object pointer. + NSURLSessionDataTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionDataTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSURLSessionDataTask); + } +} + +late final _class_NSURLSessionDataTask = objc.getClass("NSURLSessionDataTask"); +late final _sel_storeCachedResponse_forDataTask_ = + objc.registerName("storeCachedResponse:forDataTask:"); +final _objc_msgSend_364 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +void _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +void _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + +class ObjCBlock_ffiVoid_NSCachedURLResponse extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSCachedURLResponse._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSCachedURLResponse castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSCachedURLResponse._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSCachedURLResponse.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSCachedURLResponse.fromFunction( + void Function(NSCachedURLResponse?) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(arg0, + retain: true, release: true)))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSCachedURLResponse.listener( + void Function(NSCachedURLResponse?) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSCachedURLResponse( + objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(arg0, retain: false, release: true))))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>? + _dartFuncListenerTrampoline; + + void call(NSCachedURLResponse? arg0) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>()( + pointer, arg0?.pointer ?? ffi.nullptr); +} + +late final _sel_getCachedResponseForDataTask_completionHandler_ = + objc.registerName("getCachedResponseForDataTask:completionHandler:"); +final _objc_msgSend_365 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removeCachedResponseForDataTask_ = + objc.registerName("removeCachedResponseForDataTask:"); +final _objc_msgSend_366 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + +/// NSURLConnection +class NSURLConnection extends objc.NSObject { + NSURLConnection._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLConnection] that points to the same underlying object as [other]. + NSURLConnection.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSURLConnection] that wraps the given raw object pointer. + NSURLConnection.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLConnection]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSURLConnection); + } + + /// initWithRequest:delegate:startImmediately: + NSURLConnection? initWithRequest_delegate_startImmediately_( + NSURLRequest request, + objc.ObjCObjectBase? delegate, + bool startImmediately) { + final _ret = _objc_msgSend_367( + this.pointer, + _sel_initWithRequest_delegate_startImmediately_, + request.pointer, + delegate?.pointer ?? ffi.nullptr, + startImmediately); + return _ret.address == 0 + ? null + : NSURLConnection.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithRequest:delegate: + NSURLConnection? initWithRequest_delegate_( + NSURLRequest request, objc.ObjCObjectBase? delegate) { + final _ret = _objc_msgSend_368(this.pointer, _sel_initWithRequest_delegate_, + request.pointer, delegate?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : NSURLConnection.castFromPointer(_ret, retain: true, release: true); + } + + /// connectionWithRequest:delegate: + static NSURLConnection? connectionWithRequest_delegate_( + NSURLRequest request, objc.ObjCObjectBase? delegate) { + final _ret = _objc_msgSend_369( + _class_NSURLConnection, + _sel_connectionWithRequest_delegate_, + request.pointer, + delegate?.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : NSURLConnection.castFromPointer(_ret, retain: true, release: true); + } + + /// originalRequest + NSURLRequest get originalRequest { + final _ret = _objc_msgSend_370(this.pointer, _sel_originalRequest); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// currentRequest + NSURLRequest get currentRequest { + final _ret = _objc_msgSend_370(this.pointer, _sel_currentRequest); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// start + void start() { + _objc_msgSend_7(this.pointer, _sel_start); + } + + /// cancel + void cancel() { + _objc_msgSend_7(this.pointer, _sel_cancel); + } + + /// scheduleInRunLoop:forMode: + void scheduleInRunLoop_forMode_(NSRunLoop aRunLoop, objc.NSString mode) { + _objc_msgSend_131(this.pointer, _sel_scheduleInRunLoop_forMode_, + aRunLoop.pointer, mode.pointer); + } + + /// unscheduleFromRunLoop:forMode: + void unscheduleFromRunLoop_forMode_(NSRunLoop aRunLoop, objc.NSString mode) { + _objc_msgSend_131(this.pointer, _sel_unscheduleFromRunLoop_forMode_, + aRunLoop.pointer, mode.pointer); + } + + /// setDelegateQueue: + void setDelegateQueue_(NSOperationQueue? queue) { + _objc_msgSend_371( + this.pointer, _sel_setDelegateQueue_, queue?.pointer ?? ffi.nullptr); + } + + /// canHandleRequest: + static bool canHandleRequest_(NSURLRequest request) { + return _objc_msgSend_372( + _class_NSURLConnection, _sel_canHandleRequest_, request.pointer); + } + + /// sendSynchronousRequest:returningResponse:error: + static objc.NSData? sendSynchronousRequest_returningResponse_error_( + NSURLRequest request, + ffi.Pointer> response, + ffi.Pointer> error) { + final _ret = _objc_msgSend_373( + _class_NSURLConnection, + _sel_sendSynchronousRequest_returningResponse_error_, + request.pointer, + response, + error); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// sendAsynchronousRequest:queue:completionHandler: + static void sendAsynchronousRequest_queue_completionHandler_( + NSURLRequest request, + NSOperationQueue queue, + ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError handler) { + _objc_msgSend_374( + _class_NSURLConnection, + _sel_sendAsynchronousRequest_queue_completionHandler_, + request.pointer, + queue.pointer, + handler.pointer); + } + + /// init + NSURLConnection init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSURLConnection.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSURLConnection new1() { + final _ret = _objc_msgSend_19(_class_NSURLConnection, _sel_new); + return NSURLConnection.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLConnection allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSURLConnection, _sel_allocWithZone_, zone); + return NSURLConnection.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSURLConnection alloc() { + final _ret = _objc_msgSend_19(_class_NSURLConnection, _sel_alloc); + return NSURLConnection.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSURLConnection, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSURLConnection, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSURLConnection, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSURLConnection, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSURLConnection, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSURLConnection, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSURLConnection, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSURLConnection, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSURLConnection = objc.getClass("NSURLConnection"); +late final _sel_initWithRequest_delegate_startImmediately_ = + objc.registerName("initWithRequest:delegate:startImmediately:"); +final _objc_msgSend_367 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_initWithRequest_delegate_ = + objc.registerName("initWithRequest:delegate:"); +final _objc_msgSend_368 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_connectionWithRequest_delegate_ = + objc.registerName("connectionWithRequest:delegate:"); +final _objc_msgSend_369 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_originalRequest = objc.registerName("originalRequest"); +final _objc_msgSend_370 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_currentRequest = objc.registerName("currentRequest"); +late final _sel_unscheduleFromRunLoop_forMode_ = + objc.registerName("unscheduleFromRunLoop:forMode:"); +late final _sel_setDelegateQueue_ = objc.registerName("setDelegateQueue:"); +final _objc_msgSend_371 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_canHandleRequest_ = objc.registerName("canHandleRequest:"); +final _objc_msgSend_372 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_sendSynchronousRequest_returningResponse_error_ = + objc.registerName("sendSynchronousRequest:returningResponse:error:"); +final _objc_msgSend_373 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); +void _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +void _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + +class ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError + extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError._( + ffi.Pointer pointer, + {bool retain = false, + bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError.fromFunction( + void Function(NSURLResponse?, objc.NSData?, objc.NSError?) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureTrampoline) + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + arg0.address == 0 ? null : NSURLResponse.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : objc.NSData.castFromPointer(arg1, retain: true, release: true), + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true)))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError.listener( + void Function(NSURLResponse?, objc.NSData?, objc.NSError?) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError( + objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= + ffi.NativeCallable, ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0.address == 0 + ? null + : NSURLResponse.castFromPointer(arg0, retain: false, release: true), + arg1.address == 0 ? null : objc.NSData.castFromPointer(arg1, retain: false, release: true), + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: false, release: true))))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>? _dartFuncListenerTrampoline; + + void call(NSURLResponse? arg0, objc.NSData? arg1, objc.NSError? arg2) => + pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + pointer, + arg0?.pointer ?? ffi.nullptr, + arg1?.pointer ?? ffi.nullptr, + arg2?.pointer ?? ffi.nullptr); +} + +late final _sel_sendAsynchronousRequest_queue_completionHandler_ = + objc.registerName("sendAsynchronousRequest:queue:completionHandler:"); +final _objc_msgSend_374 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + +/// NSURLCredential +class NSURLCredential extends objc.NSObject { + NSURLCredential._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLCredential] that points to the same underlying object as [other]. + NSURLCredential.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSURLCredential] that wraps the given raw object pointer. + NSURLCredential.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLCredential]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSURLCredential); + } + + /// persistence + NSURLCredentialPersistence get persistence { + final _ret = _objc_msgSend_375(this.pointer, _sel_persistence); + return NSURLCredentialPersistence.fromValue(_ret); + } + + /// initWithUser:password:persistence: + NSURLCredential initWithUser_password_persistence_(objc.NSString user, + objc.NSString password, NSURLCredentialPersistence persistence) { + final _ret = _objc_msgSend_376( + this.pointer, + _sel_initWithUser_password_persistence_, + user.pointer, + password.pointer, + persistence.value); + return NSURLCredential.castFromPointer(_ret, retain: true, release: true); + } + + /// credentialWithUser:password:persistence: + static NSURLCredential credentialWithUser_password_persistence_( + objc.NSString user, + objc.NSString password, + NSURLCredentialPersistence persistence) { + final _ret = _objc_msgSend_377( + _class_NSURLCredential, + _sel_credentialWithUser_password_persistence_, + user.pointer, + password.pointer, + persistence.value); + return NSURLCredential.castFromPointer(_ret, retain: true, release: true); + } + + /// user + objc.NSString? get user { + final _ret = _objc_msgSend_20(this.pointer, _sel_user); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// password + objc.NSString? get password { + final _ret = _objc_msgSend_20(this.pointer, _sel_password); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// hasPassword + bool get hasPassword { + return _objc_msgSend_13(this.pointer, _sel_hasPassword); + } + + /// initWithIdentity:certificates:persistence: + NSURLCredential initWithIdentity_certificates_persistence_( + ffi.Pointer<__SecIdentity> identity, + objc.NSArray? certArray, + NSURLCredentialPersistence persistence) { + final _ret = _objc_msgSend_378( + this.pointer, + _sel_initWithIdentity_certificates_persistence_, + identity, + certArray?.pointer ?? ffi.nullptr, + persistence.value); + return NSURLCredential.castFromPointer(_ret, retain: true, release: true); + } + + /// credentialWithIdentity:certificates:persistence: + static NSURLCredential credentialWithIdentity_certificates_persistence_( + ffi.Pointer<__SecIdentity> identity, + objc.NSArray? certArray, + NSURLCredentialPersistence persistence) { + final _ret = _objc_msgSend_379( + _class_NSURLCredential, + _sel_credentialWithIdentity_certificates_persistence_, + identity, + certArray?.pointer ?? ffi.nullptr, + persistence.value); + return NSURLCredential.castFromPointer(_ret, retain: true, release: true); + } + + /// identity + ffi.Pointer<__SecIdentity> get identity { + return _objc_msgSend_380(this.pointer, _sel_identity); + } + + /// certificates + objc.NSArray get certificates { + final _ret = _objc_msgSend_32(this.pointer, _sel_certificates); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithTrust: + NSURLCredential initWithTrust_(ffi.Pointer<__SecTrust> trust) { + final _ret = _objc_msgSend_381(this.pointer, _sel_initWithTrust_, trust); + return NSURLCredential.castFromPointer(_ret, retain: true, release: true); + } + + /// credentialForTrust: + static NSURLCredential credentialForTrust_(ffi.Pointer<__SecTrust> trust) { + final _ret = _objc_msgSend_382( + _class_NSURLCredential, _sel_credentialForTrust_, trust); + return NSURLCredential.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSURLCredential init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSURLCredential.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSURLCredential new1() { + final _ret = _objc_msgSend_19(_class_NSURLCredential, _sel_new); + return NSURLCredential.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLCredential allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSURLCredential, _sel_allocWithZone_, zone); + return NSURLCredential.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSURLCredential alloc() { + final _ret = _objc_msgSend_19(_class_NSURLCredential, _sel_alloc); + return NSURLCredential.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSURLCredential, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSURLCredential, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSURLCredential, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSURLCredential, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSURLCredential, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSURLCredential, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSURLCredential, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSURLCredential, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSURLCredential = objc.getClass("NSURLCredential"); + +enum NSURLCredentialPersistence { + NSURLCredentialPersistenceNone(0), + NSURLCredentialPersistenceForSession(1), + NSURLCredentialPersistencePermanent(2), + NSURLCredentialPersistenceSynchronizable(3); + + final int value; + const NSURLCredentialPersistence(this.value); + + static NSURLCredentialPersistence fromValue(int value) => switch (value) { + 0 => NSURLCredentialPersistenceNone, + 1 => NSURLCredentialPersistenceForSession, + 2 => NSURLCredentialPersistencePermanent, + 3 => NSURLCredentialPersistenceSynchronizable, + _ => throw ArgumentError( + "Unknown value for NSURLCredentialPersistence: $value"), + }; +} + +late final _sel_persistence = objc.registerName("persistence"); +final _objc_msgSend_375 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithUser_password_persistence_ = + objc.registerName("initWithUser:password:persistence:"); +final _objc_msgSend_376 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_credentialWithUser_password_persistence_ = + objc.registerName("credentialWithUser:password:persistence:"); +final _objc_msgSend_377 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_user = objc.registerName("user"); +late final _sel_password = objc.registerName("password"); +late final _sel_hasPassword = objc.registerName("hasPassword"); + +final class __SecIdentity extends ffi.Opaque {} + +late final _sel_initWithIdentity_certificates_persistence_ = + objc.registerName("initWithIdentity:certificates:persistence:"); +final _objc_msgSend_378 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__SecIdentity>, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__SecIdentity>, + ffi.Pointer, + int)>(); +late final _sel_credentialWithIdentity_certificates_persistence_ = + objc.registerName("credentialWithIdentity:certificates:persistence:"); +final _objc_msgSend_379 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__SecIdentity>, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__SecIdentity>, + ffi.Pointer, + int)>(); +late final _sel_identity = objc.registerName("identity"); +final _objc_msgSend_380 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer<__SecIdentity> Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer<__SecIdentity> Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_certificates = objc.registerName("certificates"); + +final class __SecTrust extends ffi.Opaque {} + +late final _sel_initWithTrust_ = objc.registerName("initWithTrust:"); +final _objc_msgSend_381 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<__SecTrust>)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<__SecTrust>)>(); +late final _sel_credentialForTrust_ = objc.registerName("credentialForTrust:"); +final _objc_msgSend_382 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<__SecTrust>)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<__SecTrust>)>(); + +/// NSURLProtectionSpace +class NSURLProtectionSpace extends objc.NSObject { + NSURLProtectionSpace._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLProtectionSpace] that points to the same underlying object as [other]. + NSURLProtectionSpace.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSURLProtectionSpace] that wraps the given raw object pointer. + NSURLProtectionSpace.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLProtectionSpace]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSURLProtectionSpace); + } + + /// initWithHost:port:protocol:realm:authenticationMethod: + NSURLProtectionSpace initWithHost_port_protocol_realm_authenticationMethod_( + objc.NSString host, + int port, + objc.NSString? protocol, + objc.NSString? realm, + objc.NSString? authenticationMethod) { + final _ret = _objc_msgSend_383( + this.pointer, + _sel_initWithHost_port_protocol_realm_authenticationMethod_, + host.pointer, + port, + protocol?.pointer ?? ffi.nullptr, + realm?.pointer ?? ffi.nullptr, + authenticationMethod?.pointer ?? ffi.nullptr); + return NSURLProtectionSpace.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithProxyHost:port:type:realm:authenticationMethod: + NSURLProtectionSpace initWithProxyHost_port_type_realm_authenticationMethod_( + objc.NSString host, + int port, + objc.NSString? type, + objc.NSString? realm, + objc.NSString? authenticationMethod) { + final _ret = _objc_msgSend_383( + this.pointer, + _sel_initWithProxyHost_port_type_realm_authenticationMethod_, + host.pointer, + port, + type?.pointer ?? ffi.nullptr, + realm?.pointer ?? ffi.nullptr, + authenticationMethod?.pointer ?? ffi.nullptr); + return NSURLProtectionSpace.castFromPointer(_ret, + retain: true, release: true); + } + + /// realm + objc.NSString? get realm { + final _ret = _objc_msgSend_20(this.pointer, _sel_realm); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// receivesCredentialSecurely + bool get receivesCredentialSecurely { + return _objc_msgSend_13(this.pointer, _sel_receivesCredentialSecurely); + } + + /// isProxy + bool get isProxy { + return _objc_msgSend_13(this.pointer, _sel_isProxy); + } + + /// host + objc.NSString get host { + final _ret = _objc_msgSend_11(this.pointer, _sel_host); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// port + int get port { + return _objc_msgSend_250(this.pointer, _sel_port); + } + + /// proxyType + objc.NSString? get proxyType { + final _ret = _objc_msgSend_20(this.pointer, _sel_proxyType); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// protocol + objc.NSString? get protocol { + final _ret = _objc_msgSend_20(this.pointer, _sel_protocol); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// authenticationMethod + objc.NSString get authenticationMethod { + final _ret = _objc_msgSend_11(this.pointer, _sel_authenticationMethod); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// distinguishedNames + objc.NSArray? get distinguishedNames { + final _ret = _objc_msgSend_87(this.pointer, _sel_distinguishedNames); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// serverTrust + ffi.Pointer<__SecTrust> get serverTrust { + return _objc_msgSend_384(this.pointer, _sel_serverTrust); + } + + /// init + NSURLProtectionSpace init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSURLProtectionSpace.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSURLProtectionSpace new1() { + final _ret = _objc_msgSend_19(_class_NSURLProtectionSpace, _sel_new); + return NSURLProtectionSpace.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSURLProtectionSpace allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28( + _class_NSURLProtectionSpace, _sel_allocWithZone_, zone); + return NSURLProtectionSpace.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSURLProtectionSpace alloc() { + final _ret = _objc_msgSend_19(_class_NSURLProtectionSpace, _sel_alloc); + return NSURLProtectionSpace.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSURLProtectionSpace, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSURLProtectionSpace, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSURLProtectionSpace, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13( + _class_NSURLProtectionSpace, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSURLProtectionSpace, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSURLProtectionSpace, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSURLProtectionSpace, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSURLProtectionSpace, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSURLProtectionSpace = objc.getClass("NSURLProtectionSpace"); +late final _sel_initWithHost_port_protocol_realm_authenticationMethod_ = + objc.registerName("initWithHost:port:protocol:realm:authenticationMethod:"); +final _objc_msgSend_383 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_initWithProxyHost_port_type_realm_authenticationMethod_ = objc + .registerName("initWithProxyHost:port:type:realm:authenticationMethod:"); +late final _sel_realm = objc.registerName("realm"); +late final _sel_receivesCredentialSecurely = + objc.registerName("receivesCredentialSecurely"); +late final _sel_isProxy = objc.registerName("isProxy"); +late final _sel_host = objc.registerName("host"); +late final _sel_proxyType = objc.registerName("proxyType"); +late final _sel_protocol = objc.registerName("protocol"); +late final _sel_authenticationMethod = + objc.registerName("authenticationMethod"); +late final _sel_distinguishedNames = objc.registerName("distinguishedNames"); +late final _sel_serverTrust = objc.registerName("serverTrust"); +final _objc_msgSend_384 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer<__SecTrust> Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer<__SecTrust> Function( + ffi.Pointer, ffi.Pointer)>(); + +/// NSURLCredentialStorage +class NSURLCredentialStorage extends objc.NSObject { + NSURLCredentialStorage._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLCredentialStorage] that points to the same underlying object as [other]. + NSURLCredentialStorage.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSURLCredentialStorage] that wraps the given raw object pointer. + NSURLCredentialStorage.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLCredentialStorage]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSURLCredentialStorage); + } + + /// sharedCredentialStorage + static NSURLCredentialStorage getSharedCredentialStorage() { + final _ret = _objc_msgSend_385( + _class_NSURLCredentialStorage, _sel_sharedCredentialStorage); + return NSURLCredentialStorage.castFromPointer(_ret, + retain: true, release: true); + } + + /// credentialsForProtectionSpace: + objc.NSDictionary? credentialsForProtectionSpace_( + NSURLProtectionSpace space) { + final _ret = _objc_msgSend_386( + this.pointer, _sel_credentialsForProtectionSpace_, space.pointer); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// allCredentials + objc.NSDictionary get allCredentials { + final _ret = _objc_msgSend_256(this.pointer, _sel_allCredentials); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// setCredential:forProtectionSpace: + void setCredential_forProtectionSpace_( + NSURLCredential credential, NSURLProtectionSpace space) { + _objc_msgSend_387(this.pointer, _sel_setCredential_forProtectionSpace_, + credential.pointer, space.pointer); + } + + /// removeCredential:forProtectionSpace: + void removeCredential_forProtectionSpace_( + NSURLCredential credential, NSURLProtectionSpace space) { + _objc_msgSend_387(this.pointer, _sel_removeCredential_forProtectionSpace_, + credential.pointer, space.pointer); + } + + /// removeCredential:forProtectionSpace:options: + void removeCredential_forProtectionSpace_options_(NSURLCredential credential, + NSURLProtectionSpace space, objc.NSDictionary? options) { + _objc_msgSend_388( + this.pointer, + _sel_removeCredential_forProtectionSpace_options_, + credential.pointer, + space.pointer, + options?.pointer ?? ffi.nullptr); + } + + /// defaultCredentialForProtectionSpace: + NSURLCredential? defaultCredentialForProtectionSpace_( + NSURLProtectionSpace space) { + final _ret = _objc_msgSend_389( + this.pointer, _sel_defaultCredentialForProtectionSpace_, space.pointer); + return _ret.address == 0 + ? null + : NSURLCredential.castFromPointer(_ret, retain: true, release: true); + } + + /// setDefaultCredential:forProtectionSpace: + void setDefaultCredential_forProtectionSpace_( + NSURLCredential credential, NSURLProtectionSpace space) { + _objc_msgSend_387( + this.pointer, + _sel_setDefaultCredential_forProtectionSpace_, + credential.pointer, + space.pointer); + } + + /// getCredentialsForProtectionSpace:task:completionHandler: + void getCredentialsForProtectionSpace_task_completionHandler_( + NSURLProtectionSpace protectionSpace, + NSURLSessionTask task, + ObjCBlock_ffiVoid_NSDictionary completionHandler) { + _objc_msgSend_390( + this.pointer, + _sel_getCredentialsForProtectionSpace_task_completionHandler_, + protectionSpace.pointer, + task.pointer, + completionHandler.pointer); + } + + /// setCredential:forProtectionSpace:task: + void setCredential_forProtectionSpace_task_(NSURLCredential credential, + NSURLProtectionSpace protectionSpace, NSURLSessionTask task) { + _objc_msgSend_391(this.pointer, _sel_setCredential_forProtectionSpace_task_, + credential.pointer, protectionSpace.pointer, task.pointer); + } + + /// removeCredential:forProtectionSpace:options:task: + void removeCredential_forProtectionSpace_options_task_( + NSURLCredential credential, + NSURLProtectionSpace protectionSpace, + objc.NSDictionary? options, + NSURLSessionTask task) { + _objc_msgSend_392( + this.pointer, + _sel_removeCredential_forProtectionSpace_options_task_, + credential.pointer, + protectionSpace.pointer, + options?.pointer ?? ffi.nullptr, + task.pointer); + } + + /// getDefaultCredentialForProtectionSpace:task:completionHandler: + void getDefaultCredentialForProtectionSpace_task_completionHandler_( + NSURLProtectionSpace space, + NSURLSessionTask task, + ObjCBlock_ffiVoid_NSURLCredential completionHandler) { + _objc_msgSend_393( + this.pointer, + _sel_getDefaultCredentialForProtectionSpace_task_completionHandler_, + space.pointer, + task.pointer, + completionHandler.pointer); + } + + /// setDefaultCredential:forProtectionSpace:task: + void setDefaultCredential_forProtectionSpace_task_(NSURLCredential credential, + NSURLProtectionSpace protectionSpace, NSURLSessionTask task) { + _objc_msgSend_391( + this.pointer, + _sel_setDefaultCredential_forProtectionSpace_task_, + credential.pointer, + protectionSpace.pointer, + task.pointer); + } + + /// init + NSURLCredentialStorage init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSURLCredentialStorage.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSURLCredentialStorage new1() { + final _ret = _objc_msgSend_19(_class_NSURLCredentialStorage, _sel_new); + return NSURLCredentialStorage.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSURLCredentialStorage allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28( + _class_NSURLCredentialStorage, _sel_allocWithZone_, zone); + return NSURLCredentialStorage.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSURLCredentialStorage alloc() { + final _ret = _objc_msgSend_19(_class_NSURLCredentialStorage, _sel_alloc); + return NSURLCredentialStorage.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSURLCredentialStorage, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSURLCredentialStorage, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSURLCredentialStorage, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13( + _class_NSURLCredentialStorage, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSURLCredentialStorage, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSURLCredentialStorage, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSURLCredentialStorage, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSURLCredentialStorage, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSURLCredentialStorage = + objc.getClass("NSURLCredentialStorage"); +late final _sel_sharedCredentialStorage = + objc.registerName("sharedCredentialStorage"); +final _objc_msgSend_385 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_credentialsForProtectionSpace_ = + objc.registerName("credentialsForProtectionSpace:"); +final _objc_msgSend_386 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_allCredentials = objc.registerName("allCredentials"); +late final _sel_setCredential_forProtectionSpace_ = + objc.registerName("setCredential:forProtectionSpace:"); +final _objc_msgSend_387 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removeCredential_forProtectionSpace_ = + objc.registerName("removeCredential:forProtectionSpace:"); +late final _sel_removeCredential_forProtectionSpace_options_ = + objc.registerName("removeCredential:forProtectionSpace:options:"); +final _objc_msgSend_388 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_defaultCredentialForProtectionSpace_ = + objc.registerName("defaultCredentialForProtectionSpace:"); +final _objc_msgSend_389 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setDefaultCredential_forProtectionSpace_ = + objc.registerName("setDefaultCredential:forProtectionSpace:"); +void _ObjCBlock_ffiVoid_NSDictionary_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +void _ObjCBlock_ffiVoid_NSDictionary_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + +class ObjCBlock_ffiVoid_NSDictionary extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSDictionary._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSDictionary castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSDictionary._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSDictionary.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSDictionary_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSDictionary.fromFunction( + void Function(objc.NSDictionary?) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSDictionary_closureTrampoline) + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSDictionary.castFromPointer(arg0, + retain: true, release: true)))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSDictionary.listener(void Function(objc.NSDictionary?) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSDictionary( + objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSDictionary_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSDictionary.castFromPointer(arg0, retain: false, release: true))))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>? + _dartFuncListenerTrampoline; + + void call(objc.NSDictionary? arg0) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>()( + pointer, arg0?.pointer ?? ffi.nullptr); +} + +late final _sel_getCredentialsForProtectionSpace_task_completionHandler_ = objc + .registerName("getCredentialsForProtectionSpace:task:completionHandler:"); +final _objc_msgSend_390 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_setCredential_forProtectionSpace_task_ = + objc.registerName("setCredential:forProtectionSpace:task:"); +final _objc_msgSend_391 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removeCredential_forProtectionSpace_options_task_ = + objc.registerName("removeCredential:forProtectionSpace:options:task:"); +final _objc_msgSend_392 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +void _ObjCBlock_ffiVoid_NSURLCredential_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +void _ObjCBlock_ffiVoid_NSURLCredential_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + +class ObjCBlock_ffiVoid_NSURLCredential extends objc.ObjCBlockBase { + ObjCBlock_ffiVoid_NSURLCredential._(ffi.Pointer pointer, + {bool retain = false, bool release = true}) + : super(pointer, retain: retain, release: release); + + /// Returns a block that wraps the given raw block pointer. + static ObjCBlock_ffiVoid_NSURLCredential castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) { + return ObjCBlock_ffiVoid_NSURLCredential._(pointer, + retain: retain, release: release); + } + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSURLCredential.fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._(objc.newPointerBlock( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLCredential_fnPtrTrampoline) + .cast(), + ptr.cast())); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + ObjCBlock_ffiVoid_NSURLCredential.fromFunction( + void Function(NSURLCredential?) fn) + : this._(objc.newClosureBlock( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLCredential_closureTrampoline) + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSURLCredential.castFromPointer(arg0, + retain: true, release: true)))); + static ffi.Pointer? _dartFuncTrampoline; + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + ObjCBlock_ffiVoid_NSURLCredential.listener(void Function(NSURLCredential?) fn) + : this._(wrapListenerBlock_ObjCBlock_ffiVoid_NSURLCredential( + objc.newClosureBlock( + (_dartFuncListenerTrampoline ??= ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLCredential_closureTrampoline) + ..keepIsolateAlive = false) + .nativeFunction + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSURLCredential.castFromPointer(arg0, + retain: false, release: true))))); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>? + _dartFuncListenerTrampoline; + + void call(NSURLCredential? arg0) => pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>()( + pointer, arg0?.pointer ?? ffi.nullptr); +} + +late final _sel_getDefaultCredentialForProtectionSpace_task_completionHandler_ = + objc.registerName( + "getDefaultCredentialForProtectionSpace:task:completionHandler:"); +final _objc_msgSend_393 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_setDefaultCredential_forProtectionSpace_task_ = + objc.registerName("setDefaultCredential:forProtectionSpace:task:"); + +/// NSURLProtocol +class NSURLProtocol extends objc.NSObject { + NSURLProtocol._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLProtocol] that points to the same underlying object as [other]. + NSURLProtocol.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSURLProtocol] that wraps the given raw object pointer. + NSURLProtocol.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLProtocol]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSURLProtocol); + } + + /// initWithRequest:cachedResponse:client: + NSURLProtocol initWithRequest_cachedResponse_client_(NSURLRequest request, + NSCachedURLResponse? cachedResponse, objc.ObjCObjectBase? client) { + final _ret = _objc_msgSend_394( + this.pointer, + _sel_initWithRequest_cachedResponse_client_, + request.pointer, + cachedResponse?.pointer ?? ffi.nullptr, + client?.pointer ?? ffi.nullptr); + return NSURLProtocol.castFromPointer(_ret, retain: true, release: true); + } + + /// client + objc.ObjCObjectBase? get client { + final _ret = _objc_msgSend_84(this.pointer, _sel_client); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// request + NSURLRequest get request { + final _ret = _objc_msgSend_370(this.pointer, _sel_request); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// cachedResponse + NSCachedURLResponse? get cachedResponse { + final _ret = _objc_msgSend_395(this.pointer, _sel_cachedResponse); + return _ret.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(_ret, + retain: true, release: true); + } + + /// canInitWithRequest: + static bool canInitWithRequest_(NSURLRequest request) { + return _objc_msgSend_372( + _class_NSURLProtocol, _sel_canInitWithRequest_, request.pointer); + } + + /// canonicalRequestForRequest: + static NSURLRequest canonicalRequestForRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_396(_class_NSURLProtocol, + _sel_canonicalRequestForRequest_, request.pointer); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// requestIsCacheEquivalent:toRequest: + static bool requestIsCacheEquivalent_toRequest_( + NSURLRequest a, NSURLRequest b) { + return _objc_msgSend_397(_class_NSURLProtocol, + _sel_requestIsCacheEquivalent_toRequest_, a.pointer, b.pointer); + } + + /// startLoading + void startLoading() { + _objc_msgSend_7(this.pointer, _sel_startLoading); + } + + /// stopLoading + void stopLoading() { + _objc_msgSend_7(this.pointer, _sel_stopLoading); + } + + /// propertyForKey:inRequest: + static objc.ObjCObjectBase? propertyForKey_inRequest_( + objc.NSString key, NSURLRequest request) { + final _ret = _objc_msgSend_398(_class_NSURLProtocol, + _sel_propertyForKey_inRequest_, key.pointer, request.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// setProperty:forKey:inRequest: + static void setProperty_forKey_inRequest_(objc.ObjCObjectBase value, + objc.NSString key, NSMutableURLRequest request) { + _objc_msgSend_406(_class_NSURLProtocol, _sel_setProperty_forKey_inRequest_, + value.pointer, key.pointer, request.pointer); + } + + /// removePropertyForKey:inRequest: + static void removePropertyForKey_inRequest_( + objc.NSString key, NSMutableURLRequest request) { + _objc_msgSend_407(_class_NSURLProtocol, + _sel_removePropertyForKey_inRequest_, key.pointer, request.pointer); + } + + /// registerClass: + static bool registerClass_(objc.ObjCObjectBase protocolClass) { + return _objc_msgSend_0( + _class_NSURLProtocol, _sel_registerClass_, protocolClass.pointer); + } + + /// unregisterClass: + static void unregisterClass_(objc.ObjCObjectBase protocolClass) { + _objc_msgSend_27( + _class_NSURLProtocol, _sel_unregisterClass_, protocolClass.pointer); + } + + /// canInitWithTask: + static bool canInitWithTask_(NSURLSessionTask task) { + return _objc_msgSend_408( + _class_NSURLProtocol, _sel_canInitWithTask_, task.pointer); + } + + /// initWithTask:cachedResponse:client: + NSURLProtocol initWithTask_cachedResponse_client_(NSURLSessionTask task, + NSCachedURLResponse? cachedResponse, objc.ObjCObjectBase? client) { + final _ret = _objc_msgSend_409( + this.pointer, + _sel_initWithTask_cachedResponse_client_, + task.pointer, + cachedResponse?.pointer ?? ffi.nullptr, + client?.pointer ?? ffi.nullptr); + return NSURLProtocol.castFromPointer(_ret, retain: true, release: true); + } + + /// task + NSURLSessionTask? get task { + final _ret = _objc_msgSend_410(this.pointer, _sel_task); + return _ret.address == 0 + ? null + : NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSURLProtocol init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSURLProtocol.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSURLProtocol new1() { + final _ret = _objc_msgSend_19(_class_NSURLProtocol, _sel_new); + return NSURLProtocol.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLProtocol allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSURLProtocol, _sel_allocWithZone_, zone); + return NSURLProtocol.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSURLProtocol alloc() { + final _ret = _objc_msgSend_19(_class_NSURLProtocol, _sel_alloc); + return NSURLProtocol.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSURLProtocol, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSURLProtocol, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSURLProtocol, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSURLProtocol, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSURLProtocol, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSURLProtocol, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSURLProtocol, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSURLProtocol, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSURLProtocol = objc.getClass("NSURLProtocol"); +late final _sel_initWithRequest_cachedResponse_client_ = + objc.registerName("initWithRequest:cachedResponse:client:"); +final _objc_msgSend_394 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_client = objc.registerName("client"); +late final _sel_request = objc.registerName("request"); +late final _sel_cachedResponse = objc.registerName("cachedResponse"); +final _objc_msgSend_395 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_canInitWithRequest_ = objc.registerName("canInitWithRequest:"); +late final _sel_canonicalRequestForRequest_ = + objc.registerName("canonicalRequestForRequest:"); +final _objc_msgSend_396 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_requestIsCacheEquivalent_toRequest_ = + objc.registerName("requestIsCacheEquivalent:toRequest:"); +final _objc_msgSend_397 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_startLoading = objc.registerName("startLoading"); +late final _sel_stopLoading = objc.registerName("stopLoading"); +late final _sel_propertyForKey_inRequest_ = + objc.registerName("propertyForKey:inRequest:"); +final _objc_msgSend_398 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + +/// NSMutableURLRequest +class NSMutableURLRequest extends NSURLRequest { + NSMutableURLRequest._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSMutableURLRequest] that points to the same underlying object as [other]. + NSMutableURLRequest.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSMutableURLRequest] that wraps the given raw object pointer. + NSMutableURLRequest.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSMutableURLRequest]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSMutableURLRequest); + } + + /// URL + objc.NSURL? get URL { + final _ret = _objc_msgSend_24(this.pointer, _sel_URL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// setURL: + set URL(objc.NSURL? value) { + return _objc_msgSend_25( + this.pointer, _sel_setURL_, value?.pointer ?? ffi.nullptr); + } + + /// cachePolicy + NSURLRequestCachePolicy get cachePolicy { + final _ret = _objc_msgSend_356(this.pointer, _sel_cachePolicy); + return NSURLRequestCachePolicy.fromValue(_ret); + } + + /// setCachePolicy: + set cachePolicy(NSURLRequestCachePolicy value) { + return _objc_msgSend_399(this.pointer, _sel_setCachePolicy_, value.value); + } + + /// timeoutInterval + double get timeoutInterval { + return objc.useMsgSendVariants + ? _objc_msgSend_18Fpret(this.pointer, _sel_timeoutInterval) + : _objc_msgSend_18(this.pointer, _sel_timeoutInterval); + } + + /// setTimeoutInterval: + set timeoutInterval(double value) { + return _objc_msgSend_127(this.pointer, _sel_setTimeoutInterval_, value); + } + + /// mainDocumentURL + objc.NSURL? get mainDocumentURL { + final _ret = _objc_msgSend_24(this.pointer, _sel_mainDocumentURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// setMainDocumentURL: + set mainDocumentURL(objc.NSURL? value) { + return _objc_msgSend_25( + this.pointer, _sel_setMainDocumentURL_, value?.pointer ?? ffi.nullptr); + } + + /// networkServiceType + NSURLRequestNetworkServiceType get networkServiceType { + final _ret = _objc_msgSend_357(this.pointer, _sel_networkServiceType); + return NSURLRequestNetworkServiceType.fromValue(_ret); + } + + /// setNetworkServiceType: + set networkServiceType(NSURLRequestNetworkServiceType value) { + return _objc_msgSend_400( + this.pointer, _sel_setNetworkServiceType_, value.value); + } + + /// allowsCellularAccess + bool get allowsCellularAccess { + return _objc_msgSend_13(this.pointer, _sel_allowsCellularAccess); + } + + /// setAllowsCellularAccess: + set allowsCellularAccess(bool value) { + return _objc_msgSend_14(this.pointer, _sel_setAllowsCellularAccess_, value); + } + + /// allowsExpensiveNetworkAccess + bool get allowsExpensiveNetworkAccess { + return _objc_msgSend_13(this.pointer, _sel_allowsExpensiveNetworkAccess); + } + + /// setAllowsExpensiveNetworkAccess: + set allowsExpensiveNetworkAccess(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setAllowsExpensiveNetworkAccess_, value); + } + + /// allowsConstrainedNetworkAccess + bool get allowsConstrainedNetworkAccess { + return _objc_msgSend_13(this.pointer, _sel_allowsConstrainedNetworkAccess); + } + + /// setAllowsConstrainedNetworkAccess: + set allowsConstrainedNetworkAccess(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setAllowsConstrainedNetworkAccess_, value); + } + + /// assumesHTTP3Capable + bool get assumesHTTP3Capable { + return _objc_msgSend_13(this.pointer, _sel_assumesHTTP3Capable); + } + + /// setAssumesHTTP3Capable: + set assumesHTTP3Capable(bool value) { + return _objc_msgSend_14(this.pointer, _sel_setAssumesHTTP3Capable_, value); + } + + /// attribution + NSURLRequestAttribution get attribution { + final _ret = _objc_msgSend_358(this.pointer, _sel_attribution); + return NSURLRequestAttribution.fromValue(_ret); + } + + /// setAttribution: + set attribution(NSURLRequestAttribution value) { + return _objc_msgSend_401(this.pointer, _sel_setAttribution_, value.value); + } + + /// requiresDNSSECValidation + bool get requiresDNSSECValidation { + return _objc_msgSend_13(this.pointer, _sel_requiresDNSSECValidation); + } + + /// setRequiresDNSSECValidation: + set requiresDNSSECValidation(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setRequiresDNSSECValidation_, value); + } + + /// HTTPMethod + objc.NSString get HTTPMethod { + final _ret = _objc_msgSend_11(this.pointer, _sel_HTTPMethod); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setHTTPMethod: + set HTTPMethod(objc.NSString value) { + return _objc_msgSend_12(this.pointer, _sel_setHTTPMethod_, value.pointer); + } + + /// allHTTPHeaderFields + objc.NSDictionary? get allHTTPHeaderFields { + final _ret = _objc_msgSend_83(this.pointer, _sel_allHTTPHeaderFields); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// setAllHTTPHeaderFields: + set allHTTPHeaderFields(objc.NSDictionary? value) { + return _objc_msgSend_402(this.pointer, _sel_setAllHTTPHeaderFields_, + value?.pointer ?? ffi.nullptr); + } + + /// setValue:forHTTPHeaderField: + void setValue_forHTTPHeaderField_(objc.NSString? value, objc.NSString field) { + _objc_msgSend_403(this.pointer, _sel_setValue_forHTTPHeaderField_, + value?.pointer ?? ffi.nullptr, field.pointer); + } + + /// addValue:forHTTPHeaderField: + void addValue_forHTTPHeaderField_(objc.NSString value, objc.NSString field) { + _objc_msgSend_116(this.pointer, _sel_addValue_forHTTPHeaderField_, + value.pointer, field.pointer); + } + + /// HTTPBody + objc.NSData? get HTTPBody { + final _ret = _objc_msgSend_359(this.pointer, _sel_HTTPBody); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// setHTTPBody: + set HTTPBody(objc.NSData? value) { + return _objc_msgSend_404( + this.pointer, _sel_setHTTPBody_, value?.pointer ?? ffi.nullptr); + } + + /// HTTPBodyStream + NSInputStream? get HTTPBodyStream { + final _ret = _objc_msgSend_360(this.pointer, _sel_HTTPBodyStream); + return _ret.address == 0 + ? null + : NSInputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// setHTTPBodyStream: + set HTTPBodyStream(NSInputStream? value) { + return _objc_msgSend_405( + this.pointer, _sel_setHTTPBodyStream_, value?.pointer ?? ffi.nullptr); + } + + /// HTTPShouldHandleCookies + bool get HTTPShouldHandleCookies { + return _objc_msgSend_13(this.pointer, _sel_HTTPShouldHandleCookies); + } + + /// setHTTPShouldHandleCookies: + set HTTPShouldHandleCookies(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setHTTPShouldHandleCookies_, value); + } + + /// HTTPShouldUsePipelining + bool get HTTPShouldUsePipelining { + return _objc_msgSend_13(this.pointer, _sel_HTTPShouldUsePipelining); + } + + /// setHTTPShouldUsePipelining: + set HTTPShouldUsePipelining(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setHTTPShouldUsePipelining_, value); + } + + /// requestWithURL: + static NSMutableURLRequest requestWithURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_354( + _class_NSMutableURLRequest, _sel_requestWithURL_, URL.pointer); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } + + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_13( + _class_NSMutableURLRequest, _sel_supportsSecureCoding); + } + + /// requestWithURL:cachePolicy:timeoutInterval: + static NSMutableURLRequest requestWithURL_cachePolicy_timeoutInterval_( + objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, + double timeoutInterval) { + final _ret = _objc_msgSend_355( + _class_NSMutableURLRequest, + _sel_requestWithURL_cachePolicy_timeoutInterval_, + URL.pointer, + cachePolicy.value, + timeoutInterval); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithURL: + NSMutableURLRequest initWithURL_(objc.NSURL URL) { + final _ret = + _objc_msgSend_354(this.pointer, _sel_initWithURL_, URL.pointer); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithURL:cachePolicy:timeoutInterval: + NSMutableURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, double timeoutInterval) { + final _ret = _objc_msgSend_355( + this.pointer, + _sel_initWithURL_cachePolicy_timeoutInterval_, + URL.pointer, + cachePolicy.value, + timeoutInterval); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } + + /// init + NSMutableURLRequest init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } + + /// new + static NSMutableURLRequest new1() { + final _ret = _objc_msgSend_19(_class_NSMutableURLRequest, _sel_new); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSMutableURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSMutableURLRequest, _sel_allocWithZone_, zone); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSMutableURLRequest alloc() { + final _ret = _objc_msgSend_19(_class_NSMutableURLRequest, _sel_alloc); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSMutableURLRequest, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSMutableURLRequest, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSMutableURLRequest, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSMutableURLRequest, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSMutableURLRequest, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSMutableURLRequest, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSMutableURLRequest, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_NSMutableURLRequest, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSMutableURLRequest = objc.getClass("NSMutableURLRequest"); +late final _sel_setURL_ = objc.registerName("setURL:"); +late final _sel_setCachePolicy_ = objc.registerName("setCachePolicy:"); +final _objc_msgSend_399 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_setTimeoutInterval_ = objc.registerName("setTimeoutInterval:"); +late final _sel_setMainDocumentURL_ = objc.registerName("setMainDocumentURL:"); +late final _sel_setNetworkServiceType_ = + objc.registerName("setNetworkServiceType:"); +final _objc_msgSend_400 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_setAllowsCellularAccess_ = + objc.registerName("setAllowsCellularAccess:"); +late final _sel_setAllowsExpensiveNetworkAccess_ = + objc.registerName("setAllowsExpensiveNetworkAccess:"); +late final _sel_setAllowsConstrainedNetworkAccess_ = + objc.registerName("setAllowsConstrainedNetworkAccess:"); +late final _sel_setAssumesHTTP3Capable_ = + objc.registerName("setAssumesHTTP3Capable:"); +late final _sel_setAttribution_ = objc.registerName("setAttribution:"); +final _objc_msgSend_401 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_setRequiresDNSSECValidation_ = + objc.registerName("setRequiresDNSSECValidation:"); +late final _sel_setHTTPMethod_ = objc.registerName("setHTTPMethod:"); +late final _sel_setAllHTTPHeaderFields_ = + objc.registerName("setAllHTTPHeaderFields:"); +final _objc_msgSend_402 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setValue_forHTTPHeaderField_ = + objc.registerName("setValue:forHTTPHeaderField:"); +final _objc_msgSend_403 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_addValue_forHTTPHeaderField_ = + objc.registerName("addValue:forHTTPHeaderField:"); +late final _sel_setHTTPBody_ = objc.registerName("setHTTPBody:"); +final _objc_msgSend_404 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setHTTPBodyStream_ = objc.registerName("setHTTPBodyStream:"); +final _objc_msgSend_405 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setHTTPShouldHandleCookies_ = + objc.registerName("setHTTPShouldHandleCookies:"); +late final _sel_setHTTPShouldUsePipelining_ = + objc.registerName("setHTTPShouldUsePipelining:"); +late final _sel_setProperty_forKey_inRequest_ = + objc.registerName("setProperty:forKey:inRequest:"); +final _objc_msgSend_406 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removePropertyForKey_inRequest_ = + objc.registerName("removePropertyForKey:inRequest:"); +final _objc_msgSend_407 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_registerClass_ = objc.registerName("registerClass:"); +late final _sel_unregisterClass_ = objc.registerName("unregisterClass:"); +late final _sel_canInitWithTask_ = objc.registerName("canInitWithTask:"); +final _objc_msgSend_408 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithTask_cachedResponse_client_ = + objc.registerName("initWithTask:cachedResponse:client:"); +final _objc_msgSend_409 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_task = objc.registerName("task"); +final _objc_msgSend_410 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + +/// NSXMLParser +class NSXMLParser extends objc.NSObject { + NSXMLParser._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSXMLParser] that points to the same underlying object as [other]. + NSXMLParser.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [NSXMLParser] that wraps the given raw object pointer. + NSXMLParser.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSXMLParser]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_NSXMLParser); + } + + /// initWithContentsOfURL: + NSXMLParser? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_35( + this.pointer, _sel_initWithContentsOfURL_, url.pointer); + return _ret.address == 0 + ? null + : NSXMLParser.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithData: + NSXMLParser initWithData_(objc.NSData data) { + final _ret = + _objc_msgSend_336(this.pointer, _sel_initWithData_, data.pointer); + return NSXMLParser.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithStream: + NSXMLParser initWithStream_(NSInputStream stream) { + final _ret = + _objc_msgSend_411(this.pointer, _sel_initWithStream_, stream.pointer); + return NSXMLParser.castFromPointer(_ret, retain: true, release: true); + } + + /// delegate + objc.ObjCObjectBase? get delegate { + final _ret = _objc_msgSend_84(this.pointer, _sel_delegate); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// setDelegate: + set delegate(objc.ObjCObjectBase? value) { + return _objc_msgSend_103( + this.pointer, _sel_setDelegate_, value?.pointer ?? ffi.nullptr); + } + + /// shouldProcessNamespaces + bool get shouldProcessNamespaces { + return _objc_msgSend_13(this.pointer, _sel_shouldProcessNamespaces); + } + + /// setShouldProcessNamespaces: + set shouldProcessNamespaces(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setShouldProcessNamespaces_, value); + } + + /// shouldReportNamespacePrefixes + bool get shouldReportNamespacePrefixes { + return _objc_msgSend_13(this.pointer, _sel_shouldReportNamespacePrefixes); + } + + /// setShouldReportNamespacePrefixes: + set shouldReportNamespacePrefixes(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setShouldReportNamespacePrefixes_, value); + } + + /// externalEntityResolvingPolicy + NSXMLParserExternalEntityResolvingPolicy get externalEntityResolvingPolicy { + final _ret = + _objc_msgSend_412(this.pointer, _sel_externalEntityResolvingPolicy); + return NSXMLParserExternalEntityResolvingPolicy.fromValue(_ret); + } + + /// setExternalEntityResolvingPolicy: + set externalEntityResolvingPolicy( + NSXMLParserExternalEntityResolvingPolicy value) { + return _objc_msgSend_413( + this.pointer, _sel_setExternalEntityResolvingPolicy_, value.value); + } + + /// allowedExternalEntityURLs + objc.NSSet? get allowedExternalEntityURLs { + final _ret = + _objc_msgSend_414(this.pointer, _sel_allowedExternalEntityURLs); + return _ret.address == 0 + ? null + : objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// setAllowedExternalEntityURLs: + set allowedExternalEntityURLs(objc.NSSet? value) { + return _objc_msgSend_415(this.pointer, _sel_setAllowedExternalEntityURLs_, + value?.pointer ?? ffi.nullptr); + } + + /// parse + bool parse() { + return _objc_msgSend_13(this.pointer, _sel_parse); + } + + /// abortParsing + void abortParsing() { + _objc_msgSend_7(this.pointer, _sel_abortParsing); + } + + /// parserError + objc.NSError? get parserError { + final _ret = _objc_msgSend_333(this.pointer, _sel_parserError); + return _ret.address == 0 + ? null + : objc.NSError.castFromPointer(_ret, retain: true, release: true); + } + + /// shouldResolveExternalEntities + bool get shouldResolveExternalEntities { + return _objc_msgSend_13(this.pointer, _sel_shouldResolveExternalEntities); + } + + /// setShouldResolveExternalEntities: + set shouldResolveExternalEntities(bool value) { + return _objc_msgSend_14( + this.pointer, _sel_setShouldResolveExternalEntities_, value); + } + + /// publicID + objc.NSString? get publicID { + final _ret = _objc_msgSend_20(this.pointer, _sel_publicID); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// systemID + objc.NSString? get systemID { + final _ret = _objc_msgSend_20(this.pointer, _sel_systemID); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// lineNumber + int get lineNumber { + return _objc_msgSend_250(this.pointer, _sel_lineNumber); + } + + /// columnNumber + int get columnNumber { + return _objc_msgSend_250(this.pointer, _sel_columnNumber); + } + + /// init + NSXMLParser init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return NSXMLParser.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static NSXMLParser new1() { + final _ret = _objc_msgSend_19(_class_NSXMLParser, _sel_new); + return NSXMLParser.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSXMLParser allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_28(_class_NSXMLParser, _sel_allocWithZone_, zone); + return NSXMLParser.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSXMLParser alloc() { + final _ret = _objc_msgSend_19(_class_NSXMLParser, _sel_alloc); + return NSXMLParser.castFromPointer(_ret, retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_NSXMLParser, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_NSXMLParser, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_NSXMLParser, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13(_class_NSXMLParser, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_NSXMLParser, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_NSXMLParser, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_NSXMLParser, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = + _objc_msgSend_19(_class_NSXMLParser, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_NSXMLParser = objc.getClass("NSXMLParser"); +late final _sel_initWithContentsOfURL_ = + objc.registerName("initWithContentsOfURL:"); +late final _sel_initWithStream_ = objc.registerName("initWithStream:"); +final _objc_msgSend_411 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_shouldProcessNamespaces = + objc.registerName("shouldProcessNamespaces"); +late final _sel_setShouldProcessNamespaces_ = + objc.registerName("setShouldProcessNamespaces:"); +late final _sel_shouldReportNamespacePrefixes = + objc.registerName("shouldReportNamespacePrefixes"); +late final _sel_setShouldReportNamespacePrefixes_ = + objc.registerName("setShouldReportNamespacePrefixes:"); + +enum NSXMLParserExternalEntityResolvingPolicy { + NSXMLParserResolveExternalEntitiesNever(0), + NSXMLParserResolveExternalEntitiesNoNetwork(1), + NSXMLParserResolveExternalEntitiesSameOriginOnly(2), + NSXMLParserResolveExternalEntitiesAlways(3); + + final int value; + const NSXMLParserExternalEntityResolvingPolicy(this.value); + + static NSXMLParserExternalEntityResolvingPolicy fromValue(int value) => + switch (value) { + 0 => NSXMLParserResolveExternalEntitiesNever, + 1 => NSXMLParserResolveExternalEntitiesNoNetwork, + 2 => NSXMLParserResolveExternalEntitiesSameOriginOnly, + 3 => NSXMLParserResolveExternalEntitiesAlways, + _ => throw ArgumentError( + "Unknown value for NSXMLParserExternalEntityResolvingPolicy: $value"), + }; +} + +late final _sel_externalEntityResolvingPolicy = + objc.registerName("externalEntityResolvingPolicy"); +final _objc_msgSend_412 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setExternalEntityResolvingPolicy_ = + objc.registerName("setExternalEntityResolvingPolicy:"); +final _objc_msgSend_413 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_allowedExternalEntityURLs = + objc.registerName("allowedExternalEntityURLs"); +final _objc_msgSend_414 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setAllowedExternalEntityURLs_ = + objc.registerName("setAllowedExternalEntityURLs:"); +final _objc_msgSend_415 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_parse = objc.registerName("parse"); +late final _sel_abortParsing = objc.registerName("abortParsing"); +late final _sel_parserError = objc.registerName("parserError"); +late final _sel_shouldResolveExternalEntities = + objc.registerName("shouldResolveExternalEntities"); +late final _sel_setShouldResolveExternalEntities_ = + objc.registerName("setShouldResolveExternalEntities:"); +late final _sel_publicID = objc.registerName("publicID"); +late final _sel_systemID = objc.registerName("systemID"); +late final _sel_lineNumber = objc.registerName("lineNumber"); +late final _sel_columnNumber = objc.registerName("columnNumber"); + +/// ThermionTextureSwift +class ThermionTextureSwift extends objc.NSObject { + ThermionTextureSwift._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [ThermionTextureSwift] that points to the same underlying object as [other]. + ThermionTextureSwift.castFrom(objc.ObjCObjectBase other) + : this._(other.pointer, retain: true, release: true); + + /// Constructs a [ThermionTextureSwift] that wraps the given raw object pointer. + ThermionTextureSwift.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [ThermionTextureSwift]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_0( + obj.pointer, _sel_isKindOfClass_, _class_ThermionTextureSwift); + } + + /// cvMetalTextureCache + int get cvMetalTextureCache { + return _objc_msgSend_157(this.pointer, _sel_cvMetalTextureCache); + } + + /// setCvMetalTextureCache: + set cvMetalTextureCache(int value) { + return _objc_msgSend_416(this.pointer, _sel_setCvMetalTextureCache_, value); + } + + /// metalDevice + objc.ObjCObjectBase? get metalDevice { + final _ret = _objc_msgSend_84(this.pointer, _sel_metalDevice); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// setMetalDevice: + set metalDevice(objc.ObjCObjectBase? value) { + return _objc_msgSend_103( + this.pointer, _sel_setMetalDevice_, value?.pointer ?? ffi.nullptr); + } + + /// cvMetalTexture + int get cvMetalTexture { + return _objc_msgSend_157(this.pointer, _sel_cvMetalTexture); + } + + /// setCvMetalTexture: + set cvMetalTexture(int value) { + return _objc_msgSend_416(this.pointer, _sel_setCvMetalTexture_, value); + } + + /// metalTexture + objc.ObjCObjectBase? get metalTexture { + final _ret = _objc_msgSend_84(this.pointer, _sel_metalTexture); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// setMetalTexture: + set metalTexture(objc.ObjCObjectBase? value) { + return _objc_msgSend_103( + this.pointer, _sel_setMetalTexture_, value?.pointer ?? ffi.nullptr); + } + + /// metalTextureAddress + int get metalTextureAddress { + return _objc_msgSend_250(this.pointer, _sel_metalTextureAddress); + } + + /// setMetalTextureAddress: + set metalTextureAddress(int value) { + return _objc_msgSend_251(this.pointer, _sel_setMetalTextureAddress_, value); + } + + /// init + ThermionTextureSwift init() { + final _ret = _objc_msgSend_19(this.pointer, _sel_init); + return ThermionTextureSwift.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithWidth:height: + ThermionTextureSwift initWithWidth_height_(int width, int height) { + final _ret = _objc_msgSend_417( + this.pointer, _sel_initWithWidth_height_, width, height); + return ThermionTextureSwift.castFromPointer(_ret, + retain: true, release: true); + } + + /// destroyTexture + void destroyTexture() { + _objc_msgSend_7(this.pointer, _sel_destroyTexture); + } + + /// fillColor + void fillColor() { + _objc_msgSend_7(this.pointer, _sel_fillColor); + } + + /// getTextureBytes + objc.NSData? getTextureBytes() { + final _ret = _objc_msgSend_359(this.pointer, _sel_getTextureBytes); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// new + static ThermionTextureSwift new1() { + final _ret = _objc_msgSend_19(_class_ThermionTextureSwift, _sel_new); + return ThermionTextureSwift.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static ThermionTextureSwift allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_28( + _class_ThermionTextureSwift, _sel_allocWithZone_, zone); + return ThermionTextureSwift.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static ThermionTextureSwift alloc() { + final _ret = _objc_msgSend_19(_class_ThermionTextureSwift, _sel_alloc); + return ThermionTextureSwift.castFromPointer(_ret, + retain: false, release: true); + } + + /// cancelPreviousPerformRequestsWithTarget:selector:object: + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + objc.ObjCObjectBase aTarget, + ffi.Pointer aSelector, + objc.ObjCObjectBase? anArgument) { + _objc_msgSend_29( + _class_ThermionTextureSwift, + _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, + aTarget.pointer, + aSelector, + anArgument?.pointer ?? ffi.nullptr); + } + + /// cancelPreviousPerformRequestsWithTarget: + static void cancelPreviousPerformRequestsWithTarget_( + objc.ObjCObjectBase aTarget) { + _objc_msgSend_27(_class_ThermionTextureSwift, + _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.pointer); + } + + /// accessInstanceVariablesDirectly + static bool getAccessInstanceVariablesDirectly() { + return _objc_msgSend_13( + _class_ThermionTextureSwift, _sel_accessInstanceVariablesDirectly); + } + + /// useStoredAccessor + static bool useStoredAccessor() { + return _objc_msgSend_13( + _class_ThermionTextureSwift, _sel_useStoredAccessor); + } + + /// keyPathsForValuesAffectingValueForKey: + static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { + final _ret = _objc_msgSend_30(_class_ThermionTextureSwift, + _sel_keyPathsForValuesAffectingValueForKey_, key.pointer); + return objc.NSSet.castFromPointer(_ret, retain: true, release: true); + } + + /// automaticallyNotifiesObserversForKey: + static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { + return _objc_msgSend_31(_class_ThermionTextureSwift, + _sel_automaticallyNotifiesObserversForKey_, key.pointer); + } + + /// classFallbacksForKeyedArchiver + static objc.NSArray classFallbacksForKeyedArchiver() { + final _ret = _objc_msgSend_32( + _class_ThermionTextureSwift, _sel_classFallbacksForKeyedArchiver); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// classForKeyedUnarchiver + static objc.ObjCObjectBase classForKeyedUnarchiver() { + final _ret = _objc_msgSend_19( + _class_ThermionTextureSwift, _sel_classForKeyedUnarchiver); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +late final _class_ThermionTextureSwift = + objc.getClass("swift_module.ThermionTextureSwift"); +late final _sel_cvMetalTextureCache = objc.registerName("cvMetalTextureCache"); +late final _sel_setCvMetalTextureCache_ = + objc.registerName("setCvMetalTextureCache:"); +final _objc_msgSend_416 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_metalDevice = objc.registerName("metalDevice"); +late final _sel_setMetalDevice_ = objc.registerName("setMetalDevice:"); +late final _sel_cvMetalTexture = objc.registerName("cvMetalTexture"); +late final _sel_setCvMetalTexture_ = objc.registerName("setCvMetalTexture:"); +late final _sel_metalTexture = objc.registerName("metalTexture"); +late final _sel_setMetalTexture_ = objc.registerName("setMetalTexture:"); +late final _sel_metalTextureAddress = objc.registerName("metalTextureAddress"); +late final _sel_setMetalTextureAddress_ = + objc.registerName("setMetalTextureAddress:"); +late final _sel_initWithWidth_height_ = + objc.registerName("initWithWidth:height:"); +final _objc_msgSend_417 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Int64, ffi.Int64)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, int, int)>(); +late final _sel_destroyTexture = objc.registerName("destroyTexture"); +late final _sel_fillColor = objc.registerName("fillColor"); +late final _sel_getTextureBytes = objc.registerName("getTextureBytes"); diff --git a/thermion_dart/test/swift/swift_bindings.g.dart.m b/thermion_dart/test/swift/swift_bindings.g.dart.m new file mode 100644 index 00000000..94b7d3f8 --- /dev/null +++ b/thermion_dart/test/swift/swift_bindings.g.dart.m @@ -0,0 +1,111 @@ +#include + +#import "../../native/include/generated/ThermionTextureSwiftObjCAPI.h" + +typedef void (^ListenerBlock)(NSDictionary* , struct _NSRange , BOOL * ); +ListenerBlock wrapListenerBlock_ObjCBlock_ffiVoid_NSDictionary_NSRange_bool(ListenerBlock block) { + ListenerBlock wrapper = [^void(NSDictionary* arg0, struct _NSRange arg1, BOOL * arg2) { + block([arg0 retain], arg1, arg2); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock1)(id , struct _NSRange , BOOL * ); +ListenerBlock1 wrapListenerBlock_ObjCBlock_ffiVoid_objcObjCObject_NSRange_bool(ListenerBlock1 block) { + ListenerBlock1 wrapper = [^void(id arg0, struct _NSRange arg1, BOOL * arg2) { + block([arg0 retain], arg1, arg2); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock2)(NSTimer* ); +ListenerBlock2 wrapListenerBlock_ObjCBlock_ffiVoid_NSTimer(ListenerBlock2 block) { + ListenerBlock2 wrapper = [^void(NSTimer* arg0) { + block([arg0 retain]); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock3)(NSFileHandle* ); +ListenerBlock3 wrapListenerBlock_ObjCBlock_ffiVoid_NSFileHandle(ListenerBlock3 block) { + ListenerBlock3 wrapper = [^void(NSFileHandle* arg0) { + block([arg0 retain]); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock4)(NSError* ); +ListenerBlock4 wrapListenerBlock_ObjCBlock_ffiVoid_NSError(ListenerBlock4 block) { + ListenerBlock4 wrapper = [^void(NSError* arg0) { + block([arg0 retain]); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock5)(NSDictionary* , NSError* ); +ListenerBlock5 wrapListenerBlock_ObjCBlock_ffiVoid_NSDictionary_NSError(ListenerBlock5 block) { + ListenerBlock5 wrapper = [^void(NSDictionary* arg0, NSError* arg1) { + block([arg0 retain], [arg1 retain]); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock6)(NSArray* ); +ListenerBlock6 wrapListenerBlock_ObjCBlock_ffiVoid_NSArray(ListenerBlock6 block) { + ListenerBlock6 wrapper = [^void(NSArray* arg0) { + block([arg0 retain]); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock7)(NSTextCheckingResult* , NSMatchingFlags , BOOL * ); +ListenerBlock7 wrapListenerBlock_ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool(ListenerBlock7 block) { + ListenerBlock7 wrapper = [^void(NSTextCheckingResult* arg0, NSMatchingFlags arg1, BOOL * arg2) { + block([arg0 retain], arg1, arg2); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock8)(NSCachedURLResponse* ); +ListenerBlock8 wrapListenerBlock_ObjCBlock_ffiVoid_NSCachedURLResponse(ListenerBlock8 block) { + ListenerBlock8 wrapper = [^void(NSCachedURLResponse* arg0) { + block([arg0 retain]); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock9)(NSURLResponse* , NSData* , NSError* ); +ListenerBlock9 wrapListenerBlock_ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError(ListenerBlock9 block) { + ListenerBlock9 wrapper = [^void(NSURLResponse* arg0, NSData* arg1, NSError* arg2) { + block([arg0 retain], [arg1 retain], [arg2 retain]); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock10)(NSDictionary* ); +ListenerBlock10 wrapListenerBlock_ObjCBlock_ffiVoid_NSDictionary(ListenerBlock10 block) { + ListenerBlock10 wrapper = [^void(NSDictionary* arg0) { + block([arg0 retain]); + } copy]; + [block release]; + return wrapper; +} + +typedef void (^ListenerBlock11)(NSURLCredential* ); +ListenerBlock11 wrapListenerBlock_ObjCBlock_ffiVoid_NSURLCredential(ListenerBlock11 block) { + ListenerBlock11 wrapper = [^void(NSURLCredential* arg0) { + block([arg0 retain]); + } copy]; + [block release]; + return wrapper; +} diff --git a/thermion_dart/test/view_tests.dart b/thermion_dart/test/view_tests.dart new file mode 100644 index 00000000..f7603bc8 --- /dev/null +++ b/thermion_dart/test/view_tests.dart @@ -0,0 +1,133 @@ +import 'dart:async'; + +import 'package:test/test.dart'; +import 'package:thermion_dart/thermion_dart.dart'; +import 'package:vector_math/vector_math_64.dart'; +import 'helpers.dart'; + +void main() async { + final testHelper = TestHelper("view"); + + group('view tests', () { + test('get camera from view', () async { + var viewer = await testHelper.createViewer(); + var view = await viewer.getViewAt(0); + expect(await view.getCamera(), isNotNull); + }); + + test('one swapchain, render view to render target', () async { + var viewer = await testHelper.createViewer(); + + final texture = await testHelper.createTexture(500, 500); + final renderTarget = await viewer.createRenderTarget( + 500, 500, texture.metalTextureAddress); + viewer.setRenderTarget(renderTarget); + + await viewer.setBackgroundColor(1.0, 0, 0, 1); + final cube = await viewer.createGeometry(GeometryHelper.cube()); + + var mainCamera = await viewer.getMainCamera(); + mainCamera.setTransform(Matrix4.translation(Vector3(0, 0, 5))); + await testHelper.capture( + viewer, + renderTarget: renderTarget, + "default_swapchain_default_view_render_target"); + }); + + test('create secondary view, default swapchain', () async { + var viewer = await testHelper.createViewer(); + await viewer.setBackgroundColor(1.0, 0, 0, 1); + + final cube = await viewer.createGeometry(GeometryHelper.cube()); + + var mainCamera = await viewer.getMainCamera(); + mainCamera.setTransform(Matrix4.translation(Vector3(0, 0, 5))); + await testHelper.capture(viewer, "default_swapchain_default_view"); + + final view = await viewer.createView(); + view.updateViewport(500, 500); + view.setCamera(mainCamera); + await testHelper.capture( + viewer, + "default_swapchain_new_view_with_main_camera", + view: view, + ); + + var newCamera = await viewer.createCamera(); + newCamera.setTransform(Matrix4.translation(Vector3(0.0, 0.0, 10.0))); + newCamera.setLensProjection(); + view.setCamera(newCamera); + + await testHelper.capture( + viewer, + "default_swapchain_new_view_new_camera", + view: view, + ); + + await testHelper.capture( + viewer, + "default_swapchain_default_view_main_camera_no_change", + ); + + await viewer.dispose(); + }); + + test('create secondary view, different swapchain', () async { + var viewer = await testHelper.createViewer(); + await viewer.setBackgroundColor(1.0, 0, 0, 1); + final cube = await viewer.createGeometry(GeometryHelper.cube()); + + var mainCamera = await viewer.getMainCamera(); + mainCamera.setTransform(Matrix4.translation(Vector3(0, 0, 5))); + final swapChain = await viewer.createHeadlessSwapChain(1, 1); + await testHelper.capture( + viewer, "create_swapchain_default_view_default_swapchain"); + + final view = await viewer.createView(); + + final texture = await testHelper.createTexture(200, 400); + final renderTarget = await viewer.createRenderTarget( + 200, 400, texture.metalTextureAddress); + await view.setRenderTarget(renderTarget); + + await view.updateViewport(200, 400); + view.setCamera(mainCamera); + mainCamera.setLensProjection(aspect: 0.5); + + await testHelper.capture( + viewer, + view: view, + swapChain: swapChain, + renderTarget: renderTarget, + "create_swapchain_secondary_view_new_swapchain", + ); + + await viewer.dispose(); + }); + + test('pick', () async { + var viewer = await testHelper.createViewer( + bg: kRed, cameraPosition: Vector3(0, 0, 5)); + + final cube = await viewer.createGeometry(GeometryHelper.cube()); + + final completer = Completer(); + late StreamSubscription listener; + listener = viewer.pickResult.listen((result) async { + completer.complete(result.entity); + await listener.cancel(); + }); + + viewer.pick(250, 250); + + for (int i = 0; i < 10; i++) { + await viewer.requestFrame(); + await Future.delayed(Duration(milliseconds: 100)); + } + + expect(completer.isCompleted, true); + expect(await completer.future, cube); + await viewer.dispose(); + }); + }); +} diff --git a/thermion_dart/test/viewport_gizmo.dart b/thermion_dart/test/viewport_gizmo.dart index 52f90e2d..628d7447 100644 --- a/thermion_dart/test/viewport_gizmo.dart +++ b/thermion_dart/test/viewport_gizmo.dart @@ -3,8 +3,8 @@ import 'dart:io'; import 'dart:math'; import 'package:ffi/ffi.dart'; import 'package:test/test.dart'; -import 'package:thermion_dart/src/swift/swift_bindings.g.dart'; -import 'package:thermion_dart/src/utils/dart_resources.dart'; +import 'swift/swift_bindings.g.dart'; +import 'package:thermion_dart/src/utils/src/dart_resources.dart'; import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart'; import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart'; import 'package:thermion_dart/thermion_dart.dart'; @@ -47,9 +47,9 @@ late String testDir; void main() async { final packageUri = findPackageRoot('thermion_dart'); testDir = Directory("${packageUri.toFilePath()}/test").path; - final lib = ThermionDartTexture1(DynamicLibrary.open( + final lib = ThermionTexture1(DynamicLibrary.open( '${packageUri.toFilePath()}/native/lib/macos/swift/libthermion_swift.dylib')); - final object = ThermionDartTexture.new1(lib); + final object = ThermionTexture.new1(lib); object.initWithWidth_height_(500, 500); final resourceLoader = calloc(1); diff --git a/thermion_dart/test/viewport_grid.dart b/thermion_dart/test/viewport_grid.dart index fb727013..ff607382 100644 --- a/thermion_dart/test/viewport_grid.dart +++ b/thermion_dart/test/viewport_grid.dart @@ -1,8 +1,8 @@ import 'dart:ffi'; import 'dart:io'; import 'package:ffi/ffi.dart'; -import 'package:thermion_dart/src/swift/swift_bindings.g.dart'; -import 'package:thermion_dart/src/utils/dart_resources.dart'; +import 'swift/swift_bindings.g.dart'; +import 'package:thermion_dart/src/utils/src/dart_resources.dart'; import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart'; import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart'; @@ -43,9 +43,9 @@ late String testDir; void main() async { final packageUri = findPackageRoot('thermion_dart'); testDir = Directory("${packageUri.toFilePath()}/test").path; - final lib = ThermionDartTexture1(DynamicLibrary.open( + final lib = ThermionTexture1(DynamicLibrary.open( '${packageUri.toFilePath()}/native/lib/macos/swift/libthermion_swift.dylib')); - final object = ThermionDartTexture.new1(lib); + final object = ThermionTexture.new1(lib); object.initWithWidth_height_(500, 500); final resourceLoader = calloc(1); diff --git a/thermion_flutter/thermion_flutter/CHANGELOG.md b/thermion_flutter/thermion_flutter/CHANGELOG.md index a53788d0..cc0d6e32 100644 --- a/thermion_flutter/thermion_flutter/CHANGELOG.md +++ b/thermion_flutter/thermion_flutter/CHANGELOG.md @@ -1,3 +1,44 @@ +## 0.2.1-dev.5 + + - Update a dependency to the latest release. + +## 0.2.1-dev.4 + + - Update a dependency to the latest release. + +## 0.2.1-dev.3 + + - Update a dependency to the latest release. + +## 0.2.1-dev.2 + + - Update a dependency to the latest release. + +## 0.2.1-dev.1 + + - Update a dependency to the latest release. + +## 0.2.1-dev.0 + + - Update a dependency to the latest release. + +## 0.2.1-dev.0.0.0 + + - y + +## 0.2.0 + + - Graduate package to a stable release. See pre-releases prior to this version for changelog entries. + +## 0.2.0-dev.8.0.0 + + - **REFACTOR**: continual refactor to support multiple render targets. + - **FEAT**: camera and resizing improvements. + - **FEAT**: support multiple ThermionWidget on Android. + - **FEAT**: use imported texture on iOS. + - **FEAT**: working implementation of multiple widgets on macos. + - **FEAT**: add rendering check to ThermionWidget ticker. + ## 0.2.0-dev.7.0 - Update a dependency to the latest release. diff --git a/thermion_flutter/thermion_flutter/android/src/main/kotlin/dev/thermion/android/ThermionFlutterPlugin.kt b/thermion_flutter/thermion_flutter/android/src/main/kotlin/dev/thermion/android/ThermionFlutterPlugin.kt index e039d05d..ca0188da 100644 --- a/thermion_flutter/thermion_flutter/android/src/main/kotlin/dev/thermion/android/ThermionFlutterPlugin.kt +++ b/thermion_flutter/thermion_flutter/android/src/main/kotlin/dev/thermion/android/ThermionFlutterPlugin.kt @@ -26,6 +26,7 @@ import io.flutter.view.TextureRegistry.SurfaceTextureEntry import java.io.File import java.util.* + class LoadFilamentResourceFromOwnerImpl(plugin:ThermionFlutterPlugin) : LoadFilamentResourceFromOwner { var plugin = plugin override fun loadResourceFromOwner(path: String?, owner: Pointer?): ResourceBuffer { @@ -66,10 +67,18 @@ class ThermionFlutterPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, Lo private var lifecycle: Lifecycle? = null private lateinit var _lib : FilamentInterop + + private data class TextureEntry( + val surfaceTextureEntry: SurfaceTextureEntry, + val surfaceTexture: SurfaceTexture, + val surface: Surface + ) var _surfaceTexture: SurfaceTexture? = null private var _surfaceTextureEntry: SurfaceTextureEntry? = null var _surface: Surface? = null + private val textures: MutableMap = mutableMapOf() + private lateinit var activity:Activity @@ -153,35 +162,54 @@ class ThermionFlutterPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, Lo @RequiresApi(Build.VERSION_CODES.M) override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { - Log.e("thermion_flutter", call.method, null) when (call.method) { "createTexture" -> { - if(_surfaceTextureEntry != null) { - result.error("TEXTURE_EXISTS", "Texture already exist. Make sure you call destroyTexture first", null) - return - } - val args = call.arguments as List<*> - val width = args[0] as Int - val height = args[1] as Int - if(width <1 || height < 1) { - result.error("DIMENSION_MISMATCH","Both dimensions must be greater than zero (you provided $width x $height)", null); - return; - } - Log.i("thermion_flutter", "Creating SurfaceTexture ${width}x${height}"); - - _surfaceTextureEntry = flutterPluginBinding.textureRegistry.createSurfaceTexture() - _surfaceTexture = _surfaceTextureEntry!!.surfaceTexture(); - _surfaceTexture!!.setDefaultBufferSize(width, height) + val args = call.arguments as List<*> + val width = args[0] as Int + val height = args[1] as Int + if (width < 1 || height < 1) { + result.error("DIMENSION_MISMATCH", "Both dimensions must be greater than zero (you provided $width x $height)", null) + return + } + Log.i("thermion_flutter", "Creating SurfaceTexture ${width}x${height}") + + val surfaceTextureEntry = flutterPluginBinding.textureRegistry.createSurfaceTexture() + val surfaceTexture = surfaceTextureEntry.surfaceTexture() + surfaceTexture.setDefaultBufferSize(width, height) - _surface = Surface(_surfaceTexture) + val surface = Surface(surfaceTexture) - if(!_surface!!.isValid) { - result.error("SURFACE_INVALID", "Failed to create valid surface", null) - } else { - val nativeWindow = _lib.get_native_window_from_surface(_surface!! as Object, JNIEnv.CURRENT) - result.success(listOf(_surfaceTextureEntry!!.id(), null, Pointer.nativeValue(nativeWindow))) - } - } + if (!surface.isValid) { + result.error("SURFACE_INVALID", "Failed to create valid surface", null) + } else { + val flutterTextureId = surfaceTextureEntry.id() + textures[flutterTextureId] = TextureEntry(surfaceTextureEntry, surfaceTexture, surface) + val nativeWindow = _lib.get_native_window_from_surface(surface as Object, JNIEnv.CURRENT) + result.success(listOf(flutterTextureId, flutterTextureId, Pointer.nativeValue(nativeWindow))) + } + } + "destroyTexture" -> { + val args = call.arguments as List<*> + val textureId = (args[0] as Int).toLong() + val textureEntry = textures[textureId] + if (textureEntry != null) { + textureEntry.surface.release() + textureEntry.surfaceTextureEntry.release() + textures.remove(textureId) + result.success(true) + } else { + result.error("TEXTURE_NOT_FOUND", "Texture with id $textureId not found", null) + } + } + "markTextureFrameAvailable" -> { + val textureId = (call.arguments as Int).toLong() + val textureEntry = textures[textureId] + if (textureEntry != null) { + result.success(null) + } else { + result.error("TEXTURE_NOT_FOUND", "Texture with id $textureId not found", null) + } + } "getResourceLoaderWrapper" -> { val resourceLoader = _lib.make_resource_loader_wrapper_android(loadResourceWrapper, freeResourceWrapper, Pointer(0)) result.success(Pointer.nativeValue(resourceLoader)) @@ -196,13 +224,6 @@ class ThermionFlutterPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, Lo val renderCallbackFnPointer = _lib.make_render_callback_fn_pointer(RenderCallbackImpl(this)) result.success(listOf(Pointer.nativeValue(renderCallbackFnPointer), 0)) } - "destroyTexture" -> { - _surface!!.release(); - _surfaceTextureEntry!!.release(); - _surface = null - _surfaceTextureEntry = null - result.success(true) - } else -> { result.notImplemented() } @@ -210,7 +231,13 @@ class ThermionFlutterPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, Lo } override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { - channel.setMethodCallHandler(null) + channel.setMethodCallHandler(null) + // Release all textures + for ((_, textureEntry) in textures) { + textureEntry.surface.release() + textureEntry.surfaceTextureEntry.release() + } + textures.clear() } diff --git a/thermion_flutter/thermion_flutter/ios/Classes/SwiftThermionFlutterPlugin.swift b/thermion_flutter/thermion_flutter/ios/Classes/SwiftThermionFlutterPlugin.swift index 473e76e8..2c2428a2 100644 --- a/thermion_flutter/thermion_flutter/ios/Classes/SwiftThermionFlutterPlugin.swift +++ b/thermion_flutter/thermion_flutter/ios/Classes/SwiftThermionFlutterPlugin.swift @@ -6,7 +6,7 @@ public class SwiftThermionFlutterPlugin: NSObject, FlutterPlugin { var registrar : FlutterPluginRegistrar var registry: FlutterTextureRegistry - var texture: ThermionFlutterTexture? + var textures: [Int64: ThermionFlutterTexture] = [:] var createdAt = Date() @@ -116,13 +116,12 @@ public class SwiftThermionFlutterPlugin: NSObject, FlutterPlugin { instance.resources.removeObject(forKey:rbuf.id) } - var markTextureFrameAvailable : @convention(c) (UnsafeMutableRawPointer?) -> () = { instancePtr in - let instance:SwiftThermionFlutterPlugin = Unmanaged.fromOpaque(instancePtr!).takeUnretainedValue() - if(instance.texture != nil) { - instance.registry.textureFrameAvailable(instance.texture!.flutterTextureId) + var markTextureFrameAvailable: @convention(c) (UnsafeMutableRawPointer?) -> () = { instancePtr in + let instance: SwiftThermionFlutterPlugin = Unmanaged.fromOpaque(instancePtr!).takeUnretainedValue() + for (_, texture) in instance.textures { + instance.registry.textureFrameAvailable(texture.flutterTextureId) } } - public static func register(with registrar: FlutterPluginRegistrar) { let _messenger = registrar.messenger(); @@ -151,22 +150,35 @@ public class SwiftThermionFlutterPlugin: NSObject, FlutterPlugin { result(nil) case "getSharedContext": result(nil) + case "markTextureFrameAvailable": + let flutterTextureId = call.arguments as! Int64 + registry.textureFrameAvailable(flutterTextureId) + result(nil) case "createTexture": let args = call.arguments as! [Any] let width = args[0] as! Int64 let height = args[1] as! Int64 - - self.texture = ThermionFlutterTexture(width: width, height: height, registry: registry) - let pixelBufferPtr = unsafeBitCast(self.texture!.pixelBuffer, to:UnsafeRawPointer.self) - let pixelBufferAddress = Int(bitPattern:pixelBufferPtr); + + let texture = ThermionFlutterTexture(registry: registry, width: width, height: height) - result([self.texture!.flutterTextureId as Any, nil, pixelBufferAddress]) + if texture.texture.metalTextureAddress == -1 { + result(nil) + } else { + textures[texture.flutterTextureId] = texture + result([texture.flutterTextureId, texture.texture.metalTextureAddress, nil]) + } case "destroyTexture": - let texture = self.texture - self.texture = nil - texture?.destroy() + let args = call.arguments as! [Any] + let flutterTextureId = args[0] as! Int64 - result(true) + if let texture = textures[flutterTextureId] { + registry.unregisterTexture(flutterTextureId) + texture.destroy() + textures.removeValue(forKey: flutterTextureId) + result(true) + } else { + result(false) + } default: result(FlutterMethodNotImplemented) } diff --git a/thermion_flutter/thermion_flutter/ios/Classes/ThermionFlutterTexture.swift b/thermion_flutter/thermion_flutter/ios/Classes/ThermionFlutterTexture.swift index a9af79fc..6fa28c87 100644 --- a/thermion_flutter/thermion_flutter/ios/Classes/ThermionFlutterTexture.swift +++ b/thermion_flutter/thermion_flutter/ios/Classes/ThermionFlutterTexture.swift @@ -4,45 +4,31 @@ import Flutter public class ThermionFlutterTexture : NSObject, FlutterTexture { - public var pixelBuffer: CVPixelBuffer? - - var pixelBufferAttrs = [ - kCVPixelBufferPixelFormatTypeKey: NSNumber(value: kCVPixelFormatType_32BGRA), - kCVPixelBufferOpenGLCompatibilityKey: kCFBooleanTrue, - kCVPixelBufferOpenGLESCompatibilityKey: kCFBooleanTrue, - kCVPixelBufferIOSurfacePropertiesKey: [:] - ] as CFDictionary - var flutterTextureId: Int64 = -1 - var registry: FlutterTextureRegistry? + var registry: FlutterTextureRegistry + var texture: ThermionTextureSwift - init(width:Int64, height:Int64, registry:FlutterTextureRegistry) { + init(registry:FlutterTextureRegistry, width:Int64, height:Int64) { self.registry = registry - + self.texture = ThermionTextureSwift(width:width, height: height) super.init() - - if(CVPixelBufferCreate(kCFAllocatorDefault, Int(width), Int(height), - kCVPixelFormatType_32BGRA, pixelBufferAttrs, &pixelBuffer) != kCVReturnSuccess) { - print("Error allocating pixel buffer") - } else { - self.flutterTextureId = registry.register(self) - } + self.flutterTextureId = registry.register(self) } - + public func copyPixelBuffer() -> Unmanaged? { - return Unmanaged.passRetained(pixelBuffer!); + if(self.texture.pixelBuffer == nil) { + return nil + } + return Unmanaged.passRetained(self.texture.pixelBuffer!); } public func onTextureUnregistered(_ texture:FlutterTexture) { - print("Texture unregistered") + } public func destroy() { - if(self.flutterTextureId != -1) { - self.registry!.unregisterTexture(self.flutterTextureId) - } - - self.pixelBuffer = nil + self.registry.unregisterTexture(self.flutterTextureId) + self.texture.destroyTexture() } } diff --git a/thermion_flutter/thermion_flutter/macos/Classes/ThermionDartTexture.swift b/thermion_flutter/thermion_flutter/ios/Classes/ThermionTexture.swift similarity index 53% rename from thermion_flutter/thermion_flutter/macos/Classes/ThermionDartTexture.swift rename to thermion_flutter/thermion_flutter/ios/Classes/ThermionTexture.swift index 8e7e7c98..e242bf80 100644 --- a/thermion_flutter/thermion_flutter/macos/Classes/ThermionDartTexture.swift +++ b/thermion_flutter/thermion_flutter/ios/Classes/ThermionTexture.swift @@ -1,7 +1,7 @@ import Foundation import GLKit -@objc public class ThermionDartTexture : NSObject { +@objc public class ThermionTextureSwift : NSObject { public var pixelBuffer: CVPixelBuffer? @@ -62,37 +62,6 @@ import GLKit metalTexture = CVMetalTextureGetTexture(cvMetalTexture!) let metalTexturePtr = Unmanaged.passRetained(metalTexture!).toOpaque() metalTextureAddress = Int(bitPattern:metalTexturePtr) - - // CVPixelBufferLockBaseAddress(pixelBuffer!, CVPixelBufferLockFlags(rawValue: 0)) - // let bufferWidth = Int(CVPixelBufferGetWidth(pixelBuffer!)) - // let bufferHeight = Int(CVPixelBufferGetHeight(pixelBuffer!)) - // let bytesPerRow = CVPixelBufferGetBytesPerRow(pixelBuffer!) - - // guard let baseAddress = CVPixelBufferGetBaseAddress(pixelBuffer!) else { - // return - // } - - // for row in 0.. NSData? { + guard let texture = self.metalTexture else { + print("Metal texture is not available") + return nil + } + + let width = texture.width + let height = texture.height + let bytesPerPixel = 4 // RGBA + let bytesPerRow = width * bytesPerPixel + let byteCount = bytesPerRow * height + + var bytes = [UInt8](repeating: 0, count: byteCount) + let region = MTLRegionMake2D(0, 0, width, height) + texture.getBytes(&bytes, bytesPerRow: bytesPerRow, from: region, mipmapLevel: 0) + + // Swizzle bytes from BGRA to RGBA + for i in stride(from: 0, to: byteCount, by: 4) { + let blue = bytes[i] + let green = bytes[i + 1] + let red = bytes[i + 2] + let alpha = bytes[i + 3] + + bytes[i] = red + bytes[i + 1] = green + bytes[i + 2] = blue + bytes[i + 3] = alpha + } + + // Convert Swift Data to Objective-C NSData + let nsData = Data(bytes: &bytes, count: byteCount) as NSData + return nsData +} + } diff --git a/thermion_flutter/thermion_flutter/lib/src/thermion_flutter_plugin.dart b/thermion_flutter/thermion_flutter/lib/src/thermion_flutter_plugin.dart index b37a158b..2938e0ad 100644 --- a/thermion_flutter/thermion_flutter/lib/src/thermion_flutter_plugin.dart +++ b/thermion_flutter/thermion_flutter/lib/src/thermion_flutter_plugin.dart @@ -1,8 +1,6 @@ import 'dart:async'; import 'package:thermion_dart/thermion_dart.dart'; -import 'package:flutter/widgets.dart'; import 'package:thermion_flutter_platform_interface/thermion_flutter_platform_interface.dart'; -import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dart'; /// /// Handles all platform-specific initialization to create a backing rendering @@ -13,116 +11,38 @@ import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dar class ThermionFlutterPlugin { ThermionFlutterPlugin._(); - static AppLifecycleListener? _appLifecycleListener; - static bool _initializing = false; static ThermionViewer? _viewer; - static bool _wasRenderingOnInactive = false; + static ThermionFlutterOptions? options; - static void _handleStateChange(AppLifecycleState state) async { - if (_viewer == null) { - return; - } - - await _viewer!.initialized; - switch (state) { - case AppLifecycleState.detached: - if (!_wasRenderingOnInactive) { - _wasRenderingOnInactive = _viewer!.rendering; - } - await _viewer!.setRendering(false); - break; - case AppLifecycleState.hidden: - if (!_wasRenderingOnInactive) { - _wasRenderingOnInactive = _viewer!.rendering; - } - await _viewer!.setRendering(false); - break; - case AppLifecycleState.inactive: - if (!_wasRenderingOnInactive) { - _wasRenderingOnInactive = _viewer!.rendering; - } - // on Windows in particular, restoring a window after minimizing stalls the renderer (and the whole application) for a considerable length of time. - // disabling rendering on minimize seems to fix the issue (so I wonder if there's some kind of command buffer that's filling up while the window is minimized). - await _viewer!.setRendering(false); - break; - case AppLifecycleState.paused: - if (!_wasRenderingOnInactive) { - _wasRenderingOnInactive = _viewer!.rendering; - } - await _viewer!.setRendering(false); - break; - case AppLifecycleState.resumed: - await _viewer!.setRendering(_wasRenderingOnInactive); - break; - } - } - - @Deprecated("Use createViewerWithOptions") - static Future createViewer({String? uberArchivePath}) async { + static Future createViewer( + {ThermionFlutterOptions options = + const ThermionFlutterOptions.empty()}) async { if (_initializing) { throw Exception("Existing call to createViewer has not completed."); } _initializing = true; - _viewer = await ThermionFlutterPlatform.instance - .createViewer(uberarchivePath: uberArchivePath); - _appLifecycleListener = AppLifecycleListener( - onStateChange: _handleStateChange, - ); - _viewer!.onDispose(() async { - _viewer = null; - _appLifecycleListener?.dispose(); - _appLifecycleListener = null; - }); - _initializing = false; - return _viewer!; - } - - static Future createViewerWithOptions( - {ThermionFlutterOptions options = const ThermionFlutterOptions.empty()}) async { - if (_initializing) { - throw Exception("Existing call to createViewer has not completed."); + if (_viewer != null) { + throw Exception( + "Instance of ThermionViewer has already been created. Ensure you call dispose() on that instance."); } - _initializing = true; + + options = options; + _viewer = - await ThermionFlutterPlatform.instance.createViewerWithOptions(options); - _appLifecycleListener = AppLifecycleListener( - onStateChange: _handleStateChange, - ); + await ThermionFlutterPlatform.instance.createViewer(options: options); + + var camera = await _viewer!.getActiveCamera(); + camera.setLensProjection(); + _viewer!.onDispose(() async { _viewer = null; - _appLifecycleListener?.dispose(); - _appLifecycleListener = null; + ThermionFlutterPlugin.options = null; }); _initializing = false; return _viewer!; } - - static Future createTexture( - double width, - double height, - double offsetLeft, - double offsetTop, - double pixelRatio) async { - return ThermionFlutterPlatform.instance - .createTexture(width, height, offsetLeft, offsetTop, pixelRatio); - } - - static Future destroyTexture(ThermionFlutterTexture texture) async { - return ThermionFlutterPlatform.instance.destroyTexture(texture); - } - - static Future resizeTexture( - ThermionFlutterTexture texture, - int width, - int height, - int offsetLeft, - int offsetTop, - double pixelRatio) async { - return ThermionFlutterPlatform.instance.resizeTexture( - texture, width, height, offsetLeft, offsetTop, pixelRatio); - } } diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/pixel_ratio_aware.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/pixel_ratio_aware.dart new file mode 100644 index 00000000..1d92e832 --- /dev/null +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/pixel_ratio_aware.dart @@ -0,0 +1,12 @@ +import 'package:flutter/widgets.dart'; + +class PixelRatioAware extends StatelessWidget { + final Widget Function(BuildContext context, double pixelRatio) builder; + + const PixelRatioAware({Key? key, required this.builder}) : super(key: key); + + @override + Widget build(BuildContext context) { + return builder(context, MediaQuery.of(context).devicePixelRatio); + } +} \ No newline at end of file diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/resize_observer.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/resize_observer.dart index 218f84f1..7ed5bb62 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/resize_observer.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/resize_observer.dart @@ -1,7 +1,7 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; -typedef ResizeCallback = void Function(Size newSize); +typedef ResizeCallback = void Function(Size oldSize, Size newSize); class ResizeObserver extends SingleChildRenderObjectWidget { final ResizeCallback onResized; @@ -34,7 +34,7 @@ class _RenderResizeObserver extends RenderProxyBox { void performLayout() async { super.performLayout(); if (size.width != _oldSize.width || size.height != _oldSize.height) { - onLayoutChangedCallback(size); + onLayoutChangedCallback(_oldSize, size); _oldSize = Size(size.width, size.height); } } diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_listener_widget.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_listener_widget.dart index d0a50817..2f6042e6 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_listener_widget.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_listener_widget.dart @@ -5,6 +5,7 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:thermion_dart/thermion_dart.dart'; +import 'package:thermion_flutter/src/widgets/src/pixel_ratio_aware.dart'; import 'package:vector_math/vector_math_64.dart'; extension OffsetExtension on Offset { @@ -79,54 +80,65 @@ class _ThermionListenerWidgetState extends State { HardwareKeyboard.instance.removeHandler(_handleKeyEvent); } - Widget _desktop() { + Widget _desktop(double pixelRatio) { return Listener( - onPointerHover: (event) => widget.gestureHandler - .onPointerHover(event.localPosition.toVector2(), event.delta.toVector2()), + onPointerHover: (event) => widget.gestureHandler.onPointerHover( + event.localPosition.toVector2() * pixelRatio, + event.delta.toVector2() * pixelRatio), onPointerSignal: (PointerSignalEvent pointerSignal) { if (pointerSignal is PointerScrollEvent) { widget.gestureHandler.onPointerScroll( - pointerSignal.localPosition.toVector2(), - pointerSignal.scrollDelta.dy); + pointerSignal.localPosition.toVector2() * pixelRatio, + pointerSignal.scrollDelta.dy * pixelRatio); } }, onPointerPanZoomStart: (pzs) { throw Exception("TODO - is this a pinch zoom on laptop trackpad?"); }, - onPointerDown: (d) => widget.gestureHandler - .onPointerDown(d.localPosition.toVector2(), d.buttons & kMiddleMouseButton != 0), - onPointerMove: (d) => widget.gestureHandler - .onPointerMove(d.localPosition.toVector2(), d.delta.toVector2(), d.buttons & kMiddleMouseButton != 0), - onPointerUp: (d) => widget.gestureHandler.onPointerUp(d.buttons & kMiddleMouseButton != 0), + onPointerDown: (d) => widget.gestureHandler.onPointerDown( + d.localPosition.toVector2() * pixelRatio, + d.buttons & kMiddleMouseButton != 0), + onPointerMove: (d) => widget.gestureHandler.onPointerMove( + d.localPosition.toVector2() * pixelRatio, + d.delta.toVector2() * pixelRatio, + d.buttons & kMiddleMouseButton != 0), + onPointerUp: (d) => widget.gestureHandler + .onPointerUp(d.buttons & kMiddleMouseButton != 0), child: widget.child, ); } - Widget _mobile() { - return _MobileListenerWidget(gestureHandler: widget.gestureHandler); + Widget _mobile(double pixelRatio) { + return _MobileListenerWidget( + gestureHandler: widget.gestureHandler, pixelRatio: pixelRatio, child:widget.child); } @override Widget build(BuildContext context) { - return FutureBuilder( - future: widget.gestureHandler.initialized, - builder: (_, initialized) { - if (initialized.data != true) { - return widget.child ?? Container(); - } - return Stack(children: [ - if (widget.child != null) Positioned.fill(child: widget.child!), - if (isDesktop) Positioned.fill(child: _desktop()), - if (!isDesktop) Positioned.fill(child: _mobile()) - ]); - }); + return PixelRatioAware(builder: (ctx, pixelRatio) { + return FutureBuilder( + initialData: 1.0, + future: widget.gestureHandler.initialized, + builder: (_, initialized) { + if (initialized.data != true) { + return widget.child ?? Container(); + } + return Stack(children: [ + if (isDesktop) Positioned.fill(child: _desktop(pixelRatio)), + if (!isDesktop) Positioned.fill(child: _mobile(pixelRatio)) + ]); + }); + }); } } class _MobileListenerWidget extends StatefulWidget { final InputHandler gestureHandler; + final double pixelRatio; + final Widget? child; - const _MobileListenerWidget({Key? key, required this.gestureHandler}) + const _MobileListenerWidget( + {Key? key, required this.gestureHandler, required this.pixelRatio, this.child}) : super(key: key); @override @@ -144,22 +156,29 @@ class _MobileListenerWidgetState extends State<_MobileListenerWidget> { @override Widget build(BuildContext context) { return GestureDetector( - behavior: HitTestBehavior.translucent, - onTapDown: (details) => widget.gestureHandler - .onPointerDown(details.localPosition.toVector2(), false), - onDoubleTap: () { - widget.gestureHandler.setActionForType(InputType.SCALE1, - isPan ? InputAction.TRANSLATE : InputAction.ROTATE); - }, - onScaleStart: (details) async { - await widget.gestureHandler.onScaleStart(); - }, - onScaleUpdate: (details) async { - await widget.gestureHandler.onScaleUpdate(); - }, - onScaleEnd: (details) async { - await widget.gestureHandler.onScaleUpdate(); - }, - ); + behavior: HitTestBehavior.translucent, + onTapDown: (details) => widget.gestureHandler.onPointerDown( + details.localPosition.toVector2() * widget.pixelRatio, false), + onDoubleTap: () { + widget.gestureHandler.setActionForType(InputType.SCALE1, + isPan ? InputAction.TRANSLATE : InputAction.ROTATE); + }, + onScaleStart: (details) async { + await widget.gestureHandler.onScaleStart( + details.localFocalPoint.toVector2(), details.pointerCount); + }, + onScaleUpdate: (ScaleUpdateDetails details) async { + await widget.gestureHandler.onScaleUpdate( + details.localFocalPoint.toVector2(), + details.focalPointDelta.toVector2(), + details.horizontalScale, + details.verticalScale, + details.scale, + details.pointerCount); + }, + onScaleEnd: (details) async { + await widget.gestureHandler.onScaleEnd(details.pointerCount); + }, + child: widget.child); } } diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_texture_widget.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_texture_widget.dart new file mode 100644 index 00000000..840f02f7 --- /dev/null +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_texture_widget.dart @@ -0,0 +1,200 @@ +import 'dart:async'; +import 'package:flutter/material.dart'; +import 'package:thermion_dart/src/viewer/src/shared_types/view.dart' as t; +import 'package:thermion_flutter/src/widgets/src/resize_observer.dart'; +import 'package:thermion_flutter/thermion_flutter.dart'; +import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dart'; +import 'package:vector_math/vector_math_64.dart' hide Colors; + +class ThermionTextureWidget extends StatefulWidget { + /// + /// + /// + final ThermionViewer viewer; + + /// + /// + /// + final t.View view; + + /// + /// + /// + final Widget? initial; + + /// + /// A callback that will be invoked whenever this widget (and the underlying texture is resized). + /// + final Future Function(Size size, t.View view, double pixelRatio)? onResize; + + const ThermionTextureWidget( + {super.key, + required this.viewer, + required this.view, + this.initial, + this.onResize}); + + @override + State createState() { + return _ThermionTextureWidgetState(); + } +} + +class _ThermionTextureWidgetState extends State { + ThermionFlutterTexture? _texture; + RenderTarget? _renderTarget; + + static final _views = []; + + @override + void dispose() { + super.dispose(); + _views.remove(widget.view); + _texture?.destroy(); + } + + @override + void initState() { + if (_views.contains(widget.view)) { + throw Exception("View already embedded in a widget"); + } + _views.add(widget.view); + WidgetsBinding.instance.addPostFrameCallback((timeStamp) async { + await widget.viewer.initialized; + + var dpr = MediaQuery.of(context).devicePixelRatio; + + var size = ((context.findRenderObject()) as RenderBox).size; + var width = (size.width * dpr).ceil(); + var height = (size.height * dpr).ceil(); + + _texture = await ThermionFlutterPlatform.instance + .createTexture(widget.view, width, height); + + await widget.view.updateViewport(_texture!.width, _texture!.height); + + try { + await widget.onResize?.call( + Size(_texture!.width.toDouble(), _texture!.height.toDouble()), + widget.view, + dpr); + } catch (err, st) { + print(err); + print(st); + } + + if (mounted) { + setState(() {}); + } + + _requestFrame(); + + widget.viewer.onDispose(() async { + var texture = _texture; + if (mounted) { + setState(() {}); + } + await texture?.destroy(); + _views.clear(); + }); + }); + _callbackId = _numCallbacks; + _numCallbacks++; + super.initState(); + } + + bool _rendering = false; + + static int _numCallbacks = 0; + static int _primaryCallback = 0; + late int _callbackId; + int lastRender = 0; + + void _requestFrame() { + WidgetsBinding.instance.scheduleFrameCallback((d) async { + if (widget.viewer.rendering && !_rendering) { + _rendering = true; + if (_callbackId == _primaryCallback && _texture != null) { + await widget.viewer.requestFrame(); + lastRender = d.inMilliseconds; + } + await _texture?.markFrameAvailable(); + _rendering = false; + } + _requestFrame(); + }); + } + + final _resizing = []; + + Timer? _resizeTimer; + + Future _resize(Size oldSize, Size newSize) async { + await Future.wait(_resizing); + + _resizeTimer?.cancel(); + + _resizeTimer = Timer(const Duration(milliseconds: 100), () async { + await Future.wait(_resizing); + if (!mounted) { + return; + } + + if (newSize.width == _texture?.width && + newSize.height == _texture?.height) { + return; + } + + final completer = Completer(); + + _resizing.add(completer.future); + + final dpr = MediaQuery.of(context).devicePixelRatio; + + newSize *= dpr; + + var newWidth = newSize.width.ceil(); + var newHeight = newSize.height.ceil(); + + await _texture?.resize( + newWidth, + newHeight, + 0, + 0, + ); + + await widget.view.updateViewport(_texture!.width, _texture!.height); + + await widget.onResize?.call( + Size(_texture!.width.toDouble(), _texture!.height.toDouble()), + widget.view, + dpr); + + if (!mounted) { + return; + } + setState(() {}); + completer.complete(); + _resizing.remove(completer.future); + }); + } + + @override + Widget build(BuildContext context) { + if (_texture == null) { + return widget.initial ?? Container(color: Colors.red); + } + + return ResizeObserver( + onResized: _resize, + child: Stack(children: [ + Positioned.fill( + child: Texture( + key: ObjectKey("flutter_texture_${_texture!.flutterId}"), + textureId: _texture!.flutterId, + filterQuality: FilterQuality.none, + freeze: false, + )) + ])); + } +} diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget.dart index 6e909c7d..b3246d30 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget.dart @@ -1,19 +1,49 @@ import 'dart:io'; -import 'dart:math'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:thermion_flutter/src/widgets/src/thermion_texture_widget.dart'; import 'package:thermion_flutter/src/widgets/src/thermion_widget_web.dart'; -import 'package:thermion_flutter/src/widgets/src/transparent_filament_widget.dart'; -import 'dart:async'; - -import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dart'; import 'package:thermion_flutter/thermion_flutter.dart'; import 'package:thermion_flutter_web/thermion_flutter_web_options.dart'; -import 'resize_observer.dart'; +import 'package:thermion_dart/src/viewer/src/shared_types/view.dart' as t; +import 'thermion_widget_windows.dart'; + +Future kDefaultResizeCallback(Size size, t.View view, double pixelRatio) async { + var camera = await view.getCamera(); + var near = await camera.getNear(); + var far = await camera.getCullingFar(); + var focalLength = await camera.getFocalLength(); + + await camera.setLensProjection(near:near, far:far, focalLength: focalLength, + aspect: size.width.toDouble() / size.height.toDouble()); +} class ThermionWidget extends StatefulWidget { + /// + /// The viewer. + /// final ThermionViewer viewer; - final ThermionFlutterOptions? options; + + /// + /// The [t.View] associated with this widget. If null, the default View will be used. + /// + final t.View? view; + + /// + /// A callback to invoke whenever this widget and the underlying surface are + /// resized. If a callback is not explicitly provided, the default callback + /// will be run, which changes the aspect ratio for the active camera in + /// the View managed by this widget. If you specify your own callback, + /// you probably want to preserve this behaviour (otherwise the aspect ratio) + /// will be incorrect. + /// + /// To completely disable the resize callback, pass [null]. + /// + /// IMPORTANT - size is specified in physical pixels, not logical pixels. + /// If you need to work with Flutter dimensions, divide [size] by + /// [pixelRatio]. + /// + final Future Function(Size size, t.View view, double pixelRatio)? onResize; /// /// The content to render before the texture widget is available. @@ -22,130 +52,57 @@ class ThermionWidget extends StatefulWidget { final Widget? initial; const ThermionWidget( - {Key? key, this.initial, required this.viewer, this.options}) + {Key? key, + this.initial, + required this.viewer, + this.view, + this.onResize = kDefaultResizeCallback}) : super(key: key); @override - _ThermionWidgetState createState() => _ThermionWidgetState(); + State createState() => _ThermionWidgetState(); } class _ThermionWidgetState extends State { - ThermionFlutterTexture? _texture; + t.View? view; @override void initState() { - WidgetsBinding.instance.addPostFrameCallback((timeStamp) async { - await widget.viewer.initialized; - widget.viewer.onDispose(() async { - if (_texture != null) { - var texture = _texture; - _texture = null; - if (mounted) { - setState(() {}); - } - await ThermionFlutterPlugin.destroyTexture(texture!); - } - }); - var dpr = MediaQuery.of(context).devicePixelRatio; - - var size = ((context.findRenderObject()) as RenderBox).size; - _texture = await ThermionFlutterPlugin.createTexture( - size.width, size.height, 0, 0, dpr); - - if (mounted) { - setState(() {}); - } - - _requestFrame(); - }); super.initState(); + initialize(); } - -bool _rendering = false; - -void _requestFrame() { - WidgetsBinding.instance.scheduleFrameCallback((d) async { - if (!_rendering) { - _rendering = true; - await widget.viewer.requestFrame(); - _rendering = false; + Future initialize() async { + if (widget.view != null) { + view = widget.view; + } else { + view = await widget.viewer.getViewAt(0); } - _requestFrame(); - }); -} - - bool _resizing = false; - Timer? _resizeTimer; - - Future _resizeTexture(Size newSize) async { - _resizeTimer?.cancel(); - _resizeTimer = Timer(const Duration(milliseconds: 500), () async { - if (_resizing || !mounted) { - return; - } - _resizeTimer!.cancel(); - _resizing = true; - var oldTexture = _texture; - _texture = null; - if (!mounted) { - return; - } - - var dpr = MediaQuery.of(context).devicePixelRatio; - - _texture = await ThermionFlutterPlugin.resizeTexture( - oldTexture!, newSize.width.ceil(), newSize.height.ceil(), 0, 0, dpr); - setState(() {}); - _resizing = false; - }); + setState(() {}); } @override Widget build(BuildContext context) { + if (view == null) { + return widget.initial ?? Container(color: Colors.red); + } + + // Windows & Web don't support imported textures yet if (kIsWeb) { - if (_texture == null || _resizing) { - return widget.initial ?? Container(color: Colors.red); - } - return ResizeObserver( - onResized: _resizeTexture, - child: ThermionWidgetWeb( - options: widget.options as ThermionFlutterWebOptions?)); + return ThermionWidgetWeb( + viewer: widget.viewer, + options: ThermionFlutterPlugin.options as ThermionFlutterWebOptions?); } - if (_texture?.usesBackingWindow == true) { - return ResizeObserver( - onResized: _resizeTexture, - child: Stack(children: [ - Positioned.fill(child: CustomPaint(painter: TransparencyPainter())) - ])); + if (Platform.isWindows) { + return ThermionWidgetWindows(viewer: widget.viewer, view: view!, initial: widget.initial, onResize: widget.onResize); } - if (_texture == null || _resizing) { - return widget.initial ?? - Container( - color: - kIsWeb ? const Color.fromARGB(0, 170, 129, 129) : Colors.red); - } - - var textureWidget = Texture( - key: ObjectKey("texture_${_texture!.flutterTextureId}"), - textureId: _texture!.flutterTextureId!, - filterQuality: FilterQuality.none, - freeze: false, - ); - - return ResizeObserver( - onResized: _resizeTexture, - child: Stack(children: [ - Positioned.fill( - child: Platform.isLinux || Platform.isWindows - ? Transform( - alignment: Alignment.center, - transform: Matrix4.rotationX( - pi), // TODO - this rotation is due to OpenGL texture coordinate working in a different space from Flutter, can we move this to the C++ side somewhere? - child: textureWidget) - : textureWidget) - ])); + return ThermionTextureWidget( + key: ObjectKey(view!), + initial: widget.initial, + viewer: widget.viewer, + view: view!, + onResize: widget.onResize); } } diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_web_impl.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_web_impl.dart index 653d774a..29ea1013 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_web_impl.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_web_impl.dart @@ -2,18 +2,28 @@ import 'dart:js_util'; import 'dart:ui' as ui; import 'dart:ui_web' as ui_web; import 'package:logging/logging.dart'; +import 'package:thermion_flutter/thermion_flutter.dart'; import 'package:thermion_flutter_web/thermion_flutter_web_options.dart'; import 'package:web/web.dart'; import 'package:flutter/widgets.dart'; class ThermionWidgetWeb extends StatelessWidget { final ThermionFlutterWebOptions options; + final ThermionViewer viewer; const ThermionWidgetWeb( - {super.key, this.options = const ThermionFlutterWebOptions.empty()}); + {super.key, this.options = const ThermionFlutterWebOptions.empty(), required this.viewer}); @override Widget build(BuildContext context) { + if (_texture == null || _resizing) { + return widget.initial ?? Container(color: Colors.red); + } + return ResizeObserver( + onResized: _resizeTexture, + child: ThermionWidgetWeb( + options: widget.options as ThermionFlutterWebOptions?)); + if (options?.importCanvasAsWidget == true) { return _ImageCopyingWidget(); } diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_web_stub.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_web_stub.dart index 945719c7..6c1c109d 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_web_stub.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_web_stub.dart @@ -1,14 +1,16 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; -import 'package:thermion_flutter_ffi/thermion_flutter_ffi.dart'; +import 'package:thermion_flutter/thermion_flutter.dart'; import 'package:thermion_flutter_web/thermion_flutter_web_options.dart'; -class ThermionWidgetWeb extends StatefulWidget { +class ThermionWidgetWeb extends StatelessWidget { final ThermionFlutterWebOptions? options; + final ThermionViewer viewer; + + const ThermionWidgetWeb({super.key, required this.options, required this.viewer}); - const ThermionWidgetWeb({super.key, required this.options}); - @override - // ignore: no_logic_in_create_state - State createState() => throw Exception(); + Widget build(BuildContext context) { + throw Exception("STUB"); + } } diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_windows.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_windows.dart new file mode 100644 index 00000000..eea2cb12 --- /dev/null +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_widget_windows.dart @@ -0,0 +1,168 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:thermion_flutter/src/widgets/src/resize_observer.dart'; +import 'package:thermion_flutter/src/widgets/src/transparent_filament_widget.dart'; +import 'package:thermion_flutter/thermion_flutter.dart' as t; +import 'package:thermion_flutter_platform_interface/thermion_flutter_window.dart'; + +class ThermionWidgetWindows extends StatefulWidget { + + final t.ThermionViewer viewer; + + final t.View view; + + /// + /// + /// + final Widget? initial; + + /// + /// A callback that will be invoked whenever this widget (and the underlying texture is resized). + /// + final Future Function(Size size, t.View view, double pixelRatio)? onResize; + + const ThermionWidgetWindows({super.key, required this.viewer, this.initial, this.onResize, required this.view}); + + + @override + State createState() => _ThermionWidgetWindowsState(); +} + +class _ThermionWidgetWindowsState extends State { + + ThermionFlutterWindow? _window; + + @override + void initState() { + super.initState(); + + WidgetsBinding.instance.addPostFrameCallback((timeStamp) async { + await widget.viewer.initialized; + + var dpr = MediaQuery.of(context).devicePixelRatio; + + final renderBox = ((context.findRenderObject()) as RenderBox); + var size = renderBox.size; + var width = (size.width * dpr).ceil(); + var height = (size.height * dpr).ceil(); + + final offset = renderBox.localToGlobal(Offset.zero); + final offsetLeft = (offset.dx * dpr).toInt(); + final offsetTop = (offset.dy * dpr).toInt(); + + _window = await t.ThermionFlutterPlatform.instance.createWindow(width, height, offsetLeft, offsetTop); + + await widget.view.updateViewport(_window!.width, _window!.height); + + try { + await widget.onResize?.call( + Size(_window!.width.toDouble(), _window!.height.toDouble()), + widget.view, + dpr); + } catch (err, st) { + print(err); + print(st); + } + + if (mounted) { + setState(() {}); + } + + _requestFrame(); + + widget.viewer.onDispose(() async { + var window = _window; + if (mounted) { + setState(() {}); + } + await window?.destroy(); + }); + }); + } + + bool _rendering = false; + + void _requestFrame() { + WidgetsBinding.instance.scheduleFrameCallback((d) async { + if (widget.viewer.rendering && !_rendering) { + _rendering = true; + await widget.viewer.requestFrame(); + _rendering = false; + } + _requestFrame(); + }); + } + + final _resizing = []; + + Timer? _resizeTimer; + + Future _resize(Size oldSize, Size newSize) async { + await Future.wait(_resizing); + + _resizeTimer?.cancel(); + + _resizeTimer = Timer(const Duration(milliseconds: 100), () async { + await Future.wait(_resizing); + if (!mounted) { + return; + } + + if (newSize.width == _window?.width && + newSize.height == _window?.height) { + return; + } + + final completer = Completer(); + + _resizing.add(completer.future); + + final dpr = MediaQuery.of(context).devicePixelRatio; + + newSize *= dpr; + + var newWidth = newSize.width.ceil(); + var newHeight = newSize.height.ceil(); + + final renderBox = context.findRenderObject() as RenderBox; + final offset = renderBox.localToGlobal(Offset.zero); + final offsetLeft = (offset.dx * dpr).toInt(); + final offsetTop = (offset.dy * dpr).toInt(); + + await _window?.resize( + newWidth, + newHeight, + offsetLeft, + offsetTop, + ); + + await widget.view.updateViewport(_window!.width, _window!.height); + + await widget.onResize?.call( + Size(_window!.width.toDouble(), _window!.height.toDouble()), + widget.view, + dpr); + + if (!mounted) { + return; + } + setState(() {}); + completer.complete(); + _resizing.remove(completer.future); + }); + } + + @override + Widget build(BuildContext context) { + if (_window == null) { + return widget.initial ?? Container(color: Colors.red); + } + + return ResizeObserver( + onResized: _resize, + child: CustomPaint(painter:TransparencyPainter())); + } + +} diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/widgets.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/widgets.dart index ea801eaa..083271e9 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/widgets.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/widgets.dart @@ -3,3 +3,4 @@ library; export 'src/thermion_widget.dart'; export 'src/thermion_listener_widget.dart'; export 'src/camera/camera_selector_widget.dart'; +export 'src/camera/camera_orientation_widget.dart'; diff --git a/thermion_flutter/thermion_flutter/macos/Classes/SwiftThermionFlutterPlugin.swift b/thermion_flutter/thermion_flutter/macos/Classes/SwiftThermionFlutterPlugin.swift index ba07fcc0..e1c6e0c8 100644 --- a/thermion_flutter/thermion_flutter/macos/Classes/SwiftThermionFlutterPlugin.swift +++ b/thermion_flutter/thermion_flutter/macos/Classes/SwiftThermionFlutterPlugin.swift @@ -5,8 +5,8 @@ public class SwiftThermionFlutterPlugin: NSObject, FlutterPlugin { var registrar : FlutterPluginRegistrar var registry: FlutterTextureRegistry - var texture: ThermionFlutterTexture? - + var textures: [Int64: ThermionFlutterTexture] = [:] + var createdAt = Date() var destroying = false @@ -55,14 +55,7 @@ public class SwiftThermionFlutterPlugin: NSObject, FlutterPlugin { let instance:SwiftThermionFlutterPlugin = Unmanaged.fromOpaque(resourcesPtr!).takeUnretainedValue() instance.resources.removeValue(forKey:UInt32(rbuf.id)) } - - var markTextureFrameAvailable : @convention(c) (UnsafeMutableRawPointer?) -> () = { instancePtr in - let instance:SwiftThermionFlutterPlugin = Unmanaged.fromOpaque(instancePtr!).takeUnretainedValue() - if(instance.texture != nil) { - instance.registry.textureFrameAvailable(instance.texture!.flutterTextureId) - } - } - + public static func register(with registrar: FlutterPluginRegistrar) { let _messenger = registrar.messenger; @@ -79,6 +72,13 @@ public class SwiftThermionFlutterPlugin: NSObject, FlutterPlugin { self.registry = textureRegistry; self.registrar = registrar } + + var markTextureFrameAvailable : @convention(c) (UnsafeMutableRawPointer?) -> () = { instancePtr in + let instance:SwiftThermionFlutterPlugin = Unmanaged.fromOpaque(instancePtr!).takeUnretainedValue() + for (_, texture) in instance.textures { + instance.registry.textureFrameAvailable(texture.flutterTextureId) + } + } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { let methodName = call.method; @@ -88,6 +88,10 @@ public class SwiftThermionFlutterPlugin: NSObject, FlutterPlugin { resourceLoaderWrapper = make_resource_loader(loadResource, freeResource, Unmanaged.passUnretained(self).toOpaque()) } result(Int64(Int(bitPattern: resourceLoaderWrapper!))) + case "markTextureFrameAvailable": + let flutterTextureId = call.arguments as! Int64 + registry.textureFrameAvailable(flutterTextureId) + result(nil) case "getRenderCallback": if(renderCallbackHolder.isEmpty) { renderCallbackHolder.append(unsafeBitCast(markTextureFrameAvailable, to:Int64.self)) @@ -99,27 +103,29 @@ public class SwiftThermionFlutterPlugin: NSObject, FlutterPlugin { case "getSharedContext": result(nil) case "createTexture": - if(destroying) { - result(nil) - return - } let args = call.arguments as! [Any] let width = args[0] as! Int64 let height = args[1] as! Int64 - self.texture = ThermionFlutterTexture(registry: registry, width: width, height: height) + let texture = ThermionFlutterTexture(registry: registry, width: width, height: height) - if(self.texture!.texture.metalTextureAddress == -1) { + if texture.texture.metalTextureAddress == -1 { result(nil) } else { - result([self.texture!.flutterTextureId as Any, self.texture!.texture.metalTextureAddress, nil]) + textures[texture.flutterTextureId] = texture + result([texture.flutterTextureId, texture.texture.metalTextureAddress, nil]) } case "destroyTexture": - self.destroying = true - self.texture?.destroy() - self.texture = nil - result(true) - self.destroying = false + let args = call.arguments as! [Any] + let flutterTextureId = args[0] as! Int64 + + if let texture = textures[flutterTextureId] { + texture.destroy() + textures.removeValue(forKey: flutterTextureId) + result(true) + } else { + result(false) + } default: result(FlutterMethodNotImplemented) } diff --git a/thermion_flutter/thermion_flutter/macos/Classes/ThermionFlutterTexture.swift b/thermion_flutter/thermion_flutter/macos/Classes/ThermionFlutterTexture.swift index 57eea716..5610ba3a 100644 --- a/thermion_flutter/thermion_flutter/macos/Classes/ThermionFlutterTexture.swift +++ b/thermion_flutter/thermion_flutter/macos/Classes/ThermionFlutterTexture.swift @@ -6,11 +6,11 @@ public class ThermionFlutterTexture : NSObject, FlutterTexture { var flutterTextureId: Int64 = -1 var registry: FlutterTextureRegistry - var texture: ThermionDartTexture + var texture: ThermionTextureSwift init(registry:FlutterTextureRegistry, width:Int64, height:Int64) { self.registry = registry - self.texture = ThermionDartTexture(width:width, height: height) + self.texture = ThermionTextureSwift(width:width, height: height) super.init() self.flutterTextureId = registry.register(self) } @@ -23,7 +23,7 @@ public class ThermionFlutterTexture : NSObject, FlutterTexture { } public func onTextureUnregistered(_ texture:FlutterTexture) { - print("Texture unregistered") + } public func destroy() { diff --git a/thermion_flutter/thermion_flutter/macos/Classes/ThermionTexture.swift b/thermion_flutter/thermion_flutter/macos/Classes/ThermionTexture.swift new file mode 100644 index 00000000..e242bf80 --- /dev/null +++ b/thermion_flutter/thermion_flutter/macos/Classes/ThermionTexture.swift @@ -0,0 +1,142 @@ +import Foundation +import GLKit + +@objc public class ThermionTextureSwift : NSObject { + + public var pixelBuffer: CVPixelBuffer? + + var pixelBufferAttrs = [ + kCVPixelBufferPixelFormatTypeKey: NSNumber(value: kCVPixelFormatType_32ABGR ), + kCVPixelBufferIOSurfacePropertiesKey: [:] as CFDictionary + ] as [CFString : Any] as CFDictionary + + @objc public var cvMetalTextureCache:CVMetalTextureCache? + @objc public var metalDevice:MTLDevice? + + @objc public var cvMetalTexture:CVMetalTexture? + @objc public var metalTexture:MTLTexture? + @objc public var metalTextureAddress:Int = -1 + + @objc override public init() { + + } + + @objc public init(width:Int64, height:Int64) { + if(self.metalDevice == nil) { + self.metalDevice = MTLCreateSystemDefaultDevice()! + } + + // create pixel buffer + if(CVPixelBufferCreate(kCFAllocatorDefault, Int(width), Int(height), + kCVPixelFormatType_32BGRA, pixelBufferAttrs, &pixelBuffer) != kCVReturnSuccess) { + print("Error allocating pixel buffer") + metalTextureAddress = -1; + return + } + if self.cvMetalTextureCache == nil { + let cacheCreationResult = CVMetalTextureCacheCreate( + kCFAllocatorDefault, + nil, + self.metalDevice!, + nil, + &self.cvMetalTextureCache) + if(cacheCreationResult != kCVReturnSuccess) { + print("Error creating Metal texture cache") + metalTextureAddress = -1 + return + } + } + let cvret = CVMetalTextureCacheCreateTextureFromImage( + kCFAllocatorDefault, + self.cvMetalTextureCache!, + pixelBuffer!, nil, + MTLPixelFormat.bgra8Unorm, + Int(width), Int(height), + 0, + &cvMetalTexture) + if(cvret != kCVReturnSuccess) { + print("Error creating texture from image") + metalTextureAddress = -1 + return + } + metalTexture = CVMetalTextureGetTexture(cvMetalTexture!) + let metalTexturePtr = Unmanaged.passRetained(metalTexture!).toOpaque() + metalTextureAddress = Int(bitPattern:metalTexturePtr) + } + + @objc public func destroyTexture() { + CVMetalTextureCacheFlush(self.cvMetalTextureCache!, 0) + self.metalTexture = nil + self.cvMetalTexture = nil + self.pixelBuffer = nil + self.metalDevice = nil + self.cvMetalTextureCache = nil + } + + @objc public func fillColor() { + CVPixelBufferLockBaseAddress(pixelBuffer!, CVPixelBufferLockFlags(rawValue: 0)) + let bufferWidth = Int(CVPixelBufferGetWidth(pixelBuffer!)) + let bufferHeight = Int(CVPixelBufferGetHeight(pixelBuffer!)) + let bytesPerRow = CVPixelBufferGetBytesPerRow(pixelBuffer!) + + guard let baseAddress = CVPixelBufferGetBaseAddress(pixelBuffer!) else { + return + } + + for row in 0.. NSData? { + guard let texture = self.metalTexture else { + print("Metal texture is not available") + return nil + } + + let width = texture.width + let height = texture.height + let bytesPerPixel = 4 // RGBA + let bytesPerRow = width * bytesPerPixel + let byteCount = bytesPerRow * height + + var bytes = [UInt8](repeating: 0, count: byteCount) + let region = MTLRegionMake2D(0, 0, width, height) + texture.getBytes(&bytes, bytesPerRow: bytesPerRow, from: region, mipmapLevel: 0) + + // Swizzle bytes from BGRA to RGBA + for i in stride(from: 0, to: byteCount, by: 4) { + let blue = bytes[i] + let green = bytes[i + 1] + let red = bytes[i + 2] + let alpha = bytes[i + 3] + + bytes[i] = red + bytes[i + 1] = green + bytes[i + 2] = blue + bytes[i + 3] = alpha + } + + // Convert Swift Data to Objective-C NSData + let nsData = Data(bytes: &bytes, count: byteCount) as NSData + return nsData +} + + +} diff --git a/thermion_flutter/thermion_flutter/pubspec.yaml b/thermion_flutter/thermion_flutter/pubspec.yaml index 758a0196..4d466adb 100644 --- a/thermion_flutter/thermion_flutter/pubspec.yaml +++ b/thermion_flutter/thermion_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: thermion_flutter description: Flutter plugin for 3D rendering with the Thermion toolkit. -version: 0.2.0-dev.7.0 +version: 0.2.1-dev.5 homepage: https://thermion.dev repository: https://github.com/nmfisher/thermion @@ -16,14 +16,20 @@ dependencies: vector_math: ^2.1.2 plugin_platform_interface: ^2.0.0 ffi: ^2.1.2 - animation_tools_dart: ^0.0.4 - thermion_dart: ^0.2.0-dev.7.0 - thermion_flutter_platform_interface: ^0.2.0-dev.7.0 - thermion_flutter_ffi: ^0.2.0-dev.7.0 - thermion_flutter_web: ^0.1.0-dev.7.0 + animation_tools_dart: ^0.1.0 + thermion_dart: ^0.2.1-dev.0.0.6 + thermion_flutter_platform_interface: ^0.2.1-dev.5 + thermion_flutter_ffi: ^0.2.1-dev.5 + thermion_flutter_web: ^0.1.0+7 logging: ^1.2.0 web: ^1.0.0 - +dependency_overrides: + thermion_dart: + path: ../../thermion_dart + thermion_flutter_platform_interface: + path: ../thermion_flutter_platform_interface + thermion_flutter_ffi: + path: ../thermion_flutter_ffi dev_dependencies: flutter_test: sdk: flutter diff --git a/thermion_flutter/thermion_flutter/test/cpp/test.cpp b/thermion_flutter/thermion_flutter/test/cpp/test.cpp index b046dff0..fa9f0d6e 100644 --- a/thermion_flutter/thermion_flutter/test/cpp/test.cpp +++ b/thermion_flutter/thermion_flutter/test/cpp/test.cpp @@ -14,7 +14,7 @@ #include "ResourceBuffer.hpp" using namespace filament; -using namespace thermion_filament; +using namespace thermion; using namespace std; int _i = 0; diff --git a/thermion_flutter/thermion_flutter/windows/backing_window.cpp b/thermion_flutter/thermion_flutter/windows/backing_window.cpp index b98daed9..573e70e4 100644 --- a/thermion_flutter/thermion_flutter/windows/backing_window.cpp +++ b/thermion_flutter/thermion_flutter/windows/backing_window.cpp @@ -152,8 +152,20 @@ LRESULT CALLBACK FilamentWindowProc(HWND const window, UINT const message, break; } case WM_ERASEBKGND: { - // Prevent erasing of |window| when it is unfocused and minimized or - // moved out of screen etc. + HDC hdc = (HDC)wparam; + RECT rect; + GetClientRect(window, &rect); + + // Get the BackingWindow instance associated with this window + BackingWindow* backing_window = reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); + + if (backing_window) { + HBRUSH brush = CreateSolidBrush(RGB(0, 255, 0)); + FillRect(hdc, &rect, brush); + DeleteObject(brush); + } + break; } case WM_SIZE: @@ -346,8 +358,6 @@ void BackingWindow::Resize(int width, int height, int left, int top) { _top = top; RECT flutterViewRect; ::GetWindowRect(_flutterViewWindow, &flutterViewRect); - std::cout << "Resizing to " << _width << " x " << _height << " with LT" << _left << " " << _top << " flutter view rect" << flutterViewRect.left << " " << flutterViewRect.top << " " << flutterViewRect.right << " " << flutterViewRect.bottom << std::endl; - ::SetWindowPos(_windowHandle, _flutterRootWindow, flutterViewRect.left + _left, flutterViewRect.top + _top, _width, _height, SWP_NOACTIVATE); diff --git a/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp b/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp index f02c3e9b..edc57452 100644 --- a/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp +++ b/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp @@ -172,8 +172,6 @@ void ThermionFlutterPlugin::CreateTexture( auto height = (uint32_t)round(dHeight ); auto left = (uint32_t)round(dLeft ); auto top = (uint32_t)round(dTop ); - - std::cout << "Using " << width << "x" << height << std::endl; // create a single shared context for the life of the application // this will be used to create a backing texture and passed to Filament @@ -182,8 +180,10 @@ void ThermionFlutterPlugin::CreateTexture( _context = std::make_unique(_pluginRegistrar, _textureRegistrar); #else _context = std::make_unique(_pluginRegistrar, _textureRegistrar); + std::cout << "Created WGL context" << std::endl; #endif } + _context->CreateRenderingSurface(width, height, std::move(result), left, top); } @@ -210,7 +210,7 @@ void ThermionFlutterPlugin::DestroyTexture( void ThermionFlutterPlugin::HandleMethodCall( const flutter::MethodCall &methodCall, std::unique_ptr> result) { - + // std::cout << methodCall.method_name().c_str() << std::endl; if (methodCall.method_name() == "usesBackingWindow") { result->Success(flutter::EncodableValue( #ifdef WGL_USE_BACKING_WINDOW @@ -239,18 +239,19 @@ void ThermionFlutterPlugin::HandleMethodCall( int dHeight = *(std::get_if(&(args->at(1)))); int dLeft = *(std::get_if(&(args->at(2)))); int dTop = *(std::get_if(&(args->at(3)))); - auto width = (uint32_t)round(dWidth ); - auto height = (uint32_t)round(dHeight ); - auto left = (uint32_t)round(dLeft ); - auto top = (uint32_t)round(dTop ); + auto width = static_cast(dWidth); + auto height = static_cast(dHeight); + auto left = static_cast(dLeft); + auto top = static_cast(dTop ); + _context->ResizeRenderingSurface(width, height, left, top); result->Success(); #else result->Error("ERROR", "resizeWindow is only available when using a backing window"); #endif - } else if (methodCall.method_name() == "createTexture") { + } else if (methodCall.method_name() == "createWindow") { CreateTexture(methodCall, std::move(result)); - } else if (methodCall.method_name() == "destroyTexture") { + } else if (methodCall.method_name() == "destroyWindow") { DestroyTexture(methodCall, std::move(result)); } else if (methodCall.method_name() == "getRenderCallback") { flutter::EncodableList resultList; diff --git a/thermion_flutter/thermion_flutter/windows/wgl_context.cpp b/thermion_flutter/thermion_flutter/windows/wgl_context.cpp index 68bbaebd..28dedbc0 100644 --- a/thermion_flutter/thermion_flutter/windows/wgl_context.cpp +++ b/thermion_flutter/thermion_flutter/windows/wgl_context.cpp @@ -45,7 +45,7 @@ WGLContext::WGLContext(flutter::PluginRegistrarWindows *pluginRegistrar, 0, 0, 0, - 16, // Number of bits for the depthbuffer + 24, // Number of bits for the depthbuffer 0, // Number of bits for the stencilbuffer 0, // Number of Aux buffers in the framebuffer. PFD_MAIN_PLANE, @@ -117,6 +117,8 @@ void WGLContext::CreateRenderingSurface( } else { ResizeRenderingSurface(width, height, left, top); } + + // std::cout << "created window size " << width << "x" << height << " at " << left << "," << top << " with backing handle" << _backingWindow->GetHandle() << std::endl; std::vector resultList; resultList.push_back(flutter::EncodableValue()); // return null for Flutter texture ID resultList.push_back(flutter::EncodableValue()); // return null for hardware texture ID diff --git a/thermion_flutter/thermion_flutter_ffi/CHANGELOG.md b/thermion_flutter/thermion_flutter_ffi/CHANGELOG.md index abc718e9..8478b9fc 100644 --- a/thermion_flutter/thermion_flutter_ffi/CHANGELOG.md +++ b/thermion_flutter/thermion_flutter_ffi/CHANGELOG.md @@ -1,3 +1,46 @@ +## 0.2.1-dev.5 + + - Update a dependency to the latest release. + +## 0.2.1-dev.4 + + - Update a dependency to the latest release. + +## 0.2.1-dev.3 + + - Update a dependency to the latest release. + +## 0.2.1-dev.2 + + - Update a dependency to the latest release. + +## 0.2.1-dev.1 + + - Update a dependency to the latest release. + +## 0.2.1-dev.0 + + - Update a dependency to the latest release. + +## 0.2.1-dev.0.0.0 + + - y + +## 0.2.0 + + - Graduate package to a stable release. See pre-releases prior to this version for changelog entries. + +## 0.2.0-dev.8.0.0 + +> Note: This release has breaking changes. + + - **REFACTOR**: continual refactor to support multiple render targets. + - **FEAT**: support multiple ThermionWidget on Android. + - **FEAT**: use imported texture on iOS. + - **FEAT**: working implementation of multiple widgets on macos. + - **BREAKING** **REFACTOR**: refactor to support multiple Views/Render Targets. + - **BREAKING** **FEAT**: big refactor to support multiple swapchains. + ## 0.2.0-dev.7.0 - Update a dependency to the latest release. diff --git a/thermion_flutter/thermion_flutter_ffi/lib/platform_texture.dart b/thermion_flutter/thermion_flutter_ffi/lib/platform_texture.dart new file mode 100644 index 00000000..041a2b8a --- /dev/null +++ b/thermion_flutter/thermion_flutter_ffi/lib/platform_texture.dart @@ -0,0 +1,97 @@ +import 'package:logging/logging.dart'; +import 'package:thermion_dart/thermion_dart.dart'; +import 'thermion_flutter_method_channel_interface.dart'; + +class FlutterPlatformTexture extends MethodChannelFlutterTexture { + final _logger = Logger("ThermionFlutterTexture"); + + final ThermionViewer viewer; + final View view; + + int flutterId = -1; + int _lastFlutterId = -1; + int _lastHardwareId = -1; + int hardwareId = -1; + int width = -1; + int height = -1; + + SwapChain? swapChain; + + RenderTarget? _renderTarget; + + late bool destroySwapChainOnResize; + + FlutterPlatformTexture( + super.channel, this.viewer, this.view, this.swapChain) { + if (swapChain == null) { + destroySwapChainOnResize = true; + } else { + destroySwapChainOnResize = false; + } + } + + @override + Future resize( + int newWidth, int newHeight, int newLeft, int newTop) async { + if (newWidth == this.width && + newHeight == this.height && + newLeft == 0 && + newTop == 0) { + return; + } + + this.width = newWidth; + this.height = newHeight; + + var result = + await channel.invokeMethod("createTexture", [width, height, 0, 0]); + if (result == null || (result[0] == -1)) { + throw Exception("Failed to create texture"); + } + _lastFlutterId = flutterId; + _lastHardwareId = hardwareId; + flutterId = result[0] as int; + + hardwareId = result[1] as int; + + if (destroySwapChainOnResize) { + await swapChain?.destroy(); + swapChain = await viewer.createSwapChain(result[2]); + } + + _logger.info( + "Created new texture: flutter id $flutterId, hardware id $hardwareId"); + + if (destroySwapChainOnResize) { + await view.setRenderable(true, swapChain!); + } else if (hardwareId != _lastHardwareId) { + await _renderTarget?.destroy(); + _renderTarget = + await viewer.createRenderTarget(width, height, hardwareId); + await view.setRenderTarget(_renderTarget!); + await view.setRenderable(true, swapChain!); + await _destroyTexture(_lastFlutterId, _lastHardwareId); + } + } + + Future _destroyTexture(int flutterId, int? hardwareId) async { + try { + await channel.invokeMethod("destroyTexture", [flutterId, hardwareId]); + _logger.info( + "Destroyed old texture: flutter id $flutterId, hardware id $hardwareId"); + } catch (e) { + _logger.severe("Failed to destroy texture: $e"); + } + } + + Future destroy() async { + await view.setRenderTarget(null); + await _renderTarget?.destroy(); + await swapChain?.destroy(); + await channel.invokeMethod("destroyTexture", hardwareId); + } + + Future markFrameAvailable() async { + await channel.invokeMethod("markTextureFrameAvailable", this.flutterId); + } +} diff --git a/thermion_flutter/thermion_flutter_ffi/lib/texture_cache_entry.dart b/thermion_flutter/thermion_flutter_ffi/lib/texture_cache_entry.dart new file mode 100644 index 00000000..64c88d8f --- /dev/null +++ b/thermion_flutter/thermion_flutter_ffi/lib/texture_cache_entry.dart @@ -0,0 +1,11 @@ +class TextureCacheEntry { + final int flutterId; + final int hardwareId; + final DateTime creationTime; + DateTime? removalTime; + bool inUse; + + TextureCacheEntry(this.flutterId, this.hardwareId, + {this.removalTime, this.inUse = true}) + : creationTime = DateTime.now(); +} \ No newline at end of file diff --git a/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_ffi.dart b/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_ffi.dart index e30c6020..d4816ed0 100644 --- a/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_ffi.dart +++ b/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_ffi.dart @@ -1,254 +1,2 @@ -import 'dart:async'; -import 'package:flutter/services.dart'; -import 'dart:ffi'; -import 'package:thermion_dart/thermion_dart.dart'; -import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart'; -import 'package:thermion_flutter_platform_interface/thermion_flutter_platform_interface.dart'; -import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dart'; -import 'package:logging/logging.dart'; - -/// -/// An implementation of [ThermionFlutterPlatform] that uses a Flutter platform -/// channel to create a rendering context, resource loaders, and -/// render target(s). -/// -class ThermionFlutterFFI extends ThermionFlutterPlatform { - final _channel = const MethodChannel("dev.thermion.flutter/event"); - final _logger = Logger("ThermionFlutterFFI"); - - ThermionViewerFFI? _viewer; - - ThermionFlutterFFI._() {} - - static void registerWith() { - ThermionFlutterPlatform.instance = ThermionFlutterFFI._(); - } - - final _textures = {}; - - Future createViewerWithOptions( - ThermionFlutterOptions options) async { - return createViewer(uberarchivePath: options.uberarchivePath); - } - - Future createViewer({String? uberarchivePath}) async { - var resourceLoader = Pointer.fromAddress( - await _channel.invokeMethod("getResourceLoaderWrapper")); - - if (resourceLoader == nullptr) { - throw Exception("Failed to get resource loader"); - } - - var renderCallbackResult = await _channel.invokeMethod("getRenderCallback"); - var renderCallback = - Pointer)>>.fromAddress( - renderCallbackResult[0]); - var renderCallbackOwner = - Pointer.fromAddress(renderCallbackResult[1]); - - var driverPlatform = await _channel.invokeMethod("getDriverPlatform"); - var driverPtr = driverPlatform == null - ? nullptr - : Pointer.fromAddress(driverPlatform); - - var sharedContext = await _channel.invokeMethod("getSharedContext"); - - var sharedContextPtr = sharedContext == null - ? nullptr - : Pointer.fromAddress(sharedContext); - - _viewer = ThermionViewerFFI( - resourceLoader: resourceLoader, - renderCallback: renderCallback, - renderCallbackOwner: renderCallbackOwner, - driver: driverPtr, - sharedContext: sharedContextPtr, - uberArchivePath: uberarchivePath); - await _viewer!.initialized; - return _viewer!; - } - - bool _creatingTexture = false; - bool _destroyingTexture = false; - - Future _waitForTextureCreationToComplete() async { - var iter = 0; - - while (_creatingTexture || _destroyingTexture) { - await Future.delayed(Duration(milliseconds: 50)); - iter++; - if (iter > 10) { - throw Exception( - "Previous call to createTexture failed to complete within 500ms"); - } - } - } - - /// - /// Create a backing surface for rendering. - /// This is called by [ThermionWidget]; don't call this yourself. - /// - /// The name here is slightly misleading because we only create - /// a texture render target on macOS and iOS; on Android, we render into - /// a native window derived from a Surface, and on Windows we render into - /// a HWND. - /// - /// Currently, this only supports a single "texture" (aka rendering surface) - /// at any given time. If a [ThermionWidget] is disposed, it will call - /// [destroyTexture]; if it is resized, it will call [resizeTexture]. - /// - /// In future, we probably want to be able to create multiple distinct - /// textures/render targets. This would make it possible to have multiple - /// Flutter Texture widgets, each with its own Filament View attached. - /// The current design doesn't accommodate this (for example, it seems we can - /// only create a single native window from a Surface at any one time). - /// - Future createTexture(double width, double height, - double offsetLeft, double offsetRight, double pixelRatio) async { - final physicalWidth = (width * pixelRatio).ceil(); - final physicalHeight = (height * pixelRatio).ceil(); - // when a ThermionWidget is inserted, disposed then immediately reinserted - // into the widget hierarchy (e.g. rebuilding due to setState(() {}) being called in an ancestor widget) - // the first call to createTexture may not have completed before the second. - // add a loop here to wait (max 500ms) for the first call to complete - await _waitForTextureCreationToComplete(); - - // note that when [ThermionWidget] is disposed, we don't destroy the - // texture; instead, we keep it around in case a subsequent call requests - // a texture of the same size. - - if (_textures.length > 1) { - throw Exception("Multiple textures not yet supported"); - } else if (_textures.length == 1) { - if (_textures.first.height == physicalHeight && - _textures.first.width == physicalWidth) { - return _textures.first; - } else { - await _viewer!.setRendering(false); - await _viewer!.destroySwapChain(); - await destroyTexture(_textures.first); - _textures.clear(); - } - } - - _creatingTexture = true; - - var result = await _channel.invokeMethod("createTexture", - [physicalWidth, physicalHeight, offsetLeft, offsetLeft]); - - if (result == null || (result[0] == -1)) { - throw Exception("Failed to create texture"); - } - final flutterTextureId = result[0] as int?; - final hardwareTextureId = result[1] as int?; - final surfaceAddress = result[2] as int?; - - _logger.info( - "Created texture with flutter texture id ${flutterTextureId}, hardwareTextureId $hardwareTextureId and surfaceAddress $surfaceAddress"); - - _viewer?.viewportDimensions = - (physicalWidth.toDouble(), physicalHeight.toDouble()); - - final texture = ThermionFlutterTexture(flutterTextureId, hardwareTextureId, - physicalWidth, physicalHeight, surfaceAddress); - - await _viewer?.createSwapChain( - physicalWidth.toDouble(), physicalHeight.toDouble(), - surface: texture.surfaceAddress == null - ? nullptr - : Pointer.fromAddress(texture.surfaceAddress!)); - - if (texture.hardwareTextureId != null) { - // ignore: unused_local_variable - var renderTarget = await _viewer?.createRenderTarget( - physicalWidth.toDouble(), - physicalHeight.toDouble(), - texture.hardwareTextureId!); - } - - await _viewer?.updateViewportAndCameraProjection( - physicalWidth.toDouble(), physicalHeight.toDouble()); - _viewer?.render(); - _creatingTexture = false; - - _textures.add(texture); - - return texture; - } - - /// - /// Destroy a texture and clean up the texture cache (if applicable). - /// - Future destroyTexture(ThermionFlutterTexture texture) async { - if (_creatingTexture || _destroyingTexture) { - throw Exception( - "Cannot destroy texture while concurrent call to createTexture/destroyTexture has not completed"); - } - _destroyingTexture = true; - _textures.remove(texture); - await _channel.invokeMethod("destroyTexture", texture.flutterTextureId); - _destroyingTexture = false; - } - - bool _resizing = false; - - /// - /// Called by [ThermionWidget] to resize a texture. Don't call this yourself. - /// - @override - Future resizeTexture( - ThermionFlutterTexture texture, - int width, - int height, - int offsetLeft, - int offsetTop, - double pixelRatio) async { - if (_resizing) { - throw Exception("Resize underway"); - } - - width = (width * pixelRatio).ceil(); - height = (height * pixelRatio).ceil(); - - if ((width - _viewer!.viewportDimensions.$1).abs() < 0.001 || - (height - _viewer!.viewportDimensions.$2).abs() < 0.001) { - return texture; - } - _resizing = true; - bool wasRendering = _viewer!.rendering; - await _viewer!.setRendering(false); - await _viewer!.destroySwapChain(); - await destroyTexture(texture); - - var result = await _channel - .invokeMethod("createTexture", [width, height, offsetLeft, offsetLeft]); - - if (result == null || result[0] == -1) { - throw Exception("Failed to create texture"); - } - _viewer!.viewportDimensions = (width.toDouble(), height.toDouble()); - var newTexture = - ThermionFlutterTexture(result[0], result[1], width, height, result[2]); - - await _viewer!.createSwapChain(width.toDouble(), height.toDouble(), - surface: newTexture.surfaceAddress == null - ? nullptr - : Pointer.fromAddress(newTexture.surfaceAddress!)); - - if (newTexture.hardwareTextureId != null) { - // ignore: unused_local_variable - var renderTarget = await _viewer!.createRenderTarget( - width.toDouble(), height.toDouble(), newTexture.hardwareTextureId!); - } - await _viewer! - .updateViewportAndCameraProjection(width.toDouble(), height.toDouble()); - - _viewer!.viewportDimensions = (width.toDouble(), height.toDouble()); - if (wasRendering) { - await _viewer!.setRendering(true); - } - _textures.add(newTexture); - _resizing = false; - return newTexture; - } -} +export 'thermion_flutter_windows.dart'; +export 'thermion_flutter_texture_backed_platform.dart'; diff --git a/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_method_channel_interface.dart b/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_method_channel_interface.dart new file mode 100644 index 00000000..0a39c37c --- /dev/null +++ b/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_method_channel_interface.dart @@ -0,0 +1,78 @@ +import 'dart:async'; +import 'package:flutter/services.dart'; +import 'dart:ffi'; +import 'package:thermion_dart/thermion_dart.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart'; +import 'package:thermion_flutter_platform_interface/thermion_flutter_platform_interface.dart'; +import 'package:logging/logging.dart'; +import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dart'; + +/// +/// An abstract implementation of [ThermionFlutterPlatform] that uses +/// Flutter platform channels to create a rendering context, +/// resource loaders, and surface/render target(s). +/// +abstract class ThermionFlutterMethodChannelInterface + extends ThermionFlutterPlatform { + + final channel = const MethodChannel("dev.thermion.flutter/event"); + final _logger = Logger("ThermionFlutterMethodChannelInterface"); + + ThermionViewerFFI? viewer; + + Future createViewer({ThermionFlutterOptions? options}) async { + if (viewer != null) { + throw Exception( + "Only one viewer can be created over the lifetime of an application"); + } + + var resourceLoader = Pointer.fromAddress( + await channel.invokeMethod("getResourceLoaderWrapper")); + + if (resourceLoader == nullptr) { + throw Exception("Failed to get resource loader"); + } + + var driverPlatform = await channel.invokeMethod("getDriverPlatform"); + var driverPtr = driverPlatform == null + ? nullptr + : Pointer.fromAddress(driverPlatform); + + var sharedContext = await channel.invokeMethod("getSharedContext"); + + var sharedContextPtr = sharedContext == null + ? nullptr + : Pointer.fromAddress(sharedContext); + + viewer = ThermionViewerFFI( + resourceLoader: resourceLoader, + driver: driverPtr, + sharedContext: sharedContextPtr, + uberArchivePath: options?.uberarchivePath); + await viewer!.initialized; + + return viewer!; + } +} + +abstract class MethodChannelFlutterTexture extends ThermionFlutterTexture { + final MethodChannel channel; + + MethodChannelFlutterTexture(this.channel); + + + + @override + int get flutterId; + + @override + int get hardwareId; + + @override + int get height; + + @override + int get width; + + +} diff --git a/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_texture_backed_platform.dart b/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_texture_backed_platform.dart new file mode 100644 index 00000000..17a4ca93 --- /dev/null +++ b/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_texture_backed_platform.dart @@ -0,0 +1,65 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:thermion_dart/thermion_dart.dart'; +import 'package:thermion_dart/thermion_dart.dart' as t; +import 'package:thermion_flutter_ffi/thermion_flutter_method_channel_interface.dart'; +import 'package:thermion_flutter_platform_interface/thermion_flutter_platform_interface.dart'; +import 'package:logging/logging.dart'; +import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dart'; +import 'package:thermion_flutter_platform_interface/thermion_flutter_window.dart'; + +import 'platform_texture.dart'; + +/// +/// An implementation of [ThermionFlutterPlatform] that uses +/// Flutter platform channels to create a rendering context, +/// resource loaders, and a texture that will be used as a render target +/// for a headless swapchain. +/// +class ThermionFlutterTextureBackedPlatform + extends ThermionFlutterMethodChannelInterface { + + final _logger = Logger("ThermionFlutterTextureBackedPlatform"); + + static SwapChain? _swapChain; + + ThermionFlutterTextureBackedPlatform._(); + + static ThermionFlutterTextureBackedPlatform? instance; + + static void registerWith() { + instance ??= ThermionFlutterTextureBackedPlatform._(); + ThermionFlutterPlatform.instance = instance!; + } + + @override + Future createViewer({ThermionFlutterOptions? options}) async { + var viewer = await super.createViewer(options: options); + if (_swapChain != null) { + throw Exception("Only a single swapchain can be created"); + } + + // this implementation renders directly into a texture/render target + // we still need to create a (headless) swapchain, but the actual dimensions + // don't matter + if (Platform.isMacOS || Platform.isIOS) { + _swapChain = await viewer.createHeadlessSwapChain(1, 1); + } + return viewer; + } + + // On desktop platforms, textures are always created + Future createTexture(t.View view, int width, int height) async { + var texture = FlutterPlatformTexture(channel, viewer!, view, (Platform.isMacOS || Platform.isIOS)? _swapChain : null); + await texture.resize(width, height, 0, 0); + return texture; + } + + @override + Future createWindow(int width, int height, int offsetLeft, int offsetTop) { + // TODO: implement createWindow + throw UnimplementedError(); + } +} + diff --git a/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_windows.dart b/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_windows.dart new file mode 100644 index 00000000..5e7269d4 --- /dev/null +++ b/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_windows.dart @@ -0,0 +1,132 @@ +import 'dart:async'; +import 'package:flutter/services.dart'; +import 'package:thermion_dart/thermion_dart.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart'; +import 'package:thermion_flutter_ffi/thermion_flutter_method_channel_interface.dart'; +import 'package:thermion_flutter_platform_interface/thermion_flutter_platform_interface.dart'; +import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dart'; +import 'package:logging/logging.dart'; +import 'package:thermion_flutter_platform_interface/thermion_flutter_window.dart'; + +/// +/// A Windows-only implementation of [ThermionFlutterPlatform] that uses +/// a Flutter platform channel to create a rendering context, +/// resource loader and a native HWND that will be sit behind the running +/// Flutter application. +/// +class ThermionFlutterWindows + extends ThermionFlutterMethodChannelInterface { + + final _channel = const MethodChannel("dev.thermion.flutter/event"); + + final _logger = Logger("ThermionFlutterWindows"); + + ThermionViewer? _viewer; + + SwapChain? _swapChain; + + ThermionFlutterWindows._() {} + + static void registerWith() { + ThermionFlutterPlatform.instance = ThermionFlutterWindows._(); + } + + @override + Future createViewer({ThermionFlutterOptions? options}) async { + if(_viewer != null) { + throw Exception("Only one viewer should be instantiated over the life of the app"); + } + _viewer = await super.createViewer(options: options); + return _viewer!; + } + + /// + /// Not supported on Windows. Throws an exception. + /// + @override + Future createTexture(View view, int width, int height) { + throw UnimplementedError(); + } + + + @override + Future createWindow(int width, int height, int offsetLeft, int offsetTop) async { + + + var result = await _channel + .invokeMethod("createWindow", [width, height, offsetLeft, offsetLeft]); + + if (result == null || result[2] == -1) { + throw Exception("Failed to create window"); + } + + var window = + ThermionFlutterWindowImpl(result[2], _channel, viewer!); + await window.resize(width, height, offsetLeft, offsetTop); + var view = await _viewer!.getViewAt(0); + + await view.updateViewport(width, height); + _swapChain = await _viewer!.createSwapChain(window.handle); + await view.setRenderable(true, _swapChain!); + return window; + } + + +} + +class ThermionFlutterWindowImpl extends ThermionFlutterWindow { + + final ThermionViewer viewer; + final int handle; + int height = 0; + int width = 0; + int offsetLeft = 0; + int offsetTop = 0; + final MethodChannel _channel; + + + + ThermionFlutterWindowImpl(this.handle, this._channel, this.viewer); + + @override + Future destroy() async { + await _channel + .invokeMethod("destroyWindow", this.handle); + } + + @override + Future markFrameAvailable() { + // TODO: implement markFrameAvailable + throw UnimplementedError(); + } + + bool _resizing = false; + + /// + /// Called by [ThermionWidget] to resize the window. Don't call this yourself. + /// + @override + Future resize( + int width, int height, int offsetLeft, int offsetTop) async { + if (_resizing) { + throw Exception("Resize underway"); + } + + if (width == this.width && height == this.height && this.offsetLeft == offsetLeft && this.offsetTop == offsetTop) { + return; + } + + this.width = width; + this.height = height; + this.offsetLeft = offsetLeft; + this.offsetTop = offsetTop; + + _resizing = true; + + await _channel + .invokeMethod("resizeWindow", [width, height, offsetLeft, offsetTop]); + _resizing = false; + } + + +} \ No newline at end of file diff --git a/thermion_flutter/thermion_flutter_ffi/pubspec.yaml b/thermion_flutter/thermion_flutter_ffi/pubspec.yaml index 1fa1f154..fddaec73 100644 --- a/thermion_flutter/thermion_flutter_ffi/pubspec.yaml +++ b/thermion_flutter/thermion_flutter_ffi/pubspec.yaml @@ -1,7 +1,7 @@ name: thermion_flutter_ffi description: An FFI interface for the thermion_flutter plugin (all platforms except web). repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter -version: 0.2.0-dev.7.0 +version: 0.2.1-dev.5 environment: sdk: ">=3.3.0 <4.0.0" @@ -11,22 +11,28 @@ flutter: implements: thermion_flutter_platform_interface platforms: ios: - dartPluginClass: ThermionFlutterFFI + dartPluginClass: ThermionFlutterTextureBackedPlatform android: - dartPluginClass: ThermionFlutterFFI + dartPluginClass: ThermionFlutterTextureBackedPlatform macos: - dartPluginClass: ThermionFlutterFFI + dartPluginClass: ThermionFlutterTextureBackedPlatform windows: - dartPluginClass: ThermionFlutterFFI + dartPluginClass: ThermionFlutterWindows dependencies: flutter: sdk: flutter plugin_platform_interface: ^2.1.0 - thermion_flutter_platform_interface: ^0.2.0-dev.7.0 - thermion_dart: ^0.2.0-dev.7.0 + thermion_flutter_platform_interface: ^0.2.1-dev.5 + thermion_dart: ^0.2.1-dev.0.0.6 logging: ^1.2.0 +dependency_overrides: + thermion_dart: + path: ../../thermion_dart + thermion_flutter_platform_interface: + path: ../thermion_flutter_platform_interface dev_dependencies: + flutter_test: sdk: flutter mockito: ^5.0.0 diff --git a/thermion_flutter/thermion_flutter_platform_interface/CHANGELOG.md b/thermion_flutter/thermion_flutter_platform_interface/CHANGELOG.md index 394503e2..a1144b1c 100644 --- a/thermion_flutter/thermion_flutter_platform_interface/CHANGELOG.md +++ b/thermion_flutter/thermion_flutter_platform_interface/CHANGELOG.md @@ -1,3 +1,41 @@ +## 0.2.1-dev.5 + + - Update a dependency to the latest release. + +## 0.2.1-dev.4 + + - Update a dependency to the latest release. + +## 0.2.1-dev.3 + + - Update a dependency to the latest release. + +## 0.2.1-dev.2 + + - Update a dependency to the latest release. + +## 0.2.1-dev.1 + + - Update a dependency to the latest release. + +## 0.2.1-dev.0 + + - Update a dependency to the latest release. + +## 0.2.1-dev.0.0.0 + + - y + +## 0.2.0 + + - Graduate package to a stable release. See pre-releases prior to this version for changelog entries. + +## 0.2.0-dev.8.0.0 + + - **REFACTOR**: continual refactor to support multiple render targets. + - **FEAT**: support multiple ThermionWidget on Android. + - **FEAT**: working implementation of multiple widgets on macos. + ## 0.2.0-dev.7.0 - Update a dependency to the latest release. diff --git a/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart b/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart index 2a861b84..4c8a6fd6 100644 --- a/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart +++ b/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart @@ -1,15 +1,16 @@ import 'dart:async'; +import 'package:thermion_dart/thermion_dart.dart' as t; import 'package:plugin_platform_interface/plugin_platform_interface.dart'; import 'package:thermion_dart/thermion_dart.dart'; import 'thermion_flutter_texture.dart'; +import 'thermion_flutter_window.dart'; class ThermionFlutterOptions { final String? uberarchivePath; ThermionFlutterOptions({this.uberarchivePath}); const ThermionFlutterOptions.empty() : uberarchivePath = null; - } abstract class ThermionFlutterPlatform extends PlatformInterface { @@ -25,17 +26,29 @@ abstract class ThermionFlutterPlatform extends PlatformInterface { _instance = instance; } - Future createViewerWithOptions( - covariant ThermionFlutterOptions options); + /// + /// + /// + Future createViewer( + {covariant ThermionFlutterOptions? options}); - @deprecated - Future createViewer({String? uberarchivePath}); + /// + /// Create a rendering surface. + /// + /// This is internal; unless you are [thermion_*] package developer, don't + /// call this yourself. May not be supported on all platforms. + /// + Future createTexture( + t.View view, int width, int height); - Future createTexture(double width, double height, - double offsetLeft, double offsetTop, double pixelRatio); + /// + /// Create a rendering window. + /// + /// This is internal; unless you are [thermion_*] package developer, don't + /// call this yourself. May not be supported on all platforms. + /// + Future createWindow( + int width, int height, int offsetLeft, int offsetTop); - Future destroyTexture(ThermionFlutterTexture texture); - - Future resizeTexture(ThermionFlutterTexture texture, - int width, int height, int offsetTop, int offsetRight, double pixelRatio); + } diff --git a/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_texture.dart b/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_texture.dart index c71723ee..e1635990 100644 --- a/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_texture.dart +++ b/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_texture.dart @@ -1,13 +1,17 @@ -class ThermionFlutterTexture { - final int width; - final int height; - final int? flutterTextureId; - final int? hardwareTextureId; - final int? surfaceAddress; - bool get usesBackingWindow => flutterTextureId == null; +abstract class ThermionFlutterTexture { - ThermionFlutterTexture(this.flutterTextureId, this.hardwareTextureId, - this.width, this.height, this.surfaceAddress) { + int get width; + int get height; - } + int get flutterId; + int get hardwareId; + + /// + /// Destroy a texture and clean up the texture cache (if applicable). + /// + Future destroy(); + + Future resize(int width, int height, int left, int top); + + Future markFrameAvailable(); } diff --git a/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_window.dart b/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_window.dart new file mode 100644 index 00000000..6a96ba07 --- /dev/null +++ b/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_window.dart @@ -0,0 +1,16 @@ +abstract class ThermionFlutterWindow { + + int get width; + int get height; + + int get handle; + + /// + /// Destroy a texture and clean up the texture cache (if applicable). + /// + Future destroy(); + + Future resize(int width, int height, int left, int top); + + Future markFrameAvailable(); +} diff --git a/thermion_flutter/thermion_flutter_platform_interface/pubspec.yaml b/thermion_flutter/thermion_flutter_platform_interface/pubspec.yaml index a3228fe7..4efb9abc 100644 --- a/thermion_flutter/thermion_flutter_platform_interface/pubspec.yaml +++ b/thermion_flutter/thermion_flutter_platform_interface/pubspec.yaml @@ -1,7 +1,7 @@ name: thermion_flutter_platform_interface description: A common platform interface for the thermion_flutter plugin. repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter -version: 0.2.0-dev.7.0 +version: 0.2.1-dev.5 environment: sdk: ">=3.3.0 <4.0.0" @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter plugin_platform_interface: ^2.1.0 - thermion_dart: ^0.2.0-dev.7.0 + thermion_dart: ^0.2.1-dev.0.0.6 dev_dependencies: flutter_test: diff --git a/thermion_flutter/thermion_flutter_web/CHANGELOG.md b/thermion_flutter/thermion_flutter_web/CHANGELOG.md index 6c0597f5..b6264f57 100644 --- a/thermion_flutter/thermion_flutter_web/CHANGELOG.md +++ b/thermion_flutter/thermion_flutter_web/CHANGELOG.md @@ -1,3 +1,39 @@ +## 0.1.0+7 + + - Update a dependency to the latest release. + +## 0.1.0+6 + + - Update a dependency to the latest release. + +## 0.1.0+5 + + - Update a dependency to the latest release. + +## 0.1.0+4 + + - Update a dependency to the latest release. + +## 0.1.0+3 + + - Update a dependency to the latest release. + +## 0.1.0+2 + + - Update a dependency to the latest release. + +## 0.1.0+1 + + - Update a dependency to the latest release. + +## 0.1.0 + + - Graduate package to a stable release. See pre-releases prior to this version for changelog entries. + +## 0.1.0-dev.8.0.0 + + - Update a dependency to the latest release. + ## 0.1.0-dev.7.0 - Update a dependency to the latest release. diff --git a/thermion_flutter/thermion_flutter_web/pubspec.yaml b/thermion_flutter/thermion_flutter_web/pubspec.yaml index 235a5d93..1ea3c4ee 100644 --- a/thermion_flutter/thermion_flutter_web/pubspec.yaml +++ b/thermion_flutter/thermion_flutter_web/pubspec.yaml @@ -1,7 +1,7 @@ name: thermion_flutter_web description: A web platform interface for the thermion_flutter plugin. repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter -version: 0.1.0-dev.7.0 +version: 0.1.0+7 environment: sdk: ">=3.3.0 <4.0.0" @@ -20,8 +20,8 @@ dependencies: sdk: flutter plugin_platform_interface: ^2.1.0 web: ^1.0.0 - thermion_dart: ^0.2.0-dev.7.0 - thermion_flutter_platform_interface: ^0.2.0-dev.7.0 + thermion_dart: ^0.2.1-dev.0.0.6 + thermion_flutter_platform_interface: ^0.2.1-dev.5 flutter_web_plugins: sdk: flutter